{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "AGLA_STACK_W_HUMAN_BINDING_RECORD.schema.json",
  "title": "Stack W human binding record",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "$schema", "schema_id", "schema_version", "artifact_version", "status",
    "runtime_available", "authority_effect", "execution_base", "recorded_date",
    "human_authority", "raw_response", "source_context", "normalizations",
    "application_order", "decisions", "coherence_assertions", "routed_elsewhere"
  ],
  "properties": {
    "$schema": { "const": "./schemas/W_HUMAN_BINDING_RECORD.schema.json" },
    "schema_id": { "const": "AGLA_STACK_W_HUMAN_BINDING_RECORD" },
    "schema_version": { "const": "1.0.0" },
    "artifact_version": { "const": "1.0.0" },
    "status": { "const": "CANONICAL_SUPPORT_NON_PROVIDER_NON_RUNTIME_RUNTIME_DISABLED" },
    "runtime_available": { "const": false },
    "authority_effect": { "const": "CANONICAL_SUPPORT_WITHIN_STACK_W_ONLY" },
    "execution_base": { "const": "9c6caff4255637f949c2bf11242be00205f49f04" },
    "recorded_date": { "const": "2026-08-28" },
    "human_authority": { "type": "string", "minLength": 1 },
    "raw_response": { "type": "string", "minLength": 1 },
    "source_context": { "type": "string", "minLength": 1 },
    "normalizations": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "$ref": "#/$defs/normalization" } },
    "application_order": {
      "type": "array", "minItems": 9, "maxItems": 9, "uniqueItems": true,
      "prefixItems": [
        { "const": "HP-027" }, { "const": "HP-020" }, { "const": "HP-019" },
        { "const": "HP-021" }, { "const": "HP-022" }, { "const": "HP-023" },
        { "const": "HP-026" }, { "const": "HP-028" }, { "const": "HP-029" }
      ],
      "items": false
    },
    "decisions": { "type": "array", "minItems": 9, "maxItems": 9, "items": { "$ref": "#/$defs/decision" } },
    "coherence_assertions": { "type": "array", "minItems": 1, "items": { "type": "object", "required": ["id", "result", "noncollapse"], "properties": { "id": {"type":"string"}, "result": {"const":"PASS"}, "noncollapse": {"const":true} } } },
    "routed_elsewhere": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "object", "required": ["hp_id", "selected_option", "owner", "effect"], "properties": { "hp_id": {"enum":["HP-024","HP-025"]}, "selected_option": {"const":"A"}, "owner": {"type":"string"}, "effect": {"type":"string"} } } }
  },
  "$defs": {
    "normalization": {
      "type": "object", "additionalProperties": false,
      "required": ["received_surface", "recorded_as", "kind"],
      "properties": { "received_surface": {"type":"string"}, "recorded_as": {"type":"string"}, "kind": {"type":"string"} }
    },
    "decision": {
      "type": "object", "additionalProperties": false,
      "required": ["hp_id", "source_report", "selected_option", "selected_option_text", "binding"],
      "properties": {
        "hp_id": { "enum": ["HP-019","HP-020","HP-021","HP-022","HP-023","HP-026","HP-027","HP-028","HP-029"] },
        "source_report": { "type": "string", "minLength": 1 },
        "selected_option": { "enum": ["A","B","C"] },
        "selected_option_text": { "type": "string", "minLength": 1 },
        "depends_on": { "type": "string" },
        "binding": { "type": "object", "minProperties": 1 }
      }
    }
  }
}
