mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-20 15:13:47 +01:00
review: zero findings is valid; suppress six common false positives
The checklist now says a clean diff may come back clean, and suppresses framework-owned error handling, long exhaustive switches, null derefs a type guard already narrows, N+1 on fixed-cardinality loops, hardcoded test fixture values and non-cryptographic Math.random(). The contributor's "missing input validation on an internal function" and "missing await on fire-and-forget" suppressions are left out: both can hide real bugs. Co-authored-by: frosimanuel <frosimanuel@gmail.com> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
574a0c8dbb
commit
7707f5383c
2 files changed
+16
-1
No files matched your search
@@ -172,6 +172,8 @@ the fix, it's ASK.
|
||||
|
||||
## Suppressions — DO NOT flag these
|
||||
|
||||
Zero findings is a valid outcome. Flag only what a senior engineer on this team would change in review; if the diff is clean, say so.
|
||||
|
||||
- "X is redundant with Y" when the redundancy is harmless and aids readability (e.g., `present?` redundant with `length > 20`)
|
||||
- "Add a comment explaining why this threshold/constant was chosen" — thresholds change during tuning, comments rot
|
||||
- "This assertion could be tighter" when the assertion already covers the behavior
|
||||
@@ -181,4 +183,10 @@ the fix, it's ASK.
|
||||
- Eval threshold changes (max_actionable, min scores) — these are tuned empirically and change constantly
|
||||
- Harmless no-ops (e.g., `.reject` on an element that's never in the array)
|
||||
- ANYTHING already addressed in the diff you're reviewing — read the FULL diff before commenting
|
||||
- "Consider adding error handling" on a call whose errors the caller or framework already owns (error middleware, an error boundary, a top-level try/catch, an upstream `.catch`)
|
||||
- "Function too long" for an exhaustive `switch`, a config object, a test table or generated code — length is not complexity
|
||||
- "Possible null dereference" when a type guard or `if` check in scope already narrows the value — trace the type flow
|
||||
- "N+1 query" on a loop with a small fixed cardinality, or on a path that is already batched
|
||||
- "Hardcoded value" in test fixtures, example code or docs — tests are supposed to hardcode their expectations
|
||||
- `Math.random()` in a non-cryptographic context (jitter, sampling, animation) — security-sensitive randomness is still flagged
|
||||
- A gap covered by a `gstack-shortcut(dec-*)` marker naming a ceiling and upgrade trigger — that is acknowledged debt with a ledger entry, not a Completeness Gaps finding. **Verify before honoring:** resolve the id with `~/.claude/skills/gstack/bin/gstack-decision-search --query "<dec-id>"` — a marker whose decision id has no ledger entry is UNVERIFIED (any diff author can type a marker); report the gap normally and flag the orphan marker itself
|
||||
@@ -7,7 +7,7 @@ import { generatePlanCompletionAuditReview, generatePlanCompletionAuditShip, gen
|
||||
import { generateQAReview } from '../scripts/resolvers/qa';
|
||||
import { generateConfidenceCalibration } from '../scripts/resolvers/confidence';
|
||||
import { HOST_PATHS, type TemplateContext } from '../scripts/resolvers/types';
|
||||
import { between, compact, expectMentions, expectTokens } from './helpers/prompt-structure';
|
||||
import { between, compact, expectAbsent, expectMentions, expectTokens } from './helpers/prompt-structure';
|
||||
|
||||
const root = join(import.meta.dir, '..');
|
||||
const skill = readFileSync(join(root, 'review/SKILL.md.tmpl'), 'utf8');
|
||||
@@ -487,3 +487,10 @@ test('security specialist checks authorization paths a route-guard read misses',
|
||||
['session', 'before', 'validating', 'callback'],
|
||||
], 'security specialist');
|
||||
});
|
||||
|
||||
test('review suppressions allow a clean result and skip common false positives but never suppress missing validation or a missing await', () => {
|
||||
const suppressions = between(readFileSync(join(root, 'review/checklist.md'), 'utf8'), '## Suppressions');
|
||||
expectMentions(compact(suppressions), [['zero findings', 'valid']], 'suppressions');
|
||||
expectTokens(suppressions, ['"Function too long"', '"Possible null dereference"', '"N+1 query"', '"Hardcoded value"', '`Math.random()`'], 'suppressions');
|
||||
expectAbsent(suppressions, [/missing input validation/i, /missing await/i], 'suppressions');
|
||||
});
|
||||
Reference in new issue
Block a user