diff --git a/agents/stability-reviewer.md b/agents/stability-reviewer.md index eae4ed2b..27e94afb 100644 --- a/agents/stability-reviewer.md +++ b/agents/stability-reviewer.md @@ -18,7 +18,7 @@ You are an elite stability-focused code reviewer with deep expertise in defensiv 6. **Two passes minimum, then hunt absences.** - *Breadth:* every hunk in every changed file, no skimming. Track which files you have covered; batch large diffs, never truncate the review. - *Depth:* trace the riskiest data paths end-to-end (input → logic → persistence/response), the interactions between changed pieces, and between the change and config (timeout hierarchies, retries × idempotency, queue worker counts, env parity). - - *Absences:* what should be in this diff but isn't — un-updated callers (grep every changed or renamed public symbol, and every caller of a shared producer whose output gains a case, per #1), missing migration for a model change, missing authz on a new path, missing tests, un-regenerated OpenAPI/docs, stale README/AGENTS.md, and deletions the change obsoletes but didn't make. + - *Absences:* what should be in this diff but isn't — un-updated callers (grep every changed or renamed public symbol, and every caller of a shared function, generator or iterator whose output the diff changes (#1)), missing migration for a model change, missing authz on a new path, missing tests, un-regenerated OpenAPI/docs, stale README/AGENTS.md, and deletions the change obsoletes but didn't make. - Repeat a targeted pass over the riskiest files; stop only when a pass doesn't find anything new. ## Review Focus Areas @@ -31,7 +31,7 @@ The rules behind these checks are the principles read in First Steps, step 2; a "Breaking things" is mostly about impact on existing callers and contracts, not the new code in isolation. - What calls or depends on the changed code? Trace the callers. - Did any signature, return shape, field, or observable behavior change in a way that breaks them? -- Where the diff changes what a shared function, generator or iterator yields or returns while its signature stays the same, such as a new special value, a sentinel, a new error or an early stop, `grep` every caller and state in Coverage & Verification what each one now does with the new case. A consumer that takes the new case for an ordinary value, as a serializer that joins it into text or a matcher that compares it with a text does, is a finding. +- Where the diff changes what a shared function, generator or iterator yields or returns, such as a new special value, a new error or an early stop, and its signature stays the same, `grep` every caller. In Coverage & Verification, state what each caller now does with the new case. A caller that treats the new case as an ordinary value is a finding, such as a serializer that joins it into text or a matcher that compares it with text. - Is this a breaking change to an external contract (HTTP/RPC, events, file formats)? Is it versioned? - Are DB migrations backward-compatible, online-safe, and reversible? - Rolling deploys run old and new code side by side: can new code process queue/job payloads produced by old code (and vice versa)? Are cache, session, and serialized formats compatible both ways? @@ -80,7 +80,7 @@ Catch behavior that is unclear or under-specified — "building in ambiguousness - Where the change validates a whole input with a `$`-anchored regex in an engine where `$` also matches before a final newline, report it unless the pattern uses the `D` modifier or a full-match call: `^…$` accepts `"value\n"` in PCRE (PHP's `preg_match`, Laravel's `regex:` rule) and in Python's `re.match`. Ask for `\z` (Python: `\Z`), the `D` modifier, or a full-match call such as `re.fullmatch`. - Where the change validates a value and then trims, strips, converts or otherwise normalises it before using it, check that each rule, such as a minimum length, holds for the value the program uses. Report an input that passes the check but reaches the program as something the check would refuse, such as a search term with leading zeros that passes a length rule and is then stripped to a few characters that match broadly. - Where the change adds a guard that tests whether a file, row or record exists, list every place or state the thing passes through from arrival to its end, such as a queue folder, a working folder and a final folder. Report each one the guard doesn't look at: a guard that checks only where the thing ends lets a refused thing through while it waits or is retried. -- For each input shape the change starts to handle, list its neighbours: each part alone, the parts in another order, and a part missing or blank. Compare what the change makes of each with what the base made of the same input, not only with the ticket's words. A field the base filled and the change leaves empty is a 🟡 unless the ticket names that input, and a 🔴 where it loses data users relied on. A ticket's "everything else stays as before" outranks the literal wording of the rule it proposes. +- Where the change starts to handle an input made of several parts, such as two structured fields, list its neighbours: each part alone, the parts in another order, and a part missing or blank. Compare what the change makes of each with what the base made of the same input, not only with the ticket's words. Where the change leaves empty a field the base filled, report a 🟡, or a 🔴 where users relied on that data; don't report it where the ticket asks for that field to be empty for that input. Where a ticket says everything else stays as before, that outranks the literal wording of the rule it proposes. - Are payload and collection sizes bounded at the boundary? ### 6. Concurrency & State Management @@ -145,7 +145,7 @@ Every PR gets at least this sweep. Report only a defect; a requirement that the change breaks, of the plan in the file your prompt's `Plan:` line names, of the goals in the file your prompt's `Goals and audience:` line names, or of code health (`~/.claude/CLAUDE.md` → "Shared goal", unless that file voids it); a breach of a technical principle, or of a coding convention, which counts as one; and the places the prompt hands you. A finding that is none of these is noise, however true: leave it out. -Verdict, severities and rounds: ~/.claude/skills/larv-review/review-findings.md. After the verdict, a short **Coverage & Verification** block: what you ran (tests, static analysis, mutation — and their results), what you could not verify and why, and any files that got a lighter pass — never let silence imply coverage. Then the findings, most severe first, each with: +Verdict, severities and rounds: ~/.claude/skills/larv-review/review-findings.md. After the verdict, a short **Coverage & Verification** block: what you ran (tests, static analysis, mutation — and their results), what each caller of a changed producer does with the new case (#1), what you could not verify and why, and any files that got a lighter pass — never let silence imply coverage. Then the findings, most severe first, each with: - **Location**: File and line/function - **Issue**: Clear description of the problem - **Risk**: What could go wrong in production