{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://matrixnetwork.me/source/audit/source-semantic-approval-event.schema.json",
  "title": "Y-Theory source semantic human approval event",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "event_id",
    "previous_event_sha256",
    "semantic_review_registry_sha256",
    "resolution_registry_sha256",
    "review_id",
    "source_sha256",
    "decision_scope_state",
    "approved_decision_ids",
    "rejected_decision_ids",
    "held_decision_ids",
    "approved_resolution_ids",
    "approver",
    "decided_at_utc",
    "effective_living_source_version",
    "signature_confirmation",
    "notes"
  ],
  "properties": {
    "schema": { "const": "y-theory.source-semantic-approval-event.v1" },
    "event_id": { "type": "string", "pattern": "^SSR-APP-[A-Z0-9-]+$" },
    "previous_event_sha256": {
      "oneOf": [
        { "type": "null" },
        { "type": "string", "pattern": "^[a-f0-9]{64}$" }
      ]
    },
    "semantic_review_registry_sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
    "resolution_registry_sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
    "review_id": { "type": "string", "pattern": "^SSR-[A-Z0-9-]+$" },
    "source_sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
    "decision_scope_state": { "enum": ["partial_decisions", "complete_record"] },
    "approved_decision_ids": {
      "type": "array",
      "uniqueItems": true,
      "items": { "type": "string", "pattern": "^SSR-[A-Z0-9-]+$" }
    },
    "rejected_decision_ids": {
      "type": "array",
      "uniqueItems": true,
      "items": { "type": "string", "pattern": "^SSR-[A-Z0-9-]+$" }
    },
    "held_decision_ids": {
      "type": "array",
      "uniqueItems": true,
      "items": { "type": "string", "pattern": "^SSR-[A-Z0-9-]+$" }
    },
    "approved_resolution_ids": {
      "type": "array",
      "uniqueItems": true,
      "items": { "type": "string", "pattern": "^SSR-RES-[A-Z0-9-]+$" }
    },
    "approver": {
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "authority", "kind"],
      "properties": {
        "name": { "const": "Bubu Suhas Mullaveedu" },
        "authority": { "const": "canonical author/founder" },
        "kind": { "const": "canonical_human_steward" }
      }
    },
    "decided_at_utc": { "type": "string", "format": "date-time" },
    "effective_living_source_version": { "type": "string", "pattern": "^YLS-[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}\\.[0-9]+$" },
    "signature_confirmation": { "const": true },
    "notes": { "type": "string", "minLength": 20 }
  }
}
