Skip to content

feat(doop): carry the author ledger through copies, moves and restores [squash] - #175

Open
congvc-bot-x99[bot] wants to merge 2 commits into
mainfrom
agent/x99-claude-sonnet-200k/che-7083-4c1c750a0908
Open

congvc-bot-x99[bot] wants to merge 2 commits into
mainfrom
agent/x99-claude-sonnet-200k/che-7083-4c1c750a0908

Conversation

@congvc-bot-x99

@congvc-bot-x99 congvc-bot-x99 Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Closes nothing yet (draft). Implements CHE-7083, slice S4 of CHE-7064.

What

  • createFrame takes a required origin (new or copy of source pages). Every caller declares it; the REST route accepts an optional copiedFrom list and builds a copy origin from it.
  • duplicatePage, duplicateCanvas and createFrame with origin copy copy the source pages' page_authors rows into the destination (source copy, sourcePageId set) and add the copier.
  • A page move copies the source page rows into the destination, then records the mover on both pages.
  • Restore paths add the restorer and keep earlier rows.
  • Client: paste, duplicate and drawing-move send copiedFrom.
  • A copy of a legacy page inherits unknown.

Out of scope, untouched: G5 lock/pin, design_card_guard, C00 config/build/deploy. doop main does not deploy to C00.

Tests (red, then green)

Command: bunx vitest run tests/pageAuthorsInherit.test.ts tests/createFrameOrigins.test.ts tests/pageAuthorsCopyRest.test.ts

Red, before the implementation (real assertion failures, not compile errors):

 × duplicatePage: the copy holds every source row as a copy, plus the copier
 × duplicatePage: a copy of a legacy page inherits unknown
 × duplicateCanvas: each destination page gets the rows of its source page, plus the copier
 × createFrame with origin copy: the frame page inherits the rows of the source pages
 × copies the source page rows into the destination, and the writer lands on both pages
 Tests  5 failed | 4 passed (9)

(AssertionError: expected [] to deeply equal [ { kind: 'agent', ... }, ... ])

Green, after:

 tests/pageAuthorsInherit.test.ts  Tests  9 passed (9)
 tests/createFrameOrigins.test.ts  Tests 11 passed (11)   (caller -> origin table)
 tests/pageAuthorsCopyRest.test.ts Tests  1 passed (1)    (REST copiedFrom, restart-durable, bad/unreadable source refused)

pageAuthorsCopyRest was also confirmed red with the route reverted to always-new (expected 400, got 200).

Existing tests updated for the new contract: pageAuthors.test.ts (move destination now also holds the source rows), webpageImport.test.ts (passes the origin), pageIssueStore.test.ts (persist mock gains inheritedAuthors).

Checks run locally

  • bun run typecheck PASS, bun run lint PASS, bun run format:check PASS.
  • Full vitest in 3 shards: all non-browser tests pass. The puppeteer *Browser.test.ts files time out on navigation (5-30s) on this host. They fail the same way on a clean main worktree at 9eec359, and prototypeBrowser passes on this branch when run alone. claudeExtension is flaky on timeouts (passes alone on both). CI is the authority for those.

Risk

  • Source rows are read from an in-memory mirror of the ledger (the store is synchronous), loaded at boot by the backfill and updated on every append and copy commit.
  • A client that omits copiedFrom is treated as new, so a paste from an older client inherits nothing.

Review fix (head a4c4dba1)

Review finding: a legacy frame has no pageId, so paste and duplicate sent no copiedFrom and the copy lost the source page's rows. The client now resolves the page with framePageId (paste, duplicate, drawing move) and the Alt-drag duplicate in FrameView also declares its source.

Test command: bunx vitest run tests/frameClipboard.test.ts tests/drawingMove.test.ts tests/elementClipboard.test.ts tests/createFrameOrigins.test.ts

Red, before the fix (the explicit-pageId case passes):

 × paste sends the first page for a legacy frame with no pageId
 × duplicate sends the first page for a legacy frame with no pageId
 AssertionError: expected undefined to deeply equal [ { canvasId: 'c1', pageId: 'c1:page1' } ]
 Tests  2 failed | 8 passed (10)

Green, after:

 Test Files  4 passed (4)
 Tests  53 passed (53)

typecheck and lint pass.

congvc-bot[bot] added 2 commits November 27, 2026 12:14
CHE-7083, S4 of CHE-7064. createFrame takes a required origin.

Copies, page moves and restores carry the page_authors rows.
CHE-7083 review fix: paste, duplicate, Alt-drag and drawing move

resolve the first page for a frame with no pageId.
@congvc-bot-x99
congvc-bot-x99 Bot marked this pull request as ready for review November 27, 2026 06:40

This branch has not been deployed

No deployments
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.

0 participants