LUKE-342: review by voice, write the handoff prompt, and copy the document

Merged
CH
25d ago
+510-20

Linear: LUKE-342

What changes

Final review and handoff (model behavior). PLANNING_INSTRUCTIONS (apps/web/server/hosted/brain-host/planning.ts) gains two sections:

  • The final review: when the developer says the plan is done, the model goes through every assumption still confirmed: false, the open questions, contradictions between sections, and the coding choices it would leave to the agent, one at a time, and saves as the review moves. The developer may leave an assumption unconfirmed; it stays false and the prompt states it as a working assumption. There is no approval state, and the model decides when the plan is ready.
  • The handoff prompt: once the developer asks for it, the model writes it with update_plan into the same body under ## Handoff prompt, keeping the plan above it and sending the assumption list as it stands. The prompt has to make sense on its own and carries the objective, scope and out of scope, repository context (owner/name, branch, full commit, repo-relative paths), behavior, exceptions, acceptance examples, unconfirmed working assumptions, and the implementation freedom agreed on, with no secrets. Changes asked for after that are ordinary editing, and the model revises the plan and the prompt together.

The Live planning scene (packages/live/src/instructions.ts) gets one delegation line so that "the plan is done" and "write the prompt" go to the planning model.

Copy. The planning window's header gains Copy (planning-parts.tsx, planning-surface.tsx). It is always enabled and reads no flag. planMarkdown (apps/desktop/src/shared/plan-markdown.ts) produces the saved body followed by ## Assumptions with - [x] / - [ ] items. A line break inside an assumption becomes a space so the item stays one list item. The text goes through the existing WINDOW_COPY_TEXT act and clipboard row. That act's payload limit used to be 100k characters, which a full plan can exceed, so it is now PLAN_MARKDOWN_MAX_CHARS, worked out from PLAN_BOUNDS. It also accepts an empty string, so an empty plan still copies. After a successful copy the button shows the check mark until a save changes the document. If the clipboard refuses, a message saying so appears beside the button (role="alert"). No timer is involved.

Not included: an Approve button, readiness gate, approval state, versions, snapshots, a separate handoff generator or export record, or agent launch.

Tests

  • apps/web/tests/hosted-planning.test.ts: a spoken turn asks the scripted model for the prompt. The prompt lands in the same document after the saved body and names the repository and commit, and the assumption list comes back unchanged, including an unconfirmed one. A later turn keeps editing that same document. The scripted fixture model (apps/web/eve/scripted-model.ts) gains the matching handoff path.
  • apps/desktop/src/shared/plan-markdown.test.ts: the formatter's output in full, including a document with nothing confirmed, an empty body, no assumptions, and an assumption spanning lines. It also checks that the longest document the store can hold, and an empty one, both pass the copy act's own payload parse.
  • planning-model.test.ts: Copy hands the clipboard the whole document. A refused clipboard shows the failure, and the check mark clears after the document changes.
  • planning-parts.test.ts: Copy is enabled whatever the flags say, the copied and failed states render, and Copy is the only button in the document.

Mac verification

CI could not check this UI change, and this Linux VM cannot run ./scripts/verify.sh. verify.sh evidence needs a real Mac and is collected under LUKE-346. ./scripts/check.sh exits 0 here.

šŸ¤– Generated with Claude Code


Open workspace in Conductor