refactor(web): the service keeps every plan as its text alone, and the fixed template's fields path is gone (plan as one document 10/12)
PR 10 of the plan as one document rollout: the first half of the contract step, server only.
Every plan and revision in production is one document now. Dean ran the backfill: the first pass carried over 34 plans and 32 revisions; the second carried nothing. So the service stops reading and writing the fixed template's fields. The columns themselves go in PR 11, once this is live.
What changes
- Store: a plan is its text (
plan.document, now decoded as non-null) plus its sections' writers.- Nothing reads or writes
body,assumptions,fields, orfield_writersany more. savePlanDocumentand the rename's body retitling are gone.savedmeans the last save moved past the plan's start.
- Nothing reads or writes
- Write path (
plan-notes.ts): one text-only locked save.- A field-shaped edit is refused with
FIELD_EDIT(400). Only a desktop with the old field editor could send one, and no plan answersfieldsany more. - Notes keep their field shape for now: a note's
fieldnames the heading it lands under. That's how coding agents started before PR 9, and journal rows already stored, keep reading. PR 9 switches the models to heading notes and keeps accepting this shape.
- A field-shaped edit is refused with
- Revisions: a revision is its text. Inserts write the text and leave the assumptions column empty until PR 11 drops it.
- The notetaker, the planning model's context, and the voice seed read the text and sections only.
- Backfill deleted: the endpoint, app, route, and script are gone; it has run.
- The wire's
fields/fieldEditskeys stay inpackages/hosteduntil the desktop's field editor is removed (PR 12, in flight). Only server-only legacy helpers are deleted here.
Expand/contract safety
- The release live while this deploys (PR 8 and later) already creates and reads documents only.
- No row is fields-only (the backfill reported zero).
- Nothing written here is unreadable to that release: revisions keep
fieldsnull andassumptions[].
Tests
apps/web tests now describe the document world:
- notes landing in sections
- missed notes, the bound, list order, accounts kept apart
- a rename leaving the text alone
- pin, archive, delete
- revisions and restores counting sections
- the notetaker handed the text
edit_planon text- the Start snapshot
- the voice seed
Tests of removed behaviour are deleted: template formatting and order, "Unanswered", field containment, optional fields, field edits, rename retitling, the backfill, and 0082's migration test (it read the fields columns through the store).
./scripts/check.sh passes locally. There is no Mac UI change.
š¤ Generated with Claude Code