Skip to content

Add a likelihood axis to review finding triage - #441

Open
pySilver wants to merge 1 commit into
addyosmani:mainfrom
pySilver:likelihood-axis-in-finding-triage
Open

pySilver wants to merge 1 commit into
addyosmani:mainfrom
pySilver:likelihood-axis-in-finding-triage

Conversation

@pySilver

Copy link
Copy Markdown

Closes #436.

Drafts the likelihood axis you described, scoped to what you asked for: code-review-and-quality's finding triage and the code-reviewer persona, echoing into doubt-driven-development. I left security-auditor and web-performance-auditor alone — they already carry the instinct informally, and you didn't ask for them.

Used likelihood rather than the materialization name from the issue; it's your vocabulary and it reads better in a review context.

What changed

skills/code-review-and-quality/SKILL.md — Step 4 gains the axis after the existing prefix table:

  • A three-band table (likely / plausible / remote) keyed on the triggering condition, not on a numeric score. Scores invite reverse-engineering to justify a severity already chosen; a named condition is checkable by the author.
  • Name the condition, don't assert the risk. "Fails if two workers process one shard" is settleable against the single-consumer invariant; "could have a race" is not. Tied explicitly to the reproduce-before-you-raise bar you mentioned.
  • Downgrade, never drop, with the reasoning stated.
  • Request changes reserved for findings that are both consequential and plausible.

Echoed in the places the skill already keeps its discipline: one line in Honesty in Review (quantifying likelihood is the same duty as quantifying impact), one Context checklist item, three rationalizations, three red flags, two verification items.

agents/code-reviewer.md — a ### Likelihood block under Output Format applying the same rule to Critical/Important/Suggestion, two new Rules, and the output template now asks for the triggering condition on blocking findings.

skills/doubt-driven-development/SKILL.md — a new RECONCILE class, valid but immaterial, inserted at position 2. Precedence matters here: if it sits after valid + actionable it can never match, because "real issue requiring a change" matches first. Putting it before forces "can this fire?" ahead of "what do I change?", which is what lets Step 5 terminate honestly instead of grinding.

It is genuinely a distinct class, not a rename of an existing one — valid trade-off is about fix cost, noise is about the reviewer lacking context. A fully-informed, correctly-understood finding whose trigger is unreachable had no home before and landed in actionable.

Your two constraints

You flagged the risk that this becomes an excuse to wave real bugs through. Both guards are in the diff:

Assessed, not guessed. Every instruction says to check the condition against the project's real inputs, invariants, and configuration and to read them. The failure mode you'd expect — "I can't check, so I'll assume it's fine" — gets a rationalization row and an explicit rule: an unverifiable condition is labelled unverified, not downgraded. Guessing high and guessing low are the same error. In doubt-driven-development the bar is harder: to classify immaterial you must quote the invariant that prevents the trigger, or the class is actionable. A feeling isn't an invariant.

Downgraded and noted, never dropped. Stated in all three files, with the reason: the author may know the condition is reachable for reasons the diff doesn't show, so downgrading hands them the call while deleting takes it away. A filter the author can't see reads as "the reviewer found nothing". There's a red flag for a finding downgraded with no stated reason, and a verification item for it.

One interaction worth checking: the new class does not let an agent evade the doubt-theater signal, since immaterial is not actionable — a cycle that classifies everything this way still trips the existing red flag. I made that explicit rather than leaving it to be inferred.

Verification

node scripts/validate-skills.js     # 24 skills, 0 errors, 0 warnings
node scripts/validate-commands.js   # 8 commands, 0 errors
node scripts/run-evals-test.js      # 12/12 pass
bash hooks/session-start-test.sh    # payload OK

Separable hunk: evals/cases/code-review-and-quality.json adds two behavioral expectations so the rule is checkable rather than just stated. Drop that hunk if you'd rather land the guidance first and let the eval follow — nothing else depends on it.

No new files, no restructuring; every addition sits in a section that already exists.

Severity is blast radius if a finding fires; it says nothing about
whether it fires. A true-but-improbable finding ("breaks at 10M rows"
on a 400-row internal tool) is therefore labelled the same as one that
bites on the first realistic input, and under REQUEST CHANGES it can
block a merge. Confidence cannot filter these either — the reviewer is
right about them, and they are still noise.

