{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://nwilbert.github.io/pytest-given/latest/schemas/delta-v1.schema.json",
  "$defs": {
    "Attachment": {
      "additionalProperties": false,
      "properties": {
        "label": {
          "type": "string"
        },
        "content": {
          "type": "string"
        },
        "content_type": {
          "$ref": "#/$defs/ContentType",
          "default": "text"
        }
      },
      "required": [
        "label",
        "content",
        "content_type"
      ],
      "type": "object"
    },
    "AttachmentChange": {
      "enum": [
        "equal",
        "modified",
        "added",
        "removed"
      ],
      "type": "string"
    },
    "AttachmentDelta": {
      "additionalProperties": false,
      "properties": {
        "change": {
          "$ref": "#/$defs/AttachmentChange"
        },
        "before": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Its index among its step's attachments."
        },
        "after": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Its index among its step's attachments."
        },
        "lines": {
          "default": [],
          "description": "The line diff of a changed pair of payloads.",
          "items": {
            "$ref": "#/$defs/LineDelta"
          },
          "type": "array"
        }
      },
      "required": [
        "change",
        "before",
        "after",
        "lines"
      ],
      "type": "object"
    },
    "AttachmentRef": {
      "additionalProperties": false,
      "properties": {
        "label": {
          "type": "string"
        },
        "content_type": {
          "$ref": "#/$defs/ContentType"
        },
        "column_id": {
          "description": "The parameter column whose cells hold the content, which varies by case.",
          "type": "string"
        }
      },
      "required": [
        "label",
        "content_type",
        "column_id"
      ],
      "type": "object"
    },
    "CaseIdentity": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "description": "The case's ID, as the runner shows it.",
          "type": "string"
        },
        "node_id": {
          "description": "The runner's own ID of the case, which names it by its case ID, or one the recorder builds from the scenario ID and the case ID.",
          "type": "string"
        }
      },
      "required": [
        "id",
        "node_id"
      ],
      "type": "object"
    },
    "CasePair": {
      "additionalProperties": false,
      "properties": {
        "before": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "after": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "paired_by": {
          "anyOf": [
            {
              "$ref": "#/$defs/CasePairing"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "changed_cells": {
          "default": [],
          "description": "The after side's IDs of the paired columns whose cells changed.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "changed_attachments": {
          "default": [],
          "items": {
            "$ref": "#/$defs/CellDelta"
          },
          "type": "array"
        },
        "id_changed": {
          "default": false,
          "type": "boolean"
        },
        "status_changed": {
          "default": false,
          "description": "Whether the case's status or its reason differs.",
          "type": "boolean"
        }
      },
      "required": [
        "before",
        "after",
        "paired_by",
        "changed_cells",
        "changed_attachments",
        "id_changed",
        "status_changed"
      ],
      "type": "object"
    },
    "CasePairing": {
      "enum": [
        "rename-log",
        "case-id",
        "values"
      ],
      "type": "string"
    },
    "CellDelta": {
      "additionalProperties": false,
      "properties": {
        "column": {
          "description": "The after side's column ID.",
          "type": "string"
        },
        "lines": {
          "items": {
            "$ref": "#/$defs/LineDelta"
          },
          "type": "array"
        }
      },
      "required": [
        "column",
        "lines"
      ],
      "type": "object"
    },
    "CellValue": {
      "anyOf": [
        {
          "$ref": "#/$defs/ParamValue"
        },
        {
          "$ref": "#/$defs/Attachment"
        }
      ]
    },
    "Change": {
      "enum": [
        "added",
        "removed",
        "changed"
      ],
      "type": "string"
    },
    "ChangedPart": {
      "enum": [
        "title",
        "steps",
        "tags",
        "status",
        "parameters",
        "attachments"
      ],
      "type": "string"
    },
    "ColumnKind": {
      "enum": [
        "param",
        "derived",
        "attachment"
      ],
      "type": "string"
    },
    "ColumnPair": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "$ref": "#/$defs/ColumnKind"
        },
        "before": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "after": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "paired_by": {
          "anyOf": [
            {
              "$ref": "#/$defs/ColumnPairing"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "required": [
        "kind",
        "before",
        "after",
        "paired_by"
      ],
      "type": "object"
    },
    "ColumnPairing": {
      "enum": [
        "name",
        "values"
      ],
      "type": "string"
    },
    "ContentType": {
      "enum": [
        "text",
        "json"
      ],
      "type": "string"
    },
    "Definition": {
      "additionalProperties": false,
      "properties": {
        "text": {
          "type": "string"
        },
        "parts": {
          "items": {
            "$ref": "#/$defs/DefinitionPart"
          },
          "type": "array"
        }
      },
      "required": [
        "text",
        "parts"
      ],
      "type": "object"
    },
    "DefinitionPart": {
      "anyOf": [
        {
          "$ref": "#/$defs/NarrationLiteral"
        },
        {
          "$ref": "#/$defs/NarrationTermRef"
        }
      ]
    },
    "DeltaMetadata": {
      "additionalProperties": false,
      "properties": {
        "timestamp": {
          "format": "date-time",
          "type": "string"
        },
        "tools": {
          "description": "The pytest-given that built the delta, as its builder.",
          "items": {
            "$ref": "#/$defs/Tool"
          },
          "type": "array"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "before": {
          "$ref": "#/$defs/DeltaSide"
        },
        "after": {
          "$ref": "#/$defs/DeltaSide"
        },
        "kind": {
          "const": "delta",
          "default": "delta",
          "type": "string"
        },
        "schema_version": {
          "$ref": "#/$defs/DeltaSchemaVersion",
          "default": 1
        }
      },
      "required": [
        "timestamp",
        "tools",
        "title",
        "before",
        "after",
        "kind",
        "schema_version"
      ],
      "type": "object"
    },
    "DeltaSchemaVersion": {
      "const": 1,
      "type": "integer"
    },
    "DeltaSide": {
      "additionalProperties": false,
      "properties": {
        "metadata": {
          "$ref": "#/$defs/Metadata"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "suites": {
          "default": [],
          "items": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "type": "array"
        },
        "report_file": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The compared report's file name, without the directories."
        }
      },
      "required": [
        "metadata",
        "label",
        "suites",
        "report_file"
      ],
      "type": "object"
    },
    "DiffSegment": {
      "additionalProperties": false,
      "properties": {
        "mark": {
          "$ref": "#/$defs/Mark"
        },
        "before": {
          "default": [],
          "items": {
            "$ref": "#/$defs/NarrationPart"
          },
          "type": "array"
        },
        "after": {
          "default": [],
          "items": {
            "$ref": "#/$defs/NarrationPart"
          },
          "type": "array"
        }
      },
      "required": [
        "mark",
        "before",
        "after"
      ],
      "type": "object"
    },
    "EntryTable": {
      "enum": [
        "scenario",
        "term"
      ],
      "type": "string"
    },
    "ErrorCause": {
      "additionalProperties": false,
      "properties": {
        "frames": {
          "items": {
            "$ref": "#/$defs/TracebackFrame"
          },
          "type": "array"
        },
        "error_tail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "What the language or runner prints below the frames: the exception's type and message, then any detail such as an assertion diff."
        },
        "connector": {
          "description": "The sentence that joins this exception to the next one of the chain, as the recorder's language words it.",
          "type": "string"
        }
      },
      "required": [
        "frames",
        "error_tail",
        "connector"
      ],
      "type": "object"
    },
    "ErrorInfo": {
      "additionalProperties": false,
      "properties": {
        "message": {
          "description": "The error's own message, without its type: the headline a reader sees first, and empty where the error has none.",
          "type": "string"
        },
        "frames": {
          "items": {
            "$ref": "#/$defs/TracebackFrame"
          },
          "type": "array"
        },
        "error_tail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "What the language or runner prints below the frames: the exception's type and message, then any detail such as an assertion diff."
        },
        "causes": {
          "items": {
            "$ref": "#/$defs/ErrorCause"
          },
          "type": "array"
        },
        "further": {
          "description": "The errors the same test recorded after this one, in order, each with an empty `further`: a soft assertion in another runner, or an exception that carries several failures. pytest records none.",
          "items": {
            "$ref": "#/$defs/ErrorInfo"
          },
          "type": "array"
        }
      },
      "required": [
        "message",
        "frames",
        "error_tail",
        "causes",
        "further"
      ],
      "type": "object"
    },
    "Glossary": {
      "additionalProperties": false,
      "properties": {
        "terms": {
          "items": {
            "$ref": "#/$defs/GlossaryTerm"
          },
          "type": "array"
        }
      },
      "required": [
        "terms"
      ],
      "type": "object"
    },
    "GlossaryDelta": {
      "additionalProperties": false,
      "properties": {
        "before": {
          "anyOf": [
            {
              "$ref": "#/$defs/Glossary"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "after": {
          "anyOf": [
            {
              "$ref": "#/$defs/Glossary"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "terms": {
          "default": [],
          "items": {
            "$ref": "#/$defs/TermDelta"
          },
          "type": "array"
        },
        "unchanged": {
          "default": [],
          "items": {
            "$ref": "#/$defs/IdentityPair"
          },
          "type": "array"
        }
      },
      "required": [
        "before",
        "after",
        "terms",
        "unchanged"
      ],
      "type": "object"
    },
    "GlossaryTerm": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "description": "Derived from the canonical name: lowercased, each run of characters other than ASCII letters and digits folded to one `-`, and trimmed of `-` at both ends, so `Markdown glossary` is `markdown-glossary`. Citations and `term_id` name the term by it, so every recorder derives it the same way.",
          "type": "string"
        },
        "kind": {
          "anyOf": [
            {
              "$ref": "#/$defs/TermKind"
            },
            {
              "type": "null"
            }
          ],
          "description": "Null when no kind was declared or inferred."
        },
        "canonical": {
          "type": "string"
        },
        "definition": {
          "anyOf": [
            {
              "$ref": "#/$defs/Definition"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "source": {
          "anyOf": [
            {
              "$ref": "#/$defs/SourceLocation"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "section": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "avoid": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "id",
        "kind",
        "canonical",
        "definition",
        "source",
        "section",
        "avoid"
      ],
      "type": "object"
    },
    "IdentityPair": {
      "additionalProperties": false,
      "properties": {
        "before": {
          "type": "string"
        },
        "after": {
          "type": "string"
        }
      },
      "required": [
        "before",
        "after"
      ],
      "type": "object"
    },
    "LineChange": {
      "enum": [
        "equal",
        "modified",
        "removed",
        "added"
      ],
      "type": "string"
    },
    "LineDelta": {
      "additionalProperties": false,
      "properties": {
        "change": {
          "$ref": "#/$defs/LineChange"
        },
        "before": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The first line's index on its side."
        },
        "after": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The first line's index on its side."
        },
        "count": {
          "default": 1,
          "description": "An equal run's length. 1 for any other change.",
          "minimum": 1,
          "type": "integer"
        },
        "words": {
          "default": [],
          "description": "A modified line's word diff.",
          "items": {
            "$ref": "#/$defs/TextSegment"
          },
          "type": "array"
        }
      },
      "required": [
        "change",
        "before",
        "after",
        "count",
        "words"
      ],
      "type": "object"
    },
    "Mark": {
      "enum": [
        "equal",
        "removed",
        "added"
      ],
      "type": "string"
    },
    "Metadata": {
      "additionalProperties": false,
      "properties": {
        "project": {
          "description": "The project's name, which the pytest recorder takes from the rootdir.",
          "type": "string"
        },
        "timestamp": {
          "format": "date-time",
          "type": "string"
        },
        "tools": {
          "description": "A language for each language the tests are written in, in the order the recorder first met them; the runtime at most once; the runner and the recorder once each; and the builder at most once. pytest-given is the recorder on a pytest run. A recorder that builds the report itself names no builder: that role is for a separate tool that built the report from what the recorder wrote, last.",
          "items": {
            "$ref": "#/$defs/Tool"
          },
          "type": "array"
        },
        "commit_sha": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The commit the run tested, which fills `{sha}` in a source-link template. Null where it is unknown."
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The report's display name. Null shows `project` instead, which stays the name `{project}` fills in a source-link template."
        },
        "report_url": {
          "anyOf": [
            {
              "format": "uri",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The public URL the HTML report is served from: where the citations it copies link, and what `pytest-given citations` reads report links against. Null leaves the copied links alone."
        },
        "kind": {
          "const": "report",
          "default": "report",
          "type": "string"
        },
        "schema_version": {
          "$ref": "#/$defs/ReportSchemaVersion",
          "default": 1
        }
      },
      "required": [
        "project",
        "timestamp",
        "tools",
        "commit_sha",
        "title",
        "report_url",
        "kind",
        "schema_version"
      ],
      "type": "object"
    },
    "Narration": {
      "additionalProperties": false,
      "properties": {
        "text": {
          "type": "string"
        },
        "parts": {
          "default": [],
          "items": {
            "$ref": "#/$defs/NarrationPart"
          },
          "type": "array"
        }
      },
      "required": [
        "text",
        "parts"
      ],
      "type": "object"
    },
    "NarrationLiteral": {
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "string"
        }
      },
      "required": [
        "value"
      ],
      "type": "object"
    },
    "NarrationPart": {
      "anyOf": [
        {
          "$ref": "#/$defs/NarrationLiteral"
        },
        {
          "$ref": "#/$defs/NarrationValue"
        },
        {
          "$ref": "#/$defs/NarrationPlaceholder"
        },
        {
          "$ref": "#/$defs/NarrationTermRef"
        }
      ]
    },
    "NarrationPlaceholder": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string"
        },
        "column_id": {
          "description": "The parameter column whose cells fill it in.",
          "type": "string"
        },
        "literal": {
          "default": false,
          "description": "The value shows exactly as it is: in monospace, with its whitespace kept.",
          "type": "boolean"
        },
        "phrases": {
          "anyOf": [
            {
              "$ref": "#/$defs/Phrases"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A Boolean worded by phrases: the token reads both, and a case shows the one its Boolean picks."
        }
      },
      "required": [
        "name",
        "column_id",
        "literal",
        "phrases"
      ],
      "type": "object"
    },
    "NarrationTermRef": {
      "additionalProperties": false,
      "properties": {
        "term_id": {
          "type": "string"
        },
        "display": {
          "type": "string"
        }
      },
      "required": [
        "term_id",
        "display"
      ],
      "type": "object"
    },
    "NarrationValue": {
      "additionalProperties": false,
      "properties": {
        "rendered": {
          "type": "string"
        }
      },
      "required": [
        "rendered"
      ],
      "type": "object"
    },
    "ParamValue": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    },
    "ParameterCase": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "description": "The case's ID, as the runner shows it, unique within its table.",
          "type": "string"
        },
        "node_id": {
          "description": "The runner's own ID of the case, which names it by its case ID, or one the recorder builds from the scenario ID and the case ID.",
          "type": "string"
        },
        "values": {
          "description": "One cell per column, in the order of the table's columns. What a cell holds depends on its column's kind. Null is no value.",
          "items": {
            "$ref": "#/$defs/CellValue"
          },
          "type": "array"
        },
        "status": {
          "$ref": "#/$defs/Status",
          "default": "passed"
        },
        "error": {
          "anyOf": [
            {
              "$ref": "#/$defs/ErrorInfo"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "custom_id": {
          "default": false,
          "description": "Whether the case's ID was written by hand, not generated by the runner from the case's values.",
          "type": "boolean"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why the case was skipped or expected to fail, as its status says. Null for any other status."
        }
      },
      "required": [
        "id",
        "node_id",
        "values",
        "status",
        "error",
        "custom_id",
        "reason"
      ],
      "type": "object"
    },
    "ParameterColumn": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "description": "What a placeholder or an attachment badge points at, unique within its table. A param column's ID is its parameter's name; the `derived:` and `attachment:` prefixes are reserved for the generated columns, numbered per kind (`derived:0`).",
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/ColumnKind"
        }
      },
      "required": [
        "id",
        "name",
        "kind"
      ],
      "type": "object"
    },
    "ParameterDelta": {
      "additionalProperties": false,
      "properties": {
        "columns": {
          "items": {
            "$ref": "#/$defs/ColumnPair"
          },
          "type": "array"
        },
        "cases": {
          "items": {
            "$ref": "#/$defs/CasePair"
          },
          "type": "array"
        }
      },
      "required": [
        "columns",
        "cases"
      ],
      "type": "object"
    },
    "ParameterTable": {
      "additionalProperties": false,
      "properties": {
        "columns": {
          "items": {
            "$ref": "#/$defs/ParameterColumn"
          },
          "type": "array"
        },
        "cases": {
          "items": {
            "$ref": "#/$defs/ParameterCase"
          },
          "type": "array"
        }
      },
      "required": [
        "columns",
        "cases"
      ],
      "type": "object"
    },
    "Phase": {
      "enum": [
        "given",
        "when",
        "then"
      ],
      "type": "string"
    },
    "Phrases": {
      "additionalProperties": false,
      "properties": {
        "true": {
          "type": "string"
        },
        "false": {
          "type": "string"
        }
      },
      "required": [
        "true",
        "false"
      ],
      "type": "object"
    },
    "Pin": {
      "additionalProperties": false,
      "properties": {
        "story_id": {
          "type": "string"
        },
        "sentence_id": {
          "type": "integer"
        }
      },
      "required": [
        "story_id",
        "sentence_id"
      ],
      "type": "object"
    },
    "ReportSchemaVersion": {
      "const": 1,
      "type": "integer"
    },
    "Scenario": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "description": "The test's identity, without any case. A grouped scenario's cases all share it.",
          "type": "string"
        },
        "narration": {
          "$ref": "#/$defs/Narration",
          "description": "The title as authored, without a per-case scenario's case ID."
        },
        "suite": {
          "description": "Where the scenario sits in its test suite, outermost first, as the recorder chose the levels: pytest writes the dotted module name's parts, a JavaScript recorder its directory, file and `describe` blocks. No segment is empty or holds \" \u203a \", which a flat display and a `#suite=` link join them with.",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "type": "array"
        },
        "case_identity": {
          "anyOf": [
            {
              "$ref": "#/$defs/CaseIdentity"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Only on a per-case scenario: the one case it narrates."
        },
        "slug": {
          "default": "",
          "description": "What `#scenario=<slug>` addresses the scenario by, unique within the report.",
          "pattern": "^[^&=+#%\\s]+$",
          "type": "string"
        },
        "tags": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "status": {
          "$ref": "#/$defs/Status",
          "default": "passed",
          "description": "How the scenario came out. `error` means the test could not reach a verdict on the behavior it checks, such as a fixture failing outside the test body. A runner maps its own outcomes onto these: a JUnit XML `<error>`, an NUnit `Error`, a Playwright `interrupted` and a failing `beforeAll` or `beforeEach` hook are `error`; a timeout is `failed`; a Jest `todo`, a Mocha `pending`, a Playwright `fixme`, a JUnit `@Disabled` and an aborted JUnit test are `skipped`; a Jest `test.failing`, a Vitest `test.fails`, a Playwright `test.fail()` or an RSpec `pending` that fails is `xfailed`. A retried test records its last attempt."
        },
        "duration_ms": {
          "default": 0,
          "minimum": 0,
          "type": "integer"
        },
        "steps": {
          "items": {
            "$ref": "#/$defs/Step"
          },
          "type": "array"
        },
        "parameters": {
          "anyOf": [
            {
              "$ref": "#/$defs/ParameterTable"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "error": {
          "anyOf": [
            {
              "$ref": "#/$defs/ErrorInfo"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Null on a grouped parametrized scenario, whose cases each hold their own."
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why it was skipped or expected to fail, as its status says. Null for any other status, and on a grouped parametrized scenario, whose cases each hold their own."
        },
        "source": {
          "anyOf": [
            {
              "$ref": "#/$defs/SourceLocation"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "story_ids": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "pins": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/Pin"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Null when nothing pins it. An empty array when pinning turned narration matching off."
        }
      },
      "required": [
        "id",
        "narration",
        "suite",
        "case_identity",
        "slug",
        "tags",
        "status",
        "duration_ms",
        "steps",
        "parameters",
        "error",
        "reason",
        "source",
        "story_ids",
        "pins"
      ],
      "type": "object"
    },
    "ScenarioDelta": {
      "additionalProperties": false,
      "properties": {
        "change": {
          "$ref": "#/$defs/Change"
        },
        "before": {
          "anyOf": [
            {
              "$ref": "#/$defs/Scenario"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "after": {
          "anyOf": [
            {
              "$ref": "#/$defs/Scenario"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "paired_by": {
          "anyOf": [
            {
              "$ref": "#/$defs/ScenarioPairing"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "changed_in": {
          "default": [],
          "items": {
            "$ref": "#/$defs/ChangedPart"
          },
          "type": "array"
        },
        "steps": {
          "default": [],
          "items": {
            "$ref": "#/$defs/StepDelta"
          },
          "type": "array"
        },
        "parameters": {
          "anyOf": [
            {
              "$ref": "#/$defs/ParameterDelta"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "required": [
        "change",
        "before",
        "after",
        "paired_by",
        "changed_in",
        "steps",
        "parameters"
      ],
      "type": "object"
    },
    "ScenarioPairing": {
      "enum": [
        "rename-log",
        "identity",
        "title"
      ],
      "type": "string"
    },
    "SourceLocation": {
      "additionalProperties": false,
      "properties": {
        "relpath": {
          "description": "The file's POSIX path, relative to the project root.",
          "type": "string"
        },
        "line": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "relpath",
        "line"
      ],
      "type": "object"
    },
    "Status": {
      "enum": [
        "passed",
        "failed",
        "error",
        "skipped",
        "xfailed"
      ],
      "type": "string"
    },
    "Step": {
      "additionalProperties": false,
      "properties": {
        "phase": {
          "$ref": "#/$defs/Phase"
        },
        "narration": {
          "$ref": "#/$defs/Narration"
        },
        "children": {
          "items": {
            "$ref": "#/$defs/Step"
          },
          "type": "array"
        },
        "attachments": {
          "items": {
            "$ref": "#/$defs/StepAttachment"
          },
          "type": "array"
        },
        "pins": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/Pin"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Null when nothing pins it. An empty array when pinning turned narration matching off."
        },
        "fixture_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "required": [
        "phase",
        "narration",
        "children",
        "attachments",
        "pins",
        "fixture_name"
      ],
      "type": "object"
    },
    "StepAttachment": {
      "anyOf": [
        {
          "$ref": "#/$defs/Attachment"
        },
        {
          "$ref": "#/$defs/AttachmentRef"
        }
      ]
    },
    "StepChange": {
      "enum": [
        "equal",
        "modified",
        "added",
        "removed"
      ],
      "type": "string"
    },
    "StepDelta": {
      "additionalProperties": false,
      "properties": {
        "change": {
          "$ref": "#/$defs/StepChange"
        },
        "before": {
          "anyOf": [
            {
              "$ref": "#/$defs/StepPath"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "after": {
          "anyOf": [
            {
              "$ref": "#/$defs/StepPath"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "words": {
          "default": [],
          "description": "A modified step's word diff.",
          "items": {
            "$ref": "#/$defs/DiffSegment"
          },
          "type": "array"
        },
        "children": {
          "default": [],
          "description": "Only on an equal or modified step.",
          "items": {
            "$ref": "#/$defs/StepDelta"
          },
          "type": "array"
        },
        "attachments": {
          "default": [],
          "description": "Only on an equal or modified step.",
          "items": {
            "$ref": "#/$defs/AttachmentDelta"
          },
          "type": "array"
        }
      },
      "required": [
        "change",
        "before",
        "after",
        "words",
        "children",
        "attachments"
      ],
      "type": "object"
    },
    "StepPath": {
      "description": "A step's position in its scenario: the child index at each depth, outermost first.",
      "items": {
        "minimum": 0,
        "type": "integer"
      },
      "minItems": 1,
      "type": "array"
    },
    "Suggestion": {
      "additionalProperties": false,
      "properties": {
        "table": {
          "$ref": "#/$defs/EntryTable",
          "description": "The rename log's table it goes in."
        },
        "old": {
          "description": "The before side's scenario ID or term ID.",
          "type": "string"
        },
        "new": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The after side's, null where only case IDs changed."
        },
        "cases": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "A scenario entry's changed case IDs, old to new. Empty for a term.",
          "type": "object"
        }
      },
      "required": [
        "table",
        "old",
        "new",
        "cases"
      ],
      "type": "object"
    },
    "TermDelta": {
      "additionalProperties": false,
      "properties": {
        "change": {
          "$ref": "#/$defs/Change"
        },
        "before": {
          "anyOf": [
            {
              "$ref": "#/$defs/GlossaryTerm"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "after": {
          "anyOf": [
            {
              "$ref": "#/$defs/GlossaryTerm"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "paired_by": {
          "anyOf": [
            {
              "$ref": "#/$defs/TermPairing"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "before_facts": {
          "anyOf": [
            {
              "$ref": "#/$defs/TermFacts"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "after_facts": {
          "anyOf": [
            {
              "$ref": "#/$defs/TermFacts"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "definition": {
          "default": [],
          "description": "A changed definition's word diff.",
          "items": {
            "$ref": "#/$defs/DiffSegment"
          },
          "type": "array"
        }
      },
      "required": [
        "change",
        "before",
        "after",
        "paired_by",
        "before_facts",
        "after_facts",
        "definition"
      ],
      "type": "object"
    },
    "TermFacts": {
      "additionalProperties": false,
      "properties": {
        "other_forms": {
          "default": [],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "scenario_count": {
          "default": 0,
          "type": "integer"
        }
      },
      "required": [
        "other_forms",
        "scenario_count"
      ],
      "type": "object"
    },
    "TermKind": {
      "enum": [
        "actor",
        "object",
        "activity"
      ],
      "type": "string"
    },
    "TermPairing": {
      "enum": [
        "rename-log",
        "term-id"
      ],
      "type": "string"
    },
    "TextSegment": {
      "additionalProperties": false,
      "properties": {
        "mark": {
          "$ref": "#/$defs/Mark"
        },
        "text": {
          "type": "string"
        }
      },
      "required": [
        "mark",
        "text"
      ],
      "type": "object"
    },
    "Tool": {
      "additionalProperties": false,
      "properties": {
        "role": {
          "$ref": "#/$defs/ToolRole"
        },
        "name": {
          "type": "string"
        },
        "version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Null where the recorder cannot know the tool's version."
        }
      },
      "required": [
        "role",
        "name",
        "version"
      ],
      "type": "object"
    },
    "ToolRole": {
      "enum": [
        "language",
        "runtime",
        "runner",
        "recorder",
        "builder"
      ],
      "type": "string"
    },
    "TracebackFrame": {
      "additionalProperties": false,
      "properties": {
        "path": {
          "type": "string"
        },
        "line": {
          "type": "integer"
        },
        "func": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "is_internal": {
          "description": "Marks frames of the runner, the recorder and the language's own libraries, which the UI hides by default.",
          "type": "boolean"
        }
      },
      "required": [
        "path",
        "line",
        "func",
        "code",
        "is_internal"
      ],
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "default": "https://nwilbert.github.io/pytest-given/latest/schemas/delta-v1.schema.json",
      "type": "string"
    },
    "metadata": {
      "$ref": "#/$defs/DeltaMetadata"
    },
    "scenarios": {
      "default": [],
      "items": {
        "$ref": "#/$defs/ScenarioDelta"
      },
      "type": "array"
    },
    "unchanged": {
      "default": [],
      "items": {
        "$ref": "#/$defs/IdentityPair"
      },
      "type": "array"
    },
    "suggestions": {
      "default": [],
      "items": {
        "$ref": "#/$defs/Suggestion"
      },
      "type": "array"
    },
    "glossary": {
      "$ref": "#/$defs/GlossaryDelta",
      "default": {
        "before": null,
        "after": null,
        "terms": [],
        "unchanged": []
      }
    }
  },
  "required": [
    "$schema",
    "metadata",
    "scenarios",
    "unchanged",
    "suggestions",
    "glossary"
  ],
  "type": "object"
}
