{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aisa.ablera.com/contracts/drafts/solution-packet.schema.json",
  "title": "Solution packet — DRAFT inter-stage contract (Support S3 → H3)",
  "x-status": "draft",
  "description": "Stage Solution Take § 3: the packet a role holder can decide from alone — the mechanism with the verifier's verdict, the chosen kind, the exact change with expected counts, the revert path, the replay, what remains uncertain, and the predicted time. Confirmed at H3; a write inside it is additionally a write packet (contracts/write-shape.schema.json #WritePacket). Required core only (D139).",
  "type": "object", "additionalProperties": true,
  "required": ["case_id", "mechanism", "verifier_verdict", "kind", "change", "expected_result", "revert_path", "replay", "uncertainties", "predicted_minutes"],
  "properties": {
    "case_id": { "type": "string" },
    "mechanism": { "type": "object", "required": ["statement", "layer", "evidence_refs"], "properties": { "statement": { "type": "string", "description": "one sentence, layer-named" }, "layer": { "type": "string" }, "evidence_refs": { "type": "array", "minItems": 1, "items": { "type": "string" } }, "investigated": { "type": "boolean", "description": "false = a ready solution (skill or memory) answered without S2" } } },
    "verifier_verdict": { "type": "object", "required": ["verdict"], "properties": { "verdict": { "type": "string", "enum": ["agree", "disagree", "not_required", "sampled_out"] }, "verdict_paper_ref": { "type": "string" }, "separating_evidence_ref": { "type": "string" } } },
    "kind": { "type": "string", "enum": ["skill", "memory_answer", "configuration", "code", "combination", "external_owner_step", "no_fix_needed"] },
    "change": { "type": "array", "items": { "type": "object", "required": ["step_id", "what", "where"], "properties": {
      "step_id": { "type": "string" }, "what": { "type": "string" },
      "where": { "type": "object", "required": ["environment", "system"], "properties": { "environment": { "type": "string" }, "system": { "type": "string" }, "object": { "type": "string" } } },
      "write_packet_ref": { "type": "string", "description": "the write packet for this step, when it writes" },
      "skill_key": { "type": "string" },
      "handover_request_ref": { "type": "string", "description": "kind configuration/code: the Hd request (drafts/handover-packet.schema.json)" },
      "external_owner": { "type": "object", "properties": { "who": { "type": "string" }, "request_record_ref": { "type": "string" } }, "description": "SG-13: a step only the customer's own staff can perform, with its request record and age" } } } },
    "expected_result": { "type": "object", "required": ["statement", "counts"], "properties": { "statement": { "type": "string" }, "counts": { "type": "object", "additionalProperties": { "type": "integer" } } } },
    "revert_path": { "type": "object", "required": ["kind"], "properties": { "kind": { "type": "string", "enum": ["teardown_statements", "revert_commit", "compensating_action", "none_irreversible"] }, "refs": { "type": "array", "items": { "type": "string" } } } },
    "replay": { "type": "object", "required": ["assertions"], "properties": { "assertions": { "type": "array", "minItems": 1, "items": { "type": "string" } }, "customer_surface_check": { "type": "string", "description": "S6: the customer's symptom re-checked on the customer's surface" } } },
    "uncertainties": { "type": "array", "items": { "type": "string" } },
    "predicted_minutes": { "type": "number", "minimum": 0, "description": "D135: the budget of the application, in time" },
    "customer_reply_draft_ref": { "type": "string", "description": "the customer-visible text, sent only through H5-send" }
  }
}