Triage now runs on consequence x likelihood:

- code-review-and-quality: Step 4 gains a likelihood band table
  (likely / plausible / remote), the rule that a finding must name the
  condition that makes it fire, and the rule that a remote finding is
  downgraded with its condition stated rather than dropped. Echoed in
  Honesty in Review, the checklist, rationalizations, red flags, and
  the verification list.
- code-reviewer: same discipline in the persona's categorization, plus
  the output template asking for the triggering condition.
- doubt-driven-development: a new RECONCILE class, valid but
  immaterial, placed before valid + actionable so "can this fire?" is
  asked before "what do I change?". Distinct from trade-off (fix cost)
  and noise (reviewer context).

Two guards against this becoming a way to wave real bugs through:
likelihood is assessed against the project's actual inputs and
invariants and never guessed (an unverifiable condition is labelled
unverified, not downgraded), and the doubt-driven class requires
quoting the invariant that prevents the trigger.

Refs addyosmani#436

@codeCraft-Ritik codeCraft-Ritik left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice work on this! I like how you've introduced the likelihood axis in a structured way without overcomplicating the existing review flow. The distinction between likely, plausible, and remote makes the guidance much more actionable, and tying findings to explicit triggering conditions rather than speculation is a thoughtful improvement.

@pySilver

pySilver commented Aug 2, 2026

Copy link
Copy Markdown
Author

I am testing this addition for a while and I'm happy to see less nonsense issues flagged while doing code or plan reviews.

@addyosmani addyosmani left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exactly what I hoped #436 would turn into, and you built the part I most cared about. The three-tier likelihood (Likely / Plausible / Remote) is clean, and "downgrade, never drop" is the line that makes it safe: a remote finding keeps its comment and its reasoning and just stops blocking, so the author still gets to say "actually that condition is reachable, here's why." The reciprocal rule, that overstating likelihood is the same dishonesty as softening a real bug, is the right guard against the axis becoming an excuse to wave things through. Assessing against the project's real inputs rather than guessing, and flagging unverified when you can't check, closes the last gap. Merges clean, validators pass, routing unchanged.

This does add a genuine dimension to the flagship review skill's philosophy, so I want Addy's eye on it before it lands, but from a quality standpoint I'm happy with it. Approving.

@addyosmani

Copy link
Copy Markdown
Owner

@nucliweb @federicobartoli could one of you take this one before it lands? It adds a likelihood axis to review-finding triage: downgrade the improbable-but-technically-correct findings ("breaks at 10M rows" on a 400-row table) instead of blocking a merge on them, with "downgrade, never drop" as the guard. I've reviewed and approved it, it's clean and green, and frontmatter is untouched so there's no routing impact. But it changes review-blocking behavior across code-review-and-quality and doubt-driven-development, so I want a second set of eyes rather than merging on my approval alone. Background is in #436.

@addyosmani

Copy link
Copy Markdown
Owner

@nucliweb @federicobartoli re-nudge on this one: it's approved and green, just needs one of your eyes since it changes review-blocking behavior. Whenever you have a moment.

@addyosmani

Copy link
Copy Markdown
Owner

