Skip to content

refactor: paper keeps one stored document format (#1954) - #1960

Merged
quanvu309 merged 136 commits into
mainfrom
refactor/1954-one-stored-paper-format
Nov 25, 2026
Merged

quanvu309 merged 136 commits into
mainfrom
refactor/1954-one-stored-paper-format

Conversation

@quanvu309

Copy link
Copy Markdown
Collaborator

Closes #1954

Part C of #1954 (one stored Paper format). Part A was #1955 (PR 1956) and Part B was #1957 (PR 1958); both are merged.

Summary

After Part B every stored Paper is a rich document. This part deletes the code that only served the old formats:

  • Paper CRDT package: the old prose client (openPaperClient, the prose adapter) is gone. So are editor-write, inspect, native CV, native formatting import/letter/mount/transaction, presentation codec/inline/reverse and revert. PaperClient now defaults to the rich document, and the stored-document module accepts only the rich document.
  • Domain: storedPaperDocumentSchema is now the rich document schema. Block-document modules used only by the deleted code are deleted (cv-field-edits, cv-projection, merge, safety, undo, upgrade), and exports nothing imports any more are un-exported.
  • API: admitDocument no longer has an old-format branch, because its input type is rich-only.
  • Guards: the property-seed guard watched interleave.test.ts, which is deleted, so it now requires the live fast-check test (mapping.test.ts). Its ledger row proves quiet on the fixed version of the deleted file at the commit that fixed it.

Evidence

  • npx tsc --noEmit in apps/api, apps/web, packages/domain and packages/paper-crdt after merging main: 0 errors each.
  • pnpm test in packages/domain: 192 passed, 0 failed. npx vitest run in packages/paper-crdt: 23 files, 230 passed.
  • node --test scripts/*.test.mjs packages/guards/*.test.mjs on this branch after merging main (with Part B): 1050 passed, 0 failed.
  • The full API and web suites passed on this branch's complete state before the split (API 1421 passed; web 2599 passed, with 3 load-only flakes that pass alone).
  • Branch judge (branchVerdict against origin/main): 0 refusals after the retirements below.

Merge Danger

Door: two-way. Only code is deleted; no data or migration.

Blast Radius: the Paper CRDT package and the domain's Paper document modules. The API and web no longer import any deleted name; typecheck of every package proves it.

Retired checks: scripts/retired/1954.json records 31 test files. They tested the deleted prose client, its sync and merge, native formatting, and the block document code. The rich client and rich stored document keep their tests.

Closes #1954

Retired 287 checks without self-serve replacement proof: packages/domain/src/paper-blank-edits.test.ts (no replacement test); packages/domain/src/paper-cv-fields.test.ts (no replacement test); packages/domain/src/paper-cv-projection.test.ts (no replacement test); packages/domain/src/paper-doc-edits.test.ts (no replacement test); packages/domain/src/paper-doc-merge.property.test.ts (no replacement test); packages/domain/src/paper-doc-merge.test.ts (no replacement test); packages/domain/src/paper-doc-rebase-header.test.ts (no replacement test); packages/domain/src/paper-doc-repair.property.test.ts (no replacement test); packages/domain/src/paper-doc-rich-text.test.ts (no replacement test); packages/domain/src/paper-doc-safety.test.ts (no replacement test); packages/domain/src/paper-doc.test.ts (no replacement test); packages/domain/src/paper-doc-upgrade.test.ts (no replacement test); packages/domain/src/paper-doc-words.test.ts (no replacement test); packages/domain/src/paper-native.test.ts (no replacement test); packages/domain/src/paper-native-text.test.ts (no replacement test); packages/paper-crdt/src/client-fallback.test.ts (no replacement test); packages/paper-crdt/src/client-header.test.ts (no replacement test); packages/paper-crdt/src/client.test.ts (no replacement test); packages/paper-crdt/src/crdt.test.ts (no replacement test); packages/paper-crdt/src/interleave.test.ts (no replacement test); packages/paper-crdt/src/merge.test.ts (no replacement test); packages/paper-crdt/src/moved.test.ts (no replacement test); packages/paper-crdt/src/native-cv.test.ts (no replacement test); packages/paper-crdt/src/native-formatting-engine.test.ts (no replacement test); packages/paper-crdt/src/native-formatting-mount.test.ts (no replacement test); packages/paper-crdt/src/native.test.ts (no replacement test); packages/paper-crdt/src/presentation-codec.test.ts (no replacement test); packages/paper-crdt/src/probes.test.ts (no replacement test); packages/paper-crdt/src/rich-client.test.ts (no replacement test); packages/paper-crdt/src/stored-document.test.ts (no replacement test); scripts/guard-ledger/property-seed.json (no replacement test)

@quanvu309
quanvu309 enabled auto-merge (squash) November 25, 2026 16:35
@quanvu309
quanvu309 merged commit e89efa5 into main Nov 25, 2026
20 checks passed
@quanvu309
quanvu309 deleted the refactor/1954-one-stored-paper-format branch November 25, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: Paper keeps one stored document format

1 participant