{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://opencheckpoint.org/schema/v0.1/checkpoint.schema.json",
  "title": "OpenCheckpoint checkpoint document, version 0.1",
  "description": "A portable record of the working state of an unfinished AI-assisted task, captured at a well-defined boundary so that another agent, runtime, or model can continue it. The normative specification is spec/versions/v0.1.md; where this schema and the specification disagree, the specification governs and the disagreement is a bug.",
  "type": "object",
  "required": ["opencheckpoint", "id", "created_at", "source", "task"],
  "properties": {
    "opencheckpoint": {
      "description": "Specification version this document conforms to, as MAJOR.MINOR.",
      "const": "0.1"
    },
    "id": {
      "description": "Globally unique identifier of this checkpoint. SHOULD be a urn:uuid URN.",
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "created_at": {
      "description": "When the checkpoint was captured.",
      "$ref": "#/$defs/timestamp"
    },
    "parent": { "$ref": "#/$defs/parent" },
    "source": { "$ref": "#/$defs/source" },
    "task": { "$ref": "#/$defs/task" },
    "progress": { "$ref": "#/$defs/progress" },
    "statements": {
      "description": "Instructions, constraints, decisions, observations, hypotheses, questions, and quoted external content, each with its own provenance.",
      "type": "array",
      "items": { "$ref": "#/$defs/statement" }
    },
    "resources": {
      "description": "References to files, records, documents, artifacts, and other objects the task involves.",
      "type": "array",
      "items": { "$ref": "#/$defs/resource" }
    },
    "application_context": {
      "description": "Application state relevant to the task that did not necessarily originate in conversation.",
      "type": "array",
      "items": { "$ref": "#/$defs/applicationContext" }
    },
    "operations": {
      "description": "Approvals, requested input, external actions, and waits that are not finished.",
      "type": "array",
      "items": { "$ref": "#/$defs/operation" }
    },
    "continuation": { "$ref": "#/$defs/continuation" },
    "derivation": { "$ref": "#/$defs/derivation" },
    "extensions": { "$ref": "#/$defs/extensions" }
  },
  "additionalProperties": false,

  "$defs": {
    "timestamp": {
      "description": "RFC 3339 date-time with an explicit UTC offset.",
      "type": "string",
      "format": "date-time",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"
    },
    "localId": {
      "description": "Identifier of an object within this document. Unique across all objects in the document.",
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
    },
    "localRefs": {
      "description": "References to objects in this document by local identifier.",
      "type": "array",
      "items": { "$ref": "#/$defs/localId" },
      "uniqueItems": true
    },
    "text": {
      "type": "string",
      "minLength": 1
    },
    "extensions": {
      "description": "Extension data keyed by a namespaced identifier (reverse-DNS name, optionally followed by a path). Consumers ignore keys they do not understand and preserve them when re-serializing.",
      "type": "object",
      "propertyNames": {
        "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+(/[A-Za-z0-9._-]+)*$"
      }
    },
    "digest": {
      "type": "object",
      "required": ["algorithm", "value"],
      "properties": {
        "algorithm": {
          "description": "Hash algorithm name from the IANA Named Information registry, e.g. sha-256.",
          "type": "string",
          "pattern": "^[a-z0-9-]+$"
        },
        "value": {
          "description": "Lowercase hexadecimal digest.",
          "type": "string",
          "pattern": "^[0-9a-f]+$"
        }
      },
      "additionalProperties": false
    },
    "parent": {
      "description": "The checkpoint this one was derived from.",
      "type": "object",
      "required": ["id"],
      "properties": {
        "id": { "type": "string", "minLength": 1, "maxLength": 256 },
        "digest": {
          "description": "Digest of the parent document's bytes, for tamper evidence.",
          "$ref": "#/$defs/digest"
        }
      },
      "additionalProperties": false
    },
    "softwareRef": {
      "type": "object",
      "required": ["name"],
      "properties": {
        "name": { "$ref": "#/$defs/text" },
        "version": { "type": "string" },
        "uri": { "type": "string", "format": "uri" }
      },
      "additionalProperties": false
    },
    "sessionRef": {
      "description": "A pointer into a session, conversation, or task record kept by another protocol or system.",
      "type": "object",
      "required": ["protocol", "id"],
      "properties": {
        "protocol": {
          "description": "The protocol or system that defines the identifier, e.g. a2a, acp, mcp, open-responses, or a namespaced name.",
          "type": "string",
          "minLength": 1
        },
        "id": {
          "description": "Session, context, task, or conversation identifier.",
          "type": "string",
          "minLength": 1
        },
        "event": {
          "description": "Identifier of the last event or entry the checkpoint reflects.",
          "type": "string"
        },
        "uri": { "type": "string", "format": "uri" }
      },
      "additionalProperties": false
    },
    "source": {
      "description": "The system that produced the checkpoint. Informational; it confers no trust.",
      "type": "object",
      "required": ["producer"],
      "properties": {
        "producer": { "$ref": "#/$defs/softwareRef" },
        "agent": { "$ref": "#/$defs/softwareRef" },
        "model": {
          "type": "object",
          "required": ["name"],
          "properties": {
            "provider": { "type": "string" },
            "name": { "type": "string", "minLength": 1 }
          },
          "additionalProperties": false
        },
        "session_refs": {
          "type": "array",
          "items": { "$ref": "#/$defs/sessionRef" }
        },
        "extensions": { "$ref": "#/$defs/extensions" }
      },
      "additionalProperties": false
    },
    "task": {
      "type": "object",
      "required": ["objective", "status"],
      "properties": {
        "title": { "type": "string" },
        "objective": {
          "description": "What the user or system is trying to accomplish.",
          "$ref": "#/$defs/text"
        },
        "outcome": {
          "description": "What a finished result looks like.",
          "type": "string"
        },
        "status": {
          "description": "Task status at capture time.",
          "enum": ["active", "blocked", "awaiting_input", "paused", "completed", "abandoned"]
        },
        "success_criteria": {
          "type": "array",
          "items": { "$ref": "#/$defs/criterion" }
        },
        "scope": {
          "type": "object",
          "properties": {
            "includes": { "type": "array", "items": { "$ref": "#/$defs/text" } },
            "excludes": { "type": "array", "items": { "$ref": "#/$defs/text" } }
          },
          "additionalProperties": false
        },
        "extensions": { "$ref": "#/$defs/extensions" }
      },
      "additionalProperties": false
    },
    "criterion": {
      "type": "object",
      "required": ["id", "description", "state"],
      "properties": {
        "id": { "$ref": "#/$defs/localId" },
        "description": { "$ref": "#/$defs/text" },
        "state": { "enum": ["met", "unmet", "unknown"] },
        "evidence": { "$ref": "#/$defs/localRefs" }
      },
      "additionalProperties": false
    },
    "progress": {
      "type": "object",
      "properties": {
        "completed": {
          "description": "Work already done, oldest first.",
          "type": "array",
          "items": { "$ref": "#/$defs/completedStep" }
        },
        "focus": {
          "description": "What was being worked on when the checkpoint was captured.",
          "type": "object",
          "required": ["description"],
          "properties": {
            "description": { "$ref": "#/$defs/text" },
            "refs": { "$ref": "#/$defs/localRefs" }
          },
          "additionalProperties": false
        },
        "next": {
          "description": "Recommended next steps, in suggested order.",
          "type": "array",
          "items": { "$ref": "#/$defs/nextStep" }
        },
        "extensions": { "$ref": "#/$defs/extensions" }
      },
      "additionalProperties": false
    },
    "completedStep": {
      "type": "object",
      "required": ["id", "description"],
      "properties": {
        "id": { "$ref": "#/$defs/localId" },
        "description": { "$ref": "#/$defs/text" },
        "completed_at": { "$ref": "#/$defs/timestamp" },
        "evidence": { "$ref": "#/$defs/localRefs" }
      },
      "additionalProperties": false
    },
    "nextStep": {
      "type": "object",
      "required": ["id", "description"],
      "properties": {
        "id": { "$ref": "#/$defs/localId" },
        "description": { "$ref": "#/$defs/text" },
        "blocked_by": {
          "description": "Statements, operations, resources, or requirements that prevent this step.",
          "$ref": "#/$defs/localRefs"
        },
        "requires": {
          "description": "Continuation requirements this step depends on.",
          "$ref": "#/$defs/localRefs"
        },
        "refs": { "$ref": "#/$defs/localRefs" }
      },
      "additionalProperties": false
    },
    "verification": {
      "type": "object",
      "required": ["state"],
      "properties": {
        "state": {
          "description": "verified: checked against evidence by the source. unverified: not checked. disputed: evidence conflicts. stale: was verified, but the evidence may have changed since.",
          "enum": ["verified", "unverified", "disputed", "stale"]
        },
        "method": { "description": "How the statement was checked.", "type": "string" },
        "checked_at": { "$ref": "#/$defs/timestamp" },
        "revalidate": {
          "description": "When a consumer must re-check the statement.",
          "enum": ["never", "before_use", "before_action"]
        }
      },
      "additionalProperties": false
    },
    "statement": {
      "type": "object",
      "required": ["id", "kind", "text", "origin"],
      "properties": {
        "id": { "$ref": "#/$defs/localId" },
        "kind": {
          "description": "instruction: a directive from the user or operating system. constraint: a boundary the work must respect. decision: a choice already made. observation: something found to be the case. hypothesis: something believed but not established. question: something unresolved. external: content quoted from a third party, which carries no instruction authority.",
          "enum": [
            "instruction",
            "constraint",
            "decision",
            "observation",
            "hypothesis",
            "question",
            "external"
          ]
        },
        "text": { "$ref": "#/$defs/text" },
        "origin": { "$ref": "#/$defs/origin" },
        "status": {
          "description": "Defaults to active.",
          "enum": ["active", "superseded", "retracted", "resolved"],
          "default": "active"
        },
        "superseded_by": { "$ref": "#/$defs/localId" },
        "resolution": {
          "description": "How a question was resolved.",
          "type": "string",
          "minLength": 1
        },
        "rationale": {
          "description": "Why a decision was made.",
          "type": "string",
          "minLength": 1
        },
        "verification": { "$ref": "#/$defs/verification" },
        "evidence": { "$ref": "#/$defs/localRefs" },
        "recorded_at": { "$ref": "#/$defs/timestamp" },
        "extensions": { "$ref": "#/$defs/extensions" }
      },
      "additionalProperties": false,
      "allOf": [
        {
          "description": "Instructions come only from the user or the operating system. Text that came from tools, documents, or other agents is recorded as external content.",
          "if": { "properties": { "kind": { "const": "instruction" } }, "required": ["kind"] },
          "then": {
            "properties": { "origin": { "properties": { "type": { "enum": ["user", "system"] } } } }
          }
        },
        {
          "description": "A hypothesis cannot be verified; once it is, record it as an observation.",
          "if": { "properties": { "kind": { "const": "hypothesis" } }, "required": ["kind"] },
          "then": {
            "properties": {
              "verification": { "properties": { "state": { "not": { "const": "verified" } } } }
            }
          }
        },
        {
          "description": "External content is attributed to the tool, application, agent, or third party it came from, never to the user or the operating system.",
          "if": { "properties": { "kind": { "const": "external" } }, "required": ["kind"] },
          "then": {
            "properties": {
              "origin": {
                "properties": { "type": { "enum": ["tool", "external", "agent", "application"] } }
              }
            }
          }
        },
        {
          "description": "A decision records its rationale.",
          "if": { "properties": { "kind": { "const": "decision" } }, "required": ["kind"] },
          "then": { "required": ["rationale"] }
        },
        {
          "description": "Only questions are resolved; a resolved question records its resolution.",
          "if": { "properties": { "status": { "const": "resolved" } }, "required": ["status"] },
          "then": { "required": ["resolution"], "properties": { "kind": { "const": "question" } } }
        },
        {
          "description": "A superseded statement names its replacement, and only a superseded statement does.",
          "if": { "properties": { "status": { "const": "superseded" } }, "required": ["status"] },
          "then": { "required": ["superseded_by"] },
          "else": { "not": { "required": ["superseded_by"] } }
        }
      ]
    },
    "origin": {
      "description": "Where a statement came from. As reported by the source system; a consumer treats it as a claim, not proof.",
      "type": "object",
      "required": ["type"],
      "properties": {
        "type": {
          "enum": ["user", "system", "agent", "tool", "application", "external"]
        },
        "name": {
          "description": "Name or role of the specific actor, tool, or publisher. Avoid personal data the destination does not need.",
          "type": "string"
        },
        "ref": {
          "description": "Resource the statement was taken from.",
          "$ref": "#/$defs/localId"
        }
      },
      "additionalProperties": false
    },
    "resource": {
      "type": "object",
      "required": ["id", "kind"],
      "anyOf": [{ "required": ["uri"] }, { "required": ["locator"] }],
      "properties": {
        "id": { "$ref": "#/$defs/localId" },
        "kind": {
          "enum": [
            "file",
            "repository",
            "document",
            "record",
            "web",
            "artifact",
            "tool_output",
            "dataset",
            "message",
            "other"
          ]
        },
        "uri": {
          "description": "Identifier of the resource in any URI scheme. Need not be publicly resolvable.",
          "type": "string",
          "format": "uri"
        },
        "locator": {
          "description": "Identifies a resource that has no URI: an object type and key within a named system.",
          "type": "object",
          "required": ["system", "key"],
          "properties": {
            "system": { "$ref": "#/$defs/text" },
            "type": { "type": "string" },
            "key": { "$ref": "#/$defs/text" }
          },
          "additionalProperties": false
        },
        "title": { "type": "string" },
        "description": { "type": "string" },
        "media_type": {
          "type": "string",
          "pattern": "^[A-Za-z0-9!#$&^_.+-]+/[A-Za-z0-9!#$&^_.+-]+(\\s*;.*)?$"
        },
        "revision": {
          "description": "Version, commit, ETag, or other revision marker as observed by the source.",
          "type": "string",
          "minLength": 1
        },
        "digest": { "$ref": "#/$defs/digest" },
        "size": { "type": "integer", "minimum": 0 },
        "observed_at": { "$ref": "#/$defs/timestamp" },
        "availability": {
          "description": "Whether the source could access the resource when it last tried.",
          "enum": ["available", "restricted", "unavailable", "unknown"]
        },
        "sensitivity": {
          "enum": ["public", "internal", "confidential", "restricted"]
        },
        "resolver": {
          "description": "Hint for how to retrieve the resource. Never contains credentials.",
          "type": "object",
          "required": ["protocol"],
          "properties": {
            "protocol": { "type": "string", "minLength": 1 },
            "hint": { "type": "object" }
          },
          "additionalProperties": false
        },
        "excerpt": {
          "description": "A short inline excerpt. Large content is referenced, not embedded.",
          "type": "string",
          "maxLength": 4096
        },
        "extensions": { "$ref": "#/$defs/extensions" }
      },
      "additionalProperties": false
    },
    "applicationContext": {
      "type": "object",
      "required": ["id", "application"],
      "properties": {
        "id": { "$ref": "#/$defs/localId" },
        "application": { "$ref": "#/$defs/softwareRef" },
        "view": {
          "type": "object",
          "required": ["name"],
          "properties": {
            "name": { "$ref": "#/$defs/text" },
            "uri": { "type": "string", "format": "uri" }
          },
          "additionalProperties": false
        },
        "selections": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["resource"],
            "properties": {
              "resource": { "$ref": "#/$defs/localId" },
              "role": { "enum": ["focused", "selected", "open", "pinned"] },
              "detail": {
                "description": "Application-defined detail, e.g. a cell range or line span.",
                "type": "object"
              }
            },
            "additionalProperties": false
          }
        },
        "filters": {
          "description": "Application-defined filters, keyed by name.",
          "type": "object"
        },
        "drafts": {
          "type": "array",
          "items": { "$ref": "#/$defs/draft" }
        },
        "state": {
          "description": "Further application-defined state. Interpret with the schema named by state_schema.",
          "type": "object"
        },
        "state_schema": {
          "description": "URI identifying the schema of state.",
          "type": "string",
          "format": "uri"
        },
        "observed_at": { "$ref": "#/$defs/timestamp" },
        "extensions": { "$ref": "#/$defs/extensions" }
      },
      "additionalProperties": false
    },
    "draft": {
      "description": "An unsaved or unsubmitted change in an application.",
      "type": "object",
      "required": ["id", "description", "state"],
      "properties": {
        "id": { "$ref": "#/$defs/localId" },
        "description": { "$ref": "#/$defs/text" },
        "target": { "description": "Resource the draft would change.", "$ref": "#/$defs/localId" },
        "state": { "enum": ["unsaved", "saved", "submitted"] },
        "content": {
          "description": "Small inline draft content.",
          "type": "string",
          "maxLength": 16384
        },
        "content_ref": {
          "description": "Resource holding the draft content.",
          "$ref": "#/$defs/localId"
        }
      },
      "additionalProperties": false
    },
    "operation": {
      "type": "object",
      "required": ["id", "kind", "description", "status"],
      "properties": {
        "id": { "$ref": "#/$defs/localId" },
        "kind": {
          "description": "approval: needs a person's approval. input: needs information from a person. action: a side-effecting call to an external system. wait: depends on an external event or system.",
          "enum": ["approval", "input", "action", "wait"]
        },
        "description": { "$ref": "#/$defs/text" },
        "status": {
          "description": "planned: not started. awaiting: requested and waiting. uncertain: started, outcome unknown. failed: attempted and failed. approved/rejected: an approval's recorded outcome. completed: finished. cancelled: will not happen.",
          "enum": [
            "planned",
            "awaiting",
            "uncertain",
            "failed",
            "approved",
            "rejected",
            "completed",
            "cancelled"
          ]
        },
        "target": { "description": "Resource the operation acts on.", "$ref": "#/$defs/localId" },
        "record": {
          "description": "Resource in a system of record where the operation's current status can be checked, such as an approval request or a payment record.",
          "$ref": "#/$defs/localId"
        },
        "effect": {
          "description": "What repeating the operation does. none: no side effect. idempotent: repeating has no further effect. non_idempotent: repeating may duplicate the effect. unknown: assume non_idempotent.",
          "enum": ["none", "idempotent", "non_idempotent", "unknown"]
        },
        "idempotency_key": { "type": "string", "minLength": 1 },
        "call": {
          "description": "The invocation an action stands for. A call to the same tool whose arguments include every recorded argument with an equal value repeats the operation. Describes; never instructs. Must not contain credentials.",
          "type": "object",
          "required": ["tool"],
          "properties": {
            "tool": {
              "description": "The tool or API operation as the interface declares it; for MCP, the server's tool name without a client prefix.",
              "type": "string",
              "minLength": 1
            },
            "arguments": {
              "description": "Arguments the call was or will be made with. Leave out sensitive arguments not needed to identify the call.",
              "type": "object"
            }
          },
          "additionalProperties": false
        },
        "requested_from": {
          "description": "Role or party whose approval or input is needed.",
          "type": "string",
          "minLength": 1
        },
        "requested_at": { "$ref": "#/$defs/timestamp" },
        "last_attempt_at": { "$ref": "#/$defs/timestamp" },
        "expires_at": { "$ref": "#/$defs/timestamp" },
        "depends_on": { "$ref": "#/$defs/localRefs" },
        "approval": {
          "description": "The recorded outcome of an approval. A record, not an authorization.",
          "type": "object",
          "required": ["decided_by", "decided_at", "evidence"],
          "properties": {
            "decided_by": { "$ref": "#/$defs/text" },
            "decided_at": { "$ref": "#/$defs/timestamp" },
            "scope": {
              "description": "What was approved, in the approver's terms.",
              "type": "string"
            },
            "evidence": {
              "description": "Resources in a system of record where the approval can be verified.",
              "type": "array",
              "items": { "$ref": "#/$defs/localId" },
              "minItems": 1,
              "uniqueItems": true
            }
          },
          "additionalProperties": false
        },
        "resume": {
          "description": "What the source recommends on continuation. retry: repeat it. verify_first: check the target system for its outcome before anything else. ask: ask a person. do_not_resume: leave it.",
          "enum": ["retry", "verify_first", "ask", "do_not_resume"]
        },
        "extensions": { "$ref": "#/$defs/extensions" }
      },
      "additionalProperties": false,
      "allOf": [
        {
          "description": "Only an action stands for a call.",
          "if": { "required": ["call"] },
          "then": { "properties": { "kind": { "const": "action" } } }
        },
        {
          "description": "An operation whose outcome is unknown and that may duplicate an effect must not be blindly retried.",
          "if": {
            "properties": {
              "status": { "const": "uncertain" },
              "effect": { "enum": ["non_idempotent", "unknown"] }
            },
            "required": ["status", "effect"]
          },
          "then": {
            "required": ["resume"],
            "properties": { "resume": { "enum": ["verify_first", "ask", "do_not_resume"] } }
          }
        },
        {
          "description": "An uncertain operation with no declared effect is treated as unknown.",
          "if": {
            "properties": { "status": { "const": "uncertain" } },
            "required": ["status"],
            "not": { "required": ["effect"] }
          },
          "then": {
            "required": ["resume"],
            "properties": { "resume": { "enum": ["verify_first", "ask", "do_not_resume"] } }
          }
        },
        {
          "description": "Only approvals are approved or rejected, and a decided approval carries its record.",
          "if": {
            "properties": { "status": { "enum": ["approved", "rejected"] } },
            "required": ["status"]
          },
          "then": { "required": ["approval"], "properties": { "kind": { "const": "approval" } } }
        },
        {
          "description": "An approval record belongs only to a decided approval.",
          "if": { "required": ["approval"] },
          "then": { "properties": { "status": { "enum": ["approved", "rejected"] } } }
        }
      ]
    },
    "requirement": {
      "type": "object",
      "required": ["id", "kind", "name", "necessity"],
      "properties": {
        "id": { "$ref": "#/$defs/localId" },
        "kind": {
          "description": "tool: a callable tool. capability: a general ability, e.g. code execution. access: access to a resource, which the destination must already hold. extension: a checkpoint extension the consumer must understand to interpret the document fully.",
          "enum": ["tool", "capability", "access", "extension"]
        },
        "name": {
          "description": "For tool, the tool's name as known to the source. For extension, the extension key. Otherwise a short name.",
          "$ref": "#/$defs/text"
        },
        "description": { "type": "string" },
        "necessity": {
          "description": "required: continuation must not proceed without it. recommended: continuation can proceed degraded. optional: convenience.",
          "enum": ["required", "recommended", "optional"]
        },
        "fallback": {
          "description": "How to continue without it.",
          "type": "string"
        },
        "refs": { "$ref": "#/$defs/localRefs" }
      },
      "additionalProperties": false
    },
    "continuation": {
      "type": "object",
      "properties": {
        "requirements": { "type": "array", "items": { "$ref": "#/$defs/requirement" } },
        "preconditions": {
          "description": "Conditions to check before resuming.",
          "type": "array",
          "items": {
            "type": "object",
            "required": ["id", "description", "on_failure"],
            "properties": {
              "id": { "$ref": "#/$defs/localId" },
              "description": { "$ref": "#/$defs/text" },
              "refs": { "$ref": "#/$defs/localRefs" },
              "on_failure": { "enum": ["halt", "ask", "degrade"] }
            },
            "additionalProperties": false
          }
        },
        "stop_conditions": {
          "description": "Conditions under which continuation must not proceed.",
          "type": "array",
          "items": {
            "type": "object",
            "required": ["id", "description"],
            "properties": {
              "id": { "$ref": "#/$defs/localId" },
              "description": { "$ref": "#/$defs/text" },
              "refs": { "$ref": "#/$defs/localRefs" },
              "applies_to": {
                "description": "Operations this stop condition forbids.",
                "$ref": "#/$defs/localRefs"
              },
              "until": {
                "description": "What lifts this stop condition: it applies until every listed operation reaches its status in the system of record. Without it, the stop condition applies for the whole continuation.",
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "object",
                  "required": ["operation", "status"],
                  "properties": {
                    "operation": { "$ref": "#/$defs/localId" },
                    "status": {
                      "enum": ["approved", "rejected", "completed", "cancelled", "failed"]
                    }
                  },
                  "additionalProperties": false
                }
              }
            },
            "additionalProperties": false
          }
        },
        "recovery": {
          "description": "Recommended first actions on resuming, in order.",
          "type": "array",
          "items": {
            "type": "object",
            "required": ["id", "description"],
            "properties": {
              "id": { "$ref": "#/$defs/localId" },
              "description": { "$ref": "#/$defs/text" },
              "refs": { "$ref": "#/$defs/localRefs" }
            },
            "additionalProperties": false
          }
        },
        "incompatibilities": {
          "description": "Known environments or conditions in which this checkpoint cannot be continued faithfully.",
          "type": "array",
          "items": { "$ref": "#/$defs/text" }
        },
        "extensions": { "$ref": "#/$defs/extensions" }
      },
      "additionalProperties": false
    },
    "derivation": {
      "description": "How this checkpoint was produced, and what was left out.",
      "type": "object",
      "required": ["method"],
      "properties": {
        "method": {
          "description": "captured: written from a live session. compacted: reduced from earlier checkpoints or session history. merged: combined from several inputs. converted: translated from another format. authored: written by hand. forked: copied from the parent to be continued alongside possible sibling copies.",
          "enum": ["captured", "compacted", "merged", "converted", "authored", "forked"]
        },
        "inputs": {
          "description": "Checkpoints or sessions this one was derived from.",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "checkpoint": { "type": "string", "minLength": 1 },
              "session": { "$ref": "#/$defs/sessionRef" }
            },
            "minProperties": 1,
            "maxProperties": 1,
            "additionalProperties": false
          }
        },
        "omissions": {
          "description": "Information deliberately left out.",
          "type": "array",
          "items": {
            "type": "object",
            "required": ["description", "reason"],
            "properties": {
              "description": { "$ref": "#/$defs/text" },
              "reason": {
                "enum": ["size", "irrelevant", "superseded", "sensitive", "unavailable"]
              },
              "recoverable_from": {
                "description": "Resource or session from which the omitted information can be recovered.",
                "$ref": "#/$defs/localId"
              }
            },
            "additionalProperties": false
          }
        },
        "transformations": {
          "description": "Content that was condensed or rewritten, and which objects carry the result.",
          "type": "array",
          "items": {
            "type": "object",
            "required": ["description"],
            "properties": {
              "description": { "$ref": "#/$defs/text" },
              "affected": { "$ref": "#/$defs/localRefs" }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    }
  }
}
