{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "schemas/anu_state_v1.json",
  "title": "anu_state_v1",
  "description": "task-2644 보강-4 — .anu_state freshness 강제 메커니즘. snapshot_id/state_version 검증으로 stale callback 차단. spec sha256: b27da557d4245bce476cd63f4ab174aefc8a25d2da07ec2c8d2c83b01ee96153. ANCHOR-14.",
  "type": "object",
  "required": ["schema_version", "snapshot_id", "state_version", "updated_at"],
  "properties": {
    "schema_version": {"const": "v1"},
    "snapshot_id": {"type": "string", "minLength": 1,
      "description": "monotonically increasing snapshot identifier"},
    "state_version": {"type": "string", "pattern": "^v[0-9]+$|^[0-9]+$"},
    "updated_at": {"type": "string", "format": "date-time"},
    "last_chair_decision": {
      "type": ["object", "null"],
      "properties": {
        "timestamp": {"type": "string", "format": "date-time"},
        "verbatim": {"type": "string"},
        "scope": {"type": "string"},
        "task_id": {"type": ["string", "null"]}
      }
    },
    "active_tasks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "task_id": {"type": "string"},
          "dispatched_at": {"type": "string", "format": "date-time"},
          "dispatch_state_version": {"type": "string"}
        },
        "required": ["task_id", "dispatched_at", "dispatch_state_version"]
      }
    },
    "fail_closed_policy": {
      "type": "object",
      "properties": {
        "on_mismatch": {"type": "string", "enum": ["SAFE_DEGRADED_MODE", "HOLD_FOR_CHAIR"]},
        "on_missing": {"type": "string", "enum": ["SAFE_DEGRADED_MODE", "HOLD_FOR_CHAIR"]}
      },
      "description": "state mismatch/missing 시 허용되는 next_action 제한"
    }
  },
  "additionalProperties": true
}
