{
  "$id": "https://harnery.com/schemas/event-v3.schema.json",
  "anyOf": [
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "ledger.genesis",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            }
          }
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "genesis_id",
            "genesis_profile_digest",
            "contract_digest",
            "generated_schema_digest",
            "canonicalizer",
            "privacy_epoch_id",
            "candidate_created_at"
          ],
          "properties": {
            "genesis_id": {
              "pattern": "^gex_[0-9a-f-]{36}$",
              "type": "string"
            },
            "genesis_profile_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            },
            "contract_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            },
            "generated_schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            },
            "canonicalizer": {
              "const": "harnery-jcs-nfc-v1",
              "type": "string"
            },
            "privacy_epoch_id": {
              "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "candidate_created_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "ledger.activated",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            }
          }
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "activation_id",
            "genesis_id",
            "candidate_digest",
            "approval_record_id",
            "eligible_after_event_id",
            "activated_at"
          ],
          "properties": {
            "activation_id": {
              "pattern": "^act_[0-9a-f-]{36}$",
              "type": "string"
            },
            "genesis_id": {
              "pattern": "^gex_[0-9a-f-]{36}$",
              "type": "string"
            },
            "candidate_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            },
            "approval_record_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "eligible_after_event_id": {
              "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "activated_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "ledger.schema_advanced",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            }
          }
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "prior_schema_digest",
            "next_schema_digest",
            "generated_artifact_digest",
            "compatible_reader_builds",
            "release_reference",
            "effective_segment_ordinal",
            "effective_byte_offset"
          ],
          "properties": {
            "prior_schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            },
            "next_schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            },
            "generated_artifact_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            },
            "compatible_reader_builds": {
              "minItems": 1,
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                "type": "string"
              }
            },
            "release_reference": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "effective_segment_ordinal": {
              "minimum": 0,
              "type": "integer"
            },
            "effective_byte_offset": {
              "minimum": 0,
              "type": "integer"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "ledger.comparability_advanced",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            }
          }
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "prior_group_id",
            "next_group_id",
            "canonicalizer",
            "fingerprint_version",
            "privacy_epoch_id",
            "approval_record_id",
            "reason"
          ],
          "properties": {
            "prior_group_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "next_group_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "canonicalizer": {
              "const": "harnery-jcs-nfc-v1",
              "type": "string"
            },
            "fingerprint_version": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "privacy_epoch_id": {
              "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "approval_record_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "reason": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
              "type": "string"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "session.started",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "runtime_attestation",
            "resume"
          ],
          "properties": {
            "runtime_attestation": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "attestation_id",
                "generation_id",
                "adapter",
                "harness",
                "model",
                "tuning",
                "telemetry",
                "capability_profile",
                "declared_by_event_id"
              ],
              "properties": {
                "attestation_id": {
                  "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "generation_id": {
                  "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "adapter": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "id"
                          ],
                          "properties": {
                            "id": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "version": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "harness": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "id"
                          ],
                          "properties": {
                            "id": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "version": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "model": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "provider",
                            "id"
                          ],
                          "properties": {
                            "provider": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "id": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "tuning": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "additionalProperties": false,
                          "type": "object",
                          "properties": {
                            "effort": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "speed": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "telemetry": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "context_usage",
                    "wait_spans",
                    "wait_completeness",
                    "response_latency",
                    "inference_timing"
                  ],
                  "properties": {
                    "context_usage": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "value",
                            "attestation",
                            "confidence"
                          ],
                          "properties": {
                            "state": {
                              "const": "observed",
                              "type": "string"
                            },
                            "value": {
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "support",
                                "source",
                                "completeness"
                              ],
                              "properties": {
                                "support": {
                                  "anyOf": [
                                    {
                                      "const": "native",
                                      "type": "string"
                                    },
                                    {
                                      "const": "derived",
                                      "type": "string"
                                    },
                                    {
                                      "const": "conditional",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "source": {
                                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                                  "type": "string"
                                },
                                "completeness": {
                                  "anyOf": [
                                    {
                                      "const": "exact",
                                      "type": "string"
                                    },
                                    {
                                      "const": "inferred",
                                      "type": "string"
                                    },
                                    {
                                      "const": "percentage_only",
                                      "type": "string"
                                    },
                                    {
                                      "const": "lower_bound",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unknown",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            },
                            "attestation": {
                              "anyOf": [
                                {
                                  "const": "native",
                                  "type": "string"
                                },
                                {
                                  "const": "derived",
                                  "type": "string"
                                },
                                {
                                  "const": "inferred",
                                  "type": "string"
                                }
                              ]
                            },
                            "confidence": {
                              "anyOf": [
                                {
                                  "const": "exact",
                                  "type": "string"
                                },
                                {
                                  "const": "high",
                                  "type": "string"
                                },
                                {
                                  "const": "medium",
                                  "type": "string"
                                },
                                {
                                  "const": "low",
                                  "type": "string"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability"
                          ],
                          "properties": {
                            "state": {
                              "const": "unsupported",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "expected_but_missing",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "redacted",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "unknown",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state"
                          ],
                          "properties": {
                            "state": {
                              "const": "not_applicable",
                              "type": "string"
                            }
                          }
                        }
                      ]
                    },
                    "wait_spans": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "value",
                            "attestation",
                            "confidence"
                          ],
                          "properties": {
                            "state": {
                              "const": "observed",
                              "type": "string"
                            },
                            "value": {
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "support",
                                "source",
                                "completeness"
                              ],
                              "properties": {
                                "support": {
                                  "anyOf": [
                                    {
                                      "const": "native",
                                      "type": "string"
                                    },
                                    {
                                      "const": "derived",
                                      "type": "string"
                                    },
                                    {
                                      "const": "conditional",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "source": {
                                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                                  "type": "string"
                                },
                                "completeness": {
                                  "anyOf": [
                                    {
                                      "const": "exact",
                                      "type": "string"
                                    },
                                    {
                                      "const": "inferred",
                                      "type": "string"
                                    },
                                    {
                                      "const": "percentage_only",
                                      "type": "string"
                                    },
                                    {
                                      "const": "lower_bound",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unknown",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            },
                            "attestation": {
                              "anyOf": [
                                {
                                  "const": "native",
                                  "type": "string"
                                },
                                {
                                  "const": "derived",
                                  "type": "string"
                                },
                                {
                                  "const": "inferred",
                                  "type": "string"
                                }
                              ]
                            },
                            "confidence": {
                              "anyOf": [
                                {
                                  "const": "exact",
                                  "type": "string"
                                },
                                {
                                  "const": "high",
                                  "type": "string"
                                },
                                {
                                  "const": "medium",
                                  "type": "string"
                                },
                                {
                                  "const": "low",
                                  "type": "string"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability"
                          ],
                          "properties": {
                            "state": {
                              "const": "unsupported",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "expected_but_missing",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "redacted",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "unknown",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state"
                          ],
                          "properties": {
                            "state": {
                              "const": "not_applicable",
                              "type": "string"
                            }
                          }
                        }
                      ]
                    },
                    "wait_completeness": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "value",
                            "attestation",
                            "confidence"
                          ],
                          "properties": {
                            "state": {
                              "const": "observed",
                              "type": "string"
                            },
                            "value": {
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "support",
                                "source",
                                "completeness"
                              ],
                              "properties": {
                                "support": {
                                  "anyOf": [
                                    {
                                      "const": "native",
                                      "type": "string"
                                    },
                                    {
                                      "const": "derived",
                                      "type": "string"
                                    },
                                    {
                                      "const": "conditional",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "source": {
                                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                                  "type": "string"
                                },
                                "completeness": {
                                  "anyOf": [
                                    {
                                      "const": "exact",
                                      "type": "string"
                                    },
                                    {
                                      "const": "inferred",
                                      "type": "string"
                                    },
                                    {
                                      "const": "percentage_only",
                                      "type": "string"
                                    },
                                    {
                                      "const": "lower_bound",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unknown",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            },
                            "attestation": {
                              "anyOf": [
                                {
                                  "const": "native",
                                  "type": "string"
                                },
                                {
                                  "const": "derived",
                                  "type": "string"
                                },
                                {
                                  "const": "inferred",
                                  "type": "string"
                                }
                              ]
                            },
                            "confidence": {
                              "anyOf": [
                                {
                                  "const": "exact",
                                  "type": "string"
                                },
                                {
                                  "const": "high",
                                  "type": "string"
                                },
                                {
                                  "const": "medium",
                                  "type": "string"
                                },
                                {
                                  "const": "low",
                                  "type": "string"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability"
                          ],
                          "properties": {
                            "state": {
                              "const": "unsupported",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "expected_but_missing",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "redacted",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "unknown",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state"
                          ],
                          "properties": {
                            "state": {
                              "const": "not_applicable",
                              "type": "string"
                            }
                          }
                        }
                      ]
                    },
                    "response_latency": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "value",
                            "attestation",
                            "confidence"
                          ],
                          "properties": {
                            "state": {
                              "const": "observed",
                              "type": "string"
                            },
                            "value": {
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "support",
                                "source",
                                "completeness"
                              ],
                              "properties": {
                                "support": {
                                  "anyOf": [
                                    {
                                      "const": "native",
                                      "type": "string"
                                    },
                                    {
                                      "const": "derived",
                                      "type": "string"
                                    },
                                    {
                                      "const": "conditional",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "source": {
                                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                                  "type": "string"
                                },
                                "completeness": {
                                  "anyOf": [
                                    {
                                      "const": "exact",
                                      "type": "string"
                                    },
                                    {
                                      "const": "inferred",
                                      "type": "string"
                                    },
                                    {
                                      "const": "percentage_only",
                                      "type": "string"
                                    },
                                    {
                                      "const": "lower_bound",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unknown",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            },
                            "attestation": {
                              "anyOf": [
                                {
                                  "const": "native",
                                  "type": "string"
                                },
                                {
                                  "const": "derived",
                                  "type": "string"
                                },
                                {
                                  "const": "inferred",
                                  "type": "string"
                                }
                              ]
                            },
                            "confidence": {
                              "anyOf": [
                                {
                                  "const": "exact",
                                  "type": "string"
                                },
                                {
                                  "const": "high",
                                  "type": "string"
                                },
                                {
                                  "const": "medium",
                                  "type": "string"
                                },
                                {
                                  "const": "low",
                                  "type": "string"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability"
                          ],
                          "properties": {
                            "state": {
                              "const": "unsupported",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "expected_but_missing",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "redacted",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "unknown",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state"
                          ],
                          "properties": {
                            "state": {
                              "const": "not_applicable",
                              "type": "string"
                            }
                          }
                        }
                      ]
                    },
                    "inference_timing": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "value",
                            "attestation",
                            "confidence"
                          ],
                          "properties": {
                            "state": {
                              "const": "observed",
                              "type": "string"
                            },
                            "value": {
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "support",
                                "source",
                                "completeness"
                              ],
                              "properties": {
                                "support": {
                                  "anyOf": [
                                    {
                                      "const": "native",
                                      "type": "string"
                                    },
                                    {
                                      "const": "derived",
                                      "type": "string"
                                    },
                                    {
                                      "const": "conditional",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "source": {
                                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                                  "type": "string"
                                },
                                "completeness": {
                                  "anyOf": [
                                    {
                                      "const": "exact",
                                      "type": "string"
                                    },
                                    {
                                      "const": "inferred",
                                      "type": "string"
                                    },
                                    {
                                      "const": "percentage_only",
                                      "type": "string"
                                    },
                                    {
                                      "const": "lower_bound",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unknown",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            },
                            "attestation": {
                              "anyOf": [
                                {
                                  "const": "native",
                                  "type": "string"
                                },
                                {
                                  "const": "derived",
                                  "type": "string"
                                },
                                {
                                  "const": "inferred",
                                  "type": "string"
                                }
                              ]
                            },
                            "confidence": {
                              "anyOf": [
                                {
                                  "const": "exact",
                                  "type": "string"
                                },
                                {
                                  "const": "high",
                                  "type": "string"
                                },
                                {
                                  "const": "medium",
                                  "type": "string"
                                },
                                {
                                  "const": "low",
                                  "type": "string"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability"
                          ],
                          "properties": {
                            "state": {
                              "const": "unsupported",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "expected_but_missing",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "redacted",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "unknown",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state"
                          ],
                          "properties": {
                            "state": {
                              "const": "not_applicable",
                              "type": "string"
                            }
                          }
                        }
                      ]
                    }
                  }
                },
                "capability_profile": {
                  "pattern": "^cap_[a-f0-9]{64}$",
                  "type": "string"
                },
                "declared_by_event_id": {
                  "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                }
              }
            },
            "resume": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "value",
                    "attestation",
                    "confidence"
                  ],
                  "properties": {
                    "state": {
                      "const": "observed",
                      "type": "string"
                    },
                    "value": {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "prior_generation_id",
                        "continuity"
                      ],
                      "properties": {
                        "prior_generation_id": {
                          "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                          "type": "string"
                        },
                        "continuity": {
                          "const": "native",
                          "type": "string"
                        }
                      }
                    },
                    "attestation": {
                      "anyOf": [
                        {
                          "const": "native",
                          "type": "string"
                        },
                        {
                          "const": "derived",
                          "type": "string"
                        },
                        {
                          "const": "inferred",
                          "type": "string"
                        }
                      ]
                    },
                    "confidence": {
                      "anyOf": [
                        {
                          "const": "exact",
                          "type": "string"
                        },
                        {
                          "const": "high",
                          "type": "string"
                        },
                        {
                          "const": "medium",
                          "type": "string"
                        },
                        {
                          "const": "low",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability"
                  ],
                  "properties": {
                    "state": {
                      "const": "unsupported",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "expected_but_missing",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "redacted",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "unknown",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state"
                  ],
                  "properties": {
                    "state": {
                      "const": "not_applicable",
                      "type": "string"
                    }
                  }
                }
              ]
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "session.attestation_changed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "prior_attestation_id",
            "runtime_attestation",
            "reason"
          ],
          "properties": {
            "prior_attestation_id": {
              "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "runtime_attestation": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "attestation_id",
                "generation_id",
                "adapter",
                "harness",
                "model",
                "tuning",
                "telemetry",
                "capability_profile",
                "declared_by_event_id"
              ],
              "properties": {
                "attestation_id": {
                  "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "generation_id": {
                  "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "adapter": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "id"
                          ],
                          "properties": {
                            "id": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "version": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "harness": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "id"
                          ],
                          "properties": {
                            "id": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "version": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "model": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "provider",
                            "id"
                          ],
                          "properties": {
                            "provider": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "id": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "tuning": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "additionalProperties": false,
                          "type": "object",
                          "properties": {
                            "effort": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "speed": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "telemetry": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "context_usage",
                    "wait_spans",
                    "wait_completeness",
                    "response_latency",
                    "inference_timing"
                  ],
                  "properties": {
                    "context_usage": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "value",
                            "attestation",
                            "confidence"
                          ],
                          "properties": {
                            "state": {
                              "const": "observed",
                              "type": "string"
                            },
                            "value": {
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "support",
                                "source",
                                "completeness"
                              ],
                              "properties": {
                                "support": {
                                  "anyOf": [
                                    {
                                      "const": "native",
                                      "type": "string"
                                    },
                                    {
                                      "const": "derived",
                                      "type": "string"
                                    },
                                    {
                                      "const": "conditional",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "source": {
                                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                                  "type": "string"
                                },
                                "completeness": {
                                  "anyOf": [
                                    {
                                      "const": "exact",
                                      "type": "string"
                                    },
                                    {
                                      "const": "inferred",
                                      "type": "string"
                                    },
                                    {
                                      "const": "percentage_only",
                                      "type": "string"
                                    },
                                    {
                                      "const": "lower_bound",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unknown",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            },
                            "attestation": {
                              "anyOf": [
                                {
                                  "const": "native",
                                  "type": "string"
                                },
                                {
                                  "const": "derived",
                                  "type": "string"
                                },
                                {
                                  "const": "inferred",
                                  "type": "string"
                                }
                              ]
                            },
                            "confidence": {
                              "anyOf": [
                                {
                                  "const": "exact",
                                  "type": "string"
                                },
                                {
                                  "const": "high",
                                  "type": "string"
                                },
                                {
                                  "const": "medium",
                                  "type": "string"
                                },
                                {
                                  "const": "low",
                                  "type": "string"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability"
                          ],
                          "properties": {
                            "state": {
                              "const": "unsupported",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "expected_but_missing",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "redacted",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "unknown",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state"
                          ],
                          "properties": {
                            "state": {
                              "const": "not_applicable",
                              "type": "string"
                            }
                          }
                        }
                      ]
                    },
                    "wait_spans": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "value",
                            "attestation",
                            "confidence"
                          ],
                          "properties": {
                            "state": {
                              "const": "observed",
                              "type": "string"
                            },
                            "value": {
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "support",
                                "source",
                                "completeness"
                              ],
                              "properties": {
                                "support": {
                                  "anyOf": [
                                    {
                                      "const": "native",
                                      "type": "string"
                                    },
                                    {
                                      "const": "derived",
                                      "type": "string"
                                    },
                                    {
                                      "const": "conditional",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "source": {
                                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                                  "type": "string"
                                },
                                "completeness": {
                                  "anyOf": [
                                    {
                                      "const": "exact",
                                      "type": "string"
                                    },
                                    {
                                      "const": "inferred",
                                      "type": "string"
                                    },
                                    {
                                      "const": "percentage_only",
                                      "type": "string"
                                    },
                                    {
                                      "const": "lower_bound",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unknown",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            },
                            "attestation": {
                              "anyOf": [
                                {
                                  "const": "native",
                                  "type": "string"
                                },
                                {
                                  "const": "derived",
                                  "type": "string"
                                },
                                {
                                  "const": "inferred",
                                  "type": "string"
                                }
                              ]
                            },
                            "confidence": {
                              "anyOf": [
                                {
                                  "const": "exact",
                                  "type": "string"
                                },
                                {
                                  "const": "high",
                                  "type": "string"
                                },
                                {
                                  "const": "medium",
                                  "type": "string"
                                },
                                {
                                  "const": "low",
                                  "type": "string"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability"
                          ],
                          "properties": {
                            "state": {
                              "const": "unsupported",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "expected_but_missing",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "redacted",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "unknown",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state"
                          ],
                          "properties": {
                            "state": {
                              "const": "not_applicable",
                              "type": "string"
                            }
                          }
                        }
                      ]
                    },
                    "wait_completeness": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "value",
                            "attestation",
                            "confidence"
                          ],
                          "properties": {
                            "state": {
                              "const": "observed",
                              "type": "string"
                            },
                            "value": {
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "support",
                                "source",
                                "completeness"
                              ],
                              "properties": {
                                "support": {
                                  "anyOf": [
                                    {
                                      "const": "native",
                                      "type": "string"
                                    },
                                    {
                                      "const": "derived",
                                      "type": "string"
                                    },
                                    {
                                      "const": "conditional",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "source": {
                                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                                  "type": "string"
                                },
                                "completeness": {
                                  "anyOf": [
                                    {
                                      "const": "exact",
                                      "type": "string"
                                    },
                                    {
                                      "const": "inferred",
                                      "type": "string"
                                    },
                                    {
                                      "const": "percentage_only",
                                      "type": "string"
                                    },
                                    {
                                      "const": "lower_bound",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unknown",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            },
                            "attestation": {
                              "anyOf": [
                                {
                                  "const": "native",
                                  "type": "string"
                                },
                                {
                                  "const": "derived",
                                  "type": "string"
                                },
                                {
                                  "const": "inferred",
                                  "type": "string"
                                }
                              ]
                            },
                            "confidence": {
                              "anyOf": [
                                {
                                  "const": "exact",
                                  "type": "string"
                                },
                                {
                                  "const": "high",
                                  "type": "string"
                                },
                                {
                                  "const": "medium",
                                  "type": "string"
                                },
                                {
                                  "const": "low",
                                  "type": "string"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability"
                          ],
                          "properties": {
                            "state": {
                              "const": "unsupported",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "expected_but_missing",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "redacted",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "unknown",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state"
                          ],
                          "properties": {
                            "state": {
                              "const": "not_applicable",
                              "type": "string"
                            }
                          }
                        }
                      ]
                    },
                    "response_latency": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "value",
                            "attestation",
                            "confidence"
                          ],
                          "properties": {
                            "state": {
                              "const": "observed",
                              "type": "string"
                            },
                            "value": {
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "support",
                                "source",
                                "completeness"
                              ],
                              "properties": {
                                "support": {
                                  "anyOf": [
                                    {
                                      "const": "native",
                                      "type": "string"
                                    },
                                    {
                                      "const": "derived",
                                      "type": "string"
                                    },
                                    {
                                      "const": "conditional",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "source": {
                                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                                  "type": "string"
                                },
                                "completeness": {
                                  "anyOf": [
                                    {
                                      "const": "exact",
                                      "type": "string"
                                    },
                                    {
                                      "const": "inferred",
                                      "type": "string"
                                    },
                                    {
                                      "const": "percentage_only",
                                      "type": "string"
                                    },
                                    {
                                      "const": "lower_bound",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unknown",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            },
                            "attestation": {
                              "anyOf": [
                                {
                                  "const": "native",
                                  "type": "string"
                                },
                                {
                                  "const": "derived",
                                  "type": "string"
                                },
                                {
                                  "const": "inferred",
                                  "type": "string"
                                }
                              ]
                            },
                            "confidence": {
                              "anyOf": [
                                {
                                  "const": "exact",
                                  "type": "string"
                                },
                                {
                                  "const": "high",
                                  "type": "string"
                                },
                                {
                                  "const": "medium",
                                  "type": "string"
                                },
                                {
                                  "const": "low",
                                  "type": "string"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability"
                          ],
                          "properties": {
                            "state": {
                              "const": "unsupported",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "expected_but_missing",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "redacted",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "unknown",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state"
                          ],
                          "properties": {
                            "state": {
                              "const": "not_applicable",
                              "type": "string"
                            }
                          }
                        }
                      ]
                    },
                    "inference_timing": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "value",
                            "attestation",
                            "confidence"
                          ],
                          "properties": {
                            "state": {
                              "const": "observed",
                              "type": "string"
                            },
                            "value": {
                              "additionalProperties": false,
                              "type": "object",
                              "required": [
                                "support",
                                "source",
                                "completeness"
                              ],
                              "properties": {
                                "support": {
                                  "anyOf": [
                                    {
                                      "const": "native",
                                      "type": "string"
                                    },
                                    {
                                      "const": "derived",
                                      "type": "string"
                                    },
                                    {
                                      "const": "conditional",
                                      "type": "string"
                                    }
                                  ]
                                },
                                "source": {
                                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                                  "type": "string"
                                },
                                "completeness": {
                                  "anyOf": [
                                    {
                                      "const": "exact",
                                      "type": "string"
                                    },
                                    {
                                      "const": "inferred",
                                      "type": "string"
                                    },
                                    {
                                      "const": "percentage_only",
                                      "type": "string"
                                    },
                                    {
                                      "const": "lower_bound",
                                      "type": "string"
                                    },
                                    {
                                      "const": "unknown",
                                      "type": "string"
                                    }
                                  ]
                                }
                              }
                            },
                            "attestation": {
                              "anyOf": [
                                {
                                  "const": "native",
                                  "type": "string"
                                },
                                {
                                  "const": "derived",
                                  "type": "string"
                                },
                                {
                                  "const": "inferred",
                                  "type": "string"
                                }
                              ]
                            },
                            "confidence": {
                              "anyOf": [
                                {
                                  "const": "exact",
                                  "type": "string"
                                },
                                {
                                  "const": "high",
                                  "type": "string"
                                },
                                {
                                  "const": "medium",
                                  "type": "string"
                                },
                                {
                                  "const": "low",
                                  "type": "string"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability"
                          ],
                          "properties": {
                            "state": {
                              "const": "unsupported",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "capability",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "expected_but_missing",
                              "type": "string"
                            },
                            "capability": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "redacted",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state",
                            "reason"
                          ],
                          "properties": {
                            "state": {
                              "const": "unknown",
                              "type": "string"
                            },
                            "reason": {
                              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "state"
                          ],
                          "properties": {
                            "state": {
                              "const": "not_applicable",
                              "type": "string"
                            }
                          }
                        }
                      ]
                    }
                  }
                },
                "capability_profile": {
                  "pattern": "^cap_[a-f0-9]{64}$",
                  "type": "string"
                },
                "declared_by_event_id": {
                  "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                }
              }
            },
            "reason": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
              "type": "string"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "session.resumed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "prior_generation_id",
            "continuity",
            "evidence_reference"
          ],
          "properties": {
            "prior_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "continuity": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                }
              ]
            },
            "evidence_reference": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "session.termination_observed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observation",
            "observer_instance_id",
            "subject_instance_id",
            "provisional",
            "reason"
          ],
          "properties": {
            "observation": {
              "anyOf": [
                {
                  "const": "stale",
                  "type": "string"
                },
                {
                  "const": "killed",
                  "type": "string"
                },
                {
                  "const": "disappeared",
                  "type": "string"
                },
                {
                  "const": "hook_silent",
                  "type": "string"
                }
              ]
            },
            "observer_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "subject_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "provisional": {
              "const": true,
              "type": "boolean"
            },
            "reason": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
              "type": "string"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "run.started",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "run_kind"
          ],
          "properties": {
            "run_kind": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "policy_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "run.completed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "outcome",
            "duration_ms"
          ],
          "properties": {
            "outcome": {
              "anyOf": [
                {
                  "const": "succeeded",
                  "type": "string"
                },
                {
                  "const": "failed",
                  "type": "string"
                },
                {
                  "const": "cancelled",
                  "type": "string"
                },
                {
                  "const": "timed_out",
                  "type": "string"
                },
                {
                  "const": "denied",
                  "type": "string"
                },
                {
                  "const": "interrupted",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "duration_ms": {
              "minimum": 0,
              "type": "integer"
            },
            "evidence_reference": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "turn.started",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id",
            "turn_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "input",
            "intent_kind"
          ],
          "properties": {
            "input": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "storage",
                "media_type",
                "bytes"
              ],
              "properties": {
                "storage": {
                  "anyOf": [
                    {
                      "const": "omitted",
                      "type": "string"
                    },
                    {
                      "const": "artifact_reference",
                      "type": "string"
                    }
                  ]
                },
                "media_type": {
                  "pattern": "^[a-z0-9.+-]+/[a-z0-9.+-]+$",
                  "maxLength": 127,
                  "type": "string"
                },
                "bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "lines": {
                  "minimum": 0,
                  "type": "integer"
                },
                "artifact_id": {
                  "pattern": "^art_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "fingerprint": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "algorithm",
                    "canonicalizer",
                    "key_epoch",
                    "scope",
                    "digest"
                  ],
                  "properties": {
                    "algorithm": {
                      "const": "hmac-sha256",
                      "type": "string"
                    },
                    "canonicalizer": {
                      "const": "harnery-jcs-nfc-v1",
                      "type": "string"
                    },
                    "key_epoch": {
                      "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                      "type": "string"
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "const": "generation",
                          "type": "string"
                        },
                        {
                          "const": "root",
                          "type": "string"
                        }
                      ]
                    },
                    "digest": {
                      "pattern": "^sha256:[a-f0-9]{64}$",
                      "type": "string"
                    }
                  }
                }
              }
            },
            "intent_kind": {
              "anyOf": [
                {
                  "const": "build",
                  "type": "string"
                },
                {
                  "const": "change",
                  "type": "string"
                },
                {
                  "const": "diagnose",
                  "type": "string"
                },
                {
                  "const": "review",
                  "type": "string"
                },
                {
                  "const": "explain",
                  "type": "string"
                },
                {
                  "const": "coordinate",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "stop_remediation": {
              "type": "boolean"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "tool.requested",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id",
            "turn_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by",
            "span_id"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "tool",
            "input",
            "exact_input",
            "targets"
          ],
          "properties": {
            "tool": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "namespace",
                "name"
              ],
              "properties": {
                "namespace": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                },
                "name": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                }
              }
            },
            "input": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "storage",
                "media_type",
                "bytes"
              ],
              "properties": {
                "storage": {
                  "anyOf": [
                    {
                      "const": "omitted",
                      "type": "string"
                    },
                    {
                      "const": "artifact_reference",
                      "type": "string"
                    }
                  ]
                },
                "media_type": {
                  "pattern": "^[a-z0-9.+-]+/[a-z0-9.+-]+$",
                  "maxLength": 127,
                  "type": "string"
                },
                "bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "lines": {
                  "minimum": 0,
                  "type": "integer"
                },
                "artifact_id": {
                  "pattern": "^art_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "fingerprint": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "algorithm",
                    "canonicalizer",
                    "key_epoch",
                    "scope",
                    "digest"
                  ],
                  "properties": {
                    "algorithm": {
                      "const": "hmac-sha256",
                      "type": "string"
                    },
                    "canonicalizer": {
                      "const": "harnery-jcs-nfc-v1",
                      "type": "string"
                    },
                    "key_epoch": {
                      "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                      "type": "string"
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "const": "generation",
                          "type": "string"
                        },
                        {
                          "const": "root",
                          "type": "string"
                        }
                      ]
                    },
                    "digest": {
                      "pattern": "^sha256:[a-f0-9]{64}$",
                      "type": "string"
                    }
                  }
                }
              }
            },
            "exact_input": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "algorithm",
                "canonicalizer",
                "key_epoch",
                "scope",
                "digest"
              ],
              "properties": {
                "algorithm": {
                  "const": "hmac-sha256",
                  "type": "string"
                },
                "canonicalizer": {
                  "const": "harnery-jcs-nfc-v1",
                  "type": "string"
                },
                "key_epoch": {
                  "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "scope": {
                  "anyOf": [
                    {
                      "const": "generation",
                      "type": "string"
                    },
                    {
                      "const": "root",
                      "type": "string"
                    }
                  ]
                },
                "digest": {
                  "pattern": "^sha256:[a-f0-9]{64}$",
                  "type": "string"
                }
              }
            },
            "targets": {
              "maxItems": 64,
              "type": "array",
              "items": {
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "kind",
                  "access",
                  "fingerprint",
                  "extractor_version"
                ],
                "properties": {
                  "kind": {
                    "anyOf": [
                      {
                        "const": "workspace_path",
                        "type": "string"
                      },
                      {
                        "const": "external_path",
                        "type": "string"
                      },
                      {
                        "const": "url",
                        "type": "string"
                      },
                      {
                        "const": "query",
                        "type": "string"
                      },
                      {
                        "const": "pattern",
                        "type": "string"
                      },
                      {
                        "const": "artifact",
                        "type": "string"
                      },
                      {
                        "const": "service",
                        "type": "string"
                      },
                      {
                        "const": "resource",
                        "type": "string"
                      }
                    ]
                  },
                  "access": {
                    "anyOf": [
                      {
                        "const": "read",
                        "type": "string"
                      },
                      {
                        "const": "write",
                        "type": "string"
                      },
                      {
                        "const": "execute",
                        "type": "string"
                      },
                      {
                        "const": "publish",
                        "type": "string"
                      },
                      {
                        "const": "delete",
                        "type": "string"
                      },
                      {
                        "const": "unknown",
                        "type": "string"
                      }
                    ]
                  },
                  "display": {
                    "maxLength": 240,
                    "type": "string"
                  },
                  "fingerprint": {
                    "additionalProperties": false,
                    "type": "object",
                    "required": [
                      "algorithm",
                      "canonicalizer",
                      "key_epoch",
                      "scope",
                      "digest"
                    ],
                    "properties": {
                      "algorithm": {
                        "const": "hmac-sha256",
                        "type": "string"
                      },
                      "canonicalizer": {
                        "const": "harnery-jcs-nfc-v1",
                        "type": "string"
                      },
                      "key_epoch": {
                        "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                        "type": "string"
                      },
                      "scope": {
                        "anyOf": [
                          {
                            "const": "generation",
                            "type": "string"
                          },
                          {
                            "const": "root",
                            "type": "string"
                          }
                        ]
                      },
                      "digest": {
                        "pattern": "^sha256:[a-f0-9]{64}$",
                        "type": "string"
                      }
                    }
                  },
                  "extractor_version": {
                    "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                    "type": "string"
                  }
                }
              }
            },
            "recovery": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "reason"
              ],
              "properties": {
                "reason": {
                  "anyOf": [
                    {
                      "const": "request_not_observed",
                      "type": "string"
                    },
                    {
                      "const": "completion_not_observed_before_turn_end",
                      "type": "string"
                    },
                    {
                      "const": "completion_not_observed_before_next_turn",
                      "type": "string"
                    },
                    {
                      "const": "span_cap_pressure",
                      "type": "string"
                    },
                    {
                      "const": "explicit_end_salvage",
                      "type": "string"
                    },
                    {
                      "const": "command_completion_not_observed",
                      "type": "string"
                    }
                  ]
                },
                "requested_event_id": {
                  "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "elapsed_upper_bound_ms": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "command.started",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id",
            "turn_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by",
            "span_id"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "executable",
            "executable_class",
            "exact_command",
            "intent_kind",
            "intent_length",
            "sensitive_argument_count"
          ],
          "properties": {
            "executable": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "executable_class": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "exact_command": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "algorithm",
                "canonicalizer",
                "key_epoch",
                "scope",
                "digest"
              ],
              "properties": {
                "algorithm": {
                  "const": "hmac-sha256",
                  "type": "string"
                },
                "canonicalizer": {
                  "const": "harnery-jcs-nfc-v1",
                  "type": "string"
                },
                "key_epoch": {
                  "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "scope": {
                  "anyOf": [
                    {
                      "const": "generation",
                      "type": "string"
                    },
                    {
                      "const": "root",
                      "type": "string"
                    }
                  ]
                },
                "digest": {
                  "pattern": "^sha256:[a-f0-9]{64}$",
                  "type": "string"
                }
              }
            },
            "intent_kind": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "intent_length": {
              "minimum": 0,
              "type": "integer"
            },
            "intent_fingerprint": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "algorithm",
                "canonicalizer",
                "key_epoch",
                "scope",
                "digest"
              ],
              "properties": {
                "algorithm": {
                  "const": "hmac-sha256",
                  "type": "string"
                },
                "canonicalizer": {
                  "const": "harnery-jcs-nfc-v1",
                  "type": "string"
                },
                "key_epoch": {
                  "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "scope": {
                  "anyOf": [
                    {
                      "const": "generation",
                      "type": "string"
                    },
                    {
                      "const": "root",
                      "type": "string"
                    }
                  ]
                },
                "digest": {
                  "pattern": "^sha256:[a-f0-9]{64}$",
                  "type": "string"
                }
              }
            },
            "sensitive_argument_count": {
              "minimum": 0,
              "type": "integer"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "command.output_observed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id",
            "turn_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by",
            "span_id"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "stream",
            "bytes"
          ],
          "properties": {
            "stream": {
              "anyOf": [
                {
                  "const": "stdout",
                  "type": "string"
                },
                {
                  "const": "stderr",
                  "type": "string"
                },
                {
                  "const": "combined",
                  "type": "string"
                }
              ]
            },
            "bytes": {
              "minimum": 0,
              "type": "integer"
            },
            "lines": {
              "minimum": 0,
              "type": "integer"
            },
            "content_fingerprint": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "algorithm",
                "canonicalizer",
                "key_epoch",
                "scope",
                "digest"
              ],
              "properties": {
                "algorithm": {
                  "const": "hmac-sha256",
                  "type": "string"
                },
                "canonicalizer": {
                  "const": "harnery-jcs-nfc-v1",
                  "type": "string"
                },
                "key_epoch": {
                  "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "scope": {
                  "anyOf": [
                    {
                      "const": "generation",
                      "type": "string"
                    },
                    {
                      "const": "root",
                      "type": "string"
                    }
                  ]
                },
                "digest": {
                  "pattern": "^sha256:[a-f0-9]{64}$",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "context.observed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "measurement"
          ],
          "properties": {
            "measurement": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "value",
                    "attestation",
                    "confidence"
                  ],
                  "properties": {
                    "state": {
                      "const": "observed",
                      "type": "string"
                    },
                    "value": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "used_tokens",
                            "limit_tokens",
                            "measured_at",
                            "method"
                          ],
                          "properties": {
                            "used_tokens": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "limit_tokens": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "remaining_tokens": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "measured_at": {
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                              "type": "string"
                            },
                            "method": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "used_percent",
                            "measured_at",
                            "method"
                          ],
                          "properties": {
                            "used_percent": {
                              "minimum": 0,
                              "maximum": 100,
                              "type": "number"
                            },
                            "remaining_percent": {
                              "minimum": 0,
                              "maximum": 100,
                              "type": "number"
                            },
                            "measured_at": {
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                              "type": "string"
                            },
                            "method": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        }
                      ]
                    },
                    "attestation": {
                      "anyOf": [
                        {
                          "const": "native",
                          "type": "string"
                        },
                        {
                          "const": "derived",
                          "type": "string"
                        },
                        {
                          "const": "inferred",
                          "type": "string"
                        }
                      ]
                    },
                    "confidence": {
                      "anyOf": [
                        {
                          "const": "exact",
                          "type": "string"
                        },
                        {
                          "const": "high",
                          "type": "string"
                        },
                        {
                          "const": "medium",
                          "type": "string"
                        },
                        {
                          "const": "low",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability"
                  ],
                  "properties": {
                    "state": {
                      "const": "unsupported",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "expected_but_missing",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "redacted",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "unknown",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state"
                  ],
                  "properties": {
                    "state": {
                      "const": "not_applicable",
                      "type": "string"
                    }
                  }
                }
              ]
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "context.compaction_started",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "before",
            "method"
          ],
          "properties": {
            "before": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "value",
                    "attestation",
                    "confidence"
                  ],
                  "properties": {
                    "state": {
                      "const": "observed",
                      "type": "string"
                    },
                    "value": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "used_tokens",
                            "limit_tokens",
                            "measured_at",
                            "method"
                          ],
                          "properties": {
                            "used_tokens": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "limit_tokens": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "remaining_tokens": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "measured_at": {
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                              "type": "string"
                            },
                            "method": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "used_percent",
                            "measured_at",
                            "method"
                          ],
                          "properties": {
                            "used_percent": {
                              "minimum": 0,
                              "maximum": 100,
                              "type": "number"
                            },
                            "remaining_percent": {
                              "minimum": 0,
                              "maximum": 100,
                              "type": "number"
                            },
                            "measured_at": {
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                              "type": "string"
                            },
                            "method": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        }
                      ]
                    },
                    "attestation": {
                      "anyOf": [
                        {
                          "const": "native",
                          "type": "string"
                        },
                        {
                          "const": "derived",
                          "type": "string"
                        },
                        {
                          "const": "inferred",
                          "type": "string"
                        }
                      ]
                    },
                    "confidence": {
                      "anyOf": [
                        {
                          "const": "exact",
                          "type": "string"
                        },
                        {
                          "const": "high",
                          "type": "string"
                        },
                        {
                          "const": "medium",
                          "type": "string"
                        },
                        {
                          "const": "low",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability"
                  ],
                  "properties": {
                    "state": {
                      "const": "unsupported",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "expected_but_missing",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "redacted",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "unknown",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state"
                  ],
                  "properties": {
                    "state": {
                      "const": "not_applicable",
                      "type": "string"
                    }
                  }
                }
              ]
            },
            "method": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "context.compaction_completed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "outcome",
            "before",
            "after"
          ],
          "properties": {
            "outcome": {
              "anyOf": [
                {
                  "const": "succeeded",
                  "type": "string"
                },
                {
                  "const": "failed",
                  "type": "string"
                },
                {
                  "const": "cancelled",
                  "type": "string"
                },
                {
                  "const": "timed_out",
                  "type": "string"
                },
                {
                  "const": "denied",
                  "type": "string"
                },
                {
                  "const": "interrupted",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "before": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "value",
                    "attestation",
                    "confidence"
                  ],
                  "properties": {
                    "state": {
                      "const": "observed",
                      "type": "string"
                    },
                    "value": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "used_tokens",
                            "limit_tokens",
                            "measured_at",
                            "method"
                          ],
                          "properties": {
                            "used_tokens": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "limit_tokens": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "remaining_tokens": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "measured_at": {
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                              "type": "string"
                            },
                            "method": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "used_percent",
                            "measured_at",
                            "method"
                          ],
                          "properties": {
                            "used_percent": {
                              "minimum": 0,
                              "maximum": 100,
                              "type": "number"
                            },
                            "remaining_percent": {
                              "minimum": 0,
                              "maximum": 100,
                              "type": "number"
                            },
                            "measured_at": {
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                              "type": "string"
                            },
                            "method": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        }
                      ]
                    },
                    "attestation": {
                      "anyOf": [
                        {
                          "const": "native",
                          "type": "string"
                        },
                        {
                          "const": "derived",
                          "type": "string"
                        },
                        {
                          "const": "inferred",
                          "type": "string"
                        }
                      ]
                    },
                    "confidence": {
                      "anyOf": [
                        {
                          "const": "exact",
                          "type": "string"
                        },
                        {
                          "const": "high",
                          "type": "string"
                        },
                        {
                          "const": "medium",
                          "type": "string"
                        },
                        {
                          "const": "low",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability"
                  ],
                  "properties": {
                    "state": {
                      "const": "unsupported",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "expected_but_missing",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "redacted",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "unknown",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state"
                  ],
                  "properties": {
                    "state": {
                      "const": "not_applicable",
                      "type": "string"
                    }
                  }
                }
              ]
            },
            "after": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "value",
                    "attestation",
                    "confidence"
                  ],
                  "properties": {
                    "state": {
                      "const": "observed",
                      "type": "string"
                    },
                    "value": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "used_tokens",
                            "limit_tokens",
                            "measured_at",
                            "method"
                          ],
                          "properties": {
                            "used_tokens": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "limit_tokens": {
                              "minimum": 1,
                              "type": "integer"
                            },
                            "remaining_tokens": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "measured_at": {
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                              "type": "string"
                            },
                            "method": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        },
                        {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "used_percent",
                            "measured_at",
                            "method"
                          ],
                          "properties": {
                            "used_percent": {
                              "minimum": 0,
                              "maximum": 100,
                              "type": "number"
                            },
                            "remaining_percent": {
                              "minimum": 0,
                              "maximum": 100,
                              "type": "number"
                            },
                            "measured_at": {
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                              "type": "string"
                            },
                            "method": {
                              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                              "type": "string"
                            }
                          }
                        }
                      ]
                    },
                    "attestation": {
                      "anyOf": [
                        {
                          "const": "native",
                          "type": "string"
                        },
                        {
                          "const": "derived",
                          "type": "string"
                        },
                        {
                          "const": "inferred",
                          "type": "string"
                        }
                      ]
                    },
                    "confidence": {
                      "anyOf": [
                        {
                          "const": "exact",
                          "type": "string"
                        },
                        {
                          "const": "high",
                          "type": "string"
                        },
                        {
                          "const": "medium",
                          "type": "string"
                        },
                        {
                          "const": "low",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability"
                  ],
                  "properties": {
                    "state": {
                      "const": "unsupported",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "expected_but_missing",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "redacted",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "unknown",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state"
                  ],
                  "properties": {
                    "state": {
                      "const": "not_applicable",
                      "type": "string"
                    }
                  }
                }
              ]
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "context.checkpointed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "checkpoint_id",
            "artifact"
          ],
          "properties": {
            "checkpoint_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "artifact": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "artifact_id",
                "kind",
                "media_type",
                "bytes",
                "retention_class"
              ],
              "properties": {
                "artifact_id": {
                  "pattern": "^art_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "kind": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                },
                "media_type": {
                  "pattern": "^[a-z0-9.+-]+/[a-z0-9.+-]+$",
                  "maxLength": 127,
                  "type": "string"
                },
                "bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "retention_class": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                },
                "integrity": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "algorithm",
                    "canonicalizer",
                    "key_epoch",
                    "scope",
                    "digest"
                  ],
                  "properties": {
                    "algorithm": {
                      "const": "hmac-sha256",
                      "type": "string"
                    },
                    "canonicalizer": {
                      "const": "harnery-jcs-nfc-v1",
                      "type": "string"
                    },
                    "key_epoch": {
                      "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                      "type": "string"
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "const": "generation",
                          "type": "string"
                        },
                        {
                          "const": "root",
                          "type": "string"
                        }
                      ]
                    },
                    "digest": {
                      "pattern": "^sha256:[a-f0-9]{64}$",
                      "type": "string"
                    }
                  }
                },
                "workspace_path": {
                  "pattern": "^(?!.*(?:^|/)\\.\\.(?:/|$))[^/\\\\][^\\\\]{0,239}$",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "context.recovery_injected",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "checkpoint_id",
            "outcome",
            "artifact_id"
          ],
          "properties": {
            "checkpoint_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "outcome": {
              "anyOf": [
                {
                  "const": "succeeded",
                  "type": "string"
                },
                {
                  "const": "failed",
                  "type": "string"
                },
                {
                  "const": "cancelled",
                  "type": "string"
                },
                {
                  "const": "timed_out",
                  "type": "string"
                },
                {
                  "const": "denied",
                  "type": "string"
                },
                {
                  "const": "interrupted",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "artifact_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "agent.delegated",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "delegation_id",
            "child_generation_id",
            "role",
            "ownership_fingerprint"
          ],
          "properties": {
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "child_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "role": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "ownership_fingerprint": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "algorithm",
                "canonicalizer",
                "key_epoch",
                "scope",
                "digest"
              ],
              "properties": {
                "algorithm": {
                  "const": "hmac-sha256",
                  "type": "string"
                },
                "canonicalizer": {
                  "const": "harnery-jcs-nfc-v1",
                  "type": "string"
                },
                "key_epoch": {
                  "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "scope": {
                  "anyOf": [
                    {
                      "const": "generation",
                      "type": "string"
                    },
                    {
                      "const": "root",
                      "type": "string"
                    }
                  ]
                },
                "digest": {
                  "pattern": "^sha256:[a-f0-9]{64}$",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "agent.started",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by",
            "span_id",
            "parent_span_id"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "delegation_id",
            "child_generation_id",
            "role"
          ],
          "properties": {
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "child_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "role": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "artifact.observed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "artifact",
            "operation"
          ],
          "properties": {
            "artifact": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "artifact_id",
                "kind",
                "media_type",
                "bytes",
                "retention_class"
              ],
              "properties": {
                "artifact_id": {
                  "pattern": "^art_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "kind": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                },
                "media_type": {
                  "pattern": "^[a-z0-9.+-]+/[a-z0-9.+-]+$",
                  "maxLength": 127,
                  "type": "string"
                },
                "bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "retention_class": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                },
                "integrity": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "algorithm",
                    "canonicalizer",
                    "key_epoch",
                    "scope",
                    "digest"
                  ],
                  "properties": {
                    "algorithm": {
                      "const": "hmac-sha256",
                      "type": "string"
                    },
                    "canonicalizer": {
                      "const": "harnery-jcs-nfc-v1",
                      "type": "string"
                    },
                    "key_epoch": {
                      "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                      "type": "string"
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "const": "generation",
                          "type": "string"
                        },
                        {
                          "const": "root",
                          "type": "string"
                        }
                      ]
                    },
                    "digest": {
                      "pattern": "^sha256:[a-f0-9]{64}$",
                      "type": "string"
                    }
                  }
                },
                "workspace_path": {
                  "pattern": "^(?!.*(?:^|/)\\.\\.(?:/|$))[^/\\\\][^\\\\]{0,239}$",
                  "type": "string"
                }
              }
            },
            "operation": {
              "anyOf": [
                {
                  "const": "created",
                  "type": "string"
                },
                {
                  "const": "updated",
                  "type": "string"
                },
                {
                  "const": "viewed",
                  "type": "string"
                },
                {
                  "const": "published",
                  "type": "string"
                }
              ]
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "progress.observed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "kind",
            "evidence_event_ids",
            "reducer_build_id"
          ],
          "properties": {
            "kind": {
              "anyOf": [
                {
                  "const": "write",
                  "type": "string"
                },
                {
                  "const": "test",
                  "type": "string"
                },
                {
                  "const": "commit",
                  "type": "string"
                },
                {
                  "const": "deploy",
                  "type": "string"
                },
                {
                  "const": "publication",
                  "type": "string"
                },
                {
                  "const": "review",
                  "type": "string"
                },
                {
                  "const": "artifact",
                  "type": "string"
                }
              ]
            },
            "evidence_event_ids": {
              "minItems": 1,
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "reducer_build_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "coord.task_changed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "actor_instance_id",
            "subject_instance_id",
            "new_state",
            "reason",
            "authority"
          ],
          "properties": {
            "actor_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "subject_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "prior_state": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "new_state": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "reason": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
              "type": "string"
            },
            "reason_fingerprint": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "algorithm",
                "canonicalizer",
                "key_epoch",
                "scope",
                "digest"
              ],
              "properties": {
                "algorithm": {
                  "const": "hmac-sha256",
                  "type": "string"
                },
                "canonicalizer": {
                  "const": "harnery-jcs-nfc-v1",
                  "type": "string"
                },
                "key_epoch": {
                  "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "scope": {
                  "anyOf": [
                    {
                      "const": "generation",
                      "type": "string"
                    },
                    {
                      "const": "root",
                      "type": "string"
                    }
                  ]
                },
                "digest": {
                  "pattern": "^sha256:[a-f0-9]{64}$",
                  "type": "string"
                }
              }
            },
            "authority": {
              "additionalProperties": false,
              "type": "object",
              "properties": {
                "transaction_id": {
                  "pattern": "^txn_[0-9a-f-]{36}$",
                  "type": "string"
                },
                "record_id": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "coord.lifecycle_changed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "actor_instance_id",
            "subject_instance_id",
            "new_state",
            "reason",
            "authority"
          ],
          "properties": {
            "actor_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "subject_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "prior_state": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "new_state": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "reason": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
              "type": "string"
            },
            "reason_fingerprint": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "algorithm",
                "canonicalizer",
                "key_epoch",
                "scope",
                "digest"
              ],
              "properties": {
                "algorithm": {
                  "const": "hmac-sha256",
                  "type": "string"
                },
                "canonicalizer": {
                  "const": "harnery-jcs-nfc-v1",
                  "type": "string"
                },
                "key_epoch": {
                  "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "scope": {
                  "anyOf": [
                    {
                      "const": "generation",
                      "type": "string"
                    },
                    {
                      "const": "root",
                      "type": "string"
                    }
                  ]
                },
                "digest": {
                  "pattern": "^sha256:[a-f0-9]{64}$",
                  "type": "string"
                }
              }
            },
            "authority": {
              "additionalProperties": false,
              "type": "object",
              "properties": {
                "transaction_id": {
                  "pattern": "^txn_[0-9a-f-]{36}$",
                  "type": "string"
                },
                "record_id": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "coord.status_observed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observer_instance_id",
            "subject_instance_id",
            "status"
          ],
          "properties": {
            "observer_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "subject_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "status": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "coord.claim_changed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "actor_instance_id",
            "subject_instance_id",
            "operation",
            "target",
            "access",
            "authority"
          ],
          "properties": {
            "actor_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "subject_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "operation": {
              "anyOf": [
                {
                  "const": "acquired",
                  "type": "string"
                },
                {
                  "const": "released",
                  "type": "string"
                },
                {
                  "const": "denied",
                  "type": "string"
                }
              ]
            },
            "target": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "kind",
                "access",
                "fingerprint",
                "extractor_version"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "const": "workspace_path",
                      "type": "string"
                    },
                    {
                      "const": "external_path",
                      "type": "string"
                    },
                    {
                      "const": "url",
                      "type": "string"
                    },
                    {
                      "const": "query",
                      "type": "string"
                    },
                    {
                      "const": "pattern",
                      "type": "string"
                    },
                    {
                      "const": "artifact",
                      "type": "string"
                    },
                    {
                      "const": "service",
                      "type": "string"
                    },
                    {
                      "const": "resource",
                      "type": "string"
                    }
                  ]
                },
                "access": {
                  "anyOf": [
                    {
                      "const": "read",
                      "type": "string"
                    },
                    {
                      "const": "write",
                      "type": "string"
                    },
                    {
                      "const": "execute",
                      "type": "string"
                    },
                    {
                      "const": "publish",
                      "type": "string"
                    },
                    {
                      "const": "delete",
                      "type": "string"
                    },
                    {
                      "const": "unknown",
                      "type": "string"
                    }
                  ]
                },
                "display": {
                  "maxLength": 240,
                  "type": "string"
                },
                "fingerprint": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "algorithm",
                    "canonicalizer",
                    "key_epoch",
                    "scope",
                    "digest"
                  ],
                  "properties": {
                    "algorithm": {
                      "const": "hmac-sha256",
                      "type": "string"
                    },
                    "canonicalizer": {
                      "const": "harnery-jcs-nfc-v1",
                      "type": "string"
                    },
                    "key_epoch": {
                      "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                      "type": "string"
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "const": "generation",
                          "type": "string"
                        },
                        {
                          "const": "root",
                          "type": "string"
                        }
                      ]
                    },
                    "digest": {
                      "pattern": "^sha256:[a-f0-9]{64}$",
                      "type": "string"
                    }
                  }
                },
                "extractor_version": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                }
              }
            },
            "access": {
              "anyOf": [
                {
                  "const": "read",
                  "type": "string"
                },
                {
                  "const": "write",
                  "type": "string"
                }
              ]
            },
            "authority": {
              "additionalProperties": false,
              "type": "object",
              "properties": {
                "transaction_id": {
                  "pattern": "^txn_[0-9a-f-]{36}$",
                  "type": "string"
                },
                "record_id": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "coord.presence_changed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "actor_instance_id",
            "subject_instance_id",
            "new_state",
            "reason",
            "authority"
          ],
          "properties": {
            "actor_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "subject_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "prior_state": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "new_state": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "reason": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
              "type": "string"
            },
            "reason_fingerprint": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "algorithm",
                "canonicalizer",
                "key_epoch",
                "scope",
                "digest"
              ],
              "properties": {
                "algorithm": {
                  "const": "hmac-sha256",
                  "type": "string"
                },
                "canonicalizer": {
                  "const": "harnery-jcs-nfc-v1",
                  "type": "string"
                },
                "key_epoch": {
                  "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "scope": {
                  "anyOf": [
                    {
                      "const": "generation",
                      "type": "string"
                    },
                    {
                      "const": "root",
                      "type": "string"
                    }
                  ]
                },
                "digest": {
                  "pattern": "^sha256:[a-f0-9]{64}$",
                  "type": "string"
                }
              }
            },
            "authority": {
              "additionalProperties": false,
              "type": "object",
              "properties": {
                "transaction_id": {
                  "pattern": "^txn_[0-9a-f-]{36}$",
                  "type": "string"
                },
                "record_id": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "coord.message_observed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "message_id",
            "direction",
            "peer_instance_id",
            "body_length",
            "body_fingerprint"
          ],
          "properties": {
            "message_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "direction": {
              "anyOf": [
                {
                  "const": "sent",
                  "type": "string"
                },
                {
                  "const": "received",
                  "type": "string"
                }
              ]
            },
            "peer_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "body_length": {
              "minimum": 0,
              "type": "integer"
            },
            "body_fingerprint": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "algorithm",
                "canonicalizer",
                "key_epoch",
                "scope",
                "digest"
              ],
              "properties": {
                "algorithm": {
                  "const": "hmac-sha256",
                  "type": "string"
                },
                "canonicalizer": {
                  "const": "harnery-jcs-nfc-v1",
                  "type": "string"
                },
                "key_epoch": {
                  "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "scope": {
                  "anyOf": [
                    {
                      "const": "generation",
                      "type": "string"
                    },
                    {
                      "const": "root",
                      "type": "string"
                    }
                  ]
                },
                "digest": {
                  "pattern": "^sha256:[a-f0-9]{64}$",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "coord.identity_attested",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "actor_instance_id",
            "subject_instance_id",
            "identity_id",
            "method",
            "authority"
          ],
          "properties": {
            "actor_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "subject_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "identity_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "method": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "authority": {
              "additionalProperties": false,
              "type": "object",
              "properties": {
                "transaction_id": {
                  "pattern": "^txn_[0-9a-f-]{36}$",
                  "type": "string"
                },
                "record_id": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "council.state_changed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "council_id",
            "new_state",
            "record_digest"
          ],
          "properties": {
            "council_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "prior_state": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "new_state": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "record_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "decision.state_changed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "decision_id",
            "new_state",
            "record_digest",
            "authority"
          ],
          "properties": {
            "decision_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "prior_state": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "new_state": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "record_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            },
            "authority": {
              "additionalProperties": false,
              "type": "object",
              "properties": {
                "transaction_id": {
                  "pattern": "^txn_[0-9a-f-]{36}$",
                  "type": "string"
                },
                "record_id": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "lifecycle.recovered",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "subject_instance_id",
            "recovery_kind",
            "new_digest"
          ],
          "properties": {
            "subject_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "recovery_kind": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "prior_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            },
            "new_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "lifecycle.sweep_observed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "subject_instance_id",
            "observation",
            "provisional",
            "age_ms"
          ],
          "properties": {
            "subject_instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "observation": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "provisional": {
              "const": true,
              "type": "boolean"
            },
            "age_ms": {
              "minimum": 0,
              "type": "integer"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "health.observed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "subsystem",
            "severity",
            "condition",
            "action",
            "recovered"
          ],
          "properties": {
            "subsystem": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "severity": {
              "anyOf": [
                {
                  "const": "unknown",
                  "type": "string"
                },
                {
                  "const": "healthy",
                  "type": "string"
                },
                {
                  "const": "attention",
                  "type": "string"
                },
                {
                  "const": "critical",
                  "type": "string"
                }
              ]
            },
            "condition": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
              "type": "string"
            },
            "action": {
              "const": "none",
              "type": "string"
            },
            "evidence_reference": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "recovered": {
              "type": "boolean"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "session.ended",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "outcome",
            "authority",
            "reason",
            "completeness",
            "span"
          ],
          "properties": {
            "outcome": {
              "anyOf": [
                {
                  "const": "succeeded",
                  "type": "string"
                },
                {
                  "const": "failed",
                  "type": "string"
                },
                {
                  "const": "cancelled",
                  "type": "string"
                },
                {
                  "const": "timed_out",
                  "type": "string"
                },
                {
                  "const": "denied",
                  "type": "string"
                },
                {
                  "const": "interrupted",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "authority": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "approved",
                  "type": "string"
                }
              ]
            },
            "reason": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
              "type": "string"
            },
            "completeness": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "value",
                    "attestation",
                    "confidence"
                  ],
                  "properties": {
                    "state": {
                      "const": "observed",
                      "type": "string"
                    },
                    "value": {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "expected",
                        "observed",
                        "missing"
                      ],
                      "properties": {
                        "expected": {
                          "uniqueItems": true,
                          "type": "array",
                          "items": {
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                            "type": "string"
                          }
                        },
                        "observed": {
                          "uniqueItems": true,
                          "type": "array",
                          "items": {
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                            "type": "string"
                          }
                        },
                        "missing": {
                          "uniqueItems": true,
                          "type": "array",
                          "items": {
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                            "type": "string"
                          }
                        }
                      }
                    },
                    "attestation": {
                      "anyOf": [
                        {
                          "const": "native",
                          "type": "string"
                        },
                        {
                          "const": "derived",
                          "type": "string"
                        },
                        {
                          "const": "inferred",
                          "type": "string"
                        }
                      ]
                    },
                    "confidence": {
                      "anyOf": [
                        {
                          "const": "exact",
                          "type": "string"
                        },
                        {
                          "const": "high",
                          "type": "string"
                        },
                        {
                          "const": "medium",
                          "type": "string"
                        },
                        {
                          "const": "low",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability"
                  ],
                  "properties": {
                    "state": {
                      "const": "unsupported",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "expected_but_missing",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "redacted",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "unknown",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state"
                  ],
                  "properties": {
                    "state": {
                      "const": "not_applicable",
                      "type": "string"
                    }
                  }
                }
              ]
            },
            "span": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "span_id",
                "opened_at",
                "duration_ms"
              ],
              "properties": {
                "span_id": {
                  "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "parent_span_id": {
                  "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "opened_at": {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                  "type": "string"
                },
                "duration_ms": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "open_event_id": {
                  "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "turn.completed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id",
            "turn_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "outcome",
            "duration_ms",
            "tool_call_count",
            "response",
            "usage",
            "inference",
            "harness",
            "span"
          ],
          "properties": {
            "outcome": {
              "anyOf": [
                {
                  "const": "succeeded",
                  "type": "string"
                },
                {
                  "const": "failed",
                  "type": "string"
                },
                {
                  "const": "cancelled",
                  "type": "string"
                },
                {
                  "const": "timed_out",
                  "type": "string"
                },
                {
                  "const": "denied",
                  "type": "string"
                },
                {
                  "const": "interrupted",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "duration_ms": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "value",
                    "attestation",
                    "confidence"
                  ],
                  "properties": {
                    "state": {
                      "const": "observed",
                      "type": "string"
                    },
                    "value": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "attestation": {
                      "anyOf": [
                        {
                          "const": "native",
                          "type": "string"
                        },
                        {
                          "const": "derived",
                          "type": "string"
                        },
                        {
                          "const": "inferred",
                          "type": "string"
                        }
                      ]
                    },
                    "confidence": {
                      "anyOf": [
                        {
                          "const": "exact",
                          "type": "string"
                        },
                        {
                          "const": "high",
                          "type": "string"
                        },
                        {
                          "const": "medium",
                          "type": "string"
                        },
                        {
                          "const": "low",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability"
                  ],
                  "properties": {
                    "state": {
                      "const": "unsupported",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "expected_but_missing",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "redacted",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "unknown",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state"
                  ],
                  "properties": {
                    "state": {
                      "const": "not_applicable",
                      "type": "string"
                    }
                  }
                }
              ]
            },
            "tool_call_count": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "value",
                    "attestation",
                    "confidence"
                  ],
                  "properties": {
                    "state": {
                      "const": "observed",
                      "type": "string"
                    },
                    "value": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "attestation": {
                      "anyOf": [
                        {
                          "const": "native",
                          "type": "string"
                        },
                        {
                          "const": "derived",
                          "type": "string"
                        },
                        {
                          "const": "inferred",
                          "type": "string"
                        }
                      ]
                    },
                    "confidence": {
                      "anyOf": [
                        {
                          "const": "exact",
                          "type": "string"
                        },
                        {
                          "const": "high",
                          "type": "string"
                        },
                        {
                          "const": "medium",
                          "type": "string"
                        },
                        {
                          "const": "low",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability"
                  ],
                  "properties": {
                    "state": {
                      "const": "unsupported",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "expected_but_missing",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "redacted",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "unknown",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state"
                  ],
                  "properties": {
                    "state": {
                      "const": "not_applicable",
                      "type": "string"
                    }
                  }
                }
              ]
            },
            "wait_count": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "value",
                    "attestation",
                    "confidence"
                  ],
                  "properties": {
                    "state": {
                      "const": "observed",
                      "type": "string"
                    },
                    "value": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "attestation": {
                      "anyOf": [
                        {
                          "const": "native",
                          "type": "string"
                        },
                        {
                          "const": "derived",
                          "type": "string"
                        },
                        {
                          "const": "inferred",
                          "type": "string"
                        }
                      ]
                    },
                    "confidence": {
                      "anyOf": [
                        {
                          "const": "exact",
                          "type": "string"
                        },
                        {
                          "const": "high",
                          "type": "string"
                        },
                        {
                          "const": "medium",
                          "type": "string"
                        },
                        {
                          "const": "low",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability"
                  ],
                  "properties": {
                    "state": {
                      "const": "unsupported",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "expected_but_missing",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "redacted",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "unknown",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state"
                  ],
                  "properties": {
                    "state": {
                      "const": "not_applicable",
                      "type": "string"
                    }
                  }
                }
              ]
            },
            "response": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "value",
                    "attestation",
                    "confidence"
                  ],
                  "properties": {
                    "state": {
                      "const": "observed",
                      "type": "string"
                    },
                    "value": {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "storage",
                        "media_type",
                        "bytes"
                      ],
                      "properties": {
                        "storage": {
                          "anyOf": [
                            {
                              "const": "omitted",
                              "type": "string"
                            },
                            {
                              "const": "artifact_reference",
                              "type": "string"
                            }
                          ]
                        },
                        "media_type": {
                          "pattern": "^[a-z0-9.+-]+/[a-z0-9.+-]+$",
                          "maxLength": 127,
                          "type": "string"
                        },
                        "bytes": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "lines": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "artifact_id": {
                          "pattern": "^art_[a-zA-Z0-9._-]{1,128}$",
                          "type": "string"
                        },
                        "fingerprint": {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "algorithm",
                            "canonicalizer",
                            "key_epoch",
                            "scope",
                            "digest"
                          ],
                          "properties": {
                            "algorithm": {
                              "const": "hmac-sha256",
                              "type": "string"
                            },
                            "canonicalizer": {
                              "const": "harnery-jcs-nfc-v1",
                              "type": "string"
                            },
                            "key_epoch": {
                              "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                              "type": "string"
                            },
                            "scope": {
                              "anyOf": [
                                {
                                  "const": "generation",
                                  "type": "string"
                                },
                                {
                                  "const": "root",
                                  "type": "string"
                                }
                              ]
                            },
                            "digest": {
                              "pattern": "^sha256:[a-f0-9]{64}$",
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "attestation": {
                      "anyOf": [
                        {
                          "const": "native",
                          "type": "string"
                        },
                        {
                          "const": "derived",
                          "type": "string"
                        },
                        {
                          "const": "inferred",
                          "type": "string"
                        }
                      ]
                    },
                    "confidence": {
                      "anyOf": [
                        {
                          "const": "exact",
                          "type": "string"
                        },
                        {
                          "const": "high",
                          "type": "string"
                        },
                        {
                          "const": "medium",
                          "type": "string"
                        },
                        {
                          "const": "low",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability"
                  ],
                  "properties": {
                    "state": {
                      "const": "unsupported",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "expected_but_missing",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "redacted",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "unknown",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state"
                  ],
                  "properties": {
                    "state": {
                      "const": "not_applicable",
                      "type": "string"
                    }
                  }
                }
              ]
            },
            "ritual": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "status_box_present",
                "status_box_present_strict",
                "session_name"
              ],
              "properties": {
                "status_box_present": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "type": "boolean"
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "status_box_present_strict": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "type": "boolean"
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "session_name": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "additionalProperties": false,
                          "type": "object",
                          "required": [
                            "required",
                            "present"
                          ],
                          "properties": {
                            "required": {
                              "type": "boolean"
                            },
                            "present": {
                              "type": "boolean"
                            }
                          }
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "usage": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "value",
                    "attestation",
                    "confidence"
                  ],
                  "properties": {
                    "state": {
                      "const": "observed",
                      "type": "string"
                    },
                    "value": {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "input_tokens",
                        "output_tokens",
                        "method"
                      ],
                      "properties": {
                        "input_tokens": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "output_tokens": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "cache_read_tokens": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "cache_write_tokens": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "method": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    "attestation": {
                      "anyOf": [
                        {
                          "const": "native",
                          "type": "string"
                        },
                        {
                          "const": "derived",
                          "type": "string"
                        },
                        {
                          "const": "inferred",
                          "type": "string"
                        }
                      ]
                    },
                    "confidence": {
                      "anyOf": [
                        {
                          "const": "exact",
                          "type": "string"
                        },
                        {
                          "const": "high",
                          "type": "string"
                        },
                        {
                          "const": "medium",
                          "type": "string"
                        },
                        {
                          "const": "low",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability"
                  ],
                  "properties": {
                    "state": {
                      "const": "unsupported",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "expected_but_missing",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "redacted",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "unknown",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state"
                  ],
                  "properties": {
                    "state": {
                      "const": "not_applicable",
                      "type": "string"
                    }
                  }
                }
              ]
            },
            "inference": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "value",
                    "attestation",
                    "confidence"
                  ],
                  "properties": {
                    "state": {
                      "const": "observed",
                      "type": "string"
                    },
                    "value": {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "api_time_ms",
                        "request_count"
                      ],
                      "properties": {
                        "api_time_ms": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "request_count": {
                          "minimum": 0,
                          "type": "integer"
                        }
                      }
                    },
                    "attestation": {
                      "anyOf": [
                        {
                          "const": "native",
                          "type": "string"
                        },
                        {
                          "const": "derived",
                          "type": "string"
                        },
                        {
                          "const": "inferred",
                          "type": "string"
                        }
                      ]
                    },
                    "confidence": {
                      "anyOf": [
                        {
                          "const": "exact",
                          "type": "string"
                        },
                        {
                          "const": "high",
                          "type": "string"
                        },
                        {
                          "const": "medium",
                          "type": "string"
                        },
                        {
                          "const": "low",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability"
                  ],
                  "properties": {
                    "state": {
                      "const": "unsupported",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "expected_but_missing",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "redacted",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "unknown",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state"
                  ],
                  "properties": {
                    "state": {
                      "const": "not_applicable",
                      "type": "string"
                    }
                  }
                }
              ]
            },
            "harness": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "value",
                    "attestation",
                    "confidence"
                  ],
                  "properties": {
                    "state": {
                      "const": "observed",
                      "type": "string"
                    },
                    "value": {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "hook_time_ms",
                        "hook_count"
                      ],
                      "properties": {
                        "hook_time_ms": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "hook_count": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "slowest_hook": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "slowest_hook_ms": {
                          "minimum": 0,
                          "type": "integer"
                        }
                      }
                    },
                    "attestation": {
                      "anyOf": [
                        {
                          "const": "native",
                          "type": "string"
                        },
                        {
                          "const": "derived",
                          "type": "string"
                        },
                        {
                          "const": "inferred",
                          "type": "string"
                        }
                      ]
                    },
                    "confidence": {
                      "anyOf": [
                        {
                          "const": "exact",
                          "type": "string"
                        },
                        {
                          "const": "high",
                          "type": "string"
                        },
                        {
                          "const": "medium",
                          "type": "string"
                        },
                        {
                          "const": "low",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability"
                  ],
                  "properties": {
                    "state": {
                      "const": "unsupported",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "expected_but_missing",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "redacted",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "unknown",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state"
                  ],
                  "properties": {
                    "state": {
                      "const": "not_applicable",
                      "type": "string"
                    }
                  }
                }
              ]
            },
            "span": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "span_id",
                "opened_at",
                "duration_ms"
              ],
              "properties": {
                "span_id": {
                  "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "parent_span_id": {
                  "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "opened_at": {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                  "type": "string"
                },
                "duration_ms": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "open_event_id": {
                  "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "tool.completed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id",
            "turn_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by",
            "span_id"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "tool",
            "outcome",
            "duration_ms",
            "result",
            "span"
          ],
          "properties": {
            "tool": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "namespace",
                "name"
              ],
              "properties": {
                "namespace": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                },
                "name": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                }
              }
            },
            "outcome": {
              "anyOf": [
                {
                  "const": "succeeded",
                  "type": "string"
                },
                {
                  "const": "failed",
                  "type": "string"
                },
                {
                  "const": "cancelled",
                  "type": "string"
                },
                {
                  "const": "timed_out",
                  "type": "string"
                },
                {
                  "const": "denied",
                  "type": "string"
                },
                {
                  "const": "interrupted",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "duration_ms": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "value",
                    "attestation",
                    "confidence"
                  ],
                  "properties": {
                    "state": {
                      "const": "observed",
                      "type": "string"
                    },
                    "value": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "attestation": {
                      "anyOf": [
                        {
                          "const": "native",
                          "type": "string"
                        },
                        {
                          "const": "derived",
                          "type": "string"
                        },
                        {
                          "const": "inferred",
                          "type": "string"
                        }
                      ]
                    },
                    "confidence": {
                      "anyOf": [
                        {
                          "const": "exact",
                          "type": "string"
                        },
                        {
                          "const": "high",
                          "type": "string"
                        },
                        {
                          "const": "medium",
                          "type": "string"
                        },
                        {
                          "const": "low",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability"
                  ],
                  "properties": {
                    "state": {
                      "const": "unsupported",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "expected_but_missing",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "redacted",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "unknown",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state"
                  ],
                  "properties": {
                    "state": {
                      "const": "not_applicable",
                      "type": "string"
                    }
                  }
                }
              ]
            },
            "result": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "storage",
                "media_type",
                "bytes"
              ],
              "properties": {
                "storage": {
                  "anyOf": [
                    {
                      "const": "omitted",
                      "type": "string"
                    },
                    {
                      "const": "artifact_reference",
                      "type": "string"
                    }
                  ]
                },
                "media_type": {
                  "pattern": "^[a-z0-9.+-]+/[a-z0-9.+-]+$",
                  "maxLength": 127,
                  "type": "string"
                },
                "bytes": {
                  "minimum": 0,
                  "type": "integer"
                },
                "lines": {
                  "minimum": 0,
                  "type": "integer"
                },
                "artifact_id": {
                  "pattern": "^art_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "fingerprint": {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "algorithm",
                    "canonicalizer",
                    "key_epoch",
                    "scope",
                    "digest"
                  ],
                  "properties": {
                    "algorithm": {
                      "const": "hmac-sha256",
                      "type": "string"
                    },
                    "canonicalizer": {
                      "const": "harnery-jcs-nfc-v1",
                      "type": "string"
                    },
                    "key_epoch": {
                      "pattern": "^pep_[a-zA-Z0-9._-]{1,128}$",
                      "type": "string"
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "const": "generation",
                          "type": "string"
                        },
                        {
                          "const": "root",
                          "type": "string"
                        }
                      ]
                    },
                    "digest": {
                      "pattern": "^sha256:[a-f0-9]{64}$",
                      "type": "string"
                    }
                  }
                }
              }
            },
            "error": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "class"
              ],
              "properties": {
                "class": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                },
                "code": {
                  "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                  "type": "string"
                }
              }
            },
            "recovery": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "reason"
              ],
              "properties": {
                "reason": {
                  "anyOf": [
                    {
                      "const": "request_not_observed",
                      "type": "string"
                    },
                    {
                      "const": "completion_not_observed_before_turn_end",
                      "type": "string"
                    },
                    {
                      "const": "completion_not_observed_before_next_turn",
                      "type": "string"
                    },
                    {
                      "const": "span_cap_pressure",
                      "type": "string"
                    },
                    {
                      "const": "explicit_end_salvage",
                      "type": "string"
                    },
                    {
                      "const": "command_completion_not_observed",
                      "type": "string"
                    }
                  ]
                },
                "requested_event_id": {
                  "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "elapsed_upper_bound_ms": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "span": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "span_id",
                "opened_at",
                "duration_ms"
              ],
              "properties": {
                "span_id": {
                  "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "parent_span_id": {
                  "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "opened_at": {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                  "type": "string"
                },
                "duration_ms": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "open_event_id": {
                  "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "command.completed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id",
            "turn_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by",
            "span_id"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "outcome",
            "duration_ms",
            "span"
          ],
          "properties": {
            "outcome": {
              "anyOf": [
                {
                  "const": "succeeded",
                  "type": "string"
                },
                {
                  "const": "failed",
                  "type": "string"
                },
                {
                  "const": "cancelled",
                  "type": "string"
                },
                {
                  "const": "timed_out",
                  "type": "string"
                },
                {
                  "const": "denied",
                  "type": "string"
                },
                {
                  "const": "interrupted",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "exit_code": {
              "type": "integer"
            },
            "signal": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "duration_ms": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "value",
                    "attestation",
                    "confidence"
                  ],
                  "properties": {
                    "state": {
                      "const": "observed",
                      "type": "string"
                    },
                    "value": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "attestation": {
                      "anyOf": [
                        {
                          "const": "native",
                          "type": "string"
                        },
                        {
                          "const": "derived",
                          "type": "string"
                        },
                        {
                          "const": "inferred",
                          "type": "string"
                        }
                      ]
                    },
                    "confidence": {
                      "anyOf": [
                        {
                          "const": "exact",
                          "type": "string"
                        },
                        {
                          "const": "high",
                          "type": "string"
                        },
                        {
                          "const": "medium",
                          "type": "string"
                        },
                        {
                          "const": "low",
                          "type": "string"
                        }
                      ]
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability"
                  ],
                  "properties": {
                    "state": {
                      "const": "unsupported",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "capability",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "expected_but_missing",
                      "type": "string"
                    },
                    "capability": {
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "redacted",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state",
                    "reason"
                  ],
                  "properties": {
                    "state": {
                      "const": "unknown",
                      "type": "string"
                    },
                    "reason": {
                      "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "type": "object",
                  "required": [
                    "state"
                  ],
                  "properties": {
                    "state": {
                      "const": "not_applicable",
                      "type": "string"
                    }
                  }
                }
              ]
            },
            "error_class": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "recovery": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "reason"
              ],
              "properties": {
                "reason": {
                  "anyOf": [
                    {
                      "const": "request_not_observed",
                      "type": "string"
                    },
                    {
                      "const": "completion_not_observed_before_turn_end",
                      "type": "string"
                    },
                    {
                      "const": "completion_not_observed_before_next_turn",
                      "type": "string"
                    },
                    {
                      "const": "span_cap_pressure",
                      "type": "string"
                    },
                    {
                      "const": "explicit_end_salvage",
                      "type": "string"
                    },
                    {
                      "const": "command_completion_not_observed",
                      "type": "string"
                    }
                  ]
                },
                "requested_event_id": {
                  "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "elapsed_upper_bound_ms": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "span": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "span_id",
                "opened_at",
                "duration_ms"
              ],
              "properties": {
                "span_id": {
                  "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "parent_span_id": {
                  "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "opened_at": {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                  "type": "string"
                },
                "duration_ms": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "open_event_id": {
                  "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "agent.completed",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "delegation_id",
            "child_generation_id",
            "outcome",
            "span"
          ],
          "properties": {
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "child_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "outcome": {
              "anyOf": [
                {
                  "const": "succeeded",
                  "type": "string"
                },
                {
                  "const": "failed",
                  "type": "string"
                },
                {
                  "const": "cancelled",
                  "type": "string"
                },
                {
                  "const": "timed_out",
                  "type": "string"
                },
                {
                  "const": "denied",
                  "type": "string"
                },
                {
                  "const": "interrupted",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "span": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "span_id",
                "opened_at",
                "duration_ms"
              ],
              "properties": {
                "span_id": {
                  "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "parent_span_id": {
                  "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "opened_at": {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                  "type": "string"
                },
                "duration_ms": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "open_event_id": {
                  "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "wait.started",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "wait_id",
            "kind"
          ],
          "properties": {
            "wait_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "kind": {
              "anyOf": [
                {
                  "const": "permission",
                  "type": "string"
                },
                {
                  "const": "needs_input",
                  "type": "string"
                },
                {
                  "const": "decision",
                  "type": "string"
                },
                {
                  "const": "approval",
                  "type": "string"
                },
                {
                  "const": "scheduled",
                  "type": "string"
                },
                {
                  "const": "rate_limit",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "authority_reference": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "wake_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "wait.ended",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "wait_id",
            "outcome",
            "span"
          ],
          "properties": {
            "wait_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "outcome": {
              "anyOf": [
                {
                  "const": "succeeded",
                  "type": "string"
                },
                {
                  "const": "failed",
                  "type": "string"
                },
                {
                  "const": "cancelled",
                  "type": "string"
                },
                {
                  "const": "timed_out",
                  "type": "string"
                },
                {
                  "const": "denied",
                  "type": "string"
                },
                {
                  "const": "interrupted",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "resolution_reference": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "span": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "span_id",
                "opened_at",
                "duration_ms"
              ],
              "properties": {
                "span_id": {
                  "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "parent_span_id": {
                  "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                },
                "opened_at": {
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
                  "type": "string"
                },
                "duration_ms": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "value",
                        "attestation",
                        "confidence"
                      ],
                      "properties": {
                        "state": {
                          "const": "observed",
                          "type": "string"
                        },
                        "value": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "attestation": {
                          "anyOf": [
                            {
                              "const": "native",
                              "type": "string"
                            },
                            {
                              "const": "derived",
                              "type": "string"
                            },
                            {
                              "const": "inferred",
                              "type": "string"
                            }
                          ]
                        },
                        "confidence": {
                          "anyOf": [
                            {
                              "const": "exact",
                              "type": "string"
                            },
                            {
                              "const": "high",
                              "type": "string"
                            },
                            {
                              "const": "medium",
                              "type": "string"
                            },
                            {
                              "const": "low",
                              "type": "string"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability"
                      ],
                      "properties": {
                        "state": {
                          "const": "unsupported",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "capability",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "expected_but_missing",
                          "type": "string"
                        },
                        "capability": {
                          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "redacted",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state",
                        "reason"
                      ],
                      "properties": {
                        "state": {
                          "const": "unknown",
                          "type": "string"
                        },
                        "reason": {
                          "pattern": "^[a-z0-9][a-z0-9._-]{0,79}$",
                          "type": "string"
                        }
                      }
                    },
                    {
                      "additionalProperties": false,
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "const": "not_applicable",
                          "type": "string"
                        }
                      }
                    }
                  ]
                },
                "open_event_id": {
                  "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    {
      "additionalProperties": false,
      "type": "object",
      "required": [
        "contract",
        "event_id",
        "event_type",
        "time",
        "producer",
        "scope",
        "attestation_id",
        "links",
        "provenance",
        "payload"
      ],
      "properties": {
        "contract": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "name",
            "major",
            "schema_digest"
          ],
          "properties": {
            "name": {
              "const": "harnery.event",
              "type": "string"
            },
            "major": {
              "const": 3,
              "type": "number"
            },
            "schema_digest": {
              "pattern": "^sha256:[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "event_id": {
          "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "event_type": {
          "const": "health.capability_drift",
          "type": "string"
        },
        "time": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "observed_at",
            "recorded_at",
            "clock_id",
            "skew"
          ],
          "properties": {
            "observed_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "recorded_at": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$",
              "type": "string"
            },
            "monotonic_ns": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "clock_id": {
              "pattern": "^clk_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "skew": {
              "anyOf": [
                {
                  "const": "normal",
                  "type": "string"
                },
                {
                  "const": "regressed",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            }
          }
        },
        "producer": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "producer_id",
            "boot_id",
            "sequence",
            "component",
            "build_id",
            "platform"
          ],
          "properties": {
            "producer_id": {
              "pattern": "^prd_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "boot_id": {
              "pattern": "^boot_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "sequence": {
              "minimum": 1,
              "type": "integer"
            },
            "component": {
              "anyOf": [
                {
                  "const": "agent-hook",
                  "type": "string"
                },
                {
                  "const": "agent-coord",
                  "type": "string"
                },
                {
                  "const": "session-tee",
                  "type": "string"
                },
                {
                  "const": "projector",
                  "type": "string"
                },
                {
                  "const": "health",
                  "type": "string"
                },
                {
                  "const": "recovery",
                  "type": "string"
                }
              ]
            },
            "build_id": {
              "pattern": "^build_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "platform": {
              "anyOf": [
                {
                  "const": "linux",
                  "type": "string"
                },
                {
                  "const": "windows",
                  "type": "string"
                },
                {
                  "const": "macos",
                  "type": "string"
                },
                {
                  "const": "unknown",
                  "type": "string"
                }
              ]
            },
            "bridge": {
              "const": "codex-wsl",
              "type": "string"
            }
          }
        },
        "scope": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "root_id",
            "instance_id",
            "session_id",
            "generation_id"
          ],
          "properties": {
            "root_id": {
              "pattern": "^root_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "instance_id": {
              "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "run_id": {
              "pattern": "^run_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_id": {
              "pattern": "^wf_[a-zA-Z0-9._-]{1,128}$",
              "type": "string"
            },
            "workflow_agent_id": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "session_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "turn_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            }
          }
        },
        "attestation_id": {
          "pattern": "^att_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "type": "string"
        },
        "links": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "caused_by"
          ],
          "properties": {
            "caused_by": {
              "maxItems": 64,
              "uniqueItems": true,
              "type": "array",
              "items": {
                "pattern": "^evt_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
                "type": "string"
              }
            },
            "span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_span_id": {
              "pattern": "^span_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "parent_generation_id": {
              "pattern": "^gen_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            },
            "delegation_id": {
              "pattern": "^del_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
              "type": "string"
            }
          }
        },
        "provenance": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "source_event",
            "attestation",
            "confidence",
            "attribution"
          ],
          "properties": {
            "source_event": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "attestation": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "inferred",
                  "type": "string"
                },
                {
                  "const": "operator",
                  "type": "string"
                }
              ]
            },
            "confidence": {
              "anyOf": [
                {
                  "const": "exact",
                  "type": "string"
                },
                {
                  "const": "high",
                  "type": "string"
                },
                {
                  "const": "medium",
                  "type": "string"
                },
                {
                  "const": "low",
                  "type": "string"
                }
              ]
            },
            "source_record_id": {
              "pattern": "^(sid|tid|hid)_[a-f0-9]{64}$",
              "type": "string"
            },
            "attribution": {
              "additionalProperties": false,
              "type": "object",
              "required": [
                "method",
                "state"
              ],
              "properties": {
                "method": {
                  "anyOf": [
                    {
                      "const": "session_env",
                      "type": "string"
                    },
                    {
                      "const": "native_payload",
                      "type": "string"
                    },
                    {
                      "const": "heartbeat_match",
                      "type": "string"
                    },
                    {
                      "const": "explicit_argument",
                      "type": "string"
                    },
                    {
                      "const": "unattributed",
                      "type": "string"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "verified",
                      "type": "string"
                    },
                    {
                      "const": "unverified",
                      "type": "string"
                    },
                    {
                      "const": "conflict",
                      "type": "string"
                    }
                  ]
                },
                "observer_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                },
                "subject_instance_id": {
                  "pattern": "^inst_[a-zA-Z0-9._-]{1,128}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "payload": {
          "additionalProperties": false,
          "type": "object",
          "required": [
            "signal",
            "promised",
            "expected_count",
            "observed_count",
            "generation_ended"
          ],
          "properties": {
            "signal": {
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$",
              "type": "string"
            },
            "promised": {
              "anyOf": [
                {
                  "const": "native",
                  "type": "string"
                },
                {
                  "const": "derived",
                  "type": "string"
                },
                {
                  "const": "conditional",
                  "type": "string"
                }
              ]
            },
            "expected_count": {
              "minimum": 0,
              "type": "integer"
            },
            "observed_count": {
              "minimum": 0,
              "type": "integer"
            },
            "generation_ended": {
              "type": "boolean"
            }
          }
        }
      }
    }
  ]
}
