Verify Review Findings — Confirm or Refute, Fix Structure
A review finding is a hypothesis, not a verdict. Before reporting any correctness finding, confirm or
refute it against the code's actual semantics and full control/data flow. A false positive is expensive: it
erodes trust in the whole review, and acting on it wastes effort or introduces a regression "fixing" code that
was correct.
This skill governs the rigor applied to each finding. For dispatching a multi-specialist review panel, use the
multiagent-review skill; for R-specific engineering judgment, use advanced-r-engineering. This skill applies
in single-pass review too.
The core discipline: confirm or refute before reporting
Never flag a suspicious-looking line in isolation. For every candidate correctness bug, do all of the following
before writing it down as a bug:
Read the whole function, not the line. The disproof of a suspected bug often lives a few lines away —
in an earlier loop, a sibling branch, or the function's preamble.
Find where inputs are validated. A guard that makes the suspicious line safe may run earlier in the
same function, in a different loop, or in the caller. If a typo'd/missing input would already have errored
upstream, the "silent wrong result" you imagined cannot happen.
Verify the exact semantics of any stdlib/library call the finding hinges on — empirically. Do not trust
intuition about ordering, recycling, NA propagation, partial matching, or silent coercion. Run a two-line
snippet and look. In R:
# Does intersect() return first-arg order or second-arg order? Check, don't guess.
base::intersect(c("group_A", "-", "group_B"), c("group_B", "group_A"))
#> "group_A" "group_B" <- first-argument (contrast) order, operators dropped
Rscript -e 'print(base::intersect(c("a","-","b"), c("b","a")))'
Trace callers and reachability. Is the suspicious path on a primary path, or is it dead / deprecated /
guarded out? A "bug" in an unreachable branch is a different (lower) severity than one on the hot path.
Construct the concrete failure. State it as: input X → produces wrong output Y, expected Z. If a
reproducing input cannot be constructed, the finding is probably not a bug — downgrade or drop it.
If a finding survives all five, it is real. If it does not, it is a false positive — but stop before
discarding it.
Classify every finding
- TRUE BUG — a concrete reproducing input produces a wrong result or a crash. Fix the root cause
(see below).
- FALSE POSITIVE — code is correct and clear. Drop it. Record the evidence (the semantic check, the
upstream guard) so it is not re-flagged next review.
- FALSE POSITIVE — code is correct but misread because it is confusing. This is the important case: the
confusion is itself a real, lower-severity defect — a communication bug. Correct code that an experienced
reviewer reads as broken will be "fixed" into an actual bug eventually. The remedy is structural
clarification, not a behavior change.
Reporting a finding honestly includes saying "this specific claim was a false positive, and here is why" — with
the evidence. That is more valuable than silently deleting it.
Why correct code reads as buggy: the confusion smells
When a false positive traces to confusing structure, look for these signatures — each is a structural defect
worth fixing even though behavior is correct:
Load-bearing reliance on non-obvious language semantics, uncommented. Correctness rides on a detail many
competent programmers get wrong: set-operation ordering, vector recycling, NA/NULL propagation, partial
argument matching, implicit numeric/character coercion. No comment flags it. The reader assumes the common
(wrong) mental model and "finds" a bug.
A helper doing implicit double duty. One opaque call quietly does two or three jobs at once (e.g. filter
and reorder and strip tokens). From the call site it looks like one thing, so its other effects read as
missing or wrong.
Guards separated from the code they protect. Validation in loop 1; the code that depends on it in
loop 2. Reading loop 2 alone, the protection is invisible and the code looks unguarded.
Dead or fallback branches that silently do something arbitrary. A branch that "handles" malformed input
by guessing (e.g. taking the first two tokens) instead of rejecting it. It is both unreachable noise and a
latent wrong-result generator.
Multi-pass designs over an opaque intermediate representation. Correctness is smeared across passes over
a token list / index map / scratch column, so no single place states what the function guarantees.
The structural-fix playbook
When the diagnosis is "correct but confusing," restructure so correctness is self-evident. Prefer, in order:
- State and enforce the contract up front. Validate inputs at the top;
stop()/raise with a clear message
on violation. The function's precondition becomes readable, not implicit.
- Replace clever double-duty calls with explicit single-purpose steps. One statement, one job.
- Co-locate guards with the code they protect. Move validation next to the operation that relies on it, or
merge the passes so the guarantee is visible where it matters.
- Delete dead fallbacks. Do not preserve arbitrary silent behavior "just in case." Reject malformed input
loudly instead.
- Collapse to a single linear pass when the multi-pass design exists only to thread an opaque
intermediate.
- Comment only the residual. Add a comment exactly where a genuinely non-obvious, load-bearing semantic
remains — not as a substitute for restructuring.
The test: after the change, a competent reviewer reading the function top-to-bottom sees the contract and the
data flow directly, with no off-screen subtlety to misread.
Then fix it properly
For both true bugs and structural clarifications:
- Fix the root cause in the correct upstream location — never a bandaid (a
tryCatch swallow, a normalize
wrapper, a skip condition) unless explicitly requested.
- Add the test first. Write a test that reproduces the bug (or pins the contract), run it against the
unchanged code to confirm it fails (or, for a false positive, confirm it passes — locking the behavior the
reviewer misread so it is not re-flagged), then make the change and confirm green.
- Lock the previously-misread behavior with a regression test. If a reviewer misread
intersect ordering
once, a test asserting the order makes the next misread impossible to land.
- Run the affected suite and any downstream consumers; report pass/fail honestly, including pre-existing
warnings.
- Record the disposition (true bug fixed / false positive with evidence / restructured for clarity) where the
finding was tracked.
Worked example
A detailed end-to-end case — a real review finding that was a false positive on two counts, the empirical
checks that refuted it, the one genuine narrow bug it masked, and the structural rewrite that removed the
confusion — is in references/false-positive-case-study.md. Read it
for a concrete model of the whole loop: refute → classify → restructure → test-first → lock.
Improve this skill from use
After completing a task with this skill, reflect on whether its instructions or resources revealed a
gap, ambiguity, stale instruction, avoidable friction, or error. If concrete evidence surfaced, include
a brief Skill feedback note in the handoff or final response that names the affected file or section
and proposes the smallest useful correction. Do not invent feedback when no issue surfaced, and do not
edit the skill during an unrelated task without the user's authorization.
1---2name: verify-review-findings3description: Verify code-review findings before reporting them, and turn confusing-but-correct code into structural fixes. Use this skill when reviewing code, triaging or acting on review findings (e.g. a review TODO), deciding "is this actually a bug?", confirming or refuting a suspected defect, or fixing a bug found in review. Enforces a confirm-or-refute discipline that prevents false positives (flagging a non-bug) caused by non-obvious language semantics, helpers doing hidden double duty, and guards that live elsewhere in the flow — and treats a false positive triggered by unclear code as a real communication defect to be fixed structurally. Complements multiagent-review (which orchestrates the review) by governing the rigor of each individual finding.4---56# Verify Review Findings — Confirm or Refute, Fix Structure78A review finding is a **hypothesis, not a verdict**. Before reporting any correctness finding, confirm or9refute it against the code's actual semantics and full control/data flow. A false positive is expensive: it10erodes trust in the whole review, and acting on it wastes effort or introduces a regression "fixing" code that11was correct.1213This skill governs the rigor applied to each finding. For dispatching a multi-specialist review panel, use the14`multiagent-review` skill; for R-specific engineering judgment, use `advanced-r-engineering`. This skill applies15in single-pass review too.1617## The core discipline: confirm or refute before reporting1819Never flag a suspicious-looking line in isolation. For every candidate correctness bug, do all of the following20before writing it down as a bug:21221. **Read the whole function, not the line.** The disproof of a suspected bug often lives a few lines away —23 in an earlier loop, a sibling branch, or the function's preamble.24252. **Find where inputs are validated.** A guard that makes the suspicious line safe may run earlier in the26 same function, in a different loop, or in the caller. If a typo'd/missing input would already have errored27 upstream, the "silent wrong result" you imagined cannot happen.28293. **Verify the exact semantics of any stdlib/library call the finding hinges on — empirically.** Do not trust30 intuition about ordering, recycling, `NA` propagation, partial matching, or silent coercion. Run a two-line31 snippet and look. In R:3233 ```r34 # Does intersect() return first-arg order or second-arg order? Check, don't guess.35 base::intersect(c("group_A", "-", "group_B"), c("group_B", "group_A"))36 #> "group_A" "group_B" <- first-argument (contrast) order, operators dropped37 ```3839 ```bash40 Rscript -e 'print(base::intersect(c("a","-","b"), c("b","a")))'41 ```42434. **Trace callers and reachability.** Is the suspicious path on a primary path, or is it dead / deprecated /44 guarded out? A "bug" in an unreachable branch is a different (lower) severity than one on the hot path.45465. **Construct the concrete failure.** State it as: *input X → produces wrong output Y, expected Z.* If a47 reproducing input cannot be constructed, the finding is probably not a bug — downgrade or drop it.4849If a finding survives all five, it is real. If it does not, it is a **false positive** — but stop before50discarding it.5152## Classify every finding5354- **TRUE BUG** — a concrete reproducing input produces a wrong result or a crash. Fix the root cause55 (see below).56- **FALSE POSITIVE — code is correct and clear.** Drop it. Record the evidence (the semantic check, the57 upstream guard) so it is not re-flagged next review.58- **FALSE POSITIVE — code is correct but *misread because it is confusing*.** This is the important case: the59 confusion is itself a real, lower-severity defect — a **communication bug**. Correct code that an experienced60 reviewer reads as broken will be "fixed" into an actual bug eventually. The remedy is **structural61 clarification**, not a behavior change.6263Reporting a finding honestly includes saying "this specific claim was a false positive, and here is why" — with64the evidence. That is more valuable than silently deleting it.6566## Why correct code reads as buggy: the confusion smells6768When a false positive traces to confusing structure, look for these signatures — each is a structural defect69worth fixing even though behavior is correct:70711. **Load-bearing reliance on non-obvious language semantics, uncommented.** Correctness rides on a detail many72 competent programmers get wrong: set-operation ordering, vector recycling, `NA`/`NULL` propagation, partial73 argument matching, implicit numeric/character coercion. No comment flags it. The reader assumes the common74 (wrong) mental model and "finds" a bug.75762. **A helper doing implicit double duty.** One opaque call quietly does two or three jobs at once (e.g. filter77 *and* reorder *and* strip tokens). From the call site it looks like one thing, so its other effects read as78 missing or wrong.79803. **Guards separated from the code they protect.** Validation in loop 1; the code that depends on it in81 loop 2. Reading loop 2 alone, the protection is invisible and the code looks unguarded.82834. **Dead or fallback branches that silently do something arbitrary.** A branch that "handles" malformed input84 by guessing (e.g. taking the first two tokens) instead of rejecting it. It is both unreachable noise and a85 latent wrong-result generator.86875. **Multi-pass designs over an opaque intermediate representation.** Correctness is smeared across passes over88 a token list / index map / scratch column, so no single place states what the function guarantees.8990## The structural-fix playbook9192When the diagnosis is "correct but confusing," restructure so correctness is self-evident. Prefer, in order:9394- **State and enforce the contract up front.** Validate inputs at the top; `stop()`/raise with a clear message95 on violation. The function's precondition becomes readable, not implicit.96- **Replace clever double-duty calls with explicit single-purpose steps.** One statement, one job.97- **Co-locate guards with the code they protect.** Move validation next to the operation that relies on it, or98 merge the passes so the guarantee is visible where it matters.99- **Delete dead fallbacks.** Do not preserve arbitrary silent behavior "just in case." Reject malformed input100 loudly instead.101- **Collapse to a single linear pass** when the multi-pass design exists only to thread an opaque102 intermediate.103- **Comment only the residual.** Add a comment exactly where a genuinely non-obvious, load-bearing semantic104 remains — not as a substitute for restructuring.105106The test: after the change, a competent reviewer reading the function top-to-bottom sees the contract and the107data flow directly, with no off-screen subtlety to misread.108109## Then fix it properly110111For both true bugs and structural clarifications:112113- **Fix the root cause in the correct upstream location** — never a bandaid (a `tryCatch` swallow, a normalize114 wrapper, a skip condition) unless explicitly requested.115- **Add the test first.** Write a test that reproduces the bug (or pins the contract), run it against the116 unchanged code to confirm it fails (or, for a false positive, confirm it *passes* — locking the behavior the117 reviewer misread so it is not re-flagged), then make the change and confirm green.118- **Lock the previously-misread behavior with a regression test.** If a reviewer misread `intersect` ordering119 once, a test asserting the order makes the next misread impossible to land.120- **Run the affected suite and any downstream consumers**; report pass/fail honestly, including pre-existing121 warnings.122- Record the disposition (true bug fixed / false positive with evidence / restructured for clarity) where the123 finding was tracked.124125## Worked example126127A detailed end-to-end case — a real review finding that was a false positive on two counts, the empirical128checks that refuted it, the one genuine narrow bug it masked, and the structural rewrite that removed the129confusion — is in [references/false-positive-case-study.md](references/false-positive-case-study.md). Read it130for a concrete model of the whole loop: refute → classify → restructure → test-first → lock.131132## Improve this skill from use133134After completing a task with this skill, reflect on whether its instructions or resources revealed a135gap, ambiguity, stale instruction, avoidable friction, or error. If concrete evidence surfaced, include136a brief `Skill feedback` note in the handoff or final response that names the affected file or section137and proposes the smallest useful correction. Do not invent feedback when no issue surfaced, and do not138edit the skill during an unrelated task without the user's authorization.