Skip to content

Copy QA: which Discard closes a draft - #1740

Merged
haowjy merged 1 commit into
feat/document-commands-never-refusefrom
fix/copy-closed-draft
Nov 17, 2026
Merged

haowjy merged 1 commit into
feat/document-commands-never-refusefrom
fix/copy-closed-draft

Conversation

@haowjy

@haowjy haowjy commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Changelog

None. Documentation only: a QA recipe is corrected; no code behavior changed.

Why

The never-refuse design says a draft that closed is copied from the closed draft, and a draft view whose draft never existed copies the live text. A browser run (prober-1555) reported that after a strip Discard, ./mf doc copy ... --draft-work w1 gave the live text, not the closed draft's.

Finding: no code defect, and #1721 does not conflict with the decision. #1721 only deleted the no_draft refusal, so a Work with no draft copies live; it did not touch the closed-draft read (readWorkDraft in effective-document-reader.ts still prefers the open draft, then the latest closed one). The browser's Discard on a live chat sends ends: "tree": the app reverts the text in the room and the draft stays open, now equal to live (document_drafts.status stayed active, GET .../draft was 404). The writer's Draft view shows the live text, so Copy gives it. That is the decision, not a break of it.

The QA doc's step 3 said "Discard all" without saying which Discard closes the draft, so it read as if the browser strip did.

Examples

Copy after a Discard

  1. Setup: this branch, MODEL_PROVIDER=mock LIVE_TEST_MODEL= pnpm dev; Work w1, a draft-mode chat, manuscript://CopySource = A still lake., mock write replace to A stormy lake..
  2. Open draft: ./mf doc copy manuscript://CopySource --to kb://A --draft-work w1 gives A stormy lake..
  3. POST /api/projects/<id>/branches/<branch>/discard {"commandId":…,"all":true} closes the draft (status closed). Same copy gives A stormy lake. (closed draft), also for a folder: a drafted document gives the closed text, an undrafted one gives live.
  4. A Work that never drafted the document (manuscript://Plain) copies Plain live..
  5. Browser strip Discard on the live chat: draft stays open and equals live; Copy gives A quiet pond. (live), matching what Draft view shows.

Benchmarks

None. Documentation only.

Design decisions

None. Follows never-refuse/design.md section 5 and pr-b-plan.md as written.

Changes

  • apps/server/server/domains/context/.context/qa/copy-server.md step 3: names the Discard that closes a draft, and says the browser strip's Discard on a live chat leaves it open and equal to live.

Compatibility and risk

None. No code changed.

Verification

  • Browser: none beyond the strip Discard step; the change is a QA document, and the browser run in step 5 of Examples is the check. Real server (mock model), steps above: open draft, closed draft (single document and folder), never-drafted document, and a browser strip Discard, each as listed.
  • pnpm check green on the commit.

Deferred

None.

References

@haowjy
haowjy marked this pull request as ready for review November 17, 2026 02:50
@haowjy
haowjy merged commit 171d8d7 into feat/document-commands-never-refuse Nov 17, 2026
21 checks passed
@haowjy
haowjy deleted the fix/copy-closed-draft branch November 17, 2026 03:16
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.

1 participant