{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://goethecloud.com/format/1/schema/project.schema.json",
  "$comment": "SPDX-License-Identifier: MIT",
  "title": "Goethe Format 1: project.json",
  "description": "The outline, the story bible, the settings and the person's window of a Goethe Write project (docs/format/GOETHE_FORMAT_1.md, section 5). Readers ignore keys they do not know; Goethe Write 1 does not keep them. Licence: MIT, Copyright (c) 2026 ICSL FZE (LICENSE beside this file).",
  "type": "object",
  "properties": {
    "format": {
      "type": "integer",
      "description": "Layout number of project.json: 2 in every package of format 1. Not the package's version (manifest.json has that); readers do not use it"
    },
    "tree": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/node"
      },
      "description": "The roots of the outline in sidebar order"
    },
    "dailyGoal": {
      "type": "integer",
      "description": "Words a day; 0: none"
    },
    "days": {
      "type": "object",
      "propertyNames": {
        "$ref": "#/$defs/day"
      },
      "additionalProperties": {
        "type": "integer"
      },
      "description": "Local day → manuscript words when that day began"
    },
    "expanded": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/uuid"
      },
      "description": "Legacy copy of window.expanded for older versions; its order has no meaning"
    },
    "selection": {
      "$ref": "#/$defs/uuid"
    },
    "bible": {
      "$ref": "#/$defs/storyBible"
    },
    "settings": {
      "$ref": "#/$defs/projectSettings"
    },
    "collapsed": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/uuid"
      },
      "description": "Legacy (read when window.sidebarFolded is missing)"
    },
    "window": {
      "$ref": "#/$defs/windowState"
    },
    "goetheLog": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/goetheLogEntry"
      }
    },
    "manuscriptGoal": {
      "$ref": "#/$defs/manuscriptGoal"
    }
  },
  "required": [
    "format",
    "tree",
    "dailyGoal",
    "days",
    "expanded"
  ],
  "$defs": {
    "uuid": {
      "type": "string",
      "pattern": "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$",
      "description": "A UUID; written in upper case, read in any case"
    },
    "date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "number",
          "description": "Legacy (older files only): seconds since 2001-01-01T00:00:00Z"
        }
      ],
      "description": "A time: ISO 8601 in UTC with whole seconds, e.g. \"2026-11-12T10:00:00Z\" (readers also accept fractional seconds and offsets)"
    },
    "day": {
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
      "description": "A local calendar day, yyyy-MM-dd"
    },
    "writeStatus": {
      "type": "string",
      "enum": [
        "none",
        "idea",
        "draft",
        "revised",
        "done"
      ],
      "description": "How far a text is"
    },
    "writeLabel": {
      "type": "string",
      "enum": [
        "red",
        "orange",
        "yellow",
        "green",
        "blue",
        "purple",
        "gray"
      ],
      "description": "A colour tag"
    },
    "nodeKind": {
      "type": "string",
      "enum": [
        "manuscript",
        "characters",
        "places",
        "research",
        "trash",
        "folder",
        "text",
        "character",
        "place",
        "file"
      ],
      "description": "Roots: manuscript, characters, places, research, trash; entries: folder, text, character, place, file"
    },
    "anchor": {
      "type": "object",
      "description": "A passage in a text",
      "properties": {
        "node": {
          "$ref": "#/$defs/uuid",
          "description": "The node whose text it points into"
        },
        "location": {
          "type": "integer",
          "description": "Start, in UTF-16 code units of the text as Goethe Write holds it (footnote, field, picture: one U+FFFC each)"
        },
        "length": {
          "type": "integer",
          "description": "Length in UTF-16 code units; 0 marks a position"
        },
        "quote": {
          "type": "string",
          "description": "The covered text when the anchor was made or last refreshed (U+FFFC included); a hint for finding the passage again"
        }
      },
      "required": [
        "node",
        "location",
        "length",
        "quote"
      ]
    },
    "field": {
      "type": "object",
      "description": "A named value on a sheet (\"Alter: 34\"), or a value of a field of the project's own",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "name": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "value"
      ]
    },
    "node": {
      "type": "object",
      "description": "An entry of the outline",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid",
          "description": "Identity; names texts/<id>.rtf|.rtfd and files/<id>.<ext>"
        },
        "kind": {
          "$ref": "#/$defs/nodeKind",
          "description": "Unknown values are read as text"
        },
        "title": {
          "type": "string",
          "description": "Title; standard root titles are stored in German and localized for display"
        },
        "synopsis": {
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/writeStatus",
          "description": "Unknown values are read as none"
        },
        "label": {
          "$ref": "#/$defs/writeLabel"
        },
        "includeInExport": {
          "type": "boolean"
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/node"
          },
          "description": "Children in outline order"
        },
        "notes": {
          "type": "string",
          "description": "Notes beside the text (not exported)"
        },
        "target": {
          "type": "integer",
          "description": "Word goal; 0: none"
        },
        "pov": {
          "type": "string",
          "description": "Point of view, a name"
        },
        "place": {
          "type": "string",
          "description": "Where the scene takes place, free text"
        },
        "when": {
          "type": "string",
          "description": "Time as the author writes it"
        },
        "date": {
          "$ref": "#/$defs/date",
          "description": "Date on the timeline"
        },
        "threads": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Plot lines"
        },
        "links": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/uuid"
          },
          "description": "Nodes linked by hand"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Other names of a character or place"
        },
        "fields": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/field"
          }
        },
        "file": {
          "type": "string",
          "description": "Original file name of a research file; its bytes are files/<id>.<ext>"
        },
        "url": {
          "type": "string",
          "description": "A web page"
        },
        "origin": {
          "$ref": "#/$defs/uuid",
          "description": "In the trash: the parent it was deleted from"
        },
        "lockedForGoethe": {
          "type": "boolean",
          "description": "Goethe (the assistant) never reads this node or anything below it; only true is written"
        },
        "keywordList": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Keywords (written only when there are some)"
        },
        "ownStatus": {
          "$ref": "#/$defs/uuid",
          "description": "An OwnStatus of bible.order.ownStatuses"
        }
      },
      "required": [
        "id"
      ]
    },
    "characterRelation": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "from": {
          "$ref": "#/$defs/uuid"
        },
        "to": {
          "$ref": "#/$defs/uuid"
        },
        "kind": {
          "type": "string",
          "description": "family, love, friendship, rivalry, work, other, or any own string"
        },
        "role": {
          "type": "string"
        },
        "inverseRole": {
          "type": "string"
        },
        "directed": {
          "type": "boolean"
        },
        "startScene": {
          "$ref": "#/$defs/uuid"
        },
        "endScene": {
          "$ref": "#/$defs/uuid"
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "from",
        "to"
      ]
    },
    "characterRelationGroup": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "title": {
          "type": "string"
        },
        "members": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/uuid"
          }
        },
        "color": {
          "type": "integer",
          "description": "Index into 8 colours, modulo 8"
        }
      }
    },
    "relationPoint": {
      "type": "object",
      "properties": {
        "x": {
          "type": "number"
        },
        "y": {
          "type": "number"
        }
      }
    },
    "characterRelations": {
      "type": "object",
      "properties": {
        "edges": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/characterRelation"
          }
        },
        "groups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/characterRelationGroup"
          }
        },
        "positions": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/relationPoint"
          },
          "description": "Character node id (upper case) → card origin in canvas points"
        },
        "dismissed": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Declined suggestions: two upper-case UUIDs, sorted, joined by |"
        }
      }
    },
    "storyFact": {
      "type": "object",
      "description": "A setup and its payoff",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "kind": {
          "type": "string",
          "enum": [
            "secret",
            "clue",
            "promise",
            "question",
            "fact"
          ]
        },
        "title": {
          "type": "string"
        },
        "detail": {
          "type": "string"
        },
        "setup": {
          "$ref": "#/$defs/uuid"
        },
        "payoff": {
          "$ref": "#/$defs/uuid"
        },
        "openOnPurpose": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "kind",
        "title",
        "detail",
        "openOnPurpose"
      ]
    },
    "knowledgeEvent": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "fact": {
          "$ref": "#/$defs/uuid"
        },
        "character": {
          "$ref": "#/$defs/uuid"
        },
        "scene": {
          "$ref": "#/$defs/uuid"
        },
        "kind": {
          "type": "string",
          "enum": [
            "learns",
            "uses"
          ]
        }
      },
      "required": [
        "id",
        "fact",
        "character",
        "scene",
        "kind"
      ]
    },
    "characterBeat": {
      "type": "object",
      "description": "Legacy: converted into changes when read",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "character": {
          "$ref": "#/$defs/uuid"
        },
        "scene": {
          "$ref": "#/$defs/uuid"
        },
        "goal": {
          "type": "string"
        },
        "fear": {
          "type": "string"
        },
        "relationships": {
          "type": "string"
        },
        "turningPoint": {
          "type": "boolean"
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "character",
        "scene",
        "goal",
        "fear",
        "relationships",
        "turningPoint",
        "note"
      ]
    },
    "entityChange": {
      "type": "object",
      "description": "From this scene on, a field of a character or place has this value",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "entity": {
          "$ref": "#/$defs/uuid"
        },
        "scene": {
          "$ref": "#/$defs/uuid"
        },
        "field": {
          "type": "string"
        },
        "value": {
          "type": "string"
        },
        "note": {
          "type": "string"
        },
        "turningPoint": {
          "type": "boolean"
        }
      },
      "required": [
        "entity",
        "scene"
      ]
    },
    "travelTime": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "from": {
          "$ref": "#/$defs/uuid"
        },
        "to": {
          "$ref": "#/$defs/uuid"
        },
        "hours": {
          "type": "number"
        }
      },
      "required": [
        "id",
        "from",
        "to",
        "hours"
      ]
    },
    "worldRule": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "title": {
          "type": "string"
        },
        "detail": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "forbidden",
            "requires"
          ]
        },
        "patterns": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Words, or regular expressions in slashes"
        },
        "threads": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "enabled": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "title",
        "detail",
        "kind",
        "patterns",
        "threads",
        "enabled"
      ]
    },
    "sourceLink": {
      "type": "object",
      "description": "Evidence for a passage",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "anchor": {
          "$ref": "#/$defs/anchor"
        },
        "research": {
          "$ref": "#/$defs/uuid"
        },
        "page": {
          "type": "string"
        },
        "quote": {
          "type": "string"
        },
        "note": {
          "type": "string"
        },
        "verified": {
          "type": "boolean"
        },
        "checkedText": {
          "type": "string"
        },
        "sourceDigest": {
          "type": "string",
          "description": "Lower-case hex SHA-256 of the research item when checked"
        },
        "checkedAt": {
          "$ref": "#/$defs/date"
        }
      },
      "required": [
        "anchor"
      ]
    },
    "commentReply": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "author": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "date": {
          "$ref": "#/$defs/date"
        }
      },
      "required": [
        "id",
        "author",
        "text",
        "date"
      ]
    },
    "comment": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "anchor": {
          "$ref": "#/$defs/anchor"
        },
        "text": {
          "type": "string"
        },
        "author": {
          "type": "string"
        },
        "date": {
          "$ref": "#/$defs/date"
        },
        "resolved": {
          "type": "boolean"
        },
        "replies": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/commentReply"
          }
        }
      },
      "required": [
        "id",
        "anchor"
      ]
    },
    "fieldRule": {
      "type": "object",
      "properties": {
        "field": {
          "$ref": "#/$defs/uuid",
          "description": "A MetadataDefinition id"
        },
        "value": {
          "type": "string"
        }
      },
      "required": [
        "field",
        "value"
      ]
    },
    "collection": {
      "type": "object",
      "description": "A saved selection of entries",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "title": {
          "type": "string"
        },
        "statuses": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/writeStatus"
          }
        },
        "labels": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/writeLabel"
          }
        },
        "pov": {
          "type": "string"
        },
        "thread": {
          "type": "string"
        },
        "place": {
          "type": "string"
        },
        "character": {
          "$ref": "#/$defs/uuid"
        },
        "text": {
          "type": "string"
        },
        "openWork": {
          "type": "boolean"
        },
        "manual": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/uuid"
          },
          "description": "Present (even empty): filled by hand with exactly these nodes; rules ignored"
        },
        "ownStatuses": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/uuid"
          }
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "fieldRules": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/fieldRule"
          }
        }
      },
      "required": [
        "id",
        "title",
        "statuses",
        "labels",
        "pov",
        "thread",
        "place",
        "text",
        "openWork"
      ]
    },
    "revisionRound": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "title": {
          "type": "string"
        },
        "goal": {
          "type": "string"
        },
        "color": {
          "type": "integer",
          "description": "0–5: blue, red, green, purple, orange, teal"
        },
        "started": {
          "$ref": "#/$defs/date"
        },
        "finished": {
          "$ref": "#/$defs/date"
        },
        "targetWords": {
          "type": "integer"
        }
      },
      "required": [
        "id",
        "title",
        "goal",
        "color",
        "started",
        "targetWords"
      ]
    },
    "snapshot": {
      "type": "object",
      "description": "A saved version of a text",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid",
          "description": "Its text is snapshots/<id>.rtf|.rtfd"
        },
        "node": {
          "$ref": "#/$defs/uuid"
        },
        "title": {
          "type": "string"
        },
        "date": {
          "$ref": "#/$defs/date"
        },
        "words": {
          "type": "integer"
        },
        "variant": {
          "type": "boolean",
          "description": "true: an alternative; false: a backup"
        }
      },
      "required": [
        "id",
        "node",
        "title",
        "date",
        "words",
        "variant"
      ]
    },
    "deletedPassage": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid",
          "description": "Newer entries: deleted/<id>.rtf|.rtfd holds it formatted"
        },
        "node": {
          "$ref": "#/$defs/uuid"
        },
        "text": {
          "type": "string",
          "description": "The words (fields as their values)"
        },
        "date": {
          "$ref": "#/$defs/date"
        }
      },
      "required": [
        "id",
        "node",
        "text",
        "date"
      ]
    },
    "argumentNode": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "kind": {
          "type": "string",
          "enum": [
            "claim",
            "evidence",
            "counter",
            "rebuttal",
            "conclusion"
          ]
        },
        "title": {
          "type": "string"
        },
        "detail": {
          "type": "string"
        },
        "parent": {
          "$ref": "#/$defs/uuid"
        },
        "anchor": {
          "$ref": "#/$defs/anchor"
        },
        "research": {
          "$ref": "#/$defs/uuid"
        },
        "page": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "kind",
        "title",
        "detail",
        "page"
      ]
    },
    "clauseRevision": {
      "type": "object",
      "properties": {
        "version": {
          "type": "integer"
        },
        "body": {
          "type": "string"
        },
        "date": {
          "$ref": "#/$defs/date"
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "version",
        "body",
        "date",
        "note"
      ]
    },
    "clauseVariant": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "title": {
          "type": "string"
        },
        "body": {
          "type": "string",
          "description": "Text with {{Name}} variables and {{#wenn Name}} … {{/wenn}} conditions"
        },
        "approved": {
          "type": "boolean"
        },
        "approvedBy": {
          "type": "string"
        },
        "approvedDate": {
          "$ref": "#/$defs/date"
        },
        "version": {
          "type": "integer"
        },
        "history": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/clauseRevision"
          }
        }
      }
    },
    "clause": {
      "type": "object",
      "description": "A text module (Textbaustein)",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "title": {
          "type": "string"
        },
        "category": {
          "type": "string"
        },
        "variants": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/clauseVariant"
          }
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "title",
        "category",
        "variants",
        "note"
      ]
    },
    "valueVersion": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string"
        },
        "validFrom": {
          "$ref": "#/$defs/date"
        }
      },
      "required": [
        "value",
        "validFrom"
      ]
    },
    "variable": {
      "type": "object",
      "description": "A value used in texts",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "name": {
          "type": "string",
          "description": "The key texts use: ⟦var:<name>⟧"
        },
        "value": {
          "type": "string"
        },
        "note": {
          "type": "string"
        },
        "research": {
          "$ref": "#/$defs/uuid"
        },
        "history": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/valueVersion"
          }
        }
      }
    },
    "term": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "term": {
          "type": "string"
        },
        "definition": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "anchor": {
          "$ref": "#/$defs/anchor"
        },
        "changed": {
          "$ref": "#/$defs/date"
        }
      },
      "required": [
        "id",
        "term",
        "definition",
        "aliases"
      ]
    },
    "caseStatement": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "party": {
          "type": "string"
        },
        "claim": {
          "type": "string"
        },
        "when": {
          "type": "string"
        },
        "research": {
          "$ref": "#/$defs/uuid"
        },
        "page": {
          "type": "string"
        },
        "anchor": {
          "$ref": "#/$defs/anchor"
        }
      },
      "required": [
        "id",
        "party",
        "claim",
        "when",
        "page"
      ]
    },
    "caseEvent": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "title": {
          "type": "string"
        },
        "date": {
          "$ref": "#/$defs/date"
        },
        "when": {
          "type": "string"
        },
        "participants": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/uuid"
          }
        },
        "statements": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/caseStatement"
          }
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "title",
        "when",
        "participants",
        "statements",
        "note"
      ]
    },
    "roleMark": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "anchor": {
          "$ref": "#/$defs/anchor"
        },
        "role": {
          "type": "string",
          "enum": [
            "ownSubmission",
            "opposingSubmission",
            "undisputed",
            "evidence",
            "assessment"
          ]
        }
      },
      "required": [
        "id",
        "anchor",
        "role"
      ]
    },
    "approval": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "node": {
          "$ref": "#/$defs/uuid"
        },
        "by": {
          "type": "string"
        },
        "date": {
          "$ref": "#/$defs/date"
        },
        "snapshot": {
          "$ref": "#/$defs/uuid"
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "node",
        "by",
        "date",
        "note"
      ]
    },
    "trackedChange": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "kind": {
          "type": "string",
          "enum": [
            "insertion",
            "deletion"
          ]
        },
        "anchor": {
          "$ref": "#/$defs/anchor"
        },
        "author": {
          "type": "string"
        },
        "date": {
          "$ref": "#/$defs/date"
        },
        "round": {
          "$ref": "#/$defs/uuid"
        }
      },
      "required": [
        "id",
        "kind",
        "anchor",
        "author",
        "date"
      ]
    },
    "legalSource": {
      "type": "object",
      "description": "An entry of the bibliography",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "kind": {
          "type": "string",
          "enum": [
            "book",
            "commentary",
            "article",
            "chapter",
            "online"
          ]
        },
        "authors": {
          "type": "string"
        },
        "edited": {
          "type": "boolean"
        },
        "title": {
          "type": "string"
        },
        "shortTitle": {
          "type": "string"
        },
        "edition": {
          "type": "string"
        },
        "volume": {
          "type": "string"
        },
        "place": {
          "type": "string"
        },
        "year": {
          "type": "string"
        },
        "journal": {
          "type": "string"
        },
        "page": {
          "type": "string"
        },
        "container": {
          "type": "string"
        },
        "containerEditors": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "accessed": {
          "type": "string"
        }
      }
    },
    "statement": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "anchor": {
          "$ref": "#/$defs/anchor"
        },
        "kind": {
          "type": "string",
          "enum": [
            "claim",
            "evidence",
            "assumption",
            "conclusion",
            "event",
            "belief",
            "falseBelief",
            "data",
            "interpretation",
            "recommendation"
          ]
        },
        "title": {
          "type": "string"
        },
        "participants": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/uuid"
          }
        },
        "occurred": {
          "type": "string"
        },
        "occurredDate": {
          "$ref": "#/$defs/date"
        },
        "knownSince": {
          "type": "string"
        },
        "knownDate": {
          "$ref": "#/$defs/date"
        },
        "knownScene": {
          "$ref": "#/$defs/uuid"
        },
        "validFrom": {
          "$ref": "#/$defs/date"
        },
        "validUntil": {
          "$ref": "#/$defs/date"
        },
        "created": {
          "$ref": "#/$defs/date"
        },
        "checked": {
          "type": "boolean"
        },
        "checkedText": {
          "type": "string"
        },
        "checkedAt": {
          "$ref": "#/$defs/date"
        },
        "checkedBy": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "anchor",
        "kind",
        "title",
        "participants",
        "occurred",
        "knownSince",
        "created",
        "checked",
        "checkedText",
        "checkedBy",
        "note"
      ]
    },
    "ref": {
      "type": "object",
      "description": "One of four cases, the value under \"_0\"",
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "statement": {
              "type": "object",
              "properties": {
                "_0": {
                  "$ref": "#/$defs/uuid"
                }
              },
              "required": [
                "_0"
              ]
            }
          },
          "required": [
            "statement"
          ]
        },
        {
          "type": "object",
          "properties": {
            "passage": {
              "type": "object",
              "properties": {
                "_0": {
                  "$ref": "#/$defs/anchor"
                }
              },
              "required": [
                "_0"
              ]
            }
          },
          "required": [
            "passage"
          ]
        },
        {
          "type": "object",
          "properties": {
            "node": {
              "type": "object",
              "properties": {
                "_0": {
                  "$ref": "#/$defs/uuid"
                }
              },
              "required": [
                "_0"
              ]
            }
          },
          "required": [
            "node"
          ]
        },
        {
          "type": "object",
          "properties": {
            "question": {
              "type": "object",
              "properties": {
                "_0": {
                  "$ref": "#/$defs/uuid"
                }
              },
              "required": [
                "_0"
              ]
            }
          },
          "required": [
            "question"
          ]
        }
      ]
    },
    "relation": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "from": {
          "$ref": "#/$defs/ref"
        },
        "kind": {
          "type": "string",
          "enum": [
            "supports",
            "contradicts",
            "requires",
            "supersedes",
            "conditional",
            "resolves"
          ]
        },
        "to": {
          "$ref": "#/$defs/ref"
        },
        "confirmed": {
          "type": "boolean",
          "description": "false: a suggestion found by the app"
        },
        "note": {
          "type": "string"
        },
        "created": {
          "$ref": "#/$defs/date"
        }
      },
      "required": [
        "id",
        "from",
        "kind",
        "to",
        "confirmed",
        "note",
        "created"
      ]
    },
    "openQuestion": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "title": {
          "type": "string"
        },
        "detail": {
          "type": "string"
        },
        "anchors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/anchor"
          }
        },
        "owner": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "enum": [
            "open",
            "decided",
            "dropped"
          ]
        },
        "decision": {
          "type": "string"
        },
        "reasoning": {
          "type": "string"
        },
        "decidedAt": {
          "$ref": "#/$defs/date"
        },
        "decidedBy": {
          "type": "string"
        },
        "created": {
          "$ref": "#/$defs/date"
        }
      },
      "required": [
        "id",
        "title",
        "detail",
        "anchors",
        "owner",
        "state",
        "decision",
        "reasoning",
        "decidedBy",
        "created"
      ]
    },
    "reviewEntry": {
      "type": "object",
      "properties": {
        "node": {
          "$ref": "#/$defs/uuid"
        },
        "dimension": {
          "type": "string",
          "enum": [
            "content",
            "sources",
            "language",
            "approval"
          ]
        },
        "done": {
          "type": "boolean"
        },
        "openPoints": {
          "type": "integer"
        },
        "by": {
          "type": "string"
        },
        "date": {
          "$ref": "#/$defs/date"
        },
        "reason": {
          "type": "string"
        }
      },
      "required": [
        "node",
        "dimension",
        "done",
        "openPoints",
        "by",
        "reason"
      ]
    },
    "metadataDefinition": {
      "type": "object",
      "description": "A field of the project's own",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "name": {
          "type": "string",
          "description": "The key of the values in Node.fields"
        },
        "type": {
          "type": "string",
          "enum": [
            "text",
            "date",
            "choice",
            "multiChoice",
            "person",
            "number",
            "check"
          ]
        },
        "options": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "showInOutline": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "name",
        "type",
        "options",
        "showInOutline"
      ]
    },
    "clauseUse": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "clause": {
          "$ref": "#/$defs/uuid"
        },
        "variant": {
          "$ref": "#/$defs/uuid"
        },
        "version": {
          "type": "integer"
        },
        "anchor": {
          "$ref": "#/$defs/anchor"
        },
        "insertedText": {
          "type": "string",
          "description": "As inserted, fields as ⟦…⟧ tokens"
        },
        "keepLocal": {
          "type": "boolean"
        },
        "date": {
          "$ref": "#/$defs/date"
        }
      },
      "required": [
        "id",
        "clause",
        "variant",
        "version",
        "anchor",
        "insertedText",
        "keepLocal",
        "date"
      ]
    },
    "storyCurvePoint": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "at": {
          "type": "number",
          "description": "0: start of the manuscript, 1: its end"
        },
        "value": {
          "type": "number",
          "description": "0–5"
        }
      },
      "required": [
        "id",
        "at",
        "value"
      ]
    },
    "storyCurve": {
      "type": "object",
      "description": "A curve the writer drew",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "kind": {
          "type": "string",
          "enum": [
            "tension",
            "storyTime",
            "mood",
            "tempo",
            "presence"
          ]
        },
        "character": {
          "$ref": "#/$defs/uuid"
        },
        "points": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/storyCurvePoint"
          }
        }
      },
      "required": [
        "kind"
      ]
    },
    "ownStatus": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "title": {
          "type": "string"
        },
        "countsAs": {
          "$ref": "#/$defs/writeStatus"
        }
      }
    },
    "orderLists": {
      "type": "object",
      "properties": {
        "statusNames": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "WriteStatus raw value → the project's name"
        },
        "ownStatuses": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ownStatus"
          }
        },
        "labelNames": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "WriteLabel raw value → the project's name"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "goalPlan": {
      "type": "object",
      "properties": {
        "deadline": {
          "$ref": "#/$defs/day"
        },
        "writingDays": {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 1,
            "maximum": 7
          },
          "description": "1 = Sunday … 7 = Saturday"
        },
        "dailyFromDeadline": {
          "type": "boolean"
        },
        "sessionGoal": {
          "type": "integer"
        }
      }
    },
    "storyBible": {
      "type": "object",
      "description": "What the project knows besides the texts",
      "properties": {
        "characterRelations": {
          "$ref": "#/$defs/characterRelations"
        },
        "facts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/storyFact"
          }
        },
        "knowledge": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/knowledgeEvent"
          }
        },
        "beats": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/characterBeat"
          },
          "description": "Legacy: converted into changes when read, then written empty"
        },
        "changes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/entityChange"
          }
        },
        "travel": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/travelTime"
          }
        },
        "rules": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/worldRule"
          }
        },
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/sourceLink"
          }
        },
        "comments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/comment"
          }
        },
        "collections": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/collection"
          }
        },
        "rounds": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/revisionRound"
          }
        },
        "snapshots": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/snapshot"
          },
          "description": "Newest first"
        },
        "deleted": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/deletedPassage"
          },
          "description": "Newest first, at most 200"
        },
        "intended": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Warnings marked as intended (opaque ids)"
        },
        "arguments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/argumentNode"
          }
        },
        "clauses": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/clause"
          }
        },
        "variables": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/variable"
          }
        },
        "terms": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/term"
          }
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/caseEvent"
          }
        },
        "roles": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/roleMark"
          }
        },
        "approvals": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/approval"
          }
        },
        "tracked": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/trackedChange"
          }
        },
        "literature": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/legalSource"
          }
        },
        "statements": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/statement"
          }
        },
        "relations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/relation"
          }
        },
        "questions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/openQuestion"
          }
        },
        "reviews": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/reviewEntry"
          }
        },
        "metadata": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/metadataDefinition"
          }
        },
        "clauseUses": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/clauseUse"
          }
        },
        "curves": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/storyCurve"
          }
        },
        "order": {
          "$ref": "#/$defs/orderLists"
        },
        "goals": {
          "$ref": "#/$defs/goalPlan"
        }
      }
    },
    "paperSize": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "custom-<lower-case uuid>"
        },
        "name": {
          "type": "string"
        },
        "width": {
          "type": "number"
        },
        "height": {
          "type": "number"
        },
        "unit": {
          "type": "string",
          "enum": [
            "mm",
            "cm",
            "in",
            "pt",
            "pica",
            "cicero"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "width",
        "height",
        "unit"
      ]
    },
    "watermark": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "text",
            "picture"
          ]
        },
        "text": {
          "type": "string",
          "description": "May hold {title} {subtitle} {author} {case} {date} {recipient}"
        },
        "font": {
          "type": "string"
        },
        "bold": {
          "type": "boolean"
        },
        "size": {
          "type": "number",
          "description": "Points; 0: automatic"
        },
        "color": {
          "type": "string",
          "description": "#RRGGBB"
        },
        "opacity": {
          "type": "number",
          "description": "0.05–1"
        },
        "slant": {
          "type": "string",
          "enum": [
            "rising",
            "falling",
            "level"
          ]
        },
        "picture": {
          "type": "string",
          "description": "<sha256>.png in watermarks/"
        },
        "scale": {
          "type": "number",
          "description": "Percent; 0: automatic"
        },
        "washout": {
          "type": "boolean"
        },
        "pages": {
          "type": "string",
          "enum": [
            "all",
            "notTitle",
            "textOnly"
          ]
        },
        "recipient": {
          "type": "string"
        },
        "recipients": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "styleSpec": {
      "type": "object",
      "description": "A paragraph style (Formatvorlage)",
      "properties": {
        "style": {
          "type": "integer",
          "description": "0 Text, 1–3 Überschrift 1–3, 4 Zitat, 5–7 Überschrift 4–6",
          "minimum": 0,
          "maximum": 7
        },
        "family": {
          "type": "string"
        },
        "size": {
          "type": "number",
          "description": "Points"
        },
        "bold": {
          "type": "boolean"
        },
        "italic": {
          "type": "boolean"
        },
        "lineSpacing": {
          "type": "number",
          "description": "Multiple of the line height"
        },
        "spaceBefore": {
          "type": "number",
          "description": "Points"
        },
        "spaceAfter": {
          "type": "number",
          "description": "Points"
        },
        "indent": {
          "type": "number",
          "description": "Points"
        },
        "alignment": {
          "type": "string",
          "description": "left, center, justified"
        },
        "keepWithNext": {
          "type": "boolean",
          "description": "Optional (since 13 November 2026): every paragraph of the style stays on the page of the next one's start (Word w:keepNext); absent: on for headings, off otherwise"
        },
        "keepLines": {
          "type": "boolean",
          "description": "Optional: the paragraphs do not break across pages (Word w:keepLines); absent: on for headings, off otherwise"
        },
        "pageBreakBefore": {
          "type": "boolean",
          "description": "Optional: each paragraph begins a page (Word w:pageBreakBefore); absent: off"
        },
        "widowControl": {
          "type": "boolean",
          "description": "Optional: no first or last line alone on a page (Word w:widowControl); absent: on"
        }
      },
      "required": [
        "style",
        "family",
        "size",
        "bold",
        "italic",
        "lineSpacing",
        "spaceBefore",
        "spaceAfter",
        "indent",
        "alignment"
      ]
    },
    "exportSettings": {
      "type": "object",
      "description": "Page setup and export",
      "properties": {
        "format": {
          "type": "string",
          "enum": [
            "pdf",
            "docx",
            "epub",
            "markdown",
            "rtf"
          ]
        },
        "preset": {
          "type": "string",
          "description": "text, standard, buch, normseite, schriftsatz, gutachten"
        },
        "titles": {
          "type": "boolean",
          "description": "Legacy, read only when titleHeadings is missing"
        },
        "titleHeadings": {
          "type": "string",
          "enum": [
            "folders",
            "all",
            "none"
          ]
        },
        "separator": {
          "type": "string",
          "description": "blank, stars, or text:<mark>"
        },
        "titlePage": {
          "type": "boolean"
        },
        "tableOfContents": {
          "type": "boolean"
        },
        "tocDepth": {
          "type": "integer"
        },
        "chapterNewPage": {
          "type": "boolean"
        },
        "pageNumbers": {
          "type": "boolean"
        },
        "numberPosition": {
          "type": "string",
          "description": "left, center, right, topleft, topcenter, topright"
        },
        "numberFormat": {
          "type": "string",
          "description": "number, page, pageOf"
        },
        "headerLeft": {
          "type": "string",
          "description": "May hold {title} {subtitle} {author} {case} {chapter} {date} {page} {pages}"
        },
        "headerCenter": {
          "type": "string",
          "description": "May hold {title} {subtitle} {author} {case} {chapter} {date} {page} {pages}"
        },
        "headerRight": {
          "type": "string",
          "description": "May hold {title} {subtitle} {author} {case} {chapter} {date} {page} {pages}"
        },
        "footerLeft": {
          "type": "string",
          "description": "May hold {title} {subtitle} {author} {case} {chapter} {date} {page} {pages}"
        },
        "footerCenter": {
          "type": "string",
          "description": "May hold {title} {subtitle} {author} {case} {chapter} {date} {page} {pages}"
        },
        "footerRight": {
          "type": "string",
          "description": "May hold {title} {subtitle} {author} {case} {chapter} {date} {page} {pages}"
        },
        "furnitureFirstBare": {
          "type": "boolean"
        },
        "furnitureMirrored": {
          "type": "boolean"
        },
        "furnitureFamily": {
          "type": "string"
        },
        "furnitureSize": {
          "type": "number",
          "description": "Points; 0: as the look"
        },
        "furnitureLines": {
          "type": "boolean"
        },
        "font": {
          "type": "string"
        },
        "size": {
          "type": "number",
          "description": "Points"
        },
        "lineSpacing": {
          "type": "number"
        },
        "justified": {
          "type": "boolean"
        },
        "marginTop": {
          "type": "number",
          "description": "Centimetres"
        },
        "marginBottom": {
          "type": "number",
          "description": "Centimetres"
        },
        "marginLeft": {
          "type": "number",
          "description": "Centimetres"
        },
        "marginRight": {
          "type": "number",
          "description": "Centimetres"
        },
        "paper": {
          "type": "string",
          "description": "A paper id, or custom-<uuid>"
        },
        "customPaper": {
          "$ref": "#/$defs/paperSize"
        },
        "landscape": {
          "type": "boolean"
        },
        "mirrored": {
          "type": "boolean",
          "description": "Missing: as the look"
        },
        "gutter": {
          "type": "number",
          "description": "Centimetres"
        },
        "headerDistance": {
          "type": "number",
          "description": "Centimetres"
        },
        "footerDistance": {
          "type": "number",
          "description": "Centimetres"
        },
        "marginNumbers": {
          "type": "boolean"
        },
        "scope": {
          "$ref": "#/$defs/uuid",
          "description": "Export only this part"
        },
        "bibliography": {
          "type": "boolean"
        },
        "numberHeadings": {
          "type": "boolean"
        },
        "includeReview": {
          "type": "boolean"
        },
        "watermark": {
          "$ref": "#/$defs/watermark"
        }
      }
    },
    "screenplaySpan": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        },
        "styles": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Bold, Italic, Underline, Strikeout, AllCaps, HiddenText, and names a file brings"
        },
        "attributes": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The FDX <Text> attributes as read"
        }
      },
      "required": [
        "text",
        "styles"
      ]
    },
    "screenplayBlock": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "sourceIndex": {
          "type": "integer",
          "description": "Index of the source paragraph in originalData"
        },
        "sourcePath": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "[body index, paragraph inside a DualDialogue]",
          "minItems": 2,
          "maxItems": 2
        },
        "dualGroup": {
          "$ref": "#/$defs/uuid"
        },
        "dualVoice": {
          "type": "integer"
        },
        "spans": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/screenplaySpan"
          }
        },
        "element": {
          "type": "string",
          "description": "FDX paragraph type: Scene Heading, Action, Character, Parenthetical, Dialogue, Transition …"
        },
        "text": {
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/writeStatus"
        },
        "number": {
          "type": "string",
          "description": "Scene number; \"\": none"
        },
        "omitted": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/screenplayBlock"
          }
        },
        "deletions": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "offset": {
                "type": "integer",
                "description": "UTF-16 code units in the paragraph"
              },
              "revision": {
                "type": "integer"
              }
            },
            "required": [
              "offset"
            ]
          }
        }
      },
      "required": [
        "id",
        "element",
        "text"
      ]
    },
    "screenplayTitleParagraph": {
      "type": "object",
      "properties": {
        "spans": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/screenplaySpan"
          }
        },
        "alignment": {
          "type": "string",
          "enum": [
            "Left",
            "Center",
            "Right",
            "Full"
          ]
        }
      },
      "required": [
        "spans",
        "alignment"
      ]
    },
    "sceneNumberOptions": {
      "type": "object",
      "properties": {
        "left": {
          "type": "boolean"
        },
        "right": {
          "type": "boolean"
        },
        "autoHideRight": {
          "type": "boolean"
        },
        "scheme": {
          "type": "string",
          "enum": [
            "1A",
            "A2"
          ]
        },
        "leftLocation": {
          "type": "number",
          "description": "Inches"
        },
        "rightLocation": {
          "type": "number",
          "description": "Inches"
        }
      },
      "required": [
        "left",
        "right",
        "autoHideRight",
        "scheme",
        "leftLocation",
        "rightLocation"
      ]
    },
    "revisionSetting": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "mark": {
          "type": "string"
        },
        "pageColor": {
          "type": "string",
          "description": "#RRRRGGGGBBBB"
        },
        "color": {
          "type": "string",
          "description": "#RRRRGGGGBBBB"
        },
        "style": {
          "type": "string"
        },
        "full": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "name",
        "mark",
        "pageColor",
        "style",
        "full"
      ]
    },
    "revisionState": {
      "type": "object",
      "properties": {
        "mode": {
          "type": "boolean"
        },
        "active": {
          "type": "integer"
        },
        "shown": {
          "type": "string",
          "description": "Active or All"
        },
        "location": {
          "type": "number",
          "description": "Inches"
        },
        "pageColors": {
          "type": "boolean"
        },
        "sets": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/revisionSetting"
          }
        }
      },
      "required": [
        "mode",
        "active",
        "shown",
        "location",
        "pageColors",
        "sets"
      ]
    },
    "screenplayDraft": {
      "type": "object",
      "description": "A screenplay draft (transitional; a later version moves screenplays into scripts/)",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "title": {
          "type": "string"
        },
        "sourceScenes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/uuid"
          }
        },
        "originalData": {
          "type": "string",
          "description": "Base64: the imported file's bytes exactly as read (FDX, Fountain, or text from a PDF)",
          "contentEncoding": "base64"
        },
        "originalFormat": {
          "type": "string",
          "description": "fdx or fountain"
        },
        "blocks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/screenplayBlock"
          }
        },
        "modified": {
          "$ref": "#/$defs/date"
        },
        "titlePage": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/screenplayTitleParagraph"
          }
        },
        "numbering": {
          "$ref": "#/$defs/sceneNumberOptions"
        },
        "revisions": {
          "$ref": "#/$defs/revisionState"
        }
      },
      "required": [
        "id",
        "title",
        "sourceScenes",
        "blocks",
        "modified"
      ]
    },
    "authorBeat": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "title": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "act": {
          "type": "integer"
        },
        "color": {
          "$ref": "#/$defs/writeLabel"
        },
        "scene": {
          "$ref": "#/$defs/uuid"
        },
        "threads": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "x": {
          "type": "number"
        },
        "y": {
          "type": "number"
        }
      },
      "required": [
        "id",
        "title",
        "summary",
        "act",
        "threads"
      ]
    },
    "authorWorkspace": {
      "type": "object",
      "description": "The phases Idee, Recherche, Beats and Drehbuch",
      "properties": {
        "logline": {
          "type": "string"
        },
        "premise": {
          "type": "string"
        },
        "genre": {
          "type": "string"
        },
        "audience": {
          "type": "string"
        },
        "notes": {
          "type": "string"
        },
        "beats": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/authorBeat"
          }
        },
        "drafts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/screenplayDraft"
          }
        },
        "stage": {
          "type": "string",
          "description": "Legacy, moved to window.stage"
        },
        "selectedDraft": {
          "$ref": "#/$defs/uuid",
          "description": "Legacy, moved to window.draft"
        }
      }
    },
    "projectSettings": {
      "type": "object",
      "description": "Settings of the project",
      "properties": {
        "authorWorkspace": {
          "$ref": "#/$defs/authorWorkspace"
        },
        "workKind": {
          "type": "string",
          "enum": [
            "novel",
            "nonfiction",
            "legal",
            "screenplay"
          ]
        },
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "author": {
          "type": "string"
        },
        "caseNumber": {
          "type": "string"
        },
        "language": {
          "type": "string",
          "description": "Output language; en… English, anything else German"
        },
        "storyTools": {
          "type": "boolean"
        },
        "legalTools": {
          "type": "boolean"
        },
        "scienceTools": {
          "type": "boolean"
        },
        "consultingTools": {
          "type": "boolean"
        },
        "shownTools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Tool ids shown beyond their groups"
        },
        "hiddenTools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Tool ids hidden although their group is on"
        },
        "annexPrefix": {
          "type": "string"
        },
        "styles": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/styleSpec"
          }
        },
        "trackChanges": {
          "type": "boolean"
        },
        "export": {
          "$ref": "#/$defs/exportSettings"
        },
        "goetheRules": {
          "type": "string",
          "description": "House rules for the assistant Goethe"
        },
        "takenOver": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "One-time migrations already done"
        }
      }
    },
    "textPlace": {
      "type": "object",
      "description": "Caret and scroll of a text (UTF-16 code units, points)",
      "properties": {
        "location": {
          "type": "integer"
        },
        "length": {
          "type": "integer"
        },
        "top": {
          "type": "integer"
        },
        "offset": {
          "type": "number"
        },
        "width": {
          "type": "number"
        },
        "scale": {
          "type": "number"
        }
      },
      "required": [
        "location",
        "length"
      ]
    },
    "reviewState": {
      "type": "object",
      "properties": {
        "filter": {
          "type": "string",
          "enum": [
            "all",
            "hints",
            "comments",
            "questions",
            "changes",
            "sources"
          ]
        },
        "sort": {
          "type": "string",
          "enum": [
            "place",
            "date",
            "kind",
            "person"
          ]
        },
        "showDone": {
          "type": "boolean"
        },
        "showIntended": {
          "type": "boolean"
        },
        "person": {
          "type": "string"
        },
        "part": {
          "$ref": "#/$defs/uuid"
        }
      }
    },
    "boardPlace": {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "cards",
            "outline",
            "text",
            "composite"
          ]
        },
        "folder": {
          "$ref": "#/$defs/uuid"
        }
      },
      "required": [
        "mode",
        "folder"
      ]
    },
    "timelineViewport": {
      "type": "object",
      "properties": {
        "rest": {
          "type": "string",
          "enum": [
            "work",
            "part",
            "chapter"
          ]
        },
        "anchor": {
          "$ref": "#/$defs/uuid"
        },
        "into": {
          "type": "number"
        },
        "scale": {
          "type": "number"
        },
        "fallback": {
          "type": "number"
        }
      }
    },
    "timelinePlace": {
      "type": "object",
      "properties": {
        "height": {
          "type": "number"
        },
        "position": {
          "type": "string",
          "enum": [
            "bottom",
            "top"
          ]
        },
        "folded": {
          "type": "boolean"
        }
      }
    },
    "timelineMore": {
      "type": "object",
      "properties": {
        "viewports": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/timelineViewport"
          }
        },
        "places": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/timelinePlace"
          }
        },
        "laneHeights": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "laneColours": {
          "type": "object",
          "additionalProperties": {
            "type": "integer"
          }
        },
        "laneOrder": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "laneSort": {
          "type": "string"
        },
        "locked": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "columnsOff": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "alwaysDark": {
          "type": "boolean"
        },
        "groups": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "opened": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "curvesOpen": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "curveHeight": {
          "type": "integer"
        },
        "propsOff": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "timelineState": {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "reading",
            "chronology",
            "analysis"
          ]
        },
        "x": {
          "type": "number"
        },
        "y": {
          "type": "number"
        },
        "measure": {
          "type": "string",
          "enum": [
            "even",
            "pages",
            "words"
          ]
        },
        "zoom": {
          "type": "string",
          "enum": [
            "work",
            "part",
            "chapter"
          ]
        },
        "anchor": {
          "$ref": "#/$defs/uuid"
        },
        "collapsed": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "lanes": {
          "type": "string"
        },
        "hidden": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "solo": {
          "type": "string"
        },
        "curves": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "presence": {
          "$ref": "#/$defs/uuid"
        },
        "more": {
          "$ref": "#/$defs/timelineMore"
        }
      }
    },
    "columnWidth": {
      "type": "object",
      "properties": {
        "width": {
          "type": "number"
        },
        "dragged": {
          "type": "boolean"
        }
      },
      "required": [
        "width",
        "dragged"
      ]
    },
    "sideColumns": {
      "type": "object",
      "properties": {
        "sidebar": {
          "type": "boolean"
        },
        "info": {
          "type": "boolean"
        }
      }
    },
    "windowState": {
      "type": "object",
      "description": "The window as the person left it (never device values)",
      "properties": {
        "expanded": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/uuid"
          },
          "description": "Open folders and texts in the sidebar (sorted); its presence marks the current layout"
        },
        "sidebarFolded": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/uuid"
          }
        },
        "infoFolded": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "infoPage": {
          "type": "string"
        },
        "places": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/textPlace"
          },
          "description": "Node id → caret and scroll"
        },
        "timeline": {
          "$ref": "#/$defs/timelineState"
        },
        "review": {
          "$ref": "#/$defs/reviewState"
        },
        "parts": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Tool id → chosen part"
        },
        "tool": {
          "type": "string"
        },
        "collection": {
          "$ref": "#/$defs/uuid"
        },
        "board": {
          "$ref": "#/$defs/boardPlace"
        },
        "stage": {
          "type": "string",
          "enum": [
            "idea",
            "research",
            "beats",
            "manuscript",
            "screenplay",
            "revision",
            "output"
          ]
        },
        "draft": {
          "$ref": "#/$defs/uuid"
        },
        "frame": {
          "type": "string",
          "description": "Legacy (read once, never written since the person/device split)"
        },
        "sidebar": {
          "$ref": "#/$defs/columnWidth",
          "description": "Legacy (read once, never written since the person/device split)"
        },
        "info": {
          "$ref": "#/$defs/columnWidth",
          "description": "Legacy (read once, never written since the person/device split)"
        },
        "columns": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/sideColumns"
          },
          "description": "Legacy (read once, never written since the person/device split)"
        },
        "ribbonPinned": {
          "type": "boolean",
          "description": "Legacy (read once, never written since the person/device split)"
        },
        "ribbonTab": {
          "type": "string",
          "description": "Legacy (read once, never written since the person/device split)"
        },
        "presentation": {
          "type": "string",
          "enum": [
            "draft",
            "pages"
          ],
          "description": "Legacy (read once, never written since the person/device split)"
        },
        "zoom": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "fit",
                "pageWidth",
                "wholePage"
              ]
            },
            {
              "type": "number",
              "exclusiveMinimum": 0
            }
          ],
          "description": "Legacy (read once, never written since the person/device split)"
        },
        "spread": {
          "type": "boolean",
          "description": "Legacy (read once, never written since the person/device split)"
        },
        "lineWidth": {
          "type": "string",
          "enum": [
            "narrow",
            "medium",
            "wide"
          ],
          "description": "Legacy (read once, never written since the person/device split)"
        },
        "sceneStrip": {
          "type": "boolean",
          "description": "Legacy (read once, never written since the person/device split)"
        },
        "inspector": {
          "type": "boolean",
          "description": "Legacy (read once, never written since the person/device split)"
        },
        "inspectorTab": {
          "type": "string",
          "description": "Legacy (read once, never written since the person/device split)"
        }
      }
    },
    "goetheLogEntry": {
      "type": "object",
      "description": "What the assistant Goethe changed (never the text)",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "date": {
          "$ref": "#/$defs/date"
        },
        "model": {
          "type": "string"
        },
        "action": {
          "type": "string"
        },
        "context": {
          "type": "string"
        },
        "result": {
          "type": "string"
        },
        "texts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "node": {
                "$ref": "#/$defs/uuid"
              },
              "before": {
                "type": "string",
                "description": "SHA-256, lower-case hex"
              },
              "after": {
                "type": "string",
                "description": "SHA-256, lower-case hex"
              }
            },
            "required": [
              "node",
              "before",
              "after"
            ]
          }
        }
      },
      "required": [
        "id",
        "date",
        "model",
        "action",
        "context",
        "result",
        "texts"
      ]
    },
    "manuscriptGoal": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "integer",
          "description": "0: no goal"
        },
        "unit": {
          "type": "string",
          "enum": [
            "words",
            "characters"
          ]
        },
        "bound": {
          "type": "string",
          "enum": [
            "atLeast",
            "atMost"
          ]
        },
        "withNotes": {
          "type": "boolean"
        }
      }
    }
  }
}
