{
  "$id": "urn:mars:schema:v1:mars-error-code",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Machine-readable error codes per MARS Specification Section 12.5.\n\nEach code maps to an HTTP status code and a semantic description.",
  "oneOf": [
    {
      "const": "MARS-001",
      "description": "MARS-001 (400): Invalid entry schema.",
      "type": "string"
    },
    {
      "const": "MARS-002",
      "description": "MARS-002 (400): Invalid entry signature.",
      "type": "string"
    },
    {
      "const": "MARS-003",
      "description": "MARS-003 (400): Invalid publisher DID.",
      "type": "string"
    },
    {
      "const": "MARS-004",
      "description": "MARS-004 (400): Invalid lineage chain.",
      "type": "string"
    },
    {
      "const": "MARS-005",
      "description": "MARS-005 (400): Hash mismatch (itemDataHash ≠ computed hash).",
      "type": "string"
    },
    {
      "const": "MARS-006",
      "description": "MARS-006 (401): Missing or invalid authentication token.",
      "type": "string"
    },
    {
      "const": "MARS-007",
      "description": "MARS-007 (403): Insufficient permissions for operation.",
      "type": "string"
    },
    {
      "const": "MARS-008",
      "description": "MARS-008 (404): Entry not found.",
      "type": "string"
    },
    {
      "const": "MARS-009",
      "description": "MARS-009 (409): Conflict (version exists, tamper detected, or concurrent update).",
      "type": "string"
    },
    {
      "const": "MARS-010",
      "description": "MARS-010 (402): Insufficient bond for entry type.",
      "type": "string"
    },
    {
      "const": "MARS-011",
      "description": "MARS-011 (410): Entry has been revoked.",
      "type": "string"
    },
    {
      "const": "MARS-012",
      "description": "MARS-012 (422): itemData does not conform to itemSchemaUri.",
      "type": "string"
    },
    {
      "const": "MARS-013",
      "description": "MARS-013 (429): Rate limit exceeded.",
      "type": "string"
    },
    {
      "const": "MARS-014",
      "description": "MARS-014 (503): On-chain anchoring temporarily unavailable.",
      "type": "string"
    },
    {
      "const": "MARS-015",
      "description": "MARS-015 (504): Weave DHT write timeout.",
      "type": "string"
    }
  ],
  "title": "MarsErrorCode"
}
