Review agents before deploying nontrivial changes
code-reviewsubagentsarchitectpedantdeployworktreestesting
Running independent review agents on a change after writing it and before shipping it (Justin's /review skill runs an architect and a pedant in parallel) repeatedly caught data-loss bugs that passing test suites and static analysis missed. It is now a standard pre-deploy step for anything touching sync, counts, caching, watermarks, or concurrency.
What it caught
- Delta vs absolute counts (Message app, v2.9.7): a sync performance refactor wrote absolute message/unread counts computed from the sync delta. Incremental sync would have reset a 1,000-message thread to 1, permanently. The old accidental full re-sync on every cold start had been silently healing it. The same review caught that the MMS watermark had to be an
_IDrather than a date, a stale-intent navigation replay, and a watermark that advanced even on failure. None were caught by 386 unit tests. - Two data-loss races in DM delete (tldr v1.48.0, Dart): a stale snapshot removing just-sent messages, and deleted messages resurrected by in-flight polls; plus a dead-code guard (a set added to and removed from with no
awaitbetween, so no async reader could ever see it non-empty). 79 passing tests andflutter analyzecaught none. - A notification audit with adversarial verifiers (agents told to refute each finding) kept only findings that survived, and the verifiers found two more HIGHs themselves.
Why tests miss these: unit tests with mocked DAOs and in-memory fakes do not exercise multi-run state, ordering, or "what happens on the second sync".
How to run it
- Finish the change and its tests.
- Run architect + pedant reviews on the diff (and the surrounding code paths).
- Triage findings in the same session: fix, re-test, then deploy. Budget time for this.
- For bug hunts, have each suspicion reproduced by a test or on a device before fixing it.
Parallel worktree merges leave semantic seams
When several agents work in separate git worktrees and their branches auto-merge cleanly, the merged result can still be wrong: two agents independently fixed the same latent bug (errors never shown) and the merge kept both mechanisms (a Toast and a Snackbar racing to clear the error); another agent preserved a double-call pattern that a sibling branch had just made harmful. Review the merged result, not each branch.
Related habits
- After any hotfix branch deploy, merge it back to the main branch immediately; one hotfix was missing from two later releases.
git merge-base --is-ancestor <fix> <tag>proves whether a release contains a commit. - Fix root causes, not symptoms: read the whole path from UI to system API to callback, trace actual values, find where data is lost. Three rounds of MMS symptom fixes failed before that.
- Verify on the real target before declaring a fix: three MMS "fixes" were never run on the phone at all.