refactor(hosted): the plan wire carries the document alone, with the fixed template's fields and their edit forms gone (plan as one document cleanup)

Merged
DA
7d ago
+147-2167

Cleanup after the plan as one document rollout. The wire carries the document alone; the fixed template's fields and their edit forms are gone.

What's dropped

  • Wire (plan-wire.ts, live-contract.ts): planFieldsSchema, PlanFields, planFieldEditSchema, PLAN_FIELD_BOUNDS, and the optional fields/fieldEdits keys on the plan and on the plan.draft frame. Nothing sends them since PR 10; nothing reads them since PR 12.
  • Edit (plan-edit.ts): planEditRequestSchema is the document form alone, { document: { base, value } }, and a conflict answers the text. applyDeveloperEdit, the field lenses, and PlanFieldEditRequest are deleted. A field-shaped edit is refused at decode (400, same as before), and the server's FIELD_EDIT refusal goes too.
  • Copy (plan-markdown.ts): planMarkdown is the plan's name as a title over its text. PLAN_MARKDOWN_MAX_CHARS is that title plus the longest text.
  • Template (plan-template.ts): the fields formatter is gone (planBody, planDocumentOf, PlanContent, the empty fields, PLAN_EMPTY_TEXT, the text-field helpers).

What stays, and why

  • PLAN_FIELD (the default sections' keys) and PLAN_HEADING / PLAN_FIELD_HEADING / PLAN_FIELD_PURPOSE / PLAN_FIELD_BAR: the default template's guidance and the prompts use them, and so does the older-agent note reader (its TODO is for after 2026-10-14 00:00Z). I didn't rename them to template/section vocabulary; the keys run through the prompts, their test, and that reader, which is not a trivial rename.
  • planDocumentSchema.assumptions (always []): a desktop through v0.11.0 requires the key.

Tests and goldens

  • Tests of the removed behaviour are deleted (field edits and their merge, the fields-to-document render, Copy's assumptions list). The document merge, Copy, and the client's edit tests use the document form.
  • Goldens re-recorded with LUKE_UPDATE_FIXTURES=1: the plan, plan answer, draft frame, and edit request/answer/value lose the field shapes; planFieldsSchema and planFieldEditSchema goldens are deleted.

./scripts/check.sh passes locally. The desktop only changes two type imports; CI cannot verify the Mac UI and verify.sh was not run (LUKE-159).

šŸ¤– Generated with Claude Code


Devin Review