oficina / equipo Public

Merge branch 'duplicate-keep-decided' into main

Merge duplicate-keep-decided: a person's decision outranks age

When two duplicate tasks are combined, a task whose merge card a
person answered is kept over an undecided one at the same stage; a
carded loser is only linked. Staging's swipe-back pair is a fixture.
Hosted CI passed on 7383ae1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 093607453aad0b070fa83130c84ca5df4f6bb041 parent b87bdecparent 7383ae1
8 files changed, +168 −7
  • .rastrillo/budgets.txt +3 −3
  • internal/equipo/chat/duplicates.go +2 −1
  • internal/equipo/chat/housekeeping.go +15 −1
  • internal/equipo/housekeeping/duplicates.go +11 −2
  • internal/equipo/housekeeping/housekeeping_test.go +28 −0
  • internal/equipo/housekeeping/testdata/duplicate_possible.json +10 −0
  • internal/equipo/housekeeping/testdata/duplicate_same_creator.json +37 −0
  • internal/thintest/duplicates_contract_test.go +62 −0

CI passed — run details

diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index f6d8de3e..7e51dfbf 100644
--- a/.rastrillo/budgets.txt
+++ b/.rastrillo/budgets.txt
@@ -49,7 +49,7 @@ perf GET /api/v1/notebook skip Thin v1 person API: bearer-only JSON for devices;
perf GET /api/v1/thinking skip Thin v1 person API: bearer-only JSON for devices; the browser reads thinking words on /settings/thinking.
perf GET /api/v1/tasks skip Thin v1 person API: bearer-only JSON for devices; the browser reads tasks through /tasks.
perf GET /api/v1/tasks/{id} skip Thin v1 person API: bearer-only JSON for devices; the browser reads a task through /tasks/{id}.
-size internal/equipo/chat 14160 - Release slice 1 (hosted checks) adds the hosted CI offer, the binding's acceptance inside the step report's transaction, the hosted sandbox rule and the fix round's failing units (about 65 lines); measured 14160. Turn batching adds turnText, the frame fit (fitTail, batchFull) and the stranded-turn recovery in sync (about 115 lines); measured 14095. The re-run ruling (recheckMayMerge, refreshAfterRecheck, about 70 lines); measured 13981. Merge authority thin v1 adds the gate's store side (mergeauth.go: authorizeMerge before dispatch and at each hub request, the fence for runners below the merge-facts protocol, the ask card in Equipo's words, the ships question, receipts with Undo, the policy tool and API, about 1000 lines); the gate is pure, in internal/equipo/mergegate, but its inputs and audit must be read and written inside the store's transactions. Measured 13204. Mac recheck runs a waiting task's needs_macos checks again when a Mac that fits arrives (macrecheck.go, about 90 lines); measured 12485. Spend 1 merged onto Projects UX: measured 12376 with both. Spend 1 adds a task's spend from its usage rows (TaskSpend, about 60 lines) and the usage rows' round; measured 12047. Projects UX adds per-person project stars with the auto-star reconciliation, the person's and the coordinator's star_project (stars.go, about 210 lines) and the project's own repository in its view; measured 12206. Claude's sign-in by a link adds the code route beside the token's in SendSecret, the sign-in prompt and the kind it becomes (about 40 lines); measured 11933. Mac runners slices A and B add per-runner mailboxes, placement, withdrawal, the offline rule, the runners view, transfers and publication (runners.go, transfers.go, about 1100 lines). Composer attachments add uploads, the message link, the mailbox relay with chunk frames hydrated from the stored file, and serving (attachments.go, attachments_http.go, about 330 lines); the link and relay run inside the send and dispatch transactions, so they live beside them; sniffing and stripping are pure, in internal/attach. Measured 10292. Merged with UX1 thinking words (f2602d3), measured 9801. Housekeeping slice 1 adds the loop's ledger and state machine, the housekeeping principal's checks inside the shared store functions, reservations, Pause, quiet hours, the digest, claim recovery and the API (housekeeping.go, housekeeping_control.go, housekeeping_http.go, about 1,350 lines); the checks must run inside the store's transactions, so they live beside them; the detectors themselves are pure, in internal/equipo/housekeeping. Measured 9637. Thin v1 UX1 thinking words adds the per-person set and its API (thinking.go, about 100 lines); measured 8305. Connections slice 1 review round 2: the mutation ledger matches record_task by subject only and refuses an ambiguous call with the earlier operations, the preference and forget (about 120 lines); measured 8236. Thin v1 UX1 round 3 adds Equipo combining duplicate tasks reversibly (duplicates.go: detection, the in-transaction fold checks, fold, Undo, about 400 lines) and headlines on findings and steps (headline.go); measured 7898. Connections slice 1 adds connection records from hello and attempts, the connect mailbox, the API, usage rows and the turn's mutation ledger (connections.go and tools.go, about 600 lines); measured 7400 after merging UX1. Thin v1 UX1 adds step activity lines, duplicates and their fold, the coordinator at work on a task, project facts from the runner catalog and open merge cards for the pages (inner.go, about 330 lines); measured 6610 with slice 4c's review fixes. Thin v1 slice 4c adds the merge policy, the merge card, the rebase round and duplicate reports (merge.go, about 380 lines). Thin v1 instance core: conversation, projects, tasks, review and, from slice 4b, questions to the specialists (questions.go, about 470 lines) share one store, transaction and event log; splitting would export the transaction internals. Measured 5514 source lines; revisit at the slice 7 sweep.
+size internal/equipo/chat 14175 - The duplicate keep rule merged onto main: measured 14175. The duplicate combine keeps the decided task: the housekeeping view reads each task's newest merge card and marks it Decided (about 12 lines); measured 14110. Turn batching adds turnText, the frame fit (fitTail, batchFull) and the stranded-turn recovery in sync (about 115 lines); measured 14095. The re-run ruling (recheckMayMerge, refreshAfterRecheck, about 70 lines); measured 13981. Merge authority thin v1 adds the gate's store side (mergeauth.go: authorizeMerge before dispatch and at each hub request, the fence for runners below the merge-facts protocol, the ask card in Equipo's words, the ships question, receipts with Undo, the policy tool and API, about 1000 lines); the gate is pure, in internal/equipo/mergegate, but its inputs and audit must be read and written inside the store's transactions. Measured 13204. Mac recheck runs a waiting task's needs_macos checks again when a Mac that fits arrives (macrecheck.go, about 90 lines); measured 12485. Spend 1 merged onto Projects UX: measured 12376 with both. Spend 1 adds a task's spend from its usage rows (TaskSpend, about 60 lines) and the usage rows' round; measured 12047. Projects UX adds per-person project stars with the auto-star reconciliation, the person's and the coordinator's star_project (stars.go, about 210 lines) and the project's own repository in its view; measured 12206. Claude's sign-in by a link adds the code route beside the token's in SendSecret, the sign-in prompt and the kind it becomes (about 40 lines); measured 11933. Mac runners slices A and B add per-runner mailboxes, placement, withdrawal, the offline rule, the runners view, transfers and publication (runners.go, transfers.go, about 1100 lines). Composer attachments add uploads, the message link, the mailbox relay with chunk frames hydrated from the stored file, and serving (attachments.go, attachments_http.go, about 330 lines); the link and relay run inside the send and dispatch transactions, so they live beside them; sniffing and stripping are pure, in internal/attach. Measured 10292. Merged with UX1 thinking words (f2602d3), measured 9801. Housekeeping slice 1 adds the loop's ledger and state machine, the housekeeping principal's checks inside the shared store functions, reservations, Pause, quiet hours, the digest, claim recovery and the API (housekeeping.go, housekeeping_control.go, housekeeping_http.go, about 1,350 lines); the checks must run inside the store's transactions, so they live beside them; the detectors themselves are pure, in internal/equipo/housekeeping. Measured 9637. Thin v1 UX1 thinking words adds the per-person set and its API (thinking.go, about 100 lines); measured 8305. Connections slice 1 review round 2: the mutation ledger matches record_task by subject only and refuses an ambiguous call with the earlier operations, the preference and forget (about 120 lines); measured 8236. Thin v1 UX1 round 3 adds Equipo combining duplicate tasks reversibly (duplicates.go: detection, the in-transaction fold checks, fold, Undo, about 400 lines) and headlines on findings and steps (headline.go); measured 7898. Connections slice 1 adds connection records from hello and attempts, the connect mailbox, the API, usage rows and the turn's mutation ledger (connections.go and tools.go, about 600 lines); measured 7400 after merging UX1. Thin v1 UX1 adds step activity lines, duplicates and their fold, the coordinator at work on a task, project facts from the runner catalog and open merge cards for the pages (inner.go, about 330 lines); measured 6610 with slice 4c's review fixes. Thin v1 slice 4c adds the merge policy, the merge card, the rebase round and duplicate reports (merge.go, about 380 lines). Thin v1 instance core: conversation, projects, tasks, review and, from slice 4b, questions to the specialists (questions.go, about 470 lines) share one store, transaction and event log; splitting would export the transaction internals. Measured 5514 source lines; revisit at the slice 7 sweep. Release slice 1 (hosted checks) adds the hosted CI offer, the binding's acceptance inside the step report's transaction, the hosted sandbox rule and the fix round's failing units (about 65 lines); measured 14160. Turn batching adds turnText, the frame fit (fitTail, batchFull) and the stranded-turn recovery in sync (about 115 lines); measured 14095. The re-run ruling (recheckMayMerge, refreshAfterRecheck, about 70 lines); measured 13981. Merge authority thin v1 adds the gate's store side (mergeauth.go: authorizeMerge before dispatch and at each hub request, the fence for runners below the merge-facts protocol, the ask card in Equipo's words, the ships question, receipts with Undo, the policy tool and API, about 1000 lines); the gate is pure, in internal/equipo/mergegate, but its inputs and audit must be read and written inside the store's transactions. Measured 13204. Mac recheck runs a waiting task's needs_macos checks again when a Mac that fits arrives (macrecheck.go, about 90 lines); measured 12485. Spend 1 merged onto Projects UX: measured 12376 with both. Spend 1 adds a task's spend from its usage rows (TaskSpend, about 60 lines) and the usage rows' round; measured 12047. Projects UX adds per-person project stars with the auto-star reconciliation, the person's and the coordinator's star_project (stars.go, about 210 lines) and the project's own repository in its view; measured 12206. Claude's sign-in by a link adds the code route beside the token's in SendSecret, the sign-in prompt and the kind it becomes (about 40 lines); measured 11933. Mac runners slices A and B add per-runner mailboxes, placement, withdrawal, the offline rule, the runners view, transfers and publication (runners.go, transfers.go, about 1100 lines). Composer attachments add uploads, the message link, the mailbox relay with chunk frames hydrated from the stored file, and serving (attachments.go, attachments_http.go, about 330 lines); the link and relay run inside the send and dispatch transactions, so they live beside them; sniffing and stripping are pure, in internal/attach. Measured 10292. Merged with UX1 thinking words (f2602d3), measured 9801. Housekeeping slice 1 adds the loop's ledger and state machine, the housekeeping principal's checks inside the shared store functions, reservations, Pause, quiet hours, the digest, claim recovery and the API (housekeeping.go, housekeeping_control.go, housekeeping_http.go, about 1,350 lines); the checks must run inside the store's transactions, so they live beside them; the detectors themselves are pure, in internal/equipo/housekeeping. Measured 9637. Thin v1 UX1 thinking words adds the per-person set and its API (thinking.go, about 100 lines); measured 8305. Connections slice 1 review round 2: the mutation ledger matches record_task by subject only and refuses an ambiguous call with the earlier operations, the preference and forget (about 120 lines); measured 8236. Thin v1 UX1 round 3 adds Equipo combining duplicate tasks reversibly (duplicates.go: detection, the in-transaction fold checks, fold, Undo, about 400 lines) and headlines on findings and steps (headline.go); measured 7898. Connections slice 1 adds connection records from hello and attempts, the connect mailbox, the API, usage rows and the turn's mutation ledger (connections.go and tools.go, about 600 lines); measured 7400 after merging UX1. Thin v1 UX1 adds step activity lines, duplicates and their fold, the coordinator at work on a task, project facts from the runner catalog and open merge cards for the pages (inner.go, about 330 lines); measured 6610 with slice 4c's review fixes. Thin v1 slice 4c adds the merge policy, the merge card, the rebase round and duplicate reports (merge.go, about 380 lines). Thin v1 instance core: conversation, projects, tasks, review and, from slice 4b, questions to the specialists (questions.go, about 470 lines) share one store, transaction and event log; splitting would export the transaction internals. Measured 5514 source lines; revisit at the slice 7 sweep.
perf GET /api/v1/questions/{id} skip Thin v1 person API: bearer-only JSON for devices; the browser reads questions on /tasks/{id}.
perf GET /api/v1/steps/{id}/log skip Thin v1 person API: bearer-only JSON for devices; the browser shows the log tail on /tasks/{id}.
perf GET /api/v1/connections/preference skip Connections slice 1 person API: bearer-only JSON for devices; the browser shows the preference on /conversation/connections.
@@ -61,6 +61,6 @@ perf GET /conversation/attachments/{id} skip Composer attachments: the bytes of
perf GET /conversation/attachments/{id}/preview skip Composer attachments: an image thumbnail inside the conversation; a file, not a screen.
perf GET /api/v1/runners skip Mac runners person API: bearer-only JSON for devices; the browser shows runners in the Team section.
time cmd/equipo-runner 60s Mac runners slice B: TestReleaseRunnerHasNoFakeWorker builds the release runner exactly as make release-runner does and the thin package under the testbuild tag (measured 11.9s locally with a warm cache).
-size internal/headless - 8679 Release slice 1 merged onto main: measured 8679. Turn batching merged onto the browser lane: measured 8523. Turn batching adds TestHeadlessTurnBatching (three messages behind a slow turn through the real runner and fake CLI: the one next turn, its input, the bubbles and note, the usage rows and the spend lines) and TestHeadlessBatchAfterRefusedReply (the real runner reconnects after a refused reply), about 190 lines; measured 8518. Merge authority extends 4c_checks_card to end in Equipo's own merge, measured by the real runner, with its receipt (about 30 lines); measured 8330. Claude's sign-in by a link adds its end-to-end, contained-launch and real runner kill tests (signin_test.go, signin_contained_test.go, about 400 lines); measured 8090. The draft stream drive records each draw and the commit (about 27 lines) merged onto the paste box: measured 8679. The paste box merged onto turn batching: measured 8652. The paste box adds its browser drive (browser_paste_test.go, about 130 lines: streaming, copy text, keyboard, scripts off); measured 8464. Merge authority extends 4c_checks_card to end in Equipo's own merge, measured by the real runner, with its receipt (about 30 lines); measured 8330. Claude's sign-in by a link adds its end-to-end, contained-launch and real runner kill tests (signin_test.go, signin_contained_test.go, about 400 lines); measured 8090. Turn batching merged onto the browser lane: measured 8523. Turn batching adds TestHeadlessTurnBatching (three messages behind a slow turn through the real runner and fake CLI: the one next turn, its input, the bubbles and note, the usage rows and the spend lines) and TestHeadlessBatchAfterRefusedReply (the real runner reconnects after a refused reply), about 190 lines; measured 8518. Merge authority extends 4c_checks_card to end in Equipo's own merge, measured by the real runner, with its receipt (about 30 lines); measured 8330. Claude's sign-in by a link adds its end-to-end, contained-launch and real runner kill tests (signin_test.go, signin_contained_test.go, about 400 lines); measured 8090.
-size internal/thintest - 13823 Release slice 1 merged onto main: measured 13823. Release slice 1 (hosted checks) adds its contracts (hosted_checks_contract_test.go: the pass that asks, the failure's fix round, every binding rule, the protocol 4 runner; about 140 lines); measured 13816. Turn batching merged onto the ThinkingCycles clock fix (the drive takes a still clock and the page's record of each phrase, about 50 lines): measured 13678. Turn batching merged onto the browser lane: measured 13631. Turn batching adds its contracts (the crash between turns, the stranded recovery, failed, cancelled, interrupted and retried turns, the cancelled batch, the note clearing, batches split to fit one frame and the failed batch's note; about 430 lines); measured 13630 with the ship buttons merged. The ship buttons add their contract and browser tests (ships_buttons_test.go, ships_buttons_browser_test.go, about 190 lines); measured 13196. Merge authority merged onto Machines in Settings, with the re-run ruling's cases and stale thinking lines: measured 12998. Merge authority thin v1 adds its contracts (mergeauth_contract_test.go, about 650 lines) the protocol-aware rigs and the Mac re-run contract (macrecheck_mergeauth_contract_test.go) and the review fixes' contracts; measured 12535 with main merged. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Machines in Settings adds its fixture, page and browser tests (machines_fixture_test.go, machines_pages_test.go, machines_browser_test.go, about 160 lines); measured 11759. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Stale thinking lines merged onto Machines in Settings: measured 11967. Machines in Settings adds its fixture, page and browser tests (machines_fixture_test.go, machines_pages_test.go, machines_browser_test.go, about 160 lines); measured 11759. Stale thinking lines add their browser drive (stale_thinking_browser_test.go, about 200 lines) and the queued test now checks the note; measured 11795. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Spend 1 merged onto the four UI branches: measured 11325. Spend 1 marks overcounting Claude rows (about 120 lines); it adds the task page's spend contract and the 0059 upgrade (spend_pages_test.go, about 100 lines) and the fix round feedback by protocol (about 40); measured 10224. The team panel merged onto Projects UX and the Settings UX pass: measured 11064 with all three. The team panel adds its page contract and the drawer's browser drive at 1280 and 390 (team_panel_test.go, team_panel_browser_test.go, about 300 lines); measured 10235. Projects UX merged onto the Settings UX pass: measured 10768 with both. Projects UX adds the Projects page contracts (order, quiet fold, filter, stars and Undo, the coordinator's star, repository counts, whole words), the decision cards' Mac and Ask about this contracts and their browser drive (projects_pages_test.go, projects_browser_test.go, about 330 lines); measured 10321. The Settings UX pass adds the Settings pattern's page contracts and the savebar, Housekeeping groups and Teams browser drives (settings_ux_pages_test.go, settings_ux_browser_test.go, about 430 lines); measured 10390. Claude's sign-in by a link adds the code contract (signin_contract_test.go: the card, the code route's refusals, the wrong-code card, the kind it becomes and the canary sweep, about 220 lines); measured 9896. The Connections Add page and the Settings rail add their page contracts and the rail's browser drive (connections_add_pages_test.go, settings_rail_pages_test.go, about 230 lines); measured 9676. Claude setup tokens add the token and Check again contracts; measured 9444 with the composer and Mac lines merged. The instant thinking line adds its browser drive (instant_browser_test.go, about 230 lines); measured 9064 with the composer and Mac lines merged. Mac runners add the role, scoping, migration, placement, withdrawal, transfer and publication contracts (about 900 test lines) beside the thin v1 contracts; one package keeps one instance harness. The InnerScreens transition wait merged onto main: measured 13685. The inner screens drive waits for the row menu's opacity transition to end before it reads the menu at rest (about 7 lines); measured 13251. Turn batching merged onto the ThinkingCycles clock fix (the drive takes a still clock and the page's record of each phrase, about 50 lines): measured 13678. Turn batching merged onto the browser lane: measured 13631. Turn batching adds its contracts (the crash between turns, the stranded recovery, failed, cancelled, interrupted and retried turns, the cancelled batch, the note clearing, batches split to fit one frame and the failed batch's note; about 430 lines); measured 13630 with the ship buttons merged. The ship buttons add their contract and browser tests (ships_buttons_test.go, ships_buttons_browser_test.go, about 190 lines); measured 13196. Merge authority merged onto Machines in Settings, with the re-run ruling's cases and stale thinking lines: measured 12998. Merge authority thin v1 adds its contracts (mergeauth_contract_test.go, about 650 lines) the protocol-aware rigs and the Mac re-run contract (macrecheck_mergeauth_contract_test.go) and the review fixes' contracts; measured 12535 with main merged. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Machines in Settings adds its fixture, page and browser tests (machines_fixture_test.go, machines_pages_test.go, machines_browser_test.go, about 160 lines); measured 11759. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Stale thinking lines merged onto Machines in Settings: measured 11967. Machines in Settings adds its fixture, page and browser tests (machines_fixture_test.go, machines_pages_test.go, machines_browser_test.go, about 160 lines); measured 11759. Stale thinking lines add their browser drive (stale_thinking_browser_test.go, about 200 lines) and the queued test now checks the note; measured 11795. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Spend 1 merged onto the four UI branches: measured 11325. Spend 1 marks overcounting Claude rows (about 120 lines); it adds the task page's spend contract and the 0059 upgrade (spend_pages_test.go, about 100 lines) and the fix round feedback by protocol (about 40); measured 10224. The team panel merged onto Projects UX and the Settings UX pass: measured 11064 with all three. The team panel adds its page contract and the drawer's browser drive at 1280 and 390 (team_panel_test.go, team_panel_browser_test.go, about 300 lines); measured 10235. Projects UX merged onto the Settings UX pass: measured 10768 with both. Projects UX adds the Projects page contracts (order, quiet fold, filter, stars and Undo, the coordinator's star, repository counts, whole words), the decision cards' Mac and Ask about this contracts and their browser drive (projects_pages_test.go, projects_browser_test.go, about 330 lines); measured 10321. The Settings UX pass adds the Settings pattern's page contracts and the savebar, Housekeeping groups and Teams browser drives (settings_ux_pages_test.go, settings_ux_browser_test.go, about 430 lines); measured 10390. Claude's sign-in by a link adds the code contract (signin_contract_test.go: the card, the code route's refusals, the wrong-code card, the kind it becomes and the canary sweep, about 220 lines); measured 9896. The Connections Add page and the Settings rail add their page contracts and the rail's browser drive (connections_add_pages_test.go, settings_rail_pages_test.go, about 230 lines); measured 9676. Claude setup tokens add the token and Check again contracts; measured 9444 with the composer and Mac lines merged. The instant thinking line adds its browser drive (instant_browser_test.go, about 230 lines); measured 9064 with the composer and Mac lines merged. Mac runners add the role, scoping, migration, placement, withdrawal, transfer and publication contracts (about 900 test lines) beside the thin v1 contracts; one package keeps one instance harness.
+size internal/headless - 8679 The duplicate keep rule merged onto main: measured 8679. The draft stream drive records each draw and the commit (about 27 lines) merged onto the paste box: measured 8679. The paste box merged onto turn batching: measured 8652. The paste box adds its browser drive (browser_paste_test.go, about 130 lines: streaming, copy text, keyboard, scripts off); measured 8464. Merge authority extends 4c_checks_card to end in Equipo's own merge, measured by the real runner, with its receipt (about 30 lines); measured 8330. Claude's sign-in by a link adds its end-to-end, contained-launch and real runner kill tests (signin_test.go, signin_contained_test.go, about 400 lines); measured 8090. Turn batching merged onto the browser lane: measured 8523. Turn batching adds TestHeadlessTurnBatching (three messages behind a slow turn through the real runner and fake CLI: the one next turn, its input, the bubbles and note, the usage rows and the spend lines) and TestHeadlessBatchAfterRefusedReply (the real runner reconnects after a refused reply), about 190 lines; measured 8518. Merge authority extends 4c_checks_card to end in Equipo's own merge, measured by the real runner, with its receipt (about 30 lines); measured 8330. Claude's sign-in by a link adds its end-to-end, contained-launch and real runner kill tests (signin_test.go, signin_contained_test.go, about 400 lines); measured 8090. Release slice 1 merged onto main: measured 8679. Turn batching merged onto the browser lane: measured 8523. Turn batching adds TestHeadlessTurnBatching (three messages behind a slow turn through the real runner and fake CLI: the one next turn, its input, the bubbles and note, the usage rows and the spend lines) and TestHeadlessBatchAfterRefusedReply (the real runner reconnects after a refused reply), about 190 lines; measured 8518. Merge authority extends 4c_checks_card to end in Equipo's own merge, measured by the real runner, with its receipt (about 30 lines); measured 8330. Claude's sign-in by a link adds its end-to-end, contained-launch and real runner kill tests (signin_test.go, signin_contained_test.go, about 400 lines); measured 8090. The draft stream drive records each draw and the commit (about 27 lines) merged onto the paste box: measured 8679. The paste box merged onto turn batching: measured 8652. The paste box adds its browser drive (browser_paste_test.go, about 130 lines: streaming, copy text, keyboard, scripts off); measured 8464. Merge authority extends 4c_checks_card to end in Equipo's own merge, measured by the real runner, with its receipt (about 30 lines); measured 8330. Claude's sign-in by a link adds its end-to-end, contained-launch and real runner kill tests (signin_test.go, signin_contained_test.go, about 400 lines); measured 8090. Turn batching merged onto the browser lane: measured 8523. Turn batching adds TestHeadlessTurnBatching (three messages behind a slow turn through the real runner and fake CLI: the one next turn, its input, the bubbles and note, the usage rows and the spend lines) and TestHeadlessBatchAfterRefusedReply (the real runner reconnects after a refused reply), about 190 lines; measured 8518. Merge authority extends 4c_checks_card to end in Equipo's own merge, measured by the real runner, with its receipt (about 30 lines); measured 8330. Claude's sign-in by a link adds its end-to-end, contained-launch and real runner kill tests (signin_test.go, signin_contained_test.go, about 400 lines); measured 8090.
+size internal/thintest - 13885 The duplicate keep rule merged onto main: measured 13885. The duplicate combine keeps the decided task adds staging's Woodstar pair as a contract through the real store (TestContractCombineKeepsDecided, about 60 lines); measured 13747. The InnerScreens transition wait merged onto main: measured 13685. The inner screens drive waits for the row menu's opacity transition to end before it reads the menu at rest (about 7 lines); measured 13251. Turn batching merged onto the ThinkingCycles clock fix (the drive takes a still clock and the page's record of each phrase, about 50 lines): measured 13678. Turn batching merged onto the browser lane: measured 13631. Turn batching adds its contracts (the crash between turns, the stranded recovery, failed, cancelled, interrupted and retried turns, the cancelled batch, the note clearing, batches split to fit one frame and the failed batch's note; about 430 lines); measured 13630 with the ship buttons merged. The ship buttons add their contract and browser tests (ships_buttons_test.go, ships_buttons_browser_test.go, about 190 lines); measured 13196. Merge authority merged onto Machines in Settings, with the re-run ruling's cases and stale thinking lines: measured 12998. Merge authority thin v1 adds its contracts (mergeauth_contract_test.go, about 650 lines) the protocol-aware rigs and the Mac re-run contract (macrecheck_mergeauth_contract_test.go) and the review fixes' contracts; measured 12535 with main merged. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Machines in Settings adds its fixture, page and browser tests (machines_fixture_test.go, machines_pages_test.go, machines_browser_test.go, about 160 lines); measured 11759. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Stale thinking lines merged onto Machines in Settings: measured 11967. Machines in Settings adds its fixture, page and browser tests (machines_fixture_test.go, machines_pages_test.go, machines_browser_test.go, about 160 lines); measured 11759. Stale thinking lines add their browser drive (stale_thinking_browser_test.go, about 200 lines) and the queued test now checks the note; measured 11795. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Spend 1 merged onto the four UI branches: measured 11325. Spend 1 marks overcounting Claude rows (about 120 lines); it adds the task page's spend contract and the 0059 upgrade (spend_pages_test.go, about 100 lines) and the fix round feedback by protocol (about 40); measured 10224. The team panel merged onto Projects UX and the Settings UX pass: measured 11064 with all three. The team panel adds its page contract and the drawer's browser drive at 1280 and 390 (team_panel_test.go, team_panel_browser_test.go, about 300 lines); measured 10235. Projects UX merged onto the Settings UX pass: measured 10768 with both. Projects UX adds the Projects page contracts (order, quiet fold, filter, stars and Undo, the coordinator's star, repository counts, whole words), the decision cards' Mac and Ask about this contracts and their browser drive (projects_pages_test.go, projects_browser_test.go, about 330 lines); measured 10321. The Settings UX pass adds the Settings pattern's page contracts and the savebar, Housekeeping groups and Teams browser drives (settings_ux_pages_test.go, settings_ux_browser_test.go, about 430 lines); measured 10390. Claude's sign-in by a link adds the code contract (signin_contract_test.go: the card, the code route's refusals, the wrong-code card, the kind it becomes and the canary sweep, about 220 lines); measured 9896. The Connections Add page and the Settings rail add their page contracts and the rail's browser drive (connections_add_pages_test.go, settings_rail_pages_test.go, about 230 lines); measured 9676. Claude setup tokens add the token and Check again contracts; measured 9444 with the composer and Mac lines merged. The instant thinking line adds its browser drive (instant_browser_test.go, about 230 lines); measured 9064 with the composer and Mac lines merged. Mac runners add the role, scoping, migration, placement, withdrawal, transfer and publication contracts (about 900 test lines) beside the thin v1 contracts; one package keeps one instance harness. Release slice 1 merged onto main: measured 13823. Release slice 1 (hosted checks) adds its contracts (hosted_checks_contract_test.go: the pass that asks, the failure's fix round, every binding rule, the protocol 4 runner; about 140 lines); measured 13816. Turn batching merged onto the ThinkingCycles clock fix (the drive takes a still clock and the page's record of each phrase, about 50 lines): measured 13678. Turn batching merged onto the browser lane: measured 13631. Turn batching adds its contracts (the crash between turns, the stranded recovery, failed, cancelled, interrupted and retried turns, the cancelled batch, the note clearing, batches split to fit one frame and the failed batch's note; about 430 lines); measured 13630 with the ship buttons merged. The ship buttons add their contract and browser tests (ships_buttons_test.go, ships_buttons_browser_test.go, about 190 lines); measured 13196. Merge authority merged onto Machines in Settings, with the re-run ruling's cases and stale thinking lines: measured 12998. Merge authority thin v1 adds its contracts (mergeauth_contract_test.go, about 650 lines) the protocol-aware rigs and the Mac re-run contract (macrecheck_mergeauth_contract_test.go) and the review fixes' contracts; measured 12535 with main merged. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Machines in Settings adds its fixture, page and browser tests (machines_fixture_test.go, machines_pages_test.go, machines_browser_test.go, about 160 lines); measured 11759. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Stale thinking lines merged onto Machines in Settings: measured 11967. Machines in Settings adds its fixture, page and browser tests (machines_fixture_test.go, machines_pages_test.go, machines_browser_test.go, about 160 lines); measured 11759. Stale thinking lines add their browser drive (stale_thinking_browser_test.go, about 200 lines) and the queued test now checks the note; measured 11795. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Spend 1 merged onto the four UI branches: measured 11325. Spend 1 marks overcounting Claude rows (about 120 lines); it adds the task page's spend contract and the 0059 upgrade (spend_pages_test.go, about 100 lines) and the fix round feedback by protocol (about 40); measured 10224. The team panel merged onto Projects UX and the Settings UX pass: measured 11064 with all three. The team panel adds its page contract and the drawer's browser drive at 1280 and 390 (team_panel_test.go, team_panel_browser_test.go, about 300 lines); measured 10235. Projects UX merged onto the Settings UX pass: measured 10768 with both. Projects UX adds the Projects page contracts (order, quiet fold, filter, stars and Undo, the coordinator's star, repository counts, whole words), the decision cards' Mac and Ask about this contracts and their browser drive (projects_pages_test.go, projects_browser_test.go, about 330 lines); measured 10321. The Settings UX pass adds the Settings pattern's page contracts and the savebar, Housekeeping groups and Teams browser drives (settings_ux_pages_test.go, settings_ux_browser_test.go, about 430 lines); measured 10390. Claude's sign-in by a link adds the code contract (signin_contract_test.go: the card, the code route's refusals, the wrong-code card, the kind it becomes and the canary sweep, about 220 lines); measured 9896. The Connections Add page and the Settings rail add their page contracts and the rail's browser drive (connections_add_pages_test.go, settings_rail_pages_test.go, about 230 lines); measured 9676. Claude setup tokens add the token and Check again contracts; measured 9444 with the composer and Mac lines merged. The instant thinking line adds its browser drive (instant_browser_test.go, about 230 lines); measured 9064 with the composer and Mac lines merged. Mac runners add the role, scoping, migration, placement, withdrawal, transfer and publication contracts (about 900 test lines) beside the thin v1 contracts; one package keeps one instance harness. The InnerScreens transition wait merged onto main: measured 13685. The inner screens drive waits for the row menu's opacity transition to end before it reads the menu at rest (about 7 lines); measured 13251. Turn batching merged onto the ThinkingCycles clock fix (the drive takes a still clock and the page's record of each phrase, about 50 lines): measured 13678. Turn batching merged onto the browser lane: measured 13631. Turn batching adds its contracts (the crash between turns, the stranded recovery, failed, cancelled, interrupted and retried turns, the cancelled batch, the note clearing, batches split to fit one frame and the failed batch's note; about 430 lines); measured 13630 with the ship buttons merged. The ship buttons add their contract and browser tests (ships_buttons_test.go, ships_buttons_browser_test.go, about 190 lines); measured 13196. Merge authority merged onto Machines in Settings, with the re-run ruling's cases and stale thinking lines: measured 12998. Merge authority thin v1 adds its contracts (mergeauth_contract_test.go, about 650 lines) the protocol-aware rigs and the Mac re-run contract (macrecheck_mergeauth_contract_test.go) and the review fixes' contracts; measured 12535 with main merged. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Machines in Settings adds its fixture, page and browser tests (machines_fixture_test.go, machines_pages_test.go, machines_browser_test.go, about 160 lines); measured 11759. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Stale thinking lines merged onto Machines in Settings: measured 11967. Machines in Settings adds its fixture, page and browser tests (machines_fixture_test.go, machines_pages_test.go, machines_browser_test.go, about 160 lines); measured 11759. Stale thinking lines add their browser drive (stale_thinking_browser_test.go, about 200 lines) and the queued test now checks the note; measured 11795. Mac recheck adds its enrolment, skip and outcome contracts (macrecheck_contract_test.go, about 210 lines); measured 11537. Spend 1 merged onto the four UI branches: measured 11325. Spend 1 marks overcounting Claude rows (about 120 lines); it adds the task page's spend contract and the 0059 upgrade (spend_pages_test.go, about 100 lines) and the fix round feedback by protocol (about 40); measured 10224. The team panel merged onto Projects UX and the Settings UX pass: measured 11064 with all three. The team panel adds its page contract and the drawer's browser drive at 1280 and 390 (team_panel_test.go, team_panel_browser_test.go, about 300 lines); measured 10235. Projects UX merged onto the Settings UX pass: measured 10768 with both. Projects UX adds the Projects page contracts (order, quiet fold, filter, stars and Undo, the coordinator's star, repository counts, whole words), the decision cards' Mac and Ask about this contracts and their browser drive (projects_pages_test.go, projects_browser_test.go, about 330 lines); measured 10321. The Settings UX pass adds the Settings pattern's page contracts and the savebar, Housekeeping groups and Teams browser drives (settings_ux_pages_test.go, settings_ux_browser_test.go, about 430 lines); measured 10390. Claude's sign-in by a link adds the code contract (signin_contract_test.go: the card, the code route's refusals, the wrong-code card, the kind it becomes and the canary sweep, about 220 lines); measured 9896. The Connections Add page and the Settings rail add their page contracts and the rail's browser drive (connections_add_pages_test.go, settings_rail_pages_test.go, about 230 lines); measured 9676. Claude setup tokens add the token and Check again contracts; measured 9444 with the composer and Mac lines merged. The instant thinking line adds its browser drive (instant_browser_test.go, about 230 lines); measured 9064 with the composer and Mac lines merged. Mac runners add the role, scoping, migration, placement, withdrawal, transfer and publication contracts (about 900 test lines) beside the thin v1 contracts; one package keeps one instance harness.
perf GET /api/v1/projects/{id}/merge-policy skip Merge authority person API: bearer-only JSON for devices; the browser reads the policy on /projects/{id}.
diff --git a/internal/equipo/chat/duplicates.go b/internal/equipo/chat/duplicates.go
index 934e45be..31f206f3 100644
--- a/internal/equipo/chat/duplicates.go
+++ b/internal/equipo/chat/duplicates.go
@@ -19,7 +19,8 @@ import (
// read alike are a pair. When one person filed both, they read very much
// alike, neither is merging and the weaker one has no open card and no
// step at work, the weaker is combined into the one that is furthest
-// along (an open card on that one, a merge card say, does not block):
+// along, or at one stage the one whose merge card its creator answered
+// (an open card on the one kept, a merge card say, does not block):
// its report, findings and thread are copied onto the survivor
// (marked as folded from it) and it is cancelled without merging. Nothing
// is deleted, so Undo restores it exactly. Any other pair is only named:
diff --git a/internal/equipo/chat/housekeeping.go b/internal/equipo/chat/housekeeping.go
index 9e174650..ecca7e9d 100644
--- a/internal/equipo/chat/housekeeping.go
+++ b/internal/equipo/chat/housekeeping.go
@@ -552,8 +552,21 @@ func (t *txn) duplicateView(projectID string) (housekeeping.View, error) {
return v, err
}
last := map[string]stepRecord{}
+ byTask := map[string][]stepRecord{}
for _, s := range steps {
last[s.TaskID] = s
+ byTask[s.TaskID] = append(byTask[s.TaskID], s)
+ }
+ // Decided: the task's newest merge card (one per SHA asked) was
+ // answered, and the SHA it asked about is still the candidate. Only
+ // the task's creator answers a merge card (answerMerge).
+ var merges []cardRecord
+ if err := t.db.Select("task_id", "state").Where("task_id IN ? AND kind = ?", ids, wire.CardMerge).Order("created_at, rowid").Find(&merges).Error; err != nil {
+ return v, err
+ }
+ answered := map[string]bool{}
+ for _, c := range merges {
+ answered[c.TaskID] = c.State == wire.CardAnswered
}
var carded []string
if err := t.db.Model(&cardRecord{}).Where("task_id IN ? AND state = ? AND kind <> ?", ids, wire.CardOpen, wire.CardTask).Pluck("task_id", &carded).Error; err != nil {
@@ -566,8 +579,9 @@ func (t *txn) duplicateView(projectID string) (housekeeping.View, error) {
hidden := t.s.authority.TestPerson
for _, k := range open {
s, ok := last[k.ID]
+ decided := answered[k.ID] && k.MergeAsked != "" && k.MergeAsked == progressFor(k, byTask[k.ID]).candidate
v.Tasks = append(v.Tasks, housekeeping.TaskFact{ID: k.ID, Title: k.Title, Brief: k.Brief, Creator: k.Creator, Stage: k.Stage, Revision: k.Revision, CreatedAt: k.CreatedAt, DuplicateOf: k.DuplicateOf,
- Stopped: ok && s.State == wire.StepFailed, Busy: ok && (s.State == wire.StepRunning || s.State == wire.StepQueued), Carded: isCarded[k.ID], Hidden: hidden != nil && hidden(k.Creator)})
+ Stopped: ok && s.State == wire.StepFailed, Busy: ok && (s.State == wire.StepRunning || s.State == wire.StepQueued), Carded: isCarded[k.ID], Decided: decided, Hidden: hidden != nil && hidden(k.Creator)})
}
return v, nil
}
diff --git a/internal/equipo/housekeeping/duplicates.go b/internal/equipo/housekeeping/duplicates.go
index 4a16ad61..724c1297 100644
--- a/internal/equipo/housekeeping/duplicates.go
+++ b/internal/equipo/housekeeping/duplicates.go
@@ -43,7 +43,9 @@ type View struct {
// TaskFact is one open task as a detector sees it. Stopped: its last step
// failed. Busy: a step is queued or running. Carded: an open card other
// than its task card, a decision still to make (it blocks closing this
-// task, never keeping it). Hidden: its creator is a test identity.
+// task, never keeping it). Decided: the task's newest merge card, the one
+// for its current candidate, was answered by a person (only the task's
+// creator answers one). Hidden: its creator is a test identity.
type TaskFact struct {
ID string `json:"id"`
Title string `json:"title"`
@@ -56,6 +58,7 @@ type TaskFact struct {
Stopped bool `json:"stopped"`
Busy bool `json:"busy"`
Carded bool `json:"carded"`
+ Decided bool `json:"decided"`
Hidden bool `json:"hidden"`
}
@@ -79,11 +82,17 @@ func DuplicatePossible() Detector {
var stageRank = map[string]int{"noted": 0, "investigated": 1, "in_progress": 2, "in_review": 3, "ready_to_merge": 4, "merging": 5}
// stronger reports whether a is further along than b: a later stage, then
-// not stopped, then the older one, then the smaller id.
+// the one a person decided on, then not stopped, then the older one, then
+// the smaller id. A person's decision outranks age (staging's Woodstar
+// pair, 2026-11-11: the older, undecided task kept the work and the one
+// Paul had answered Wait for a Mac on was closed).
func stronger(a, b TaskFact) bool {
if ra, rb := stageRank[a.Stage], stageRank[b.Stage]; ra != rb {
return ra > rb
}
+ if a.Decided != b.Decided {
+ return a.Decided
+ }
if a.Stopped != b.Stopped {
return !a.Stopped
}
diff --git a/internal/equipo/housekeeping/housekeeping_test.go b/internal/equipo/housekeeping/housekeeping_test.go
index 11f868ce..dabd3dc1 100644
--- a/internal/equipo/housekeeping/housekeeping_test.go
+++ b/internal/equipo/housekeeping/housekeeping_test.go
@@ -56,6 +56,34 @@ func TestDetectorFixtures(t *testing.T) {
}
}
+// TestStrongerDecided: a person's recorded decision outranks age and a
+// stopped step, never the stage (staging's Woodstar pair, 2026-11-11:
+// the older, undecided task kept the work and the decided one closed).
+// Two decided or two undecided tasks keep the old order.
+func TestStrongerDecided(t *testing.T) {
+ at := func(m int) time.Time { return time.Date(2026, 11, 7, 18, m, 0, 0, time.UTC) }
+ task := func(id, stage string, m int, decided, stopped bool) TaskFact {
+ return TaskFact{ID: id, Stage: stage, CreatedAt: at(m), Decided: decided, Stopped: stopped}
+ }
+ for _, c := range []struct {
+ name string
+ a, b TaskFact
+ }{
+ {"decided beats older", task("tkB", "ready_to_merge", 5, true, false), task("tkA", "ready_to_merge", 0, false, false)},
+ {"decided beats not stopped", task("tkB", "ready_to_merge", 5, true, true), task("tkA", "ready_to_merge", 0, false, false)},
+ {"stage beats decided", task("tkB", "ready_to_merge", 5, false, false), task("tkA", "in_review", 0, true, false)},
+ {"both decided: older", task("tkA", "ready_to_merge", 0, true, false), task("tkB", "ready_to_merge", 5, true, false)},
+ {"both decided: not stopped", task("tkB", "ready_to_merge", 5, true, false), task("tkA", "ready_to_merge", 0, true, true)},
+ {"neither decided: older", task("tkA", "ready_to_merge", 0, false, false), task("tkB", "ready_to_merge", 5, false, false)},
+ {"neither decided: not stopped", task("tkB", "ready_to_merge", 5, false, false), task("tkA", "ready_to_merge", 0, false, true)},
+ {"same time: smaller id", task("tkA", "noted", 0, true, false), task("tkB", "noted", 0, true, false)},
+ } {
+ if !stronger(c.a, c.b) || stronger(c.b, c.a) {
+ t.Errorf("%s: %s should be stronger than %s", c.name, c.a.ID, c.b.ID)
+ }
+ }
+}
+
// TestRegistryModelMeansPropose: a detector that needs a model's
// judgement may only propose; the registry refuses anything else.
func TestRegistryModelMeansPropose(t *testing.T) {
diff --git a/internal/equipo/housekeeping/testdata/duplicate_possible.json b/internal/equipo/housekeeping/testdata/duplicate_possible.json
index b63b205d..c2ce9aaa 100644
--- a/internal/equipo/housekeeping/testdata/duplicate_possible.json
+++ b/internal/equipo/housekeeping/testdata/duplicate_possible.json
@@ -73,5 +73,15 @@
{"detector": "duplicate_possible", "subject": {"kind": "task", "id": "tkB"}, "owner": "p@x", "subject_revision": 1, "key": "possible:tkB:tkA",
"evidence": {"tasks": [{"id": "tkB", "title": "Alpha beta gamma epsilon", "creator": "p@x"}, {"id": "tkA", "title": "Alpha beta gamma delta", "creator": "p@x"}], "similarity": 0.75, "shared": 3},
"proposal": {"action": "link", "task": "tkB", "into": "tkA"}}]
+ },
+ {
+ "name": "staging's Woodstar pair, 2026-11-11: the older one, its merge card open, is linked to the decided one",
+ "view": {"project": "p1", "tasks": [
+ {"id": "tks6kwzzdngr", "title": "Swipe from the edge to go back doesn't work", "creator": "p@x", "stage": "ready_to_merge", "revision": 6, "created_at": "2026-11-07T18:39:00Z", "carded": true},
+ {"id": "tkf6dufnbzcg", "title": "Swipe back from the edge doesn't work", "creator": "p@x", "stage": "ready_to_merge", "revision": 8, "created_at": "2026-11-07T21:40:00Z", "decided": true}]},
+ "findings": [
+ {"detector": "duplicate_possible", "subject": {"kind": "task", "id": "tks6kwzzdngr"}, "owner": "p@x", "subject_revision": 6, "key": "possible:tks6kwzzdngr:tkf6dufnbzcg",
+ "evidence": {"tasks": [{"id": "tks6kwzzdngr", "title": "Swipe from the edge to go back doesn't work", "creator": "p@x"}, {"id": "tkf6dufnbzcg", "title": "Swipe back from the edge doesn't work", "creator": "p@x"}], "similarity": 1, "shared": 3},
+ "proposal": {"action": "link", "task": "tks6kwzzdngr", "into": "tkf6dufnbzcg"}}]
}
]
diff --git a/internal/equipo/housekeeping/testdata/duplicate_same_creator.json b/internal/equipo/housekeeping/testdata/duplicate_same_creator.json
index 76ec18a8..99e9e207 100644
--- a/internal/equipo/housekeeping/testdata/duplicate_same_creator.json
+++ b/internal/equipo/housekeeping/testdata/duplicate_same_creator.json
@@ -118,5 +118,42 @@
{"detector": "duplicate_same_creator", "subject": {"kind": "task", "id": "tkB"}, "owner": "s@x.invalid", "subject_revision": 1, "key": "duplicate:tkA:tkB",
"evidence": {"tasks": [{"id": "tkB", "title": "Alpha beta gamma epsilon", "creator": "s@x.invalid"}, {"id": "tkA", "title": "Alpha beta gamma delta", "creator": "s@x.invalid"}], "similarity": 0.75, "shared": 3},
"proposal": {"action": "combine", "task": "tkB", "into": "tkA"}}]
+ },
+ {
+ "name": "staging's Woodstar pair, 2026-11-11: the newer one decided (Wait for a Mac), the older one's merge card still open: the decided one is never folded",
+ "view": {"project": "p1", "tasks": [
+ {"id": "tks6kwzzdngr", "title": "Swipe from the edge to go back doesn't work", "creator": "p@x", "stage": "ready_to_merge", "revision": 6, "created_at": "2026-11-07T18:39:00Z", "carded": true},
+ {"id": "tkf6dufnbzcg", "title": "Swipe back from the edge doesn't work", "creator": "p@x", "stage": "ready_to_merge", "revision": 8, "created_at": "2026-11-07T21:40:00Z", "decided": true}]},
+ "findings": []
+ },
+ {
+ "name": "at one stage, a decided task keeps the work over an older undecided one",
+ "view": {"project": "p1", "tasks": [
+ {"id": "tkA", "title": "Alpha beta gamma delta", "creator": "p@x", "stage": "ready_to_merge", "revision": 1, "created_at": "2026-11-08T09:00:00Z"},
+ {"id": "tkB", "title": "Alpha beta gamma epsilon", "creator": "p@x", "stage": "ready_to_merge", "revision": 2, "created_at": "2026-11-08T09:05:00Z", "decided": true}]},
+ "findings": [
+ {"detector": "duplicate_same_creator", "subject": {"kind": "task", "id": "tkA"}, "owner": "p@x", "subject_revision": 1, "key": "duplicate:tkA:tkB",
+ "evidence": {"tasks": [{"id": "tkA", "title": "Alpha beta gamma delta", "creator": "p@x"}, {"id": "tkB", "title": "Alpha beta gamma epsilon", "creator": "p@x"}], "similarity": 0.75, "shared": 3},
+ "proposal": {"action": "combine", "task": "tkA", "into": "tkB"}}]
+ },
+ {
+ "name": "two decided tasks at one stage: the older keeps the work",
+ "view": {"project": "p1", "tasks": [
+ {"id": "tkA", "title": "Alpha beta gamma delta", "creator": "p@x", "stage": "ready_to_merge", "revision": 1, "created_at": "2026-11-08T09:00:00Z", "decided": true},
+ {"id": "tkB", "title": "Alpha beta gamma epsilon", "creator": "p@x", "stage": "ready_to_merge", "revision": 2, "created_at": "2026-11-08T09:05:00Z", "decided": true}]},
+ "findings": [
+ {"detector": "duplicate_same_creator", "subject": {"kind": "task", "id": "tkB"}, "owner": "p@x", "subject_revision": 2, "key": "duplicate:tkA:tkB",
+ "evidence": {"tasks": [{"id": "tkB", "title": "Alpha beta gamma epsilon", "creator": "p@x"}, {"id": "tkA", "title": "Alpha beta gamma delta", "creator": "p@x"}], "similarity": 0.75, "shared": 3},
+ "proposal": {"action": "combine", "task": "tkB", "into": "tkA"}}]
+ },
+ {
+ "name": "two undecided tasks at one stage: the older keeps the work",
+ "view": {"project": "p1", "tasks": [
+ {"id": "tkA", "title": "Alpha beta gamma delta", "creator": "p@x", "stage": "ready_to_merge", "revision": 1, "created_at": "2026-11-08T09:00:00Z"},
+ {"id": "tkB", "title": "Alpha beta gamma epsilon", "creator": "p@x", "stage": "ready_to_merge", "revision": 2, "created_at": "2026-11-08T09:05:00Z"}]},
+ "findings": [
+ {"detector": "duplicate_same_creator", "subject": {"kind": "task", "id": "tkB"}, "owner": "p@x", "subject_revision": 2, "key": "duplicate:tkA:tkB",
+ "evidence": {"tasks": [{"id": "tkB", "title": "Alpha beta gamma epsilon", "creator": "p@x"}, {"id": "tkA", "title": "Alpha beta gamma delta", "creator": "p@x"}], "similarity": 0.75, "shared": 3},
+ "proposal": {"action": "combine", "task": "tkB", "into": "tkA"}}]
}
]
diff --git a/internal/thintest/duplicates_contract_test.go b/internal/thintest/duplicates_contract_test.go
index 2fd61de1..be070e84 100644
--- a/internal/thintest/duplicates_contract_test.go
+++ b/internal/thintest/duplicates_contract_test.go
@@ -4,6 +4,7 @@ import (
"context"
"strings"
"testing"
+ "time"
"amadan.net/oficina/equipo/internal/equipo"
"amadan.net/oficina/equipo/internal/wire"
@@ -40,6 +41,67 @@ func (r *toolRig) tidy() int {
return n
}
+// TestContractCombineKeepsDecided: staging's Woodstar pair, 2026-11-11.
+// One person's two look-alike tasks, both Ready to merge and waiting on
+// a Mac. The person answered Wait for a Mac on the newer one; the older
+// one's merge card is still open. Equipo combined the decided one into
+// the older one. A person's decision outranks age: the decided task is
+// never closed, and the older one, a decision still open on it, is only
+// named as its duplicate. Both cards stay as they were.
+func TestContractCombineKeepsDecided(t *testing.T) {
+ r := newToolRig(t)
+ ctx := r.ctx
+ card := func(task string) (out wire.Card, ok bool) {
+ r.conv.Locked(func(c *Conversation) {
+ for _, k := range c.Cards {
+ if k.Kind == wire.CardMerge && k.TaskID == task {
+ out, ok = k, true
+ }
+ }
+ })
+ return out, ok
+ }
+ open := func(task string) func(*Conversation) bool {
+ return func(c *Conversation) bool {
+ for _, k := range c.Cards {
+ if k.Kind == wire.CardMerge && k.TaskID == task && k.State == wire.CardOpen {
+ return true
+ }
+ }
+ return false
+ }
+ }
+ older := r.judgedTask("dk1", "Swipe from the edge to go back doesn't work", strings.Repeat("7", 40), strings.Repeat("8", 40), wire.ChecksCannotRun, "needs_macos")
+ r.wait("older merge card", open(older))
+ newer := r.judgedTask("dk2", "Swipe back from the edge doesn't work", strings.Repeat("9", 40), strings.Repeat("a", 40), wire.ChecksCannotRun, "needs_macos")
+ r.wait("newer merge card", open(newer))
+ for id, at := range map[string]time.Time{older: time.Date(2026, 11, 7, 18, 39, 0, 0, time.UTC), newer: time.Date(2026, 11, 7, 21, 40, 0, 0, time.UTC)} {
+ if _, err := r.inst.DB.Writer().Exec("UPDATE chat_tasks SET created_at = ? WHERE id = ?", at, id); err != nil {
+ t.Fatal(err)
+ }
+ }
+ c, _ := card(newer)
+ if out, err := r.client.Answer(ctx, c.ID, wire.ChoiceWaitMac, c.Revision); err != nil || out.Card.State != wire.CardAnswered {
+ t.Fatalf("wait for a Mac: %+v %v", out, err)
+ }
+ r.forgetPair(older, newer)
+ if n := r.tidy(); n != 0 {
+ t.Fatalf("combined %d: a task with a decision still open on it, or the decided one, was closed", n)
+ }
+ if k, _ := r.client.Task(ctx, newer); k.Folded != nil || k.Stage != wire.StageReadyToMerge || len(k.Combined) != 0 {
+ t.Fatalf("the decided task: stage %s, folded %+v, combined %+v", k.Stage, k.Folded, k.Combined)
+ }
+ if k, _ := r.client.Task(ctx, older); k.Folded != nil || k.Stage != wire.StageReadyToMerge || k.DuplicateOf == nil || k.DuplicateOf.ID != newer {
+ t.Fatalf("the undecided task: stage %s, folded %+v, named %+v", k.Stage, k.Folded, k.DuplicateOf)
+ }
+ if c, ok := card(older); !ok || c.State != wire.CardOpen {
+ t.Fatalf("the open merge card was lost: %+v", c)
+ }
+ if c, ok := card(newer); !ok || c.State != wire.CardAnswered || c.Choice != wire.ChoiceWaitMac {
+ t.Fatalf("the answered merge card changed: %+v", c)
+ }
+}
+
// TestContractCombineDuplicates: Paul, staging ("Can Equipo itself tidy
// up the duplicates?"). Two tasks one person filed that read very much
// alike are combined by Equipo: the one furthest along keeps the work and