{
  "$comment": "generated by canon-docs, do not edit",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://beyond10x.github.io/canon/schemas/evidence-1.schema.json",
  "title": "canon-evidence/1",
  "description": "One `canon-evidence/1` record as written. `subject` and `subject_revision` bind it: the evaluator refuses a record whose subject the protocol does not declare, and applies a record only while its subject revision is the case's current revision of that subject.",
  "$ref": "#/$defs/EvidenceRecord",
  "$defs": {
    "Identifier": {
      "description": "A well-formed identifier is not empty, and without whitespace, control characters or Unicode format characters (general category Cf). The pattern checks only for whitespace; Canon also refuses control and Unicode format characters.",
      "type": "string",
      "minLength": 1,
      "pattern": "^\\S+$"
    },
    "Instant": {
      "description": "An instant written `YYYY-MM-DDTHH:MM:SSZ` in UTC, or with a fraction of one to nine digits after the seconds, `YYYY-MM-DDTHH:MM:SS.fffZ`; uppercase `T` and `Z`, no leap second (`2026-10-04T12:00:00Z`, `2026-10-04T12:00:00.400Z`): when evidence was observed, and the evaluation instant. Order forms compare every instant of one evaluation at one resolution, the coarsest precision written among its records, dropping finer digits (`12:00:00.4Z` beside `12:00:00Z` reads as `12:00:00Z`); expiry reads the whole seconds and ignores the fraction. Calendar validity is checked by Canon, not by the pattern: the date must exist (leap years included) and the time be at most 23:59:59.",
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,9})?Z$"
    },
    "EvidenceRecord": {
      "description": "One `canon-evidence/1` record as written. `subject` and `subject_revision` bind it: the evaluator refuses a record whose subject the protocol does not declare, and applies a record only while its subject revision is the case's current revision of that subject.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "format": {
          "description": "The document format; the evaluator accepts only `canon-evidence/1`.",
          "type": "string",
          "const": "canon-evidence/1"
        },
        "id": {
          "$ref": "#/$defs/Identifier"
        },
        "kind": {
          "description": "The evidence kind, which the protocol declares.",
          "$ref": "#/$defs/Identifier"
        },
        "result": {
          "description": "What the observation found; a record without one matches only an evidence match that names no result.",
          "type": "string"
        },
        "subject": {
          "description": "The artifact the record is about.",
          "$ref": "#/$defs/Identifier"
        },
        "subject_revision": {
          "description": "The revision of that artifact the record is about.",
          "$ref": "#/$defs/Identifier"
        },
        "observed_at": {
          "description": "When the observation was made; its age at the evaluation instant is measured from here. A record without it never expires.",
          "$ref": "#/$defs/Instant"
        },
        "upstream_revisions": {
          "description": "The revision of each upstream artifact the observation was made against, keyed by artifact. A record without it is never invalidated.",
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/Identifier"
          },
          "additionalProperties": {
            "$ref": "#/$defs/Identifier"
          }
        },
        "producer": {
          "description": "Who produced the record, recorded as given: Canon does not prove it. A record without one is of no evidence match that demands independence.",
          "$ref": "#/$defs/Identifier"
        },
        "child_case": {
          "description": "The child case a `case_outcome` record is about (story:case-composition): one record per child case, its `result` the child's outcome, `open` while the child runs. Written only on a `case_outcome` record, which must name its child and give an outcome.",
          "$ref": "#/$defs/Identifier"
        }
      },
      "required": [
        "format",
        "id",
        "kind",
        "subject",
        "subject_revision"
      ]
    }
  }
}
