Finding discipline
Use this skill after you have inspected enough code to know a concrete runtime
failure or present maintenance cost. The goal is fewer, sharper findings that a
PR author can fix.
Workflow
- Treat reviewer output as candidate observations. For each runtime candidate,
apply the likelihood-impact framework in Risk rating, then
apply the finding bar in Finding bar.
- Apply the three-gate actionability contract in
Actionability gate. Treat this as the required
decision point for whether a candidate may produce a finding, code, or a
test.
- Drop excluded observations using Exclusions.
- Run the confirmation pass in Confirmation pass.
- Write each finding with the format and severity rules in Output.
- Perform the final review pass before presenting findings.
Required discipline
- Optimize candidate generation for recall and finding acceptance for precision.
- Prefer no finding over a weak finding.
- Require reality, importance, and repair quality to pass independently.
Repair quality may authorize either a supported repair or an owner
consultation when the problem is proven but the repair is not. Neither path
automatically authorizes a patch or test.
- Put only proven, deliberately tolerated risk in residual risk. Reject
theoretical possibilities instead of preserving them as warnings.
- Merge duplicates under one root cause.
- Remove findings that depend on unproven assumptions.
- Check each line reference still overlaps the reviewed change when possible.
- Make titles action-oriented, not diagnostic labels.
Risk rating
Treat reviewer output as a hypothesis. Rate severity only after proving a
current production path and a meaningful consequence.
Risk reality check
Record this case before the findings CLI assigns severity and disposition:
Production path: <current producer -> transformations -> failing sink>
Reachability evidence: <observed payload, current contract, or repository invariant>
Likelihood: likely | possible | rare | unknown | theoretical
Impact: critical | high | medium | low
Actual consequence: <verified behavior and meaningful user/system impact>
Use these likelihood meanings:
likely: observed or reached by normal, recurring supported inputs.
possible: a supported current path reaches it without an exceptional
combination of events.
rare: a supported current path exists, but requires an unusual input or
state combination.
unknown: evidence is missing. Investigate; do not guess a probability.
theoretical: only an arbitrary type value, synthetic test, dependency
maximum, or imagined state reaches it. Reject it.
Use these impact meanings:
critical: exploitable security boundary, irreversible data loss or
corruption, or broad outage.
high: blocked core workflow, serious data or permission error, or many
affected users.
medium: bounded correctness or workflow failure with meaningful recovery
cost.
low: presentation defect, minor inconvenience, or easy recovery without
material loss.
Deterministic rating
Supply likelihood and impact. Do not choose severity or disposition; the
findings CLI derives the risk outcome from this table:
| Likelihood |
Low impact |
Medium impact |
High impact |
Critical impact |
| likely |
P3, accept |
P2, accept |
P1, accept |
P0, accept |
| possible |
no severity, reject |
P2, accept |
P1, accept |
P1, accept |
| rare |
no severity, reject |
no severity, reject |
P2, consult |
P1, consult |
| unknown |
no severity, investigate |
no severity, investigate |
no severity, investigate |
no severity, investigate |
| theoretical |
no severity, reject |
no severity, reject |
no severity, reject |
no severity, reject |
Low-probability, low-impact risk defaults to no finding and no code. Severity
reflects likelihood and impact together; worst-case impact alone cannot raise a
finding. Supply --handling fix|consult|follow-up|reject separately: it routes a
proven finding without changing severity or turning a rejected or unproven risk
into work. Use reject with the failed actionability gate and rationale when a
candidate does not deserve intervention. A contained systemic repair may use
fix; a material systemic repair uses consult before editing. When the owner deliberately
defers an accepted local finding, the CLI records it as residual risk without
changing its severity. The owner may reject a consulted finding without turning
it into an autonomous patch; the terminal update records that separate decision
with --owner-resolution. An unanswered consult stays open. A real adjacent
issue uses follow-up, is reported as deferred work, and does not block the
current review.
Disposition
accept: non-synthetic evidence proves the path and consequence, the table
makes action worthwhile, and the behavior violates a current contract.
investigate: reachability, likelihood, or sink behavior is still unproven.
Gather evidence; do not patch.
consult: the risk is proven, but tolerance or scope is a product, security,
compatibility, operational, or architectural choice. Ask before patching.
follow-up: the issue is real but belongs outside the current review. Record
the owner or next action without blocking the current PR.
residual: the risk is proven and the current change deliberately leaves it
unresolved. Record it without patching.
reject: the path is theoretical, the combined risk does not justify code,
or the current contract explicitly allows the proven behavior.
The burden of proof belongs to the finding. A test created from the reviewer's
example can verify a fix after acceptance; it cannot supply missing production
evidence.
Defence in depth
Rare does not mean harmless. Proven rare/high and rare/critical risks become
consults with P2 and P1 severity respectively. Present the boundary and durable
options before editing. Prefer an existing repository, framework, or dependency
primitive when the user authorizes defence in depth. A custom maze of special
cases fails the fix bar even when the underlying risk is serious.
Finding bar
A review finding must satisfy all of these:
- Introduced by the reviewed change or newly exposed by it.
- Tied to a specific changed line, symbol, config, or contract.
- Has an evidence-backed, realistic failure mode or a concrete present
maintenance cost, not just "this looks risky" or "this could be cleaner."
- Explains impact in current product, runtime, or maintenance terms.
- Has either a justified repair direction or a concrete unresolved repair
decision that is important enough to bring to the owner. A possible patch or
vague request for guidance is not enough.
- Has enough confidence that a maintainer would likely want the author to act.
Defensive findings
A finding whose remedy adds a guard, cap, escape, normalization, fallback, or
other defensive path must pass the risk rating and the relevant evidence test:
- For a capacity cap or truncation path, show repository or production evidence
that a current producer can realistically approach the threshold. A declared
downstream limit or theoretically unbounded collection is not enough.
- For escaping or delimiter handling, show that a supported or observed input
can contain the exact delimiter or control character and that the real
renderer or parser produces a material failure. An arbitrary string type or
synthetically constructed value is not enough.
A maintenance finding must use repository evidence to prove current unnecessary
complexity, duplication, or code with no current job, and name the reading,
change, test, or ownership cost it adds.
Prefer no finding over a weak finding.
Actionability gate
A candidate may produce a finding, code, or a test only after these gates pass
in order:
- Reality: trace a supported producer to the claimed boundary and verify
relevant guards, invariants, and dependency behavior. Arbitrary type values,
synthetic calls, and dependency maxima are not production evidence.
- Importance: name the violated contract, likelihood, impact, affected
party, consequence, and recovery. Compare the realistic harm with the
permanent code, tests, and operational complexity of intervening.
- Repair quality: identify the root cause and owning boundary, compare
doing nothing with plausible repairs, prefer an existing repository or
dependency primitive, and count every new branch, fallback, abstraction,
state transition, test, and failure mode.
A failed gate means reject or investigate. Worst-case impact cannot compensate
for implausible reachability, and a specific patch is not automatically a
justified patch.
Repair quality passes through one of two routes:
- Repair: one durable direction is supported and its benefit justifies its
full cost. Only this route may authorize a patch.
- Consultation: the problem is real and important, but the durable direction
requires an owner decision. Record the exact question, options checked, and
why none is supported yet; do not patch.
Choose proof after the repair passes. Before adding, changing, or removing a
test, load test-audit and let its portfolio decision own whether coverage is
kept, added, consolidated, moved, rewritten, deleted, or unnecessary. A
historical regression alone does not justify a test; visual UI defects usually
need rendered proof instead.
Required record
An actionable runtime finding records contract evidence, root cause, and
intervention justification in addition to its risk rating. An actionable
maintenance finding records root cause and intervention justification in
addition to maintenance evidence and present cost. A patch, deferral, or
approved consultation also requires the recommended repair. An unresolved or
declined consultation may omit it only when its decision explains why no repair
is supported.
Exclusions
Do not report:
- style, naming, formatting, architecture taste, or "could be cleaner"
refactors without a concrete current problem
- generic missing tests unless the missing test hides a specific failure mode
- speculative security concerns without an executable path
- broad "consider" suggestions
- duplicate findings that share the same root cause
- stale findings against code that is not part of the reviewed diff
Use residual risk only for a proven trigger and consequence that the current
change deliberately leaves unresolved. Reject unsupported possibilities rather
than preserving them as notes.
Confirmation pass
Before finalizing a runtime finding, answer:
- What exact input, state, timing, permission, platform, or dependency version
triggers this?
- What does the code do now, and why is that wrong?
- Which current contract proves it is wrong: caller expectation, test, docs,
type, API, UI behavior, security boundary, or previous behavior?
- What is the root cause, which boundary owns it, and what is the smallest
durable repair there?
- Could this be a false positive because of an upstream guard or invariant?
- Why is the recommended repair better than doing nothing after counting its
complexity, tests, and new failure modes?
If answers 1-3 are hand-wavy, keep inspecting or drop the finding. If answers
4-6 do not justify a repair, do not patch. Consult only when the proven problem
is important enough for an owner decision and the finding names the repair
question and directions already checked; otherwise investigate or reject it.
Confirm that the finding record contains a complete risk rating. For a
defensive-code finding, check capacity claims and delimiter claims
independently; evidence for one does not prove the other.
For a maintenance finding, answer instead:
- What exact changed code is unnecessarily complex, duplicated, or unused?
- What repository evidence proves that present maintenance problem?
- What present reading, change, test, or ownership cost does it add?
- What root cause and ownership error creates that cost?
- What smaller durable code preserves all current behavior?
- What boundary, domain concept, dependency direction, expected variability,
or useful test seam would the simplification preserve or remove?
- Why is changing the code better than tolerating the current maintenance
cost?
If the evidence for answers 2-3 is hand-wavy, drop the finding.
Output
Use this shape for each finding:
[P0/P1/P2/P3] Imperative title under 80 characters
The changed code in `path/to/file.ts` now does <bad behavior> when <trigger>.
That breaks <contract/user-visible behavior> because <evidence>. Fix by
<recommended durable direction>. This intervention is justified because
<benefit compared with doing nothing and full repair cost>.
Include file and line references as tightly as the harness supports. In Codex
app reviews, emit ::code-comment{...} findings when the user asked for review
findings.
For a repairless consultation, use this body instead:
[P0/P1/P2] Imperative title under 80 characters
The changed code in `path/to/file.ts` causes <proven behavior> when <trigger>,
affecting <party and consequence>. The root cause belongs to <boundary>. The
repair remains unresolved because <directions checked and why none is yet
supported>. Ask the owner to decide <specific question> before editing code.
Use exactly the severity and disposition returned by the findings CLI. Do not
choose or raise severity in prose. A severity attached to consult records the
stakes. The consultation is actionable as an owner decision, not as permission
to patch.
For a maintenance finding, use this body instead:
[maintenance] Imperative title under 80 characters
The changed code in `path/to/file.ts` adds <defense, duplication, or
indirection>, and <repository evidence> proves the present maintenance problem.
This adds <specific reading/change/test cost> without improving <behavior or
boundary>. Fix by <specific simplification at the owning boundary>. This
intervention is justified because <benefit compared with doing nothing and full
repair cost>.
Severity
P0: likely, critical impact.
P1: likely or possible high impact, or possible or rare critical impact.
P2: likely or possible medium impact, or rare high impact.
P3: likely, low impact.
Unknown and theoretical risks have no severity. Possible/low and rare/low or
medium risks are rejected. The CLI is authoritative when prose and memory
disagree.
1---2name: finding-discipline3description: Confirm actionable review findings, deduplicate root causes, and exclude nits, vague risks, and style notes.4---56# Finding discipline78Use this skill after you have inspected enough code to know a concrete runtime9failure or present maintenance cost. The goal is fewer, sharper findings that a10PR author can fix.1112## Workflow13141. Treat reviewer output as candidate observations. For each runtime candidate,15 apply the likelihood-impact framework in [Risk rating](#risk-rating), then16 apply the finding bar in [Finding bar](#finding-bar).172. Apply the three-gate actionability contract in18 [Actionability gate](#actionability-gate). Treat this as the required19 decision point for whether a candidate may produce a finding, code, or a20 test.213. Drop excluded observations using [Exclusions](#exclusions).224. Run the confirmation pass in [Confirmation pass](#confirmation-pass).235. Write each finding with the format and severity rules in [Output](#output).246. Perform the final review pass before presenting findings.2526## Required discipline2728- Optimize candidate generation for recall and finding acceptance for precision.29- Prefer no finding over a weak finding.30- Require reality, importance, and repair quality to pass independently.31 Repair quality may authorize either a supported repair or an owner32 consultation when the problem is proven but the repair is not. Neither path33 automatically authorizes a patch or test.34- Put only proven, deliberately tolerated risk in residual risk. Reject35 theoretical possibilities instead of preserving them as warnings.36- Merge duplicates under one root cause.37- Remove findings that depend on unproven assumptions.38- Check each line reference still overlaps the reviewed change when possible.39- Make titles action-oriented, not diagnostic labels.4041## Risk rating4243Treat reviewer output as a hypothesis. Rate severity only after proving a44current production path and a meaningful consequence.4546### Risk reality check4748Record this case before the findings CLI assigns severity and disposition:4950```text51Production path: <current producer -> transformations -> failing sink>52Reachability evidence: <observed payload, current contract, or repository invariant>53Likelihood: likely | possible | rare | unknown | theoretical54Impact: critical | high | medium | low55Actual consequence: <verified behavior and meaningful user/system impact>56```5758Use these likelihood meanings:5960- `likely`: observed or reached by normal, recurring supported inputs.61- `possible`: a supported current path reaches it without an exceptional62 combination of events.63- `rare`: a supported current path exists, but requires an unusual input or64 state combination.65- `unknown`: evidence is missing. Investigate; do not guess a probability.66- `theoretical`: only an arbitrary type value, synthetic test, dependency67 maximum, or imagined state reaches it. Reject it.6869Use these impact meanings:7071- `critical`: exploitable security boundary, irreversible data loss or72 corruption, or broad outage.73- `high`: blocked core workflow, serious data or permission error, or many74 affected users.75- `medium`: bounded correctness or workflow failure with meaningful recovery76 cost.77- `low`: presentation defect, minor inconvenience, or easy recovery without78 material loss.7980### Deterministic rating8182Supply likelihood and impact. Do not choose severity or disposition; the83findings CLI derives the risk outcome from this table:8485| Likelihood | Low impact | Medium impact | High impact | Critical impact |86| --- | --- | --- | --- | --- |87| likely | P3, accept | P2, accept | P1, accept | P0, accept |88| possible | no severity, reject | P2, accept | P1, accept | P1, accept |89| rare | no severity, reject | no severity, reject | P2, consult | P1, consult |90| unknown | no severity, investigate | no severity, investigate | no severity, investigate | no severity, investigate |91| theoretical | no severity, reject | no severity, reject | no severity, reject | no severity, reject |9293Low-probability, low-impact risk defaults to no finding and no code. Severity94reflects likelihood and impact together; worst-case impact alone cannot raise a95finding. Supply `--handling fix|consult|follow-up|reject` separately: it routes a96proven finding without changing severity or turning a rejected or unproven risk97into work. Use `reject` with the failed actionability gate and rationale when a98candidate does not deserve intervention. A contained systemic repair may use99`fix`; a material systemic repair uses `consult` before editing. When the owner deliberately100defers an accepted local finding, the CLI records it as residual risk without101changing its severity. The owner may reject a consulted finding without turning102it into an autonomous patch; the terminal update records that separate decision103with `--owner-resolution`. An unanswered consult stays open. A real adjacent104issue uses `follow-up`, is reported as deferred work, and does not block the105current review.106107### Disposition108109- `accept`: non-synthetic evidence proves the path and consequence, the table110 makes action worthwhile, and the behavior violates a current contract.111- `investigate`: reachability, likelihood, or sink behavior is still unproven.112 Gather evidence; do not patch.113- `consult`: the risk is proven, but tolerance or scope is a product, security,114 compatibility, operational, or architectural choice. Ask before patching.115- `follow-up`: the issue is real but belongs outside the current review. Record116 the owner or next action without blocking the current PR.117- `residual`: the risk is proven and the current change deliberately leaves it118 unresolved. Record it without patching.119- `reject`: the path is theoretical, the combined risk does not justify code,120 or the current contract explicitly allows the proven behavior.121122The burden of proof belongs to the finding. A test created from the reviewer's123example can verify a fix after acceptance; it cannot supply missing production124evidence.125126### Defence in depth127128Rare does not mean harmless. Proven rare/high and rare/critical risks become129consults with P2 and P1 severity respectively. Present the boundary and durable130options before editing. Prefer an existing repository, framework, or dependency131primitive when the user authorizes defence in depth. A custom maze of special132cases fails the fix bar even when the underlying risk is serious.133134## Finding bar135136A review finding must satisfy all of these:137138- Introduced by the reviewed change or newly exposed by it.139- Tied to a specific changed line, symbol, config, or contract.140- Has an evidence-backed, realistic failure mode or a concrete present141 maintenance cost, not just "this looks risky" or "this could be cleaner."142- Explains impact in current product, runtime, or maintenance terms.143- Has either a justified repair direction or a concrete unresolved repair144 decision that is important enough to bring to the owner. A possible patch or145 vague request for guidance is not enough.146- Has enough confidence that a maintainer would likely want the author to act.147148### Defensive findings149150A finding whose remedy adds a guard, cap, escape, normalization, fallback, or151other defensive path must pass the risk rating and the relevant evidence test:152153- For a capacity cap or truncation path, show repository or production evidence154 that a current producer can realistically approach the threshold. A declared155 downstream limit or theoretically unbounded collection is not enough.156- For escaping or delimiter handling, show that a supported or observed input157 can contain the exact delimiter or control character and that the real158 renderer or parser produces a material failure. An arbitrary string type or159 synthetically constructed value is not enough.160161A maintenance finding must use repository evidence to prove current unnecessary162complexity, duplication, or code with no current job, and name the reading,163change, test, or ownership cost it adds.164165Prefer no finding over a weak finding.166167## Actionability gate168169A candidate may produce a finding, code, or a test only after these gates pass170in order:1711721. **Reality:** trace a supported producer to the claimed boundary and verify173 relevant guards, invariants, and dependency behavior. Arbitrary type values,174 synthetic calls, and dependency maxima are not production evidence.1752. **Importance:** name the violated contract, likelihood, impact, affected176 party, consequence, and recovery. Compare the realistic harm with the177 permanent code, tests, and operational complexity of intervening.1783. **Repair quality:** identify the root cause and owning boundary, compare179 doing nothing with plausible repairs, prefer an existing repository or180 dependency primitive, and count every new branch, fallback, abstraction,181 state transition, test, and failure mode.182183A failed gate means reject or investigate. Worst-case impact cannot compensate184for implausible reachability, and a specific patch is not automatically a185justified patch.186187Repair quality passes through one of two routes:188189- **Repair:** one durable direction is supported and its benefit justifies its190 full cost. Only this route may authorize a patch.191- **Consultation:** the problem is real and important, but the durable direction192 requires an owner decision. Record the exact question, options checked, and193 why none is supported yet; do not patch.194195Choose proof after the repair passes. Before adding, changing, or removing a196test, load `test-audit` and let its portfolio decision own whether coverage is197kept, added, consolidated, moved, rewritten, deleted, or unnecessary. A198historical regression alone does not justify a test; visual UI defects usually199need rendered proof instead.200201### Required record202203An actionable runtime finding records contract evidence, root cause, and204intervention justification in addition to its risk rating. An actionable205maintenance finding records root cause and intervention justification in206addition to maintenance evidence and present cost. A patch, deferral, or207approved consultation also requires the recommended repair. An unresolved or208declined consultation may omit it only when its decision explains why no repair209is supported.210211## Exclusions212213Do not report:214215- style, naming, formatting, architecture taste, or "could be cleaner"216 refactors without a concrete current problem217- generic missing tests unless the missing test hides a specific failure mode218- speculative security concerns without an executable path219- broad "consider" suggestions220- duplicate findings that share the same root cause221- stale findings against code that is not part of the reviewed diff222223Use residual risk only for a proven trigger and consequence that the current224change deliberately leaves unresolved. Reject unsupported possibilities rather225than preserving them as notes.226227## Confirmation pass228229Before finalizing a runtime finding, answer:2302311. What exact input, state, timing, permission, platform, or dependency version232 triggers this?2332. What does the code do now, and why is that wrong?2343. Which current contract proves it is wrong: caller expectation, test, docs,235 type, API, UI behavior, security boundary, or previous behavior?2364. What is the root cause, which boundary owns it, and what is the smallest237 durable repair there?2385. Could this be a false positive because of an upstream guard or invariant?2396. Why is the recommended repair better than doing nothing after counting its240 complexity, tests, and new failure modes?241242If answers 1-3 are hand-wavy, keep inspecting or drop the finding. If answers2434-6 do not justify a repair, do not patch. Consult only when the proven problem244is important enough for an owner decision and the finding names the repair245question and directions already checked; otherwise investigate or reject it.246Confirm that the finding record contains a complete risk rating. For a247defensive-code finding, check capacity claims and delimiter claims248independently; evidence for one does not prove the other.249250For a maintenance finding, answer instead:2512521. What exact changed code is unnecessarily complex, duplicated, or unused?2532. What repository evidence proves that present maintenance problem?2543. What present reading, change, test, or ownership cost does it add?2554. What root cause and ownership error creates that cost?2565. What smaller durable code preserves all current behavior?2576. What boundary, domain concept, dependency direction, expected variability,258 or useful test seam would the simplification preserve or remove?2597. Why is changing the code better than tolerating the current maintenance260 cost?261262If the evidence for answers 2-3 is hand-wavy, drop the finding.263264## Output265266Use this shape for each finding:267268```md269[P0/P1/P2/P3] Imperative title under 80 characters270271The changed code in `path/to/file.ts` now does <bad behavior> when <trigger>.272That breaks <contract/user-visible behavior> because <evidence>. Fix by273<recommended durable direction>. This intervention is justified because274<benefit compared with doing nothing and full repair cost>.275```276277Include file and line references as tightly as the harness supports. In Codex278app reviews, emit `::code-comment{...}` findings when the user asked for review279findings.280281For a repairless consultation, use this body instead:282283```md284[P0/P1/P2] Imperative title under 80 characters285286The changed code in `path/to/file.ts` causes <proven behavior> when <trigger>,287affecting <party and consequence>. The root cause belongs to <boundary>. The288repair remains unresolved because <directions checked and why none is yet289supported>. Ask the owner to decide <specific question> before editing code.290```291292Use exactly the severity and disposition returned by the findings CLI. Do not293choose or raise severity in prose. A severity attached to `consult` records the294stakes. The consultation is actionable as an owner decision, not as permission295to patch.296297For a maintenance finding, use this body instead:298299```md300[maintenance] Imperative title under 80 characters301302The changed code in `path/to/file.ts` adds <defense, duplication, or303indirection>, and <repository evidence> proves the present maintenance problem.304This adds <specific reading/change/test cost> without improving <behavior or305boundary>. Fix by <specific simplification at the owning boundary>. This306intervention is justified because <benefit compared with doing nothing and full307repair cost>.308```309310### Severity311312- `P0`: likely, critical impact.313- `P1`: likely or possible high impact, or possible or rare critical impact.314- `P2`: likely or possible medium impact, or rare high impact.315- `P3`: likely, low impact.316317Unknown and theoretical risks have no severity. Possible/low and rare/low or318medium risks are rejected. The CLI is authoritative when prose and memory319disagree.