{
  "$comment": "generated by canon-docs, do not edit",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://beyond10x.github.io/canon/schemas/case-1.schema.json",
  "title": "canon-case/1",
  "description": "A `canon-case/1` case snapshot as written.",
  "$ref": "#/$defs/Case",
  "$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+$"
    },
    "ScalarIdentifier": {
      "description": "An identifier, or a boolean or a number written unquoted, which Canon reads as its text (`true`, `2`).",
      "anyOf": [
        {
          "$ref": "#/$defs/Identifier"
        },
        {
          "type": "boolean"
        },
        {
          "type": "number"
        }
      ]
    },
    "Case": {
      "description": "A `canon-case/1` case snapshot as written.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "format": {
          "description": "The document format; the evaluator accepts only `canon-case/1`.",
          "type": "string",
          "const": "canon-case/1"
        },
        "id": {
          "$ref": "#/$defs/Identifier"
        },
        "protocol": {
          "description": "The protocol that governs the case.",
          "$ref": "#/$defs/Identifier"
        },
        "artifacts": {
          "description": "The current revision of each declared artifact, keyed by artifact id.",
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/Identifier"
          },
          "additionalProperties": {
            "$ref": "#/$defs/CaseArtifact"
          }
        },
        "termination": {
          "description": "The outcome the case terminated through; absent while the case is open. Whether the protocol declares it is checked by the outcomes section (story:outcomes).",
          "$ref": "#/$defs/Identifier"
        },
        "revision": {
          "description": "The case's own current revision. An explicit decision applies only while its `case_revision` is this one; a snapshot without one has no explicit decision applying.",
          "$ref": "#/$defs/Identifier"
        },
        "inputs": {
          "description": "The value of each case input, keyed by input id, fixed when the case opens. Left out by a case of a protocol that declares no input.",
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/Identifier"
          },
          "additionalProperties": {
            "$ref": "#/$defs/ScalarIdentifier"
          }
        },
        "independence": {
          "description": "The dimensions on which each producer is independent of the case's work, keyed by producer, as the trusted context that writes the case resolved them. A producer absent from it, or listed with `[]`, is independent on no dimension.",
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/Identifier"
          },
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/Identifier"
            }
          }
        }
      },
      "required": [
        "format",
        "id",
        "protocol",
        "artifacts"
      ]
    },
    "CaseArtifact": {
      "description": "One declared artifact as the case snapshot records it.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "revision": {
          "description": "The artifact's current revision.",
          "$ref": "#/$defs/Identifier"
        }
      },
      "required": [
        "revision"
      ]
    }
  }
}
