{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "anu_v3/schemas/dispatch_profile_selection.schema.json",
  "title": "Dispatch Profile Selection — TRACK A seam I/O (task-2553+38)",
  "description": "Static meta-schema for the profile-engine -> dispatch selection connection seam (anu_v3.dispatch_profile_selection). 'request' = what dispatch passes in (goal_type + policy_profile + boundary). 'selection' = the fail-closed decision the seam returns by read-only consuming the C1 engine canonical API (parse_goal_request -> resolve_policy). Additive; the seam executes NO dispatch (dispatch_lifecycle_effect == 'none').",
  "type": "object",
  "additionalProperties": false,
  "required": ["request", "selection"],
  "properties": {
    "request": {
      "type": "object",
      "description": "dispatch -> seam input. Mirrors the C1 goal_request_2553plus33 contract surface.",
      "required": ["goal_id", "goal_statement", "policy_profile"],
      "additionalProperties": false,
      "properties": {
        "goal_id": { "type": "string", "minLength": 1 },
        "goal_statement": { "type": "string", "minLength": 1 },
        "goal_type": { "type": "string", "minLength": 1 },
        "boundary": { "type": "array", "items": { "type": "string" } },
        "policy_profile": {
          "type": "object",
          "required": ["name"],
          "additionalProperties": true,
          "properties": { "name": { "type": "string", "minLength": 1 } }
        }
      }
    },
    "selection": {
      "type": "object",
      "description": "seam -> dispatch decision (DispatchProfileSelection.to_decision_dict).",
      "required": [
        "schema",
        "seam",
        "seam_version",
        "status",
        "profile_bound",
        "auto_apply",
        "dispatch_lifecycle_effect",
        "goal_id",
        "goal_type",
        "profile_id",
        "profile_version",
        "boundary",
        "gate_condition_names",
        "hold_trigger_conditions",
        "allowed_actions",
        "forbidden_actions"
      ],
      "additionalProperties": true,
      "properties": {
        "schema": { "const": "anu_v3.dispatch_profile_selection.v1" },
        "seam": { "const": "anu_v3.dispatch_profile_selection" },
        "seam_version": { "type": "string", "minLength": 1 },
        "status": {
          "type": "string",
          "enum": ["SELECTED", "SELECTION_REFUSED", "HOLD_FOR_CHAIR"]
        },
        "profile_bound": { "type": "boolean" },
        "auto_apply": { "type": "boolean" },
        "dispatch_lifecycle_effect": { "const": "none" },
        "goal_id": { "type": "string" },
        "goal_type": { "type": "string" },
        "profile_id": { "type": "string" },
        "profile_version": { "type": "string" },
        "boundary": { "type": "object" },
        "gate_condition_names": { "type": "array", "items": { "type": "string" } },
        "hold_trigger_conditions": { "type": "array", "items": { "type": "string" } },
        "allowed_actions": { "type": "array", "items": { "type": "string" } },
        "forbidden_actions": { "type": "array", "items": { "type": "string" } },
        "completion_packet_meta_ref": { "type": ["string", "null"] },
        "evidence_meta_ref": { "type": ["string", "null"] },
        "refusal_code": { "type": ["string", "null"] },
        "refusal_reason": { "type": ["string", "null"] },
        "engine_decision": { "type": ["object", "null"] }
      }
    }
  }
}