Reviving this one. It conflicts with main now (code-review-and-quality has moved, including #618 on the tests step), so a rebase please, @pySilver. @nucliweb @federicobartoli I still want one of you to look before it lands since it changes when review findings block a merge; it's small once rebased.

@pySilver

pySilver commented Oct 3, 2026

Copy link
Copy Markdown
Author

@addyosmani im not sure this is still relevant with latest models. Ok it definitely is, but the way it solved isn't the best. I'd rather suggest users use review tool like revmux (on GitHub) or setup two sided chat between models in Agterm

@federicobartoli federicobartoli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this sat for two months. Addy asked in August and I missed it. I read the whole diff against today's main.

praise: the precedence reasoning in doubt-driven-development is the part I would have gotten wrong. Putting immaterial ahead of actionable, requiring the quoted invariant, and keeping it distinct from noise all hold together, and the doubt-theater flag on main still trips if everything is classified that way.

issue (blocking): rebase. Only agents/code-reviewer.md conflicts. Main renamed the persona's labels on 27 August (7cb7a20) to Critical / Required / Optional / Nit, matching the skill. In the Likelihood block that makes "three categories" four, Important becomes Required, Suggestion becomes Optional (rule 7 too), and the two template lines move under Required Changes and Optional. The skill, doubt-driven-development and the eval file merge on their own.

Two more blocking points and a few optional ones are inline. Both blocking ones are one-sentence fixes, so they can ride along with the rebase.

| **Likely** | Occurs on the normal path or the first realistic input | Label on consequence |
| **Plausible** | Needs a specific but real condition — an error path, a concurrent write, a large input | Label on consequence |
| **Remote** | Needs a conjunction the code already prevents, a scale this system won't reach, or a configuration it doesn't use | Downgrade to **Optional:** / **FYI**, with the condition stated |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (blocking): the table has no row for a condition you cannot check. "Unverified" appears only in a rationalization row and in the persona, and neither says what it does to the verdict. Read together with "blocking on a guess is an error", a Critical you cannot verify does not block. That matters more now that the skill explicitly covers a diff pasted inline, where there is no project to read. Could the rule be stated, whichever way you intend it? One option, if it matches:

Suggested change
| **Unverified** | You cannot check the condition from what you can read | Keep the consequence label, mark it unverified, and name what would settle it. A Critical one holds the merge until someone has checked; anything lower becomes a question to the author |

The rationalization row on line 387 and the persona bullet would then need the same rule in place of "blocking on a guess is the same error".

| **Remote** | Needs a conjunction the code already prevents, a scale this system won't reach, or a configuration it doesn't use | Downgrade to **Optional:** / **FYI**, with the condition stated |

**Name the condition, don't assert the risk.** "Fails if two workers process one shard" is checkable — the reader compares it against the single-consumer invariant and settles it. "Could have a race" is not. If you cannot name the condition that makes a finding fire, you have not established the finding — the same bar as reproducing a bug before you raise it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (blocking): as written, the rule and the verification item on line 415 cover every Critical and Required finding, but some Required findings on main have no trigger to name: the presumptive blockers listed under Verification (a refactor that relocates complexity, a file pushed past the size boundary, a near-duplicate helper). Read literally, those are either "not established" or need an invented condition. Could the axis be scoped to findings that predict a failure?

Suggested change
This axis is for findings that predict a failure: a bug, a vulnerability, a performance cliff. Structural and readability findings have no trigger to assess, so label those on the criteria above.

Line 415 would then read "Every Critical and Required finding that predicts a failure names the condition that makes it fire", and the persona's Required template line the same.

**Downgrade, never drop.** A remote finding keeps its comment, its condition, and your reasoning; it just stops blocking. The author may know the condition is reachable for reasons the diff doesn't show. Downgrading hands them that call — deleting takes it away, and a filter the author can't see reads as "the reviewer found nothing".

**Reserve Request changes for findings that are both consequential and plausible.** Blocking a merge on things that cannot happen trains authors to discount the whole review, including the finding that was real.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (non-blocking): "this project's actual inputs" can be read as "what legitimate users send". For untrusted input the table already lands on Plausible, but one explicit sentence would stop a reviewer from downgrading an injection because the input is unusual:

Suggested change
For input an attacker controls, the actual inputs are whatever can be sent, not what legitimate users send. A security finding is remote only when the code or configuration makes the trigger unreachable, never because the input is unusual.

Comment on lines +42 to +43
"Blocking findings name the condition that makes them fire, rather than asserting risk generically",
"Any finding judged unlikely under the project's actual inputs is downgraded with its condition stated, not omitted"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (non-blocking): line 42 is checkable on the current fixture. Line 43 has nothing to bite on: user-search.diff is a bare diff with no project around it and no finding whose trigger the code prevents, so a grader either passes it vacuously or fails it for lack of evidence. You offered to drop this hunk. I would keep 42 and hold 43 until a fixture plants a remote finding, and I am happy to add that case as a follow-up.

Suggested change
"Blocking findings name the condition that makes them fire, rather than asserting risk generically",
"Any finding judged unlikely under the project's actual inputs is downgraded with its condition stated, not omitted"
"Blocking findings name the condition that makes them fire, rather than asserting risk generically"

| "It's just a version bump" | A bump is a behavior change you didn't write. Read the changelog; semver doesn't guarantee no breakage. |
| "I'll upgrade everything in one PR to save time" | A bulk bump that breaks the build hides which package did it. One dependency per change keeps the cause and the revert clean. |
| "It's technically possible, so it's a real finding" | Possible isn't likely. If the trigger needs something the code already prevents, downgrade it and say why. Still worth writing down; not worth blocking on. |
| "Better to flag it just in case" | Every finding costs the author a read, an evaluation, and a dismissal. A review padded with impossible findings gets skimmed — and the real one gets skimmed with it. |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: "downgrade, never drop" and this row pull in opposite directions for a remote finding. Is the intended reading that an established remote finding is kept, one line, after the blocking ones, and that padding means raising findings with no named condition? If so, saying where downgraded findings go would settle it.

2. **Valid + actionable** — real issue requiring a change to the artifact. Change it, re-loop.
3. **Valid trade-off** — issue is real but cost of fixing exceeds cost of accepting. Document the trade-off explicitly so the user sees it.
4. **Noise** — reviewer flagged something that's actually correct under context the reviewer didn't have. Note it, move on, and ask: would adding that context to the contract have prevented the false flag?
2. **Valid but immaterial** — the issue is real and the reviewer understood it correctly, but its triggering condition cannot occur: the artifact or contract already prevents it, or it needs a scale or configuration this system doesn't have. Document it with the condition; do not change the artifact and do not re-loop on it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: this class is the Remote band of code-review-and-quality under another name. A short pointer between the two would keep them from drifting apart.

@federicobartoli

Copy link
Copy Markdown
Collaborator

@pySilver thanks, and sorry my review landed right after your note. I read it as "the problem is real, I would solve it differently now". The diff still does what #436 asked for, so I would rather not lose it. If you prefer not to spend more time on it, I can do the rebase and apply the points above on this branch, keeping your commit and authorship, and Addy can re-review the result. If you would rather withdraw it, that is fine too. @addyosmani your call on which way to go.

@pySilver

pySilver commented Oct 3, 2026

Copy link
Copy Markdown
Author

Sure, please take over!

@mavericksea-ai

mavericksea-ai commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

@addyosmani @federicobartoli Following the request for prevented-failure coverage, I prepared cases that distinguish a risk being reachable, genuinely prevented, or still unverified, and tested them through the repository's actual Claude Code plugin workflow.

Check Result
Eight filesystem-backed cases, three trials with and without the plugin 48 complete agent runs
Explicitly requested review skill Invoked in 24/24 plugin-enabled runs
Behavioral criteria Passed in both arms; no measured skill advantage on this suite
Evidence retained Tool traces, final answers, grading results and reproduction instructions

The cases cover reservation races and SQL parameter binding, including two situations where a lock looks sufficient but isn't:

  • A try/finally lock around return reserve(...) releases before the promise settles. The executable fixture accepts two reservations against one item; using return await reserve(...) makes it accept only one.
  • A correct queue in each worker still doesn't coordinate two workers sharing a database.

These complement the genuinely prevented case, giving that expectation concrete evidence to check. I also ran the six original dialogue fixtures through the native Tier-3 runner against both skill revisions; all passed.

I used Driftproof 0.19 to import these results and validate the resulting receipts, which are included in the evidence package.

Evidence and reproducible fixtures: report, results and retained traces. The report distinguishes the full-plugin runs from the separate skill-revision checks and documents the redactions in the public traces.

Would a small fixtures PR help your planned follow-up? I can start with the requested reachable/prevented pair, with the broader cases available for follow-up.

Optionally, I can include a tested Driftproof 0.19 receipt-export command for the native plugin results. It reuses the completed run without further model calls. The fixtures work independently, so there's no mandatory dependency or CI change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review surfaces rank findings by consequence only — no likelihood axis, so improbable findings block merges

5 participants