{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:orbiplex:schema:corpus-passage-evidence-binding:v1",
  "title": "Corpus Passage Evidence Binding v1",
  "description": "Corpus lineage fact binding one Agent passage to the evidence manifest its prompt was assembled from (P094-023a): the passage, its Agent and Flow bindings, the passage input digest that covers the manifest reference in the request metadata, the query and Room, the manifest by ref and digest, and the digest of the materialized content. It is recorded, create-only, before inference; it does not mean the inference completed.",
  "type": "object",
  "additionalProperties": false,
  "x-dia-status": "draft",
  "required": [
    "schema",
    "passage/ref",
    "agent/id",
    "agent-flow-binding/ref",
    "inference-flow-binding/ref",
    "input/digest",
    "query/id",
    "room/id",
    "evidence/manifest-ref",
    "evidence/manifest-digest",
    "materialized/digest",
    "agent/input-manifest-ref",
    "recorded-at"
  ],
  "properties": {
    "agent/input-manifest-ref": {
      "type": "string",
      "pattern": "^agent-passage-input-manifest:sha256:[A-Za-z0-9_-]{43}$",
      "description": "Canonical Agent-owned passage input commitment; this Corpus fact adds only domain relations, never a second input list."
    },
    "schema": {
      "const": "corpus-passage-evidence-binding.v1"
    },
    "passage/ref": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]*:[^\\s]+$",
      "maxLength": 512
    },
    "agent/id": {
      "type": "string",
      "pattern": "^agent:[^\\s]+$",
      "maxLength": 512
    },
    "agent-flow-binding/ref": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]*:[^\\s]+$",
      "maxLength": 512
    },
    "inference-flow-binding/ref": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]*:[^\\s]+$",
      "maxLength": 512
    },
    "input/digest": {
      "type": "string",
      "pattern": "^sha256:[A-Za-z0-9_-]{43}$"
    },
    "query/id": {
      "type": "string",
      "pattern": "^query:[^\\s]+$",
      "maxLength": 512
    },
    "room/id": {
      "type": "string",
      "pattern": "^room:[^\\s]+$",
      "maxLength": 512
    },
    "evidence/manifest-ref": {
      "type": "string",
      "pattern": "^corpus-evidence-manifest:sha256:[A-Za-z0-9_-]{43}$",
      "maxLength": 512
    },
    "evidence/manifest-digest": {
      "type": "string",
      "pattern": "^sha256:[A-Za-z0-9_-]{43}$"
    },
    "materialized/digest": {
      "type": "string",
      "pattern": "^sha256:[A-Za-z0-9_-]{43}$"
    },
    "recorded-at": {
      "type": "string",
      "format": "date-time",
      "maxLength": 64
    }
  }
}
