7.9 KiB
Selective book recovery contract — implementation decisions
Book capacity counts every owned book, active or archived, even in archived projects. Downloads never delete data or release capacity. Existing Delete Forever is explicit and separate; deletion releases the slot only on commit.
Author package: PlotDirector.BookBackup, version 2.0, .plotdirector, UTF-8 JSON. It wraps the proven project graph plus book selection, typed portable source identities and an integrity SHA256. Project snapshot format1.4 adds recovery-critical native review/Intent state. Existing1.0–1.3 readers remain supported with explicit completeness warnings. Current-format missing categories are errors, not inferred empty data.
All common project entity definitions (characters, locations, maps/floors, relationships, plots, assets and project settings) are retained deterministically. Book-owned content/history is filtered by the existing typed graph. Required cross-book canonical dependencies fail selection with a request to include the connected books. Nullable references from common definitions to excluded books/scenes are recorded as external source references and detached in the selected graph, with a visible warning and persisted external-reference history. They never become coincidentally matching destination database IDs. Unrelated book prose, attachments, goals and scene history are not exported.
Restore creates new books in a new or owner-authorised existing project. Existing project content is captured, validated and merged under the same serializable operation; the proven apply/file-stage engine is reused. Preview is bound to immutable uploaded content, selection, destination and destination snapshot. Stale destination previews require review again. No existing shared data is overwritten.
Portable keys are namespaced by a durable source-project GUID and typed entity identity. Destination mappings are scoped to the authorised target project; matching names/numbers alone never permit reuse. Stored-field compatibility and dependency remapping are checked; conflicts create independent copies. A restore operation has a durable author-scoped receipt and content/destination fingerprint for duplicate-safe retries.
Native review decisions and saved Intent evidence/decisions are portable. Encrypted review captures are decrypted only by the source server and reprotected on the destination; ciphertext, credentials, grants and live sessions are not portable. Imported review captures are historical/unbound. Native operation receipts and live cursor mappings are not replayed; stale receipts are invalidated/checked against canonical records. Intent evidence whose source identity/hash changes remains labelled historical/stale, with author decisions preserved.
Saved restore points remain a distinct same-project rewind, owner-authorised and safety-backed. Older points that omit populated recovery-critical state must fail closed. Archive/Unarchive remains visibility only. No backup workflow automatically deletes or claims a browser download proves safe local storage.
Implementation and qualification evidence will be recorded in the delivery report. Conservative refusals are explicit limitations, never successful partial backups.
Bounded compatibility and inclusion details
Files are currently bounded to 64 MiB serialized JSON (including embedded bytes); an oversized export refuses without emitting an incomplete file. Uploads are author-bound, immutable, memory-bounded and expire after 30 minutes. A newer upload invalidates that author's previous upload; confirmations expire after 20 minutes. Restarting the application requires re-uploading. Retrying the same valid confirmation is receipt-safe; a new upload of a book already present in the same destination refuses instead of duplicating it. A deliberately independent new project can receive another copy if capacity permits.
Book-specific author plot seeds follow their owning book; project-wide seeds remain included. Timeline view presets are book/filter-specific: only presets valid for the selected book/scene graph are included. Project-wide illustration definitions travel as common data; conflicting internal demand keys receive a new recovery key without replacing existing content. Global metric/relationship vocabulary is resolved through the existing import lookup contract. Existing destination singleton timeline settings win. Maps are independent copies; identical image blobs can be reused within the authorised destination, with exact byte/type/dimension checks.
Optional detached references can reconnect when the destination already contains a matching, unchanged, mapped source entity. Otherwise their typed source reference stays as disconnected history. Required cross-book references require their connected book first or the combined selection; no guessed reference is inserted. Previously imported shared definitions reuse only when both exported and current destination fingerprints and all remapped stored dependencies agree. Existing entities without a proven mapping are independent copies, even if their names match. This conservative policy can create duplicates when restoring to the original project; it never guesses ownership from an exported number.
All restores are additive. There is no replace-existing-book option. New recovery tables retain operation/mapping provenance; mappings are never considered authority without a current project-owner check and existence/content checks. Portable Intent evidence keeps original input-hash provenance but receives an invalidated destination input hash, so it cannot masquerade as fresh analysis. Native review captures get new review/manuscript identities on cross-project import and no live session. Native operation/review-import receipts are excluded from packages; same-project replacement checks/removes receipts whose canonical chapters/build/scene counts no longer exist.
Imported active web files (HTML, SVG, XML, JavaScript and CSS) keep their bytes but receive a .bin storage suffix, preventing a backup from publishing executable same-origin web content. Original attachment metadata remains available; these files may need explicit local recovery to use their original format. Other supported uploaded files retain normal extensions.
Source compatibility fingerprints normalise primary/foreign identities to typed portable keys, project ownership to its destination scope, and uploaded paths to content checksums. This allows a restored/re-exported book to reuse unchanged common entities despite different local IDs and generated filenames. Destination fingerprints separately retain actual stored references and file checksums to detect intervening edits. Names never establish portable identity. Multiple source authors' Intent assessments remain distinct historical records after ownership transfer; actor provenance is retained without granting those source users destination access.
Appending to an existing project uses a server-only protected append mode: existing Native review ciphertext/session binding and existing Intent records are left intact; only newly created books receive the portable historical state. The SQL guard forbids removal of old books in append mode. Package uploads cannot select this mode directly. Replacement/rewind retains the separate full-state safety policy.
Independent copies that share original provenance receive distinct deterministic source namespaces when exported, with fork aliases retained in the existing authorised mapping table. Identity assignment considers the full source project before selecting books, so choosing a different book subset does not collapse independent common entities back together. Required, non-detachable cross-book dependencies refuse export rather than producing a standalone file that cannot reconstruct the selection. Named global vocabularies must resolve in the destination; no new book restore falls back to an unverified exported lookup number. Historical files lacking those names may require assisted recovery.