{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://observatoryledger.com/incident.schema.json",
  "title": "Agent incident record",
  "description": "One entry in the Observatory Ledger's agent incident ledger. Every entry uses the same fields whatever the company. Each factual field cites source ids. 'unknown' is a valid value and means no public source settles the question. Records are attributed summaries of what sources report, not findings of fact.",
  "type": "object",
  "additionalProperties": false,
  "required": ["id", "slug", "label", "label_parts", "title", "labs", "run_by", "reach", "affected", "setting", "event", "first_public", "lab_disclosure", "what_happened", "dynamics", "geography", "still_unknown", "disagreements", "sources", "review"],
  "$defs": {
    "date": {
      "description": "ISO date at the precision the sources support: YYYY, YYYY-MM or YYYY-MM-DD. null when no source gives a date.",
      "type": ["string", "null"],
      "pattern": "^\\d{4}(-\\d{2}(-\\d{2})?)?$"
    },
    "date_basis": {
      "enum": ["publication", "latest update"],
      "description": "What the date is. 'latest update': the source shows only when it was last updated, so it may first have been published earlier. The builder then gives the delay only as an upper bound and leaves it out of the medians. Absent means publication."
    },
    "source_ids": {
      "type": "array",
      "items": {"type": "string", "pattern": "^S\\d+$"}
    },
    "place": {
      "type": "object",
      "additionalProperties": false,
      "required": ["party", "country", "basis", "sources"],
      "properties": {
        "party": {"type": "string", "minLength": 1},
        "country": {"type": "string", "minLength": 1, "description": "Country name, or 'not stated' when no source gives it."},
        "basis": {"enum": ["headquarters", "government jurisdiction", "named in source", "not stated"], "description": "Why this country: where the organisation is headquartered, the government it belongs to, a source naming the place, or not stated. It is never a server location unless a source says so."},
        "sources": {"$ref": "#/$defs/source_ids"},
        "note": {"type": "string"}
      }
    },
    "cited_text": {
      "type": "object",
      "additionalProperties": false,
      "required": ["text", "sources"],
      "properties": {
        "text": {"type": "string", "minLength": 1, "maxLength": 600},
        "sources": {"$ref": "#/$defs/source_ids", "minItems": 1}
      }
    }
  },
  "properties": {
    "id": {"type": "string", "pattern": "^OL-INC-\\d{4}$", "description": "Stable ledger id. Never reused, never renumbered."},
    "slug": {"type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$", "description": "URL segment under /incidents/."},
    "label": {"type": "string", "description": "Readable label: Developer-RunBy-[Pub]YYYYMon-Handle[-Model], generated from label_parts and the dates. May change if a part or a date is corrected; the id does not."},
    "label_parts": {
      "type": "object", "additionalProperties": false,
      "required": ["developer", "run_by", "handle"],
      "description": "The parts the label is generated from. The date part is the month the activity began (event.start); when no source dates the activity it is 'Pub' plus the month of the first public report.",
      "properties": {
        "developer": {"type": "string", "pattern": "^[A-Z][A-Za-z0-9]*(\\+[A-Z][A-Za-z0-9]*)*$", "description": "Who made the model as it acted. Two developers are joined with '+', in the order of the labs list."},
        "run_by": {"type": "string", "pattern": "^[A-Z][A-Za-z0-9]*$", "description": "Self when the developer ran the agent; otherwise the runner's short name, User for an individual, Unknown when no source says."},
        "handle": {"type": "string", "pattern": "^[A-Z][A-Za-z0-9]*$", "description": "One noun: the named thing reached; else the named model; else a plain event word. The prefix 'Own' marks the runner's own systems."},
        "model": {"type": ["string", "null"], "pattern": "^[A-Z][A-Za-z0-9]*(\\+[A-Z][A-Za-z0-9]*)*$", "description": "Only when a source names the model and it is not already the handle."}
      }
    },
    "former_labels": {"type": "array", "items": {"type": "string", "minLength": 1}, "description": "Earlier labels, kept so old citations still resolve. A label is never reused for another entry."},
    "run_by": {
      "type": "object", "additionalProperties": false,
      "required": ["kind", "name", "sources"],
      "description": "Who ran the agent when it acted, as the sources state it.",
      "properties": {
        "kind": {"enum": ["developer", "contracted tester", "independent evaluator", "government", "deployer", "user", "unknown"]},
        "name": {"type": "string", "minLength": 1},
        "sources": {"$ref": "#/$defs/source_ids"},
        "note": {"type": "string"}
      }
    },
    "modified_by": {
      "type": "object", "additionalProperties": false,
      "required": ["party", "sources"],
      "description": "For open-weight models: who fine-tuned or otherwise changed the model before it acted, when that is not the developer.",
      "properties": {"party": {"type": "string", "minLength": 1}, "sources": {"$ref": "#/$defs/source_ids"}, "note": {"type": "string"}}
    },
    "reach": {
      "type": "object", "additionalProperties": false,
      "required": ["outside_parties", "runner_own_systems", "detail", "sources"],
      "description": "What the agent's actions reached, relative to whoever ran it. outside_parties: systems, services or people that do not belong to the runner. runner_own_systems: the runner's own production systems, compute or credentials outside the test environment. reached: the actions arrived at the system or person. attempted: tried, but did not arrive. An entry whose actions stayed inside the test environment (both 'not reported') is outside the inclusion rule.",
      "properties": {
        "outside_parties": {"enum": ["reached", "attempted", "not reported"]},
        "runner_own_systems": {"enum": ["reached", "attempted", "not reported"]},
        "detail": {"type": "string", "minLength": 1, "maxLength": 400},
        "sources": {"$ref": "#/$defs/source_ids", "minItems": 1}
      }
    },
    "title": {"type": "string", "minLength": 1, "maxLength": 120},
    "labs": {
      "type": "array", "minItems": 1,
      "items": {
        "type": "object", "additionalProperties": false,
        "required": ["name", "model", "sources"],
        "properties": {
          "name": {"type": "string", "minLength": 1},
          "model": {"type": "string", "minLength": 1, "description": "Model name exactly as a source states it, or 'unnamed'."},
          "role": {"type": "string"},
          "sources": {"$ref": "#/$defs/source_ids", "minItems": 1}
        }
      }
    },
    "evaluator": {"type": ["string", "null"], "description": "The party running the test, when not the lab itself."},
    "affected": {"type": "array", "items": {"type": "string"}},
    "setting": {"enum": ["internal training run", "internal evaluation", "third-party evaluation", "government evaluation", "research training run", "deployment", "unknown"]},
    "event": {
      "type": "object", "additionalProperties": false,
      "required": ["start", "end", "sources"],
      "properties": {
        "start": {"$ref": "#/$defs/date"},
        "end": {"$ref": "#/$defs/date"},
        "sources": {"$ref": "#/$defs/source_ids"},
        "note": {"type": "string"},
        "per_source": {
          "type": "array",
          "items": {
            "type": "object", "additionalProperties": false,
            "required": ["source", "as_stated"],
            "properties": {
              "source": {"type": "string", "pattern": "^S\\d+$"},
              "start": {"$ref": "#/$defs/date"},
              "end": {"$ref": "#/$defs/date"},
              "as_stated": {"type": "string"}
            }
          }
        }
      }
    },
    "first_public": {
      "type": "object", "additionalProperties": false,
      "required": ["date", "by_type", "by_name", "sources"],
      "properties": {
        "date": {"$ref": "#/$defs/date"},
        "by_type": {"enum": ["lab", "affected party", "third-party evaluator", "outside researchers", "government", "press"]},
        "by_name": {"type": "string"},
        "sources": {"$ref": "#/$defs/source_ids", "minItems": 1},
        "date_basis": {"$ref": "#/$defs/date_basis"}
      }
    },
    "lab_disclosure": {
      "type": "object", "additionalProperties": false,
      "required": ["date", "form", "sources"],
      "properties": {
        "date": {"$ref": "#/$defs/date"},
        "form": {"type": "string", "description": "blog post, technical report, system card, paper, statement to press, security alert, or 'none found'."},
        "sources": {"$ref": "#/$defs/source_ids"},
        "note": {"type": "string"},
        "date_basis": {"$ref": "#/$defs/date_basis"}
      }
    },
    "disclosure_trigger": {"$ref": "#/$defs/cited_text"},
    "what_happened": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/cited_text"}},
    "scale": {
      "type": "array",
      "items": {
        "type": "object", "additionalProperties": false,
        "required": ["value", "what", "source"],
        "properties": {
          "value": {"type": "string"},
          "what": {"type": "string"},
          "source": {"type": "string", "pattern": "^S\\d+$"}
        }
      }
    },
    "dynamics": {
      "type": "object", "additionalProperties": false,
      "required": ["phase", "safeguards_enabled", "objective_deviation"],
      "description": "What an independent evaluator would need to know: when in the model's life it happened, what safeguards were on, and how far behaviour departed from the task.",
      "properties": {
        "phase": {
          "type": "object", "additionalProperties": false,
          "required": ["value", "sources"],
          "properties": {
            "value": {"type": "string", "description": "RL training, internal evaluation, third-party test, government test, mid-training, post-training, deployment, or unknown."},
            "sources": {"$ref": "#/$defs/source_ids"},
            "note": {"type": "string"}
          }
        },
        "safeguards_enabled": {
          "type": "object", "additionalProperties": false,
          "required": ["value", "sources"],
          "properties": {
            "value": {"enum": ["yes", "no", "partial", "unknown"]},
            "detail": {"type": "string"},
            "sources": {"$ref": "#/$defs/source_ids"}
          }
        },
        "objective_deviation": {
          "type": "object", "additionalProperties": false,
          "required": ["assigned_task", "observed_behaviour", "deviation_type", "sources"],
          "properties": {
            "assigned_task": {"type": "string"},
            "observed_behaviour": {"type": "string"},
            "deviation_type": {"enum": ["unauthorised means toward assigned goal", "different goal", "instructed", "followed task inside defective setup", "mistake", "unclear"], "description": "mistake: the sources describe the agent's own action as an error (for example a wrong or destructive command). It records how the action is described, not the agent's intent, and does not move responsibility for the deployment or its controls."},
            "sources": {"$ref": "#/$defs/source_ids"}
          }
        }
      }
    },
    "geography": {
      "type": "object", "additionalProperties": false,
      "required": ["developer", "origin", "destination"],
      "description": "Where the parties are. developer: the lab whose model acted. evaluator: who ran the test, if not the lab. origin: where the agents ran from, as far as sources say (usually not public). destination: what the agents reached - company, government or public service - and its country.",
      "properties": {
        "developer": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/place"}},
        "evaluator": {"type": "array", "items": {"$ref": "#/$defs/place"}},
        "origin": {
          "type": "object", "additionalProperties": false,
          "required": ["value", "sources"],
          "properties": {"value": {"type": "string"}, "sources": {"$ref": "#/$defs/source_ids"}}
        },
        "destination": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/place"}}
      }
    },
    "still_unknown": {"type": "array", "items": {"type": "string"}},
    "disagreements": {
      "type": "array",
      "items": {
        "type": "object", "additionalProperties": false,
        "required": ["field", "values"],
        "properties": {
          "field": {"type": "string"},
          "values": {
            "type": "array", "minItems": 2,
            "items": {
              "type": "object", "additionalProperties": false,
              "required": ["source", "value"],
              "properties": {"source": {"type": "string", "pattern": "^S\\d+$"}, "value": {"type": "string"}}
            }
          },
          "note": {"type": "string"}
        }
      }
    },
    "sources": {
      "type": "array", "minItems": 1,
      "items": {
        "type": "object", "additionalProperties": false,
        "required": ["id", "publisher", "title", "url", "date", "tier", "kind", "checked"],
        "properties": {
          "id": {"type": "string", "pattern": "^S\\d+$"},
          "publisher": {"type": "string"},
          "title": {"type": "string"},
          "url": {"type": "string", "pattern": "^https://"},
          "date": {"$ref": "#/$defs/date"},
          "tier": {"enum": ["E1", "E2", "E3", "E4"], "description": "E1 first-party (a lab about its own model, an affected party about its own systems, a government or evaluator about its own test). E2 independent primary (independent researchers or evaluators with direct data). E3 transport (press). E4 commentary (social posts, videos, newsletters, AI-made tables)."},
          "kind": {"type": "string"},
          "checked": {
            "type": "object", "additionalProperties": false,
            "required": ["date", "result"],
            "properties": {
              "date": {"$ref": "#/$defs/date"},
              "result": {"enum": ["opened", "saved copy read", "not reachable", "known through a citing source"]}
            }
          },
          "supports": {"type": "string"}
        }
      }
    },
    "corrections": {
      "type": "array",
      "description": "Changes made after the entry was first published, each with its date and source. Drafting changes before the first release are not listed.",
      "items": {
        "type": "object", "additionalProperties": false,
        "required": ["date", "field", "change", "sources"],
        "properties": {
          "date": {"$ref": "#/$defs/date"},
          "field": {"type": "string", "minLength": 1},
          "change": {"type": "string", "minLength": 1},
          "sources": {"$ref": "#/$defs/source_ids"}
        }
      }
    },
    "cross_refs": {
      "type": "array",
      "items": {
        "type": "object", "additionalProperties": false,
        "required": ["scheme", "id"],
        "properties": {"scheme": {"type": "string"}, "id": {"type": "string"}, "url": {"type": "string", "pattern": "^https://"}}
      }
    },
    "review": {
      "type": "object", "additionalProperties": false,
      "required": ["status", "curated_by", "cross_family_review", "as_of"],
      "properties": {
        "status": {"enum": ["proposed", "source-checked", "validated", "locked"], "description": "proposed: curated, not yet reviewed outside the curating model family. source-checked: key fields traced to an opened E1 or E2 source. validated: a cross-family review agreed. locked: the editor's final gate."},
        "curated_by": {"type": "string"},
        "cross_family_review": {"enum": ["pending", "done"]},
        "bias_note": {"type": "string"},
        "editor_check": {
          "type": "object", "additionalProperties": false,
          "required": ["approved", "date", "content_sha256"],
          "description": "Editor attestation for locked status. Hash is SHA256 of canonical public JSON without review or computed fields. A matching hash records scope, not who supplied the attestation.",
          "properties": {
            "approved": {"type": "boolean"},
            "date": {"$ref": "#/$defs/date"},
            "content_sha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"}
          }
        },
        "as_of": {"$ref": "#/$defs/date"}
      }
    },
    "computed": {
      "type": "object",
      "description": "Added by the build script from the fields above. Never hand-edited.",
      "properties": {
        "days_event_end_to_first_public": {"type": ["integer", "null"]},
        "days_event_end_to_lab_disclosure": {"type": ["integer", "null"]},
        "first_public_by_lab": {"type": ["boolean", "null"]},
        "url": {"type": "string"},
        "markdown_url": {"type": "string"}
      }
    }
  }
}
