-
Notifications
You must be signed in to change notification settings - Fork 0
Fix reviewer reliability and benchmark calibration #275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,6 +4,7 @@ import { describe, expect, it, vi } from 'vitest'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BENCH_REVIEWERS, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| compareReviewer, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enforceCorpusMinimums, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| lintRows, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| makeSpyExec, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runRow, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -93,6 +94,28 @@ describe('lintRows', () => { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| describe('enforceCorpusMinimums', () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const corpus = () => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Array.from({ length: 25 }, (_, i) => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| i < 13 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ? goldRow({ id: `gold-${i}`, holdout: i < 3 }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| : decoyRow({ id: `decoy-${i}`, holdout: i < 16 }), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| it('requires 25 rows with at least three held-out golds and decoys', () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(() => enforceCorpusMinimums(corpus(), 'api-security-reviewer')).not.toThrow(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(() => enforceCorpusMinimums(corpus().slice(0, 24), 'api-security-reviewer')).toThrow( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /at least 25 rows/, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(() => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| enforceCorpusMinimums( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| corpus().map((row) => ({ ...row, holdout: row.expected === 'PASS' && row.holdout })), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'api-security-reviewer', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ).toThrow(/held-out FAIL/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+105
to
+115
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Cover the held-out PASS failure path explicitly. This suite never verifies rejection when fewer than three held-out PASS rows exist, so a regression in the second loop branch could pass unnoticed. Proposed test+ expect(() =>
+ enforceCorpusMinimums(
+ corpus().map((row) => ({
+ ...row,
+ holdout: row.expected === 'FAIL' && row.holdout,
+ })),
+ 'api-security-reviewer',
+ ),
+ ).toThrow(/held-out PASS/);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| describe('makeSpyExec', () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| it('short-circuits the escalate pass when cascade is off — zero delegate calls', async () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const capture = []; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,14 +56,12 @@ BENCH_MODEL=opus node bench.mts run # opus ceiling, r | |
|
|
||
| ## Corpus | ||
|
|
||
| One JSONL file per reviewer (`cases-<skill>.jsonl`). The four **domain** reviewers carry 13–14 | ||
| rows each (api-security 14, the rest 13): the original 12 — 6 gold seeded-bugs (distinct catalog | ||
| items; 3 clear / 2 borderline / 1 adversarial), 3 clean decoys (trigger ≥2 checklist items, | ||
| genuinely fine), 2 near-miss decoys (look vulnerable, provably safe), 1 minimal pair (`variantOf`: | ||
| the fixed twin of a gold row, expected PASS) — plus gold rows for the licensed-source catalog | ||
| refresh items (`mass-assignment`, `object-level-authz`, `sync-io`, `layout-thrash`, | ||
| `postmessage-origin`; `command-injection` reuses its retagged original row). 2 rows per file are | ||
| `holdout: true` (excluded by `--dev`, included in baselines). Dataset-card fields per row: | ||
| One JSONL file per reviewer (`cases-<skill>.jsonl`). Each of the four **domain** reviewers carries | ||
| 25 rows spanning gold bugs, clean decoys, near misses, and fixed minimal pairs. The July 2026 | ||
| calibration expansion adds production-derived frontend-performance false-positive decoys, | ||
| the bounded backend cache-stampede decoy, and labeled coverage for the highest-frequency | ||
| previously uncovered lenses. Every domain file has at least 3 held-out golds and 3 held-out decoys | ||
| (`holdout: true`, excluded by `--dev`, included in baselines). Dataset-card fields per row: | ||
|
Comment on lines
+59
to
+64
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Update the derived corpus totals in the README. After this change, the four domain corpora contain 100 rows total, but later sections still describe a 53-row domain pool and an approximately 119-row full run. Update those figures and any dependent runtime/cost estimates. 🧰 Tools🪛 LanguageTool[uncategorized] ~62-~62: Do not mix variants of the same word (‘labeled’ and ‘labelled’) within a single text. (EN_EXACT_COHERENCY_RULE) 🤖 Prompt for AI Agents |
||
| `note` (mandatory why), `difficulty`, `provenance` (`authored`/`mined`/`adapted` — mined rows are | ||
| anonymized adaptations of real CodeRabbit/Macroscope findings from our PR history), `variantOf`. | ||
|
|
||
|
|
@@ -257,4 +255,6 @@ Notes: | |
| frontend-performance SKILL.md softened the memoize-expensive-computation bar and | ||
| `feperf-sku-rank-per-render` went caught → stable-missed (2-of-2); the bar was sharpened and | ||
| the row recovered 2-of-2 (final re-baseline 13/13). | ||
| - Corpus growth toward absolute-recall claims (≥25 rows/reviewer, mined-real, K=3) is sc-1147. | ||
| - Domain corpus size and holdout floors are now ≥25 rows/reviewer with ≥3 held-out golds and | ||
| ≥3 held-out decoys. K=3 stability runs and continued mined-real growth remain required before | ||
| making absolute-recall claims (sc-1147). | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Do not downgrade blocking regressions merely because they are tracked.
A current staged change that meets the concrete performance FAIL bar must still block the commit.
TRACKEDis not a supported gate verdict and conflicts with the generated PASS/FAIL contract; include the story ID as metadata on the--failinstead.Suggested policy adjustment
📝 Committable suggestion
🤖 Prompt for AI Agents