code-review: review the fakes' contract assumptions, diff external call sites against proven patterns, treat declared verification gaps as review scope

From the ai-cowork #154 rollout: a dockerode attach without hijack:true shipped
through three review rounds — the fake's stream accepted writes, the tests were
green, and the MR honestly declared the helper spawn as manually-smoke-only.
All three nets had the same hole: the boundary the tests fake.
This commit is contained in:
Markus Graf
2026-12-01 09:54:59 +01:00
parent 5254a480a2
commit d15cb4d165
+20 -1
View File
@@ -19,7 +19,9 @@ thorough, never pad with style opinions.
This skill is designed to run with **fresh context** (e.g. in a subagent). If the This skill is designed to run with **fresh context** (e.g. in a subagent). If the
current session authored the changes it is about to review, say so and recommend current session authored the changes it is about to review, say so and recommend
a fresh-context review instead: the assumptions made while writing code carry a fresh-context review instead: the assumptions made while writing code carry
over into its review. over into its review. The same applies to the review brief itself: an issue or
prompt highlights what the author considered risky — deliberately review what it
does *not* mention (fakes, declared verification gaps, transport plumbing).
## Workflow ## Workflow
@@ -33,6 +35,11 @@ over into its review.
3. If the diff is large (roughly >600 changed lines): review in passes, one 3. If the diff is large (roughly >600 changed lines): review in passes, one
group of related files at a time, prioritizing source code over tests, docs, group of related files at a time, prioritizing source code over tests, docs,
and generated files. State explicitly which files you did not fully review. and generated files. State explicitly which files you did not fully review.
4. **Declared verification gaps are review scope.** An MR that says "X is not
covered by automation — manual smoke before merge" has marked a surface as
untested. Either run that smoke yourself or review the surface by other
means (trace the real contract, exercise it in a safe environment).
Accepting the declaration as handled is how honest MRs ship broken features.
### Phase 2 — Context (the diff alone lies) ### Phase 2 — Context (the diff alone lies)
@@ -44,6 +51,12 @@ over into its review.
3. Trace the change into the codebase: open the full files around the hunks, 3. Trace the change into the codebase: open the full files around the hunks,
grep callers of changed functions, follow the data flow end to end. Do not grep callers of changed functions, follow the data flow end to end. Do not
judge code you have not seen in context. judge code you have not seen in context.
4. **Inventory the fakes**: find the test doubles the diff introduces or relies
on for external systems (docker, HTTP clients, DBs, queues, SDKs). Each fake
encodes the author's assumption about that system's contract — verify every
assumption against the real library (docs, source, or the repo's own proven
call site). A green suite against an optimistic fake proves the code matches
the assumption, not the system.
### Phase 3 — Review passes ### Phase 3 — Review passes
@@ -54,6 +67,12 @@ Run the passes in this order; spend effort where the real defects live:
conditions, wrong state transitions. conditions, wrong state transitions.
2. **Contract breaks** — changed signatures or behavior vs. callers; API, DB, 2. **Contract breaks** — changed signatures or behavior vs. callers; API, DB,
or schema mismatches; serialization changes. or schema mismatches; serialization changes.
2b. **External call sites vs. proven patterns** — for every call the diff adds
into an external SDK, driver, or daemon API, find the repo's existing proven
call site for the same operation and diff the two call shapes (options,
flags, stream modes, attach/hijack variants). Subtle contract differences
(a missing `hijack: true` on a docker attach, a dropped TLS option) never
show up in unit tests with fakes — they only show in production.
3. **Security at trust boundaries** — user input, files, network, env vars, 3. **Security at trust boundaries** — user input, files, network, env vars,
secrets in logs or history, auth checks, injection, unsafe deserialization. secrets in logs or history, auth checks, injection, unsafe deserialization.
4. **Tests** — which changed behavior has no test? Do new tests assert 4. **Tests** — which changed behavior has no test? Do new tests assert