mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-24 17:11:28 +01:00
Eval plans now pilot every arm, check the judge per arm, state their cost and take one planned look above 500 dollars (GST-3218) (#4591)
`/eval-plan` now refuses an eval plan that would waste money: every arm gets a small uncounted pilot, the judge is checked on each arm's outputs, the plan carries a cost line, and a run above 500 dollars takes one planned look at half its units. Small questions get a 100-dollar quick look that publishes no number. Why: 23.7% of the 28,836 dollars spent on our last 30 evals settled nothing, mostly through arms and judges that broke after the full run. Nothing to do as a reader; plans frozen before 2026-11-21 keep their old rules. 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 Review-Finding: p1/red-team#2 reader=red-team Review-Finding: p1/red-team#3 reader=red-team
This commit is contained in:
1 parent
ffdd5354b8
commit
e057dfa100
22 files changed
+483
-68
No files matched your search
+96
-8
@@ -15,7 +15,7 @@ const PLACEHOLDER = /^(?:|-+|—|n\/a|none|tbd|todo|\?)\.?$/i;
|
||||
const keyValues = (body: string[]) => {
|
||||
const kv: Record<string, string> = {};
|
||||
for (const line of body) {
|
||||
const m = /^\s*(?:[-*]\s+)?([a-z]+):(.*)$/i.exec(line);
|
||||
const m = /^\s*(?:[-*]\s+)?([a-z][a-z-]*):(.*)$/i.exec(line);
|
||||
if (m) kv[m[1]!.toLowerCase()] = m[2]!.trim().replace(/^`(.*)`$/, '$1');
|
||||
}
|
||||
return kv;
|
||||
@@ -36,6 +36,80 @@ export function modelFamily(model: string): string {
|
||||
return labs[head] ?? head;
|
||||
}
|
||||
|
||||
/**
|
||||
* The eval-loop checks (docs/TESTING_INTERNALS.md#eval-loop-checks), dated
|
||||
* LOOP_CHECKS_SINCE: an uncounted pilot per arm of at most a tenth of its
|
||||
* budget that draws every unit type in a seeded order, a judge read per arm at
|
||||
* a stated effort, a cost line, one preregistered look at half the units for a
|
||||
* counted run above INTERIM_LOOK_ABOVE_USD, "smaller" scored with tests, and a
|
||||
* check that the task machine holds no answers. A quick look (`kind: quick
|
||||
* look`) is a three-line plan capped at QUICK_LOOK_MAX_USD that publishes no
|
||||
* number. A preregistration frozen before LOOP_CHECKS_SINCE keeps its rules.
|
||||
*/
|
||||
export const LOOP_CHECKS_SINCE = '2026-11-21';
|
||||
export const PILOT_MAX_SHARE_PCT = 10;
|
||||
export const INTERIM_LOOK_ABOVE_USD = 500;
|
||||
export const QUICK_LOOK_MAX_USD = 100;
|
||||
export const loopGrandfathered = (text: string) => { const d = frozenDate(text); return d !== null && d < LOOP_CHECKS_SINCE; };
|
||||
export const isQuickLook = (text: string) => /^\s*kind:\s*quick[- ]look\s*$/im.test(text);
|
||||
const filled = (v: string | undefined) => v !== undefined && !PLACEHOLDER.test(v.trim()) && !/^<.*>$/.test(v.trim());
|
||||
const dollars = (v: string | undefined) => { const m = /^\$?\s*(\d{1,3}(?:,\d{3})+|\d+)(\.\d{1,2})?$/.exec((v ?? '').trim()); return m ? Number(m[1]!.replace(/,/g, '') + (m[2] ?? '')) : null; };
|
||||
const SMALLER = /\b(smaller (?:change|diff|patch)|less code|fewer lines|shorter diff|minimal diff|diff size)\b/i;
|
||||
|
||||
export interface QuickLookCheck { cap: number | null; errors: string[] }
|
||||
/** `kind: quick look`: `question:`, `decision:`, `stop:` and `cap:` at most QUICK_LOOK_MAX_USD paid. It publishes no number. */
|
||||
export function checkQuickLook(text: string): QuickLookCheck {
|
||||
const kv = keyValues(text.split('\n'));
|
||||
const errors = (['question', 'decision', 'stop'] as const).filter(k => !filled(kv[k])).map(k => `no ${k}: line (a quick look is three lines: question, decision, stop rule)`);
|
||||
const cap = dollars(kv.cap);
|
||||
if (cap === null || cap > QUICK_LOOK_MAX_USD) errors.push(`cap: needs a plain dollar amount (such as $100) of at most $${QUICK_LOOK_MAX_USD}; anything bigger is a counted run with a full preregistration`);
|
||||
return { cap, errors };
|
||||
}
|
||||
|
||||
export interface LoopCheck { paid: number | null; interim_required: boolean; errors: Array<{ section: string; message: string }> }
|
||||
export interface LoopSections { pilot: string[] | null; cost: string[] | null; interim: string[] | null; scoring: string[] | null; bars: string[] | null; arms: string[] | null; heldOut: string[] | null }
|
||||
/** The dated eval-loop checks over a counted run's preregistration sections. */
|
||||
export function checkLoop(s: LoopSections): LoopCheck {
|
||||
const errors: LoopCheck['errors'] = [];
|
||||
const add = (section: string, message: string) => errors.push({ section, message });
|
||||
const scoring = keyValues(s.scoring ?? []);
|
||||
const modelJudge = filled(scoring.judge);
|
||||
if (s.pilot?.length) {
|
||||
const kv = keyValues(s.pilot);
|
||||
const share = firstNumber(kv.share);
|
||||
if (share === null || share <= 0 || share > PILOT_MAX_SHARE_PCT) add('Pilot', `share: each arm's pilot spends at most ${PILOT_MAX_SHARE_PCT}% of that arm's budget`);
|
||||
if (!/^no\b/i.test(kv.counted ?? '')) add('Pilot', 'counted: no (pilot items never count toward the result)');
|
||||
for (const [k, what] of [['ran', 'how the pilot shows, on each arm\'s own outputs, that the part under test ran'], ['supply', 'how the pilot shows the units can be supplied at the planned rate'], ['units', 'every unit type the counted run uses, each drawn at least once in the pilot'], ['seed', 'the fixed seed for the draw order, which does not depend on the number of workers']] as const) if (!filled(kv[k])) add('Pilot', `${k}: ${what}`);
|
||||
if (modelJudge && !filled(kv.judge)) add('Pilot', 'judge: how the judge is checked against labels on each arm\'s pilot outputs');
|
||||
}
|
||||
if (modelJudge) {
|
||||
if (!/^yes\b/i.test(scoring['per-arm'] ?? '')) add('Scoring', 'per-arm: yes (the judge\'s agreement is read on each arm\'s outputs, not pooled)');
|
||||
if (!filled(scoring.effort)) add('Scoring', 'effort: the reasoning effort set in the judge\'s start (left unset, it inherits its parent\'s)');
|
||||
}
|
||||
const cost = keyValues(s.cost ?? []);
|
||||
const paid = dollars(cost.paid);
|
||||
if (s.cost?.length) {
|
||||
if (paid === null) add('Cost', 'paid: the counted run\'s paid budget as a plain dollar amount, such as $1,200 (no k, ranges, units or arithmetic)');
|
||||
if (!filled(cost.meter)) add('Cost', 'meter: the expected meter spend (agent and machine time), or $0');
|
||||
if (!filled(cost.ledger)) add('Cost', 'ledger: the private file where the actual cost and the decision it settled are written');
|
||||
}
|
||||
const interim_required = paid !== null && paid > INTERIM_LOOK_ABOVE_USD;
|
||||
if (interim_required) {
|
||||
const kv = keyValues(s.interim ?? []);
|
||||
if (!s.interim?.length) add('Interim look', `missing: a counted run above $${INTERIM_LOOK_ABOVE_USD} preregisters one look at half its units`);
|
||||
else {
|
||||
if (firstNumber(kv.at) !== 50) add('Interim look', 'at: 50% (the one look comes at half the units)');
|
||||
if (firstNumber(kv.looks) !== 1) add('Interim look', 'looks: 1 (no other look is taken)');
|
||||
if (!/o['’]?brien[- ]fleming/i.test(kv.bounds ?? '')) add('Interim look', 'bounds: O\'Brien-Fleming stop bounds, with their values');
|
||||
if (!filled(kv.futility)) add('Interim look', 'futility: the result at the look that stops the run as unable to reach its bar');
|
||||
}
|
||||
}
|
||||
if (SMALLER.test([...(s.arms ?? []), ...(s.bars ?? [])].join('\n')) && !(s.bars ?? []).some(l => /regression test/i.test(l))) add('Bars', 'an arm asks for a smaller change or less code, so "regression test added" is a co-primary bar (a shorter diff can come from skipping the test)');
|
||||
const answers = (s.heldOut ?? []).map(l => /^\s*(?:[-*]\s+)?answers(?: on the task machine)?:(.*)$/i.exec(l)?.[1]).find(v => v !== undefined);
|
||||
if (s.heldOut?.length && !filled(answers?.trim().replace(/^`(.*)`$/, '$1'))) add('Held-out exposure', 'answers: how each task machine was checked, before any session, for answers the agent could read there');
|
||||
return { paid, interim_required, errors };
|
||||
}
|
||||
|
||||
export interface DecisionsCheck { outcomes: Array<{ result: string; action: string }>; errors: string[] }
|
||||
/** `## Decisions`: one `if <result>: <what we do>` line per possible result, at least two, and not all the same action. */
|
||||
export function checkDecisions(body: string[] | null): DecisionsCheck {
|
||||
@@ -53,7 +127,7 @@ export function checkDecisions(body: string[] | null): DecisionsCheck {
|
||||
return { outcomes, errors };
|
||||
}
|
||||
|
||||
export interface ScoringCheck { judge: string | null; labels: number | null; agreement: number | null; errors: string[] }
|
||||
export interface ScoringCheck { judge: string | null; labels: number | null; agreement: number | null; errors: string[]; per_arm?: boolean }
|
||||
/**
|
||||
* `## Scoring`: `judge: none` or the judge model; a model judge needs `labels:`
|
||||
* (at least 40) and `agreement:` (a kappa bar of at least 0.6) and a family no
|
||||
@@ -79,10 +153,10 @@ export function checkScoring(body: string[] | null, arms: string[]): ScoringChec
|
||||
if (firstNumber(kv.interval) !== 95) errors.push('interval: 95% (the interval every comparison is reported with)');
|
||||
if (PLACEHOLDER.test(kv.mdd ?? '')) errors.push('mdd: the smallest difference this run can detect, stated before the run');
|
||||
}
|
||||
return { judge, labels, agreement, errors };
|
||||
return { judge, labels, agreement, errors, per_arm: /^yes\b/i.test(kv['per-arm'] ?? '') };
|
||||
}
|
||||
|
||||
export interface JudgeLabelCheck { ok: boolean; judge: string; n: number; kappa: number | null; need_n: number; need_kappa: number; problems: string[] }
|
||||
export interface JudgeLabelCheck { ok: boolean; judge: string; n: number; kappa: number | null; need_n: number; need_kappa: number; problems: string[]; arms: Array<{ arm: string; n: number; kappa: number | null }> }
|
||||
|
||||
/** Cohen's kappa over paired categorical labels; null when chance agreement is total (every label one class). */
|
||||
export function cohensKappa(pairs: Array<[string, string]>): number | null {
|
||||
@@ -96,26 +170,40 @@ export function cohensKappa(pairs: Array<[string, string]>): number | null {
|
||||
}
|
||||
|
||||
/** Score the preregistered judge against a JSONL file of `{"id", "human", "judge"}` rows. */
|
||||
export function checkJudgeLabels(scoring: ScoringCheck, labelsText: string): JudgeLabelCheck {
|
||||
export function checkJudgeLabels(scoring: ScoringCheck, labelsText: string, planArms: string[] = []): JudgeLabelCheck {
|
||||
const need_n = Math.max(JUDGE_MIN_LABELS, scoring.labels ?? 0);
|
||||
const need_kappa = Math.max(JUDGE_MIN_KAPPA, scoring.agreement ?? 0);
|
||||
const problems: string[] = [];
|
||||
const pairs: Array<[string, string]> = [];
|
||||
const ids = new Set<string>();
|
||||
const byArm = new Map<string, Array<[string, string]>>();
|
||||
let unarmed = 0;
|
||||
labelsText.split('\n').forEach((line, i) => {
|
||||
if (!line.trim()) return;
|
||||
let row: { id?: unknown; human?: unknown; judge?: unknown } | null = null;
|
||||
let row: { id?: unknown; human?: unknown; judge?: unknown; arm?: unknown } | null = null;
|
||||
try { row = JSON.parse(line); } catch { row = null; }
|
||||
if (!row || typeof row !== 'object' || ![row.id, row.human, row.judge].every(v => (typeof v === 'string' && v.trim() !== '') || typeof v === 'number' || typeof v === 'boolean')) { problems.push(`line ${i + 1}: needs {"id", "human", "judge"}, each a string, number or boolean`); return; }
|
||||
if (ids.has(String(row.id))) { problems.push(`id ${String(row.id)} is labelled twice`); return; }
|
||||
ids.add(String(row.id));
|
||||
pairs.push([String(row.human), String(row.judge)]);
|
||||
const arm = typeof row.arm === 'string' && row.arm.trim() ? row.arm.trim() : null;
|
||||
if (arm) byArm.set(arm, [...(byArm.get(arm) ?? []), [String(row.human), String(row.judge)]]); else unarmed++;
|
||||
});
|
||||
const kappa = cohensKappa(pairs);
|
||||
if (pairs.length < need_n) problems.push(`${pairs.length} labelled outputs, needs ${need_n}`);
|
||||
if (pairs.length && kappa === null) problems.push('every label is one class, so agreement is undefined; label outputs of every kind the judge scores');
|
||||
else if (kappa !== null && kappa < need_kappa) problems.push(`kappa ${kappa.toFixed(2)} is below the bar ${need_kappa}`);
|
||||
return { ok: problems.length === 0, judge: scoring.judge ?? 'none', n: pairs.length, kappa, need_n, need_kappa, problems };
|
||||
const arms = [...byArm].map(([arm, p]) => ({ arm, n: p.length, kappa: cohensKappa(p) }));
|
||||
if (scoring.per_arm && unarmed) problems.push(`per-arm: yes needs an "arm" on every label row; ${unarmed} have none`);
|
||||
const planned = [...new Set(planArms)];
|
||||
if (scoring.per_arm) {
|
||||
const unlabelled = planned.filter(a => !byArm.has(a));
|
||||
const unknown = [...byArm.keys()].filter(a => planned.length && !planned.includes(a));
|
||||
if (unlabelled.length) problems.push(`per-arm: yes needs labels from every arm in ## Arms; no rows for ${unlabelled.join(', ')}`);
|
||||
if (unknown.length) problems.push(`label rows name arms that are not in ## Arms: ${unknown.join(', ')}`);
|
||||
}
|
||||
if (scoring.per_arm) for (const a of arms) if (a.kappa === null || a.kappa < need_kappa) problems.push(`arm ${a.arm}: kappa ${a.kappa === null ? 'undefined' : a.kappa.toFixed(2)} on its ${a.n} labels is below the bar ${need_kappa}; the judge does not pass on this arm's outputs`);
|
||||
return { ok: problems.length === 0, judge: scoring.judge ?? 'none', n: pairs.length, kappa, need_n, need_kappa, problems, arms };
|
||||
}
|
||||
|
||||
export const renderJudgeLabels = (c: JudgeLabelCheck) => `JUDGE_AGREEMENT: ${c.ok ? 'ok' : 'unchecked'} judge=${c.judge} n=${c.n}/${c.need_n} kappa=${c.kappa === null ? 'undefined' : c.kappa.toFixed(2)} bar=${c.need_kappa}\n`;
|
||||
export const renderJudgeLabels = (c: JudgeLabelCheck) => c.arms.map(a => `JUDGE_ARM: ${a.arm} n=${a.n} kappa=${a.kappa === null ? 'undefined' : a.kappa.toFixed(2)} bar=${c.need_kappa}\n`).join('') + `JUDGE_AGREEMENT: ${c.ok ? 'ok' : 'unchecked'} judge=${c.judge} n=${c.n}/${c.need_n} kappa=${c.kappa === null ? 'undefined' : c.kappa.toFixed(2)} bar=${c.need_kappa}\n`;
|
||||
@@ -55,13 +55,17 @@ export function checkResults(preregText: string, resultsText: string, labelsText
|
||||
if (!tables.length) issues.push({ code: 'EVAL_REPORT_NO_GSTACK_ROW', message: 'no markdown table in the results file' });
|
||||
else for (const id of missing) issues.push({ code: 'EVAL_REPORT_NO_GSTACK_ROW', message: `no filled row for ${id} in the table that holds the other arms` });
|
||||
}
|
||||
if (prereg.quick) issues.push({ code: 'EVAL_QUICK_LOOK_NO_NUMBER', message: 'the plan is a quick look (kind: quick look), which publishes no number; write a counted-run preregistration to publish one' });
|
||||
for (const s of prereg.missing) issues.push({ code: 'PREREG_INCOMPLETE', message: `## ${s}: missing` });
|
||||
for (const s of prereg.empty) issues.push({ code: 'PREREG_INCOMPLETE', message: `## ${s}: empty` });
|
||||
for (const e of prereg.loop.errors) issues.push({ code: 'PREREG_INCOMPLETE', message: `## ${e.section}: ${e.message}` });
|
||||
let judge: JudgeLabelCheck | null = null;
|
||||
if (!prereg.grandfathered) {
|
||||
for (const [section, errors] of [['Decisions', prereg.decisions.errors], ['Scoring', prereg.scoring.errors]] as const) {
|
||||
for (const e of errors) issues.push({ code: 'PREREG_INCOMPLETE', message: `## ${section}: ${e}` });
|
||||
}
|
||||
if (prereg.scoring.judge && prereg.scoring.judge.toLowerCase() !== 'none') {
|
||||
judge = labelsText === null ? null : checkJudgeLabels(prereg.scoring, labelsText);
|
||||
judge = labelsText === null ? null : checkJudgeLabels(prereg.scoring, labelsText, arms);
|
||||
if (!judge) issues.push({ code: 'EVAL_JUDGE_UNCHECKED', message: `the preregistration names judge ${prereg.scoring.judge}; pass --labels <hand labels.jsonl>` });
|
||||
else if (!judge.ok) issues.push({ code: 'EVAL_JUDGE_UNCHECKED', message: judge.problems.join('; ') });
|
||||
}
|
||||
|
||||
+41
-8
@@ -19,19 +19,21 @@ import { EXCLUDED_BILLING_CATEGORIES, estimateCostUsd, hasPricing, PRICING, pric
|
||||
import type { ResultCodeName } from './result-codes';
|
||||
import type { ModelRulesCheck } from './eval-models';
|
||||
import { readLedger, release, reserve, settle, SpendCapExceeded, summarize, type SpendLedger, type SpendSummary } from './spend-ledger';
|
||||
import { checkDecisions, checkScoring, frozenDate, grandfathered, type DecisionsCheck, type ScoringCheck } from './eval-plan-checks';
|
||||
import { checkDecisions, checkLoop, checkQuickLook, checkScoring, frozenDate, grandfathered, isQuickLook, loopGrandfathered, type DecisionsCheck, type LoopCheck, type QuickLookCheck, type ScoringCheck } from './eval-plan-checks';
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// preregistration
|
||||
// ---------------------------------------------------------------------------
|
||||
export const PREREG_SECTIONS = ['Bars', 'Decisions', 'Arms', 'Comparison', 'Scoring', 'Decoys', 'Stop rules', 'Held-out exposure'] as const;
|
||||
export const PREREG_SECTIONS = ['Bars', 'Decisions', 'Arms', 'Comparison', 'Scoring', 'Pilot', 'Cost', 'Decoys', 'Stop rules', 'Held-out exposure'] as const;
|
||||
/** Sections added with the result checks; a preregistration frozen before them (`frozen:` before RESULT_CHECKS_SINCE) is not asked for them. */
|
||||
const RESULT_CHECK_SECTIONS: readonly string[] = ['Decisions', 'Scoring'];
|
||||
/** Sections added with the eval-loop checks (`frozen:` before LOOP_CHECKS_SINCE is not asked for them). */
|
||||
const LOOP_CHECK_SECTIONS: readonly string[] = ['Pilot', 'Cost'];
|
||||
/** `## Comparison`: `stack: loaded` when any arm loads gstack or another skill stack, `stack: none` with a `why:` otherwise. */
|
||||
export interface ComparisonCheck { stack: 'loaded' | 'none' | null; why: string | null; errors: string[] }
|
||||
/** `## No-gstack arm`, required when `stack: loaded`: one `<model>#no-gstack` Arms line per model, the inputs, prompt, panel and report it shares with the variants, and its masking, install and audit lines. */
|
||||
export interface NoGstackArmCheck { required: boolean; ok: boolean; arms: string[]; problems: string[] }
|
||||
export interface PreregCheck { ok: boolean; present: string[]; missing: string[]; empty: string[]; comparison: ComparisonCheck; no_gstack: NoGstackArmCheck; diagnostics: PreregDiagnostics | null; decisions: DecisionsCheck; scoring: ScoringCheck; frozen: string | null; grandfathered: boolean }
|
||||
export interface PreregCheck { ok: boolean; present: string[]; missing: string[]; empty: string[]; comparison: ComparisonCheck; no_gstack: NoGstackArmCheck; diagnostics: PreregDiagnostics | null; decisions: DecisionsCheck; scoring: ScoringCheck; frozen: string | null; grandfathered: boolean; loop: LoopCheck; loop_grandfathered: boolean; quick: QuickLookCheck | null }
|
||||
export const NO_GSTACK_LOADOUT = 'no-gstack';
|
||||
/** masking, install and audit keep the arm clean (TESTING_INTERNALS.md#no-gstack-arm): an arm that read a gstack skill file is contaminated. */
|
||||
export const NO_GSTACK_KEYS = ['arms', 'inputs', 'prompt', 'panel', 'report', 'masking', 'install', 'audit'] as const;
|
||||
@@ -46,7 +48,7 @@ export function preregTemplate(title = 'Eval preregistration'): string {
|
||||
<!-- One \`if <result>: <what we do>\` line per way the run can come out (a pass, a miss, no difference), at least two, written before anything is spent. If every result leads to the same action, the eval changes nothing: do not run it. -->
|
||||
|
||||
## Arms
|
||||
<!-- One line per arm: the arm identity first (\`<model>\` or \`<model>#<loadout>\`, the model in lib/pricing.ts, e.g. \`claude-opus-5-5#no-gstack\`), settings, and the per-item cost from \`gstack-eval-plan arms\`. Models under test are frontier models (today \`claude-opus-5-5\`, \`gpt-6.1-sol\`) plus at most one named low-cost primary; a Haiku or Sonnet arm only with a stated tier question. -->
|
||||
<!-- One line per arm: the arm identity first (\`<model>\` or \`<model>#<loadout>\`, the model in lib/pricing.ts, e.g. \`claude-opus-5-5#no-gstack\`), settings, and the per-item cost from \`gstack-eval-plan arms\`. Models under test are frontier models (today \`claude-opus-5-5\`, \`gpt-6.2-sol\`) plus at most one named low-cost primary; a Haiku or Sonnet arm only with a stated tier question. -->
|
||||
|
||||
## Comparison
|
||||
<!-- \`stack: loaded\` when any arm loads gstack or another skill stack (review variants, preamble loadouts, skill diets, a model panel under a stack); otherwise \`stack: none\` and a \`why:\` line. -->
|
||||
@@ -55,7 +57,16 @@ export function preregTemplate(title = 'Eval preregistration'): string {
|
||||
<!-- Required with \`stack: loaded\`: \`arms:\` one \`<model>#no-gstack\` Arms line per model; \`inputs:\` the same rows and fixture; \`prompt:\` the task only (no SKILL.md, preamble, hooks or installed skills); \`panel:\` the same E2E kind, trials and judge; \`report:\` its row beside the variants; \`masking:\` how the run agent is kept from gstack (an empty directory bind-mounted over ~/.capy/drive/user-garry-tan and ~/.capy/drive/org-gstack-gbrain before it starts, or a container that sees no Capy drive); \`install:\` no gstack at ~/.local/share/gstack or ~/.claude/skills; \`audit:\` the per-arm drive-read audit (an arm that read a gstack skill file is contaminated and gets zero credit). -->
|
||||
|
||||
## Scoring
|
||||
<!-- \`judge: none\` when a rule scores every metric; otherwise \`judge: <model>\` from another model family than every arm, \`labels: <n>\` hand-labelled outputs it is checked against (at least 40, never held-out rows) and \`agreement: <kappa bar>\` (at least 0.6). With two or more arms: \`paired: yes\`, \`interval: 95%\` and \`mdd: <the smallest difference this run can detect>\`. -->
|
||||
<!-- \`judge: none\` when a rule scores every metric; otherwise \`judge: <model>\` from another model family than every arm, \`labels: <n>\` hand-labelled outputs it is checked against (at least 40, never held-out rows) and \`agreement: <kappa bar>\` (at least 0.6), \`per-arm: yes\` (agreement read on each arm's outputs, not pooled) and \`effort: <the reasoning effort set in the judge's start>\`; GPT-6 Astra or GPT-6.2 Astra judges Claude arms, Claude Opus 5.5 judges GPT arms. With two or more arms: \`paired: yes\`, \`interval: 95%\` and \`mdd: <the smallest difference this run can detect>\`. -->
|
||||
|
||||
## Pilot
|
||||
<!-- Uncounted, per arm, before its counted run: \`share: <at most 10>%\` of that arm's budget; \`counted: no\`; \`ran:\` how the arm's own outputs show the part under test ran; \`judge:\` the judge's label check on that arm's pilot outputs (with a model judge); \`supply:\` how the units are shown to be suppliable at the planned rate; \`units:\` every unit type the counted run uses, each drawn at least once; \`seed:\` the fixed seed for the draw order, independent of the number of workers. An arm that fails is fixed or left out, and reported as left out. -->
|
||||
|
||||
## Cost
|
||||
<!-- \`paid: $<the counted run's paid budget>\`; \`meter: <expected agent and machine spend, or $0>\`; \`ledger: <the private file where the actual cost and the decision it settled are written>\`. A public results page carries the decision, not the cost, unless the cost is the lesson. -->
|
||||
|
||||
## Interim look
|
||||
<!-- Required when paid is above $500: \`at: 50%\` of the units; \`looks: 1\`; \`bounds: O'Brien-Fleming\` with the values (for one look at half: stop for effect at |z| >= 2.80, final |z| >= 1.98); \`futility: <the result at the look that stops the run>\`. No other look is taken. Delete this section when paid is $500 or less. -->
|
||||
|
||||
## Decoys
|
||||
<!-- Inputs the scorer must reject or score low; how many, how they were made, what a decoy pass proves. -->
|
||||
@@ -70,6 +81,19 @@ export function preregTemplate(title = 'Eval preregistration'): string {
|
||||
`;
|
||||
}
|
||||
|
||||
/** `prereg --init --quick`: a quick look, three lines and a cap, that publishes no number (docs/TESTING_INTERNALS.md#eval-loop-checks). */
|
||||
export function quickLookTemplate(title = 'Quick look'): string {
|
||||
return `# ${title}
|
||||
|
||||
kind: quick look
|
||||
question: <the one question, e.g. does this edit help on these 10 tasks>
|
||||
decision: <if it helps: open a counted run with a preregistration; if not: close the question>
|
||||
stop: <when it stops: the cap, or the first result that answers the question>
|
||||
cap: $100
|
||||
<!-- At most $100 paid and one day. A quick look publishes no number: \`results --check\` refuses it. It only opens or closes a question. -->
|
||||
`;
|
||||
}
|
||||
|
||||
/** A section's content lines (blank lines and `<!-- -->` guidance, one-line or multi-line, dropped); null when the heading is absent. */
|
||||
function sectionBody(text: string, name: string): string[] | null {
|
||||
const lines = text.split('\n');
|
||||
@@ -141,8 +165,15 @@ function checkNoGstackArm(text: string, stack: ComparisonCheck['stack']): NoGsta
|
||||
export function checkPrereg(text: string): PreregCheck {
|
||||
const present: string[] = []; const missing: string[] = []; const empty: string[] = [];
|
||||
const exempt = grandfathered(text);
|
||||
const loopExempt = loopGrandfathered(text);
|
||||
const noLoop: LoopCheck = { paid: null, interim_required: false, errors: [] };
|
||||
if (isQuickLook(text)) {
|
||||
const quick = checkQuickLook(text);
|
||||
return { ok: !quick.errors.length, present, missing, empty, comparison: { stack: null, why: null, errors: [] }, no_gstack: { required: false, ok: true, arms: [], problems: [] }, diagnostics: null, decisions: { outcomes: [], errors: [] }, scoring: { judge: null, labels: null, agreement: null, errors: [] }, frozen: frozenDate(text), grandfathered: exempt, loop: noLoop, loop_grandfathered: loopExempt, quick };
|
||||
}
|
||||
for (const name of PREREG_SECTIONS) {
|
||||
if (exempt && RESULT_CHECK_SECTIONS.includes(name)) continue;
|
||||
if (loopExempt && LOOP_CHECK_SECTIONS.includes(name)) continue;
|
||||
const body = sectionBody(text, name);
|
||||
if (body === null) missing.push(name); else if (body.length === 0) empty.push(name); else present.push(name);
|
||||
}
|
||||
@@ -151,8 +182,10 @@ export function checkPrereg(text: string): PreregCheck {
|
||||
const diagnostics = parsePreregDiagnostics(text);
|
||||
const decisions = exempt ? { outcomes: [], errors: [] } : checkDecisions(sectionBody(text, 'Decisions'));
|
||||
const scoring = exempt ? { judge: null, labels: null, agreement: null, errors: [] } : checkScoring(sectionBody(text, 'Scoring'), armIdentities(text));
|
||||
const ok = missing.length === 0 && empty.length === 0 && !comparison.errors.length && no_gstack.ok && !diagnostics?.errors.length && !decisions.errors.length && !scoring.errors.length;
|
||||
return { ok, present, missing, empty, comparison, no_gstack, diagnostics, decisions, scoring, frozen: frozenDate(text), grandfathered: exempt };
|
||||
const section = (name: string) => sectionBody(text, name);
|
||||
const loop = loopExempt ? noLoop : checkLoop({ pilot: section('Pilot'), cost: section('Cost'), interim: section('Interim look'), scoring: section('Scoring'), bars: section('Bars'), arms: section('Arms'), heldOut: section('Held-out exposure') });
|
||||
const ok = missing.length === 0 && empty.length === 0 && !comparison.errors.length && no_gstack.ok && !diagnostics?.errors.length && !decisions.errors.length && !scoring.errors.length && !loop.errors.length;
|
||||
return { ok, present, missing, empty, comparison, no_gstack, diagnostics, decisions, scoring, frozen: frozenDate(text), grandfathered: exempt, loop, loop_grandfathered: loopExempt, quick: null };
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -317,7 +350,7 @@ export interface DryRunResult {
|
||||
export interface DryRunOptions { input: string; arms: string[]; fields?: string[]; outputBudget?: number; retryPrompt?: string; maxRows?: number; cap?: number; modelRules?: ModelRulesCheck; tierQuestion?: string }
|
||||
|
||||
/** Today's frontier models under test (R54, docs/TESTING_INTERNALS.md#frontier-models-under-test); a small-tier plan is re-costed on these. */
|
||||
export const FRONTIER_MODELS = ['claude-opus-5-5', 'gpt-6.1-sol'] as const;
|
||||
export const FRONTIER_MODELS = ['claude-opus-5-5', 'gpt-6.2-sol'] as const;
|
||||
export const isSmallTierModel = (model: string) => /(^|[-/])(haiku|sonnet)(-|$)/i.test(model);
|
||||
|
||||
/** Four bytes per token, the estimator every gstack admission uses. */
|
||||
|
||||
+2
-2
@@ -53,8 +53,8 @@ export const DISPATCHES: Dispatch[] = [
|
||||
export const STATUSES = ['helps', 'no-effect', 'hurts', 'untested', 'safety'] as const;
|
||||
export type Status = (typeof STATUSES)[number];
|
||||
export const R48_VERDICTS = ['KEEP', 'FIX-METHOD', 'CUT-CANDIDATE'] as const;
|
||||
/** R54: the frontier models under test; a row may add at most one named low-cost primary, never Haiku or Sonnet. */
|
||||
export const FRONTIER_MODELS = ['claude-opus-5-5', 'gpt-6.1-sol'];
|
||||
/** R54: the frontier models under test (GPT-6.2 Sol for new plans; rows measured on 6.1 Sol keep it); a row may add at most one named low-cost primary, never Haiku or Sonnet. */
|
||||
export const FRONTIER_MODELS = ['claude-opus-5-5', 'gpt-6.2-sol', 'gpt-6.1-sol'];
|
||||
/** Why an earlier result does not count as fair evidence yet. */
|
||||
export const PRIOR_WHY: Record<string, string> = {
|
||||
stub: 'ran on the Agent SDK stub prompt, not the claude_code preset',
|
||||
|
||||
@@ -61,6 +61,10 @@ export const PRICING: Record<string, ModelPricing> = {
|
||||
'gpt-6-astra': { input_per_mtok: 10.00, output_per_mtok: 50.00, cached_input_per_mtok: 1.00, as_of: '2026-09' },
|
||||
// https://developers.openai.com/api/docs/models/gpt-6.1-sol (standard tier, up to 272K input)
|
||||
'gpt-6.1-sol': { input_per_mtok: 2.00, output_per_mtok: 10.00, cached_input_per_mtok: 0.10, as_of: '2026-10' },
|
||||
// https://developers.openai.com/api/docs/models/gpt-6.2-sol (fetched 2026-11-21; standard tier, up to 272K input)
|
||||
'gpt-6.2-sol': { input_per_mtok: 2.00, output_per_mtok: 10.00, cached_input_per_mtok: 0.10, as_of: '2026-11' },
|
||||
// https://developers.openai.com/api/docs/models/gpt-6.2-astra (fetched 2026-11-21; standard tier, up to 272K input)
|
||||
'gpt-6.2-astra': { input_per_mtok: 8.00, output_per_mtok: 40.00, cached_input_per_mtok: 0.40, as_of: '2026-11' },
|
||||
// https://developers.openai.com/api/docs/models/gpt-6-luna (fetched 2026-10-31; standard tier, up to 272K input)
|
||||
'gpt-6-luna': { input_per_mtok: 0.10, output_per_mtok: 0.50, cached_input_per_mtok: 0.01, as_of: '2026-10' },
|
||||
'gpt-5.4': { input_per_mtok: 2.50, output_per_mtok: 10.00, as_of: '2026-04' },
|
||||
|
||||
@@ -46,6 +46,12 @@ export const EVAL_RESULT_CODES = {
|
||||
summary: 'a results table counts failures without an answer-only column beside it, so a rise in failures cannot be compared with the grader\'s own reading',
|
||||
fix: 'add a column headed answer-only to the same table, counting failures by the grader\'s rule on the final answer alone, and report both readings',
|
||||
},
|
||||
// Eval-loop practice R112 (docs/TESTING_INTERNALS.md#eval-loop-checks): a quick look publishes no number.
|
||||
EVAL_QUICK_LOOK_NO_NUMBER: {
|
||||
anchor: 'eval-quick-look-no-number',
|
||||
summary: 'results --check was given a quick look (kind: quick look), which only opens or closes a question and publishes no number',
|
||||
fix: 'keep the quick look\'s answer as an opened or closed question; to publish a number, write a counted-run preregistration (prereg --init) and run it through the pilot',
|
||||
},
|
||||
EVAL_ARM_DUPLICATE: {
|
||||
anchor: 'eval-arm-duplicate',
|
||||
summary: 'the pilot was given the same arm identity twice, so two arms would share one set of attempts',
|
||||
|
||||
Reference in new issue
Block a user