{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://law.arxo.io/schema/request-refusal.schema.json",
  "title": "Typed request refusal body 0.1",
  "description": "Request refusal body only. The E2 machinery, the E3 host, and the evaluation document use separate contracts.",
  "$comment": "DECISION-0451/E0313",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "code",
    "location",
    "message"
  ],
  "properties": {
    "schemaVersion": {
      "const": "law.core.request-refusal/0.1"
    },
    "code": {
      "type": "string",
      "minLength": 1,
      "description": "Stable producer violation code; execution admission controls which producers can emit it."
    },
    "location": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "document",
        "pointer"
      ],
      "properties": {
        "document": {
          "enum": [
            "request",
            "ir",
            "lock"
          ]
        },
        "pointer": {
          "type": "string",
          "pattern": "^(?:/(?:[^~]|~[01])*)*$",
          "description": "RFC6901 pointer, including empty root; produced structurally."
        }
      }
    },
    "message": {
      "type": "string",
      "description": "Free diagnostic text, excluded only from typed request-refusal machine comparison."
    },
    "expected": {
      "description": "Normative machine value if supplied; absence differs from null."
    },
    "actual": {
      "description": "Normative machine value if supplied; absence differs from null."
    }
  }
}
