Bugs noticed in passing during the code review

Plan doc for fixing the 41 bugs the YAGNI, DRY and KISS review found on the side. They are listed under "Bugs noticed in passing" at the end of each findings file of the code cleanup (in code-cleanup/), which leaves them out because its rule 3 forbids any change of behaviour. Deleted when its last workstream ships. A fix that changes what a design chapter describes updates that chapter in the same change; nothing else moves into the design.

41bugs from 14 findings files
3workstreams, no shared files
23 · 8 · 10server · interface · scripts
15cleanup workstreams wait

Goal

Each of the 41 bugs is fixed, or found not to be one, or left as it is on purpose, and the handovers of the three workstreams together say which for every one of them. A fix comes with a test that fails without it.

Where it stands

Nothing is fixed yet. The review that found the bugs was made on 2026-11-10 at commit acfa0484. Of the files the bugs point to, only server.ts, api.ts, scratch-obeya.ts and core/types.ts have changed since (at commit 3321cd6e), by a few lines each, so the line numbers in the findings files still hold or are off by a few. Every bug was read from the code alone: none was reproduced, and some may turn out to be none.

The 41 lie in 14 findings files. 31 change behaviour; 10 concern only a comment or style (a doc comment above the wrong declaration, a constant between the imports, a bare git).

How to work from this

For the agent that takes a workstream:

  1. Read each bug in its findings file, and the finding it refers to ("see D12") where it names one. Find the code by the names given; line numbers may have moved.
  2. Test first. Write a test that fails on the code as it is, then fix the code until it passes. What cannot be reproduced in a test (or turns out to work) stays as it is and is named in the handover as "not confirmed", with what was tried.
  3. Comment and style points need no test. Fix them in one commit of their own, unless a workstream of the code cleanup reworks that place anyway: then leave them and name them in the handover as "left on purpose, done by code cleanup Wx".
  4. The handover sorts every bug of the workstream into fixed, not confirmed, or left on purpose, with a sentence each.
  5. When the workstream lands, remove each fixed bug from its "Bugs noticed in passing" list, and where a finding of the code cleanup names that bug (the table below), add a line to the finding that the bug is fixed, so the cleanup does not plan around it any more.
  6. Codex reviews the workstream's code as a second reviewer (codex exec) before the handover.

The three workstreams share no files. They can run at the same time, and each lands on its own.

Order with the code cleanup

Several bugs sit in code that a workstream of the code cleanup reworks. Since that plan may not change behaviour, its workstream would either have to keep the bug or would fix it without a test. So the cleanup workstreams named here start only once the workstream of this plan that fixes the bug has landed; code-cleanup.md says so as well.

BugFindingCleanup workstreamFixed in
shutdown leaves holding and pushingMain; generation, tried, granted never shrinkA9, A10W12W1
A failing merge-base --is-ancestor counts as "not an ancestor"E6W5W1
unlanded's unbatched pathspecsE8W5W1
snooze accepts a time more than a year aheadD12W6W1
rebuilt without the 100 ms delayF11W6W1
A null body gives 500F9W16W1
changesCode reads git's quoted file namesF16W16W1
Rows of shared_changes/archive_changes never droppedC9W7W1
commandWords splits a quote inside a wordS9W17W1
Archiving a planned task with a branchJ2W9W1
The test teardowns (canvases, workers, freed())T2, T3, T4, T7W2, W3W1
useCopy only through navigator.clipboardG17W20W2
The minimap's colourG8 (moves the minimap)W20W2
showAck hides before the undo window endsI8W19W2
openAddress opens the archive beside the searchG21W21W2
The phone ignores movedToG3, H1W21W2
fileTo writes to the canvas shown after the uploadH9W23W2
build.ts, check-app.ts, --say/--artifact read their arguments wrongR2W25W3
director.ts imports Playwright staticallyP1W24W3
runInput has no timeoutP3W24W3
tts.py --sample does not catch QuotaExhaustedP7W24W3

Cleanup workstreams not in the table (W1, W4, W8, W10, W11, W13, W14, W15, W18, W22) need not wait. Those that move code in a file a workstream here changes (W11 in workers.ts, W14 in canvas.ts) only meet merge conflicts, no conflict of behaviour.

Workstreams

Decisions