/eval-plan checks follow the plan's own dates and models, and plans name their grader (GST-3464) (#4673)

`/eval-plan dry-run --prereg ` now reads the plan's frozen date and
Models section, so plans frozen before the model-generation rule, and
competitor vendor defaults, pass as the rule allows; priced families
refuse unpriced older generations; and a new `grader:` line is required
for plans frozen from 2026-11-23.

Nothing to do for readers; plans frozen before 2026-11-23 need no
`grader:` line.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=specialist-batched
Review-Finding: p1/red-team#1 reader=red-team
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-22 10:54:45 +00:00
1 parent f7e16a54fc
commit 094263d71b
16 files changed
+217 -40

No files matched your search

+11 -1
View File
@@ -7,7 +7,7 @@
*/
import { describe, expect, test } from 'bun:test';
import { checkPrereg, quickLookTemplate } from '../lib/eval-plan';
import { checkJudgeLabels, LOOP_CHECKS_SINCE } from '../lib/eval-plan-checks';
import { checkJudgeLabels, GRADER_CHECK_SINCE, LOOP_CHECKS_SINCE } from '../lib/eval-plan-checks';
import { checkResults } from '../lib/eval-plan-report';
const PILOT: Record<string, string> = { share: '10%', counted: 'no', ran: "the skill's tool calls appear in each arm's transcripts", judge: "labels checked on each arm's pilot outputs", supply: 'three development rows per arm at the planned rate', units: 'bug fix, refactor and docs tasks, one each', seed: '7, independent of the number of workers' };
@@ -98,6 +98,16 @@ describe('smaller is scored with tests (G11) and no answers on the machine (G13)
expect(checkPrereg(plan({ arms, bars: '- pass rate, higher is better\n- regression test added, co-primary, higher is better' })).ok).toBe(true);
});
test(`from ${GRADER_CHECK_SINCE}, held-out exposure says how a grader running git treats the agent's repo, or none`, () => {
const hostile = 'answers: other git refs checked on each task machine\ngrader: a sanitized copy of .git with no config, hooks or attributes';
const scoring = 'judge: gpt-6.2-astra\nlabels: 100\nagreement: 0.6\nper-arm: yes\neffort: high\npaired: yes\ninterval: 95%\nmdd: 3 of 20 items';
expect(messages(plan({ frozen: GRADER_CHECK_SINCE }))).toEqual(['Held-out exposure: grader:']);
expect(messages(plan({ frozen: GRADER_CHECK_SINCE, heldOut: 'answers: other git refs checked\ngrader: tbd' }))).toEqual(['Held-out exposure: grader:']);
expect(checkPrereg(plan({ frozen: GRADER_CHECK_SINCE, scoring, heldOut: hostile })).ok).toBe(true);
expect(checkPrereg(plan({ frozen: GRADER_CHECK_SINCE, scoring, heldOut: 'answers: other git refs checked\n- grader: none, the scorer runs no git' })).ok).toBe(true);
expect(checkPrereg(plan({ frozen: '2026-11-22', scoring })).ok).toBe(true);
});
test('held-out exposure says how each task machine was checked for answers', () => {
expect(messages(plan({ heldOut: '' }))).toEqual(['Held-out exposure: answers:']);
expect(messages(plan({ heldOut: 'Answers on the task machine: tbd' }))).toEqual(['Held-out exposure: answers:']);
+71 -1
View File
@@ -20,7 +20,7 @@ const dirs: string[] = [];
afterEach(() => { while (dirs.length) fs.rmSync(dirs.pop()!, { recursive: true, force: true }); });
const tmp = () => { const d = fs.mkdtempSync(path.join(os.tmpdir(), 'gstack-model-gen-')); dirs.push(d); return d; };
const LOOP = '\n## Pilot\nshare: 10%\ncounted: no\nran: the part under test shows in each arm\'s own transcripts\njudge: labels checked on each arm\'s pilot outputs\nsupply: three development rows per arm at the planned rate\nunits: every task type, one each\nseed: 7, independent of the number of workers\n\n## Cost\npaid: $200\nmeter: $0\nledger: the private spend ledger\n\n## Held-out exposure\n- filled in\nanswers: other git refs and build caches checked on each task machine\n';
const LOOP = '\n## Pilot\nshare: 10%\ncounted: no\nran: the part under test shows in each arm\'s own transcripts\njudge: labels checked on each arm\'s pilot outputs\nsupply: three development rows per arm at the planned rate\nunits: every task type, one each\nseed: 7, independent of the number of workers\n\n## Cost\npaid: $200\nmeter: $0\nledger: the private spend ledger\n\n## Held-out exposure\n- filled in\nanswers: other git refs and build caches checked on each task machine\ngrader: none, the scorer runs no git in the agent\'s repo\n';
const prereg = (o: { arms?: string[]; judge?: string; models?: string; frozen?: string } = {}) => [
o.frozen ? `frozen: ${o.frozen}\n` : '',
'## Bars\n- pass rate, higher is better\n',
@@ -61,6 +61,22 @@ describe('lib/pricing.ts generation marks', () => {
expect(currentReplacement('anthropic/claude-opus-4-7')).toBe('claude-opus-5-5');
for (const current of ['claude-opus-5-5', 'gpt-6.2-sol', 'gpt-6-astra', 'gpt-6.2-astra', 'gpt-6.1-sol', 'claude-fable-5-1', 'gemini-3.6-flash', 'gpt-6-luna', 'particle-1', 'no-such-model', 'gpt-40-turbo']) expect(currentReplacement(current), current).toBeNull();
});
test('an unpriced older generation of a priced family is refused like its marked rows; unpriced current and newer ids are not', () => {
const older: Record<string, string> = {
'claude-opus-4-5': 'claude-opus-5-5', 'anthropic/claude-opus-4-6': 'claude-opus-5-5', 'claude-3-opus-20240229': 'claude-opus-5-5',
'claude-sonnet-4-5-20250929': 'claude-sonnet-5-5', 'claude-3-5-sonnet-20241022': 'claude-sonnet-5-5', 'claude-3-5-haiku': 'claude-haiku-5-5',
'gpt-5.5': 'gpt-6.2-sol', 'openai/gpt-5.3-codex': 'gpt-6.2-sol', 'gpt-4.1': 'gpt-6.2-sol', 'gpt-4.1-mini': 'gpt-6-luna', 'gpt-5-nano': 'gpt-6-luna',
'o1': 'gpt-6.2-sol', 'o3-pro': 'gpt-6.2-sol', 'o3-mini': 'gpt-6-luna',
'gemini-2.0-flash': 'gemini-3.8-flash', 'google/gemini-1.5-pro-002': 'gemini-4-argon', 'gemini-3-pro': 'gemini-4-argon',
};
for (const [model, replacement] of Object.entries(older)) expect(currentReplacement(model), model).toBe(replacement);
for (const current of ['claude-fable-5-2', 'claude-opus-5', 'gpt-6-terra', 'gpt-7', 'gemini-4-neon', 'gemini-3.7-flash', 'claude-haiku-6-0', 'deepseek-v3', 'gemini-embedding-2']) expect(currentReplacement(current), current).toBeNull();
expect(checkModelGenerations({ arms: ['claude-opus-5-5', 'claude-opus-4-5#plain'], judge: 'gpt-5.5' }).refused).toEqual([
{ model: 'claude-opus-4-5', role: 'arm', replacement: 'claude-opus-5-5' },
{ model: 'gpt-5.5', role: 'judge', replacement: 'gpt-6.2-sol' },
]);
});
});
describe('checkModelGenerations', () => {
@@ -143,4 +159,58 @@ describe('dry run and pilot start', () => {
const pilot = startPilot({ out: path.join(d, 'pilot'), cap: 5, n: 1, arms: ['claude-opus-4-7'], dryRun: dry });
expect(pilot.error).toEqual({ code: 'EVAL_MODEL_OLD_GENERATION', message: 'claude-opus-4-7 is an older generation; use claude-opus-5-5 (R116)' });
});
const files = (plan: string) => ({ 'prereg.md': plan, 'rows.jsonl': JSON.stringify({ prompt: 'hello world' }) + '\n', 'retry.txt': 'retry\n' });
const dryArgs = (arms: string, ...more: string[]) => ['dry-run', '--input', 'rows.jsonl', '--arms', arms, '--retry-prompt', 'retry.txt', ...more];
test('dry-run --prereg keeps a vendor-default arm the plan declares, and still refuses every other older arm', () => {
const plan = prereg({ arms: ['claude-opus-5-5', 'gpt-4o#mem0'], judge: 'gemini-4-argon', models: 'vendor-default: gpt-4o Mem0 1.2 as its vendor ships it' });
expect(cli(['prereg', '--check', 'prereg.md'], { 'prereg.md': plan }).code).toBe(0);
const bare = cli(dryArgs('claude-opus-5-5,gpt-4o#mem0'), files(plan));
expect(bare.code).toBe(1);
expect(bare.err).toContain('pass --prereg <file> when the plan has a vendor-default line');
const kept = cli(dryArgs('claude-opus-5-5,gpt-4o#mem0', '--prereg', 'prereg.md'), files(plan));
expect(kept.code, kept.err).toBe(0);
expect(kept.out).toContain('DRY_RUN_RESULT: pass');
expect(kept.out).toContain('MODEL_EXCEPTION: gpt-4o vendor-default system="Mem0 1.2 as its vendor ships it" roles=arm');
const other = cli(dryArgs('claude-opus-5-5,gpt-4o#mem0,gpt-4o', '--prereg', 'prereg.md'), files(plan));
expect(other.code).toBe(1);
expect(other.out).toContain('CHECK: model-generation refused gpt-4o (use gpt-6.2-sol)');
});
test('dry-run --prereg honours a plan frozen before R116, and pilot start reads both from dry-run.json', () => {
const frozen = prereg({ arms: ['claude-opus-5-5', 'claude-opus-4-7#plain'], frozen: '2026-11-20' });
const d = tmp();
for (const [name, text] of Object.entries(files(frozen))) fs.writeFileSync(path.join(d, name), text);
const run = (args: string[]) => spawnSync(BIN, args, { cwd: d, encoding: 'utf8', timeout: 60_000 });
const kept = run(dryArgs('claude-opus-5-5,claude-opus-4-7#plain', '--prereg', 'prereg.md', '--out', 'dry'));
expect(kept.status, kept.stderr).toBe(0);
expect(kept.stdout).toContain('MODEL_GENERATION: exempt (frozen 2026-11-20 in prereg.md, before R116)');
const pilot = startPilot({ out: path.join(d, 'pilot'), cap: 5, n: 1, arms: ['claude-opus-5-5', 'claude-opus-4-7#plain'], dryRun: path.join(d, 'dry', 'dry-run.json') });
expect(pilot.error).toBeUndefined();
const vendor = prereg({ arms: ['claude-opus-5-5', 'gpt-4o#mem0'], judge: 'gemini-4-argon', models: 'vendor-default: gpt-4o Mem0 1.2 as shipped' });
fs.writeFileSync(path.join(d, 'prereg.md'), vendor);
expect(run(dryArgs('claude-opus-5-5,gpt-4o#mem0', '--prereg', 'prereg.md', '--out', 'dry2')).status).toBe(0);
const dry2 = path.join(d, 'dry2', 'dry-run.json');
expect(startPilot({ out: path.join(d, 'p2'), cap: 5, n: 1, arms: ['claude-opus-5-5', 'gpt-4o#mem0'], dryRun: dry2 }).error).toBeUndefined();
expect(startPilot({ out: path.join(d, 'p3'), cap: 5, n: 1, arms: ['gpt-4o'], dryRun: dry2 }).error?.code).toBe('EVAL_MODEL_OLD_GENERATION');
});
test('dry-run --prereg names a malformed vendor-default line instead of blaming an arm', () => {
const r = cli(dryArgs('claude-opus-5-5,gpt-6.2-sol', '--prereg', 'prereg.md'), files(prereg({ arms: ['claude-opus-5-5', 'gpt-6.2-sol'], models: 'vendor-default: gpt-4o' })));
expect(r.code).toBe(1);
expect(r.err).toContain('vendor-default: gpt-4o needs the model and the competitor system');
expect(r.err).not.toContain('an arm is gpt-4o');
});
test('a frozen: date exempts only arms the plan names, in dry-run and in pilot start', () => {
const forged = cli(dryArgs('gpt-4o,claude-opus-5-5', '--prereg', 'p.md'), { ...files(''), 'p.md': 'frozen: 2026-11-01\n' });
expect(forged.code).toBe(1);
expect(forged.out).toContain('CHECK: model-generation refused gpt-4o (use gpt-6.2-sol)');
expect(forged.err).toContain('p.md does not name gpt-4o,claude-opus-5-5');
const d = tmp();
for (const [name, text] of Object.entries(files(prereg({ arms: ['claude-opus-5-5', 'claude-opus-4-7#plain'], frozen: '2026-11-20' })))) fs.writeFileSync(path.join(d, name), text);
expect(spawnSync(BIN, dryArgs('claude-opus-5-5,claude-opus-4-7#plain', '--prereg', 'prereg.md', '--out', 'dry'), { cwd: d, encoding: 'utf8', timeout: 60_000 }).status).toBe(0);
expect(startPilot({ out: path.join(d, 'pilot'), cap: 5, n: 1, arms: ['claude-opus-5-5', 'gpt-4o'], dryRun: path.join(d, 'dry', 'dry-run.json') }).error?.code).toBe('EVAL_MODEL_OLD_GENERATION');
});
});
+1 -1
View File
@@ -21,7 +21,7 @@ const tmp = () => { const d = fs.mkdtempSync(path.join(os.tmpdir(), 'gstack-no-g
afterEach(() => { while (dirs.length) fs.rmSync(dirs.pop()!, { recursive: true, force: true }); });
const RESULT_SECTIONS = '## Decisions\nif the variant passes more items: adopt it\nif there is no difference: keep the default\n\n## Scoring\njudge: none\npaired: yes\ninterval: 95%\nmdd: 2 of 9 items\n';
const LOOP = '\n## Pilot\nshare: 10%\ncounted: no\nran: the part under test shows in each arm\'s own transcripts\njudge: labels checked on each arm\'s pilot outputs\nsupply: three development rows per arm at the planned rate\nunits: every task type, one each\nseed: 7, independent of the number of workers\n\n## Cost\npaid: $200\nmeter: $0\nledger: the private spend ledger\n\n## Held-out exposure\n- filled in\nanswers: other git refs and build caches checked on each task machine\n';
const LOOP = '\n## Pilot\nshare: 10%\ncounted: no\nran: the part under test shows in each arm\'s own transcripts\njudge: labels checked on each arm\'s pilot outputs\nsupply: three development rows per arm at the planned rate\nunits: every task type, one each\nseed: 7, independent of the number of workers\n\n## Cost\npaid: $200\nmeter: $0\nledger: the private spend ledger\n\n## Held-out exposure\n- filled in\nanswers: other git refs and build caches checked on each task machine\ngrader: none, the scorer runs no git in the agent\'s repo\n';
const BASE = ['Bars', 'Decoys', 'Stop rules'].map(s => `## ${s}\n- filled in\n`).join('\n') + '\n' + RESULT_SECTIONS + LOOP;
const ARMS = (...ids: string[]) => `\n## Arms\n${ids.map(id => `- ${id} default settings, $0.01 per item`).join('\n')}\n`;
const LOADED = '\n## Comparison\nstack: loaded\n';
+1 -1
View File
@@ -14,7 +14,7 @@ import { checkPrereg, parsePreregDiagnostics, preregTemplate } from '../lib/eval
import { capyHost, type CapyHost } from './helpers/capy-host';
const BIN = path.resolve(import.meta.dir, '..', 'bin', 'gstack-eval-plan');
const LOOP = '\n## Pilot\nshare: 10%\ncounted: no\nran: the part under test shows in each arm\'s own transcripts\njudge: labels checked on each arm\'s pilot outputs\nsupply: three development rows per arm at the planned rate\nunits: every task type, one each\nseed: 7, independent of the number of workers\n\n## Cost\npaid: $200\nmeter: $0\nledger: the private spend ledger\n\n## Held-out exposure\n- filled in\nanswers: other git refs and build caches checked on each task machine\n';
const LOOP = '\n## Pilot\nshare: 10%\ncounted: no\nran: the part under test shows in each arm\'s own transcripts\njudge: labels checked on each arm\'s pilot outputs\nsupply: three development rows per arm at the planned rate\nunits: every task type, one each\nseed: 7, independent of the number of workers\n\n## Cost\npaid: $200\nmeter: $0\nledger: the private spend ledger\n\n## Held-out exposure\n- filled in\nanswers: other git refs and build caches checked on each task machine\ngrader: none, the scorer runs no git in the agent\'s repo\n';
const FILLED = ['Bars', 'Arms', 'Decoys', 'Stop rules'].map(s => `## ${s}\n- filled in\n`).join('\n') + LOOP + '\n## Comparison\nstack: none\nwhy: one arm, no skill stack\n\n## Decisions\nif the bar is met: run the full set\nif the bar is missed: fix the scorer first\n\n## Scoring\njudge: none\n';
const SUMMARIZER = [
'touch ran.marker',
+32 -1
View File
@@ -19,7 +19,7 @@ const dirs: string[] = [];
afterEach(() => { while (dirs.length) fs.rmSync(dirs.pop()!, { recursive: true, force: true }); });
const DECISIONS = '## Decisions\nif the skill arm passes more items: keep the skill\nif there is no difference: cut the skill\n';
const LOOP = '\n## Pilot\nshare: 10%\ncounted: no\nran: the part under test shows in each arm\'s own transcripts\njudge: labels checked on each arm\'s pilot outputs\nsupply: three development rows per arm at the planned rate\nunits: every task type, one each\nseed: 7, independent of the number of workers\n\n## Cost\npaid: $200\nmeter: $0\nledger: the private spend ledger\n\n## Held-out exposure\n- filled in\nanswers: other git refs and build caches checked on each task machine\n';
const LOOP = '\n## Pilot\nshare: 10%\ncounted: no\nran: the part under test shows in each arm\'s own transcripts\njudge: labels checked on each arm\'s pilot outputs\nsupply: three development rows per arm at the planned rate\nunits: every task type, one each\nseed: 7, independent of the number of workers\n\n## Cost\npaid: $200\nmeter: $0\nledger: the private spend ledger\n\n## Held-out exposure\n- filled in\nanswers: other git refs and build caches checked on each task machine\ngrader: none, the scorer runs no git in the agent\'s repo\n';
const SCORING = (judge = 'gpt-6-astra', extra = 'labels: 40\nagreement: 0.6\nper-arm: yes\neffort: high\npaired: yes\ninterval: 95%\nmdd: 3 of 20 items\n') => `## Scoring\njudge: ${judge}\n${extra}`;
/** A freeze date before the R78 amendment's 100-label bar (2026-11-22), so these fixtures keep testing the 40-label rules they were written for. */
const JUDGE_40_FROZEN = '2026-11-21';
@@ -103,6 +103,37 @@ describe(`R78 amendment: a plan frozen on or after ${JUDGE_LABELS_RAISED_SINCE}
expect(checkJudgeLabels(early, labels(40, 4))).toMatchObject({ ok: true, need_n: 40 });
expect(checkJudgeLabels({ judge: 'gpt-6-astra', labels: 40, agreement: 0.6, errors: [] }, labels(40, 4)).need_n).toBe(100);
});
const cli = (args: string[], files: Record<string, string>) => {
const d = fs.mkdtempSync(path.join(os.tmpdir(), 'gstack-judge-bar-')); dirs.push(d);
for (const [name, text] of Object.entries(files)) fs.writeFileSync(path.join(d, name), text);
const r = spawnSync(BIN, args, { cwd: d, encoding: 'utf8', timeout: 60_000 });
return { code: r.status, out: r.stdout ?? '', err: r.stderr ?? '' };
};
test('prereg --check on the command line: 40 labels pass the day before and fail from the date, where 100 pass', () => {
expect(cli(['prereg', '--check', 'p.md'], { 'p.md': prereg({ frozen: '2026-11-21' }) }).code).toBe(0);
const late = cli(['prereg', '--check', 'p.md'], { 'p.md': prereg({ frozen: JUDGE_LABELS_RAISED_SINCE }) });
expect(late.code).toBe(1);
expect(late.out).toContain('PREREG: incomplete');
expect(late.err).toContain('PREREG_INCOMPLETE');
expect(late.err).toContain('scoring: labels: needs at least 100 hand-labelled outputs the judge is checked against (40 only for a plan frozen before 2026-11-22)');
expect(cli(['prereg', '--check', 'p.md'], { 'p.md': prereg({ frozen: JUDGE_LABELS_RAISED_SINCE, scoring: SCORING('gpt-6-astra', scoring100) }) }).code).toBe(0);
});
test('judge --check on the command line: a plan frozen from the date needs 100 labelled rows; one frozen before keeps 40', () => {
const late = prereg({ frozen: JUDGE_LABELS_RAISED_SINCE, scoring: SCORING('gpt-6-astra', scoring100) });
const short = cli(['judge', '--check', 'p.md', '--labels', 'l.jsonl'], { 'p.md': late, 'l.jsonl': labels(40, 4) });
expect(short.code).toBe(1);
expect(short.err).toContain('EVAL_JUDGE_UNCHECKED');
expect(short.err).toContain('40 labelled outputs, needs 100');
const full = cli(['judge', '--check', 'p.md', '--labels', 'l.jsonl', '--json'], { 'p.md': late, 'l.jsonl': labels(100, 10) });
expect(full.code, full.err).toBe(0);
expect(JSON.parse(full.out)).toMatchObject({ ok: true, n: 100, need_n: 100, need_kappa: 0.6 });
const early = cli(['judge', '--check', 'p.md', '--labels', 'l.jsonl', '--json'], { 'p.md': prereg({ frozen: '2026-11-21' }), 'l.jsonl': labels(40, 4) });
expect(early.code, early.err).toBe(0);
expect(JSON.parse(early.out)).toMatchObject({ ok: true, n: 40, need_n: 40 });
});
});
describe('judge labels', () => {
+1 -1
View File
@@ -15,7 +15,7 @@ const dirs: string[] = [];
afterEach(() => { while (dirs.length) fs.rmSync(dirs.pop()!, { recursive: true, force: true }); });
const RESULT_SECTIONS = '## Decisions\nif the variant passes more items: adopt it\nif there is no difference: keep the default\n\n## Scoring\njudge: none\npaired: yes\ninterval: 95%\nmdd: 2 of 9 items\n';
const LOOP = '\n## Pilot\nshare: 10%\ncounted: no\nran: the part under test shows in each arm\'s own transcripts\njudge: labels checked on each arm\'s pilot outputs\nsupply: three development rows per arm at the planned rate\nunits: every task type, one each\nseed: 7, independent of the number of workers\n\n## Cost\npaid: $200\nmeter: $0\nledger: the private spend ledger\n\n## Held-out exposure\n- filled in\nanswers: other git refs and build caches checked on each task machine\n';
const LOOP = '\n## Pilot\nshare: 10%\ncounted: no\nran: the part under test shows in each arm\'s own transcripts\njudge: labels checked on each arm\'s pilot outputs\nsupply: three development rows per arm at the planned rate\nunits: every task type, one each\nseed: 7, independent of the number of workers\n\n## Cost\npaid: $200\nmeter: $0\nledger: the private spend ledger\n\n## Held-out exposure\n- filled in\nanswers: other git refs and build caches checked on each task machine\ngrader: none, the scorer runs no git in the agent\'s repo\n';
const BASE = ['Bars', 'Decoys', 'Stop rules'].map(s => `## ${s}\n- filled in\n`).join('\n') + '\n' + RESULT_SECTIONS + LOOP;
const PREREG = BASE + `
## Arms
+1 -1
View File
@@ -62,7 +62,7 @@ describe('preregistration', () => {
.replace('## Scoring\n- filled in', '## Scoring\njudge: none')
.replace('## Pilot\n- filled in', '## Pilot\nshare: 10%\ncounted: no\nran: shown in each arm\'s outputs\nsupply: three rows per arm\nunits: every task type\nseed: 7')
.replace('## Cost\n- filled in', '## Cost\npaid: $200\nmeter: $0\nledger: the private spend ledger')
.replace('## Held-out exposure\n- filled in', '## Held-out exposure\nanswers: other git refs and build caches checked');
.replace('## Held-out exposure\n- filled in', '## Held-out exposure\nanswers: other git refs and build caches checked\ngrader: none, the scorer runs no git');
expect(checkPrereg(filled)).toMatchObject({ ok: true, missing: [], empty: [] });
expect(checkPrereg('# nothing here\n').missing).toEqual([...PREREG_SECTIONS]);
});