{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://fullsend.ai/normative/entity-context-snapshot/v1/agent-runs.schema.json",
  "title": "AgentRuns",
  "type": "object",
  "required": ["runs"],
  "properties": {
    "runs": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id", "agent", "status", "input_revision", "result_record_keys", "completed_at"],
        "properties": {
          "id": { "$ref": "common.schema.json#/$defs/structural_id" },
          "agent": { "type": "string", "minLength": 1 },
          "status": { "enum": ["success", "failure", "cancelled", "skipped", "timed_out"] },
          "input_revision": {
            "$ref": "common.schema.json#/$defs/record_key",
            "description": "SHA-256 of the canonical index.json consumed by this run."
          },
          "input_head_sha": { "$ref": "common.schema.json#/$defs/git_oid" },
          "result_record_keys": {
            "type": "array",
            "items": { "$ref": "common.schema.json#/$defs/record_key" },
            "uniqueItems": true,
            "description": "Result record keys sorted by ASCII byte order."
          },
          "resulting_commit_sha": { "$ref": "common.schema.json#/$defs/git_oid" },
          "started_at": { "$ref": "common.schema.json#/$defs/timestamp" },
          "completed_at": { "$ref": "common.schema.json#/$defs/timestamp" }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
