mirror of
https://github.com/garrytan/gstack.git
synced 2026-10-03 18:06:54 +02:00
* test: delete test-infrastructure dead code (G) - exit-propagation drives the runner's real strict verdict (BunTestOutputClassifier + strictTestExitCode); delete the unused shardRunLooksTruncated predicate. - delete skill-coverage-matrix registry + its gate (nothing reads it; the floor already iterates skillCensus()). - delete touchfiles-facade export-parity tests (Bun fails missing imports at link time) and the duplicated E2E_TIERS tier-value test. - delete brain-cache-spec TRANSPORT_DEFAULT_POLICY, SKILL_RUN_RETENTION_DAYS and the now-unused BrainTrustPolicy type with their literal tests. AUTOPLAN_PREFLIGHT_BUDGET_BYTES stays: skill-preflight-budget enforces it against real resolver output. - delete audit-compliance's JSDoc-comment grep. * test: replace product tests that fake the product with real-boundary tests (F) - design: serve.test.ts drove an inline mirror server; now two tests run the real serve() on an ephemeral port (reload confinement, submit exit 0). - setup-gbrain: rollback + voyage tests execute the template-extracted init blocks (3 sites) instead of drifted local bash copies. - terminal-agent: internalHandler source greps replaced by a behavioral /internal/grant + /internal/revoke auth matrix (no/wrong/valid token). - /health: server-security-surface and the server-auth / security-audit-r2 / sidebar-tabs source greps fold into one liveness-only check on the real body; the L4 sidecar wiring gets a behavioral /pty-inject-scan test. - delete tautologies (browser-manager onDisconnect, memory-command #12), ios swiftui tap fixture self-check, memory-ingest put_page grep, detach source greps, sidebar-agent absence pins, dead-CSS pins + the dead CSS, security-audit-r2 Task 1 + the test-only meta-commands re-export, duplicate generated-SKILL.md checks. - make-pdf coverage-gaps cases move into their owner test files. * test: delete tests of dead eval code (A) - A1: the retired Eng lexical oracle (evaluateEngSeedCoverage, isEngSeedDecisionAUQ), the completion-handoff detector and the retained corpus had no paid caller since v1.87.6; delete their 26 replay files, ~2.6k helper LOC and fixtures, and the dead blocks in 8 mixed files (live hasNativePlanTerminal / batching assertions stay). - A2: dead viewport approvers in autoplan-artifact-permission and their 11 replay files + fixtures; recorder/launcher cases stay. - A3: never-wired oracles and seeders (autoplan-phase-order, eng-finding-fixture, ceo-paired-fixture, design-ui-scope, plan-skill-completion, pty-current-screen, required-reads, transcript-section-logger); plan-seed-submission now decodes through the production createPtyScreen; section manifests name their actual guard. - A4: zero-reference helper exports, plus execGit and invokeAndObserve found by the reachability pass. - 52 fixtures orphaned by the deletions; touchfile and selection-table entries for every deleted path. * test: clean up the paid eval lane (B1-B4, B6, B7) - B1: delete paid files that assert nothing or cannot pass meaningfully: skill-llm-eval-spec and skill-e2e-spec-execute (test.todo), gemini-e2e (+ gemini-session-runner; no gemini CLI in CI), ship-idempotency (red since v1.63), the two opus-4-7 *-sonnet overlay wrappers, conductor-prose (+ its source-evaluation replay), codex-e2e-plan-format; drop their keys, scripts and census rows. - B2: skill-llm-eval grades browse/sections/command-list.md with one union judge that also carries the baseline score pin; regression-vs-baseline deleted (paid run: pass, c4/c4/a4). - B3: memory-pipeline, ios-qa, ios-qa-swift-build and plan-tune-cathedral make no model calls; renamed out of the paid glob so they run on every PR. Swift builds need GSTACK_TEST_SWIFT=1; device stub deleted. - B4: codex-e2e*, outside-voice, aside and ios-device cannot run in the CI image; excluded from the weekly lane with a tracked re-entry condition. - B6: fold opus-47's negative routing controls into skill-routing-e2e journey-negatives (paid run: 3/3 unrouted) and delete the file. - B7: delete the never-green brain-privacy-gate eval; a free gstack-skill-start test now proves consent precedes artifacts egress. * test: retire the finding-count cluster and trim its helpers (C) - C0/C1: the five never-green evals (skill-e2e-autoplan-chain and skill-e2e-plan-{ceo,eng,design,devex}-finding-count) failed on harness and budget, never on skill behavior; delete them, their touchfile/tier ids, AUTOPLAN_CHAIN_BUDGET and the dedicated eighth periodic slice (--slices 7). - C2: delete the helper groups whose only paid consumers were those files (11 modules), trim claude-pty-runner and eng-seeded-coverage to the paid closure, and delete the free replay tests whose assertions exercised only that dead code (89 files, 135 orphaned fixtures). Blocks that used dead code only as input for a live subject keep their assertions: the multiSelect default moved to plan-review-decisions, runner PTY tests use inline caller policies, and the timer-safe budget checks moved to eng-finding-retry-budget. - The eight production-touching files stay except ceo-current-decision-record (its template read only feeds the retired counter). - CARVE_GUARDS.autoplan is behavioral 'none'; TODOS records the lost chain and per-finding cadence coverage with their re-entry tests. * test: fold per-incident replay series into their detector owners (D) Twelve detector families move into one owner test each: 73 incident files become describe blocks in ceo-section-loading-fixture (stale-fill race), model-overlays, coverage-audit-evidence, autoplan-phase-observer, native-auto-decide, outside-voice-evidence, eng-first-review, plan-count-completion, plan-count-file-permission, ceo-mode-option, plan-scope-selection and plan-count-prerequisite. Each block keeps its original code and fixture, so every case still runs; only tests asserting the incident file's own touchfile registration are dropped (41). Touchfile lists that named an incident now name its owner. * test: start the plan-count history PTY on its readiness marker (H) The fake CLI prints a startup marker and the runner waits for it instead of the fixed 8 s startup sleep (8.6 s -> 0.9 s locally). eng-semantic-terminal's sleeping registration cases went with C; plan-count-timeout keeps the fixed wait because it asserts deadline behavior. * test: derive paid touchfiles from each eval's static closure (E) touchfiles.test.ts now checks, per key, that the paid file's static test/helpers and test/fixtures closure (plus fixture paths it names in string literals) is covered, and names the file, path, chain and key to fix when it is not. Free *.test.ts files are no longer touchfiles, so editing a free replay test stops selecting paid evals: 950 entries removed, 653 real closure paths added. The hand-copied inventories go: periodic-fixture-selection, fake-impeccable-touchfiles and 45 per-file selection examples. Selection for the sample edits (plan-eng-review template, claude-pty-runner, plan-count-fixture, gstack-config) loses no case under either profile. CONTRIBUTING documents the rule and its lower bound. * test: skip hollow tier shards and census judges in the paid planner (B5) A paid file is now skipped for a tier lane only when every E2E id it registers is known statically and none has that tier; ids come from the touchfile registrations and literal testName/*IfSelected arguments, so a comment or skill path that quotes another id cannot unschedule it, and computed names keep today's scheduling. --list and the manifest show each skip as "skipped: no E2E_TIERS id has tier <tier>". The weekly gate census drops the LLM judges (--skip-judges); they still run in the periodic census and PR gate lanes. Gate lane 52 -> 42 files, census 41; periodic 77 -> 69. * test: run seven paid evals on the current default capture model (B8) skill-e2e-{auq-matrix,plan-format,qa-bugs,retro,workflow} pinned claude-opus-4-7 and skill-e2e-office-hours plus -brain-writeback pinned claude-sonnet-4-6; none tests a historical model, so they now capture with resolveEvalModel('capture'), and the free harness tests that execute these registrations receive the same resolver. The paid re-pin run passed all of them. skill-e2e-{design,office-hours-phase4,plan-prosons,plan} keep claude-opus-4-7: six of their cases failed on the default model (three timeouts, a missing report file, a format miss and a posture score of 3), so per the plan's fallback they keep their pins with a TODOS entry. The pre-spend estimate and drop threshold are in docs/test-audit-2026-09.md. * test: guard the reduced suite against new test-of-test files - test/test-of-test-ratchet.test.ts records the 228 free tests that import only test/ code and fails on a new one, naming the owner test to extend instead; a stale baseline entry fails with the remove instruction. - test/helpers/resolve-repo-path.ts is the one specifier/literal resolver for the ratchet and the touchfile closure invariant, with its own unit tests. - CONTRIBUTING "Test tiers" describes the paid-failure workflow (fix, then one row in the detector's owner test) and the ratchet; TEST_PORTFOLIO gains the detector -> owner-test table and no longer claims an Autoplan chain eval. - TODOS: automatic exclusion policy for chronically red periodic files (P3), the deferred native-completion table collapse, the unused CEO payment seeder; the PTY readiness item is narrowed to the paid runner. - docs/test-audit-2026-09.md collects the triage, security mapping, inventories, selection proof, behavior-commit decisions and retained false positives. * v1.91.8.0 test: smaller suite, derived paid selection, retired never-green evals Release metadata for the test-reduction branch: VERSION 1.91.8.0 (1.91.7.0 is claimed by #2983), CHANGELOG with the measured before/after table and a contributor section, durations re-recorded on Ubicloud standard-16 (857 files, 0 failures), the agents digest, CONTRIBUTING's after-measurement row, the B8 fallback TODOS entry, and the after metrics, kept-vs-plan notes, B8 run and census estimate in docs/test-audit-2026-09.md. * fix(ubicloud): skip retrieval globs that match nothing instead of reporting a failed pull * test: count issue-numbered Design findings in the UI-scope gate eval
313 lines
14 KiB
TypeScript
313 lines
14 KiB
TypeScript
/**
|
|
* Overlay behavior regression fixtures with comparative research measurements.
|
|
*
|
|
* Each paid wrapper runs both arms against the real Claude Code preset.
|
|
* Complete, valid measurements and exact ON behavior are blocking; the original
|
|
* `fixture.pass(arms)` efficacy comparator is retained as research evidence.
|
|
* New records use the versioned contract in helpers/overlay-case-policy.ts.
|
|
*
|
|
* A new eval needs a fixture, paid wrapper/census, and selection dependencies.
|
|
* The harness handles
|
|
* arm wiring, concurrency, artifact storage, rate-limit retries, and records.
|
|
*/
|
|
|
|
import * as fs from 'fs';
|
|
import * as path from 'path';
|
|
import type { AgentSdkResult } from '../helpers/agent-sdk-runner';
|
|
import { reportedThinkingTokens, type ComparisonSpec } from '../helpers/overlay-measurement';
|
|
import { setupLiteralWorkspace, correctLiteralTargets, assertFinalJson } from '../helpers/overlay-workspace';
|
|
|
|
const REPO_ROOT = path.resolve(__dirname, '..', '..');
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Types
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export interface OverlayFixture {
|
|
/** Unique, lowercase/digits/dash only. Used in artifact paths. */
|
|
id: string;
|
|
/** Path to the overlay file, relative to repo root. */
|
|
overlayPath: string;
|
|
/** API model ID, not the overlay family name. */
|
|
model: string;
|
|
/** Integer >= 3. Trials per arm. */
|
|
trials: number;
|
|
/** Max concurrent queries for this fixture's arms. Default 3. */
|
|
concurrency?: number;
|
|
/** Populate the workspace dir before each trial. */
|
|
setupWorkspace: (dir: string) => void;
|
|
/** The prompt the model receives. Non-empty. */
|
|
userPrompt: string;
|
|
/** Per-fixture tool allowlist. Omit to use runner default [Read, Glob, Grep, Bash]. */
|
|
allowedTools?: string[];
|
|
/** Max turns per trial. Omit to use runner default (5). */
|
|
maxTurns?: number;
|
|
/**
|
|
* Direction of the expected effect. `higher_is_better` = overlay should
|
|
* increase the metric (e.g. batched calls, correct target behaviors).
|
|
* `lower_is_better` = overlay should decrease it (e.g. Bash count, reported reasoning tokens).
|
|
* Used for logging; the numeric `pass` comparator is research evidence only.
|
|
*/
|
|
direction?: 'higher_is_better' | 'lower_is_better';
|
|
/** Compute the per-trial metric from the typed SDK result. */
|
|
metric: (r: AgentSdkResult, workspace?: string, deadlineAt?: number) => number;
|
|
/** Exact task correctness, separate from comparative efficacy. */
|
|
verify?: (r: AgentSdkResult, workspace: string, metric: number) => void;
|
|
/** Exact ON behavior requirement; OFF can validly miss this control variable. */
|
|
taskCorrect?: (metric: number) => boolean;
|
|
/** Exact permitted paths; read-only by default. */
|
|
allowedChanges?: string[];
|
|
metricName?: string;
|
|
comparison?: ComparisonSpec;
|
|
/** Original comparative efficacy predicate; never the behavior release gate. */
|
|
pass: (arms: { overlay: number[]; off: number[] }) => boolean;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Validation
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export function validateFixtures(fixtures: OverlayFixture[]): void {
|
|
const ids = new Set<string>();
|
|
for (const f of fixtures) {
|
|
if (!f.id || !/^[a-z0-9-]+$/.test(f.id)) {
|
|
throw new Error(
|
|
`fixture id must be non-empty, lowercase/digits/dash only: ${JSON.stringify(f.id)}`,
|
|
);
|
|
}
|
|
if (ids.has(f.id)) {
|
|
throw new Error(`duplicate fixture id: ${f.id}`);
|
|
}
|
|
ids.add(f.id);
|
|
|
|
if (!Number.isInteger(f.trials) || f.trials < 3) {
|
|
throw new Error(`${f.id}: trials must be an integer >= 3 (got ${f.trials})`);
|
|
}
|
|
if (
|
|
f.concurrency !== undefined &&
|
|
(!Number.isInteger(f.concurrency) || f.concurrency < 1)
|
|
) {
|
|
throw new Error(
|
|
`${f.id}: concurrency must be an integer >= 1 (got ${f.concurrency})`,
|
|
);
|
|
}
|
|
|
|
if (!f.model) throw new Error(`${f.id}: model must be non-empty`);
|
|
if (!f.userPrompt) throw new Error(`${f.id}: userPrompt must be non-empty`);
|
|
|
|
if (path.isAbsolute(f.overlayPath) || f.overlayPath.includes('..')) {
|
|
throw new Error(
|
|
`${f.id}: overlayPath must be relative and must not contain '..' (got ${f.overlayPath})`,
|
|
);
|
|
}
|
|
const fullPath = path.resolve(REPO_ROOT, f.overlayPath);
|
|
if (!fs.existsSync(fullPath)) {
|
|
throw new Error(`${f.id}: overlay file not found at ${f.overlayPath}`);
|
|
}
|
|
|
|
for (const fn of ['setupWorkspace', 'metric', 'pass'] as const) {
|
|
if (typeof f[fn] !== 'function') {
|
|
throw new Error(`${f.id}: ${fn} must be a function`);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Metric + predicate helpers
|
|
// ---------------------------------------------------------------------------
|
|
|
|
function mean(xs: number[]): number {
|
|
if (xs.length === 0) return 0;
|
|
return xs.reduce((a, b) => a + b, 0) / xs.length;
|
|
}
|
|
|
|
/**
|
|
* Retired paid fanout predicate, retained for free regressions: overlay mean
|
|
* beats OFF by at least 0.5 tool_use blocks in the first complete assistant
|
|
* message, AND at least 3 ON trials emit >= 2 blocks in the same message.
|
|
*
|
|
* The combined rule catches both "overlay nudges every trial slightly"
|
|
* (mean) and "overlay sometimes triggers batching" (floor). A single
|
|
* 0.5 lift with every trial still emitting 1 call would be suspicious;
|
|
* this predicate rejects it.
|
|
*/
|
|
export function fanoutPass(arms: { overlay: number[]; off: number[] }): boolean {
|
|
const lift = mean(arms.overlay) - mean(arms.off);
|
|
const floorHits = arms.overlay.filter((n) => n >= 2).length;
|
|
return lift >= 0.5 && floorHits >= 3;
|
|
}
|
|
|
|
/**
|
|
* Original "lower is better" research comparator: overlay mean should drop the
|
|
* metric by at least 20% vs baseline. Used for nudges like "effort-match"
|
|
* (reported reasoning tokens) and "dedicated tools vs Bash" (fewer Bash calls).
|
|
*/
|
|
export function lowerIsBetter20Pct(arms: { overlay: number[]; off: number[] }): boolean {
|
|
const meanOff = mean(arms.off);
|
|
if (meanOff === 0) return false; // Equality at the optimum is not efficacy lift.
|
|
return mean(arms.overlay) <= meanOff * 0.8;
|
|
}
|
|
|
|
/**
|
|
* Original "higher is better" research comparator: overlay mean should lift the
|
|
* metric by at least 20% vs baseline. Used for nudges like "literal
|
|
* interpretation" (more target behaviors completed).
|
|
*/
|
|
export function higherIsBetter20Pct(arms: { overlay: number[]; off: number[] }): boolean {
|
|
const meanOff = mean(arms.off);
|
|
const meanOn = mean(arms.overlay);
|
|
if (meanOff === 0) return meanOn > 0;
|
|
return meanOn >= meanOff * 1.2;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Metrics
|
|
// ---------------------------------------------------------------------------
|
|
|
|
/**
|
|
* Count the total number of Bash tool_use blocks across ALL assistant turns.
|
|
* Signal for "dedicated tools over Bash" nudge in claude.md.
|
|
*/
|
|
export function bashToolCallCount(r: AgentSdkResult): number {
|
|
return r.toolCalls.filter((c) => c.tool === 'Bash').length;
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Fixtures
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export const OVERLAY_FIXTURES: OverlayFixture[] = [
|
|
// -------------------------------------------------------------------------
|
|
// claude.md / "Dedicated tools over Bash"
|
|
// -------------------------------------------------------------------------
|
|
{
|
|
id: 'claude-dedicated-tools-vs-bash',
|
|
overlayPath: 'model-overlays/claude.md',
|
|
model: 'claude-opus-4-7',
|
|
trials: 10,
|
|
concurrency: 3,
|
|
direction: 'lower_is_better',
|
|
// 5 files + summary = needs more than default 5 turns. SDK throws
|
|
// instead of returning a result when it hits the cap.
|
|
maxTurns: 15,
|
|
setupWorkspace: (dir) => {
|
|
fs.mkdirSync(path.join(dir, 'src'), { recursive: true });
|
|
fs.writeFileSync(path.join(dir, 'src', 'index.ts'), "export const x = 1;\n");
|
|
fs.writeFileSync(path.join(dir, 'src', 'util.ts'), "export function util() { return 42; }\n");
|
|
fs.writeFileSync(path.join(dir, 'src', 'types.ts'), "export type Foo = { a: number };\n");
|
|
fs.writeFileSync(path.join(dir, 'src', 'config.ts'), "export const c = { n: 'demo' };\n");
|
|
fs.writeFileSync(path.join(dir, 'src', 'api.ts'), "export async function fetchFoo() { return null; }\n");
|
|
},
|
|
userPrompt:
|
|
"List every TypeScript file under src/ and tell me what each exports. " +
|
|
"Return only a JSON object mapping each src/ path to an array of its exported symbol names. " +
|
|
"The final message is consumed directly by JSON.parse: return the exact JSON object, with no Markdown fences and no other prose. " +
|
|
"You may use any tools available.",
|
|
// Metric: total Bash tool_use count across the whole session.
|
|
// The overlay says "prefer Read/Glob/Grep over cat/find/grep shell."
|
|
// A model following that should emit Glob + Read, not Bash ls/find/cat.
|
|
metric: bashToolCallCount,
|
|
metricName: 'bash_tool_calls',
|
|
verify: (r) => assertFinalJson(r, { 'src/index.ts': ['x'], 'src/util.ts': ['util'], 'src/types.ts': ['Foo'], 'src/config.ts': ['c'], 'src/api.ts': ['fetchFoo'] }),
|
|
taskCorrect: (metric) => metric === 0,
|
|
comparison: { direction: 'lower_is_better', minimum: 0 },
|
|
pass: lowerIsBetter20Pct,
|
|
},
|
|
|
|
// -------------------------------------------------------------------------
|
|
// opus-4-7.md / "Effort-match the step"
|
|
// -------------------------------------------------------------------------
|
|
{
|
|
id: 'opus-4-7-effort-match-trivial',
|
|
overlayPath: 'model-overlays/opus-4-7.md',
|
|
model: 'claude-opus-4-7',
|
|
trials: 10,
|
|
concurrency: 3,
|
|
direction: 'lower_is_better',
|
|
maxTurns: 8,
|
|
setupWorkspace: (dir) => {
|
|
fs.writeFileSync(
|
|
path.join(dir, 'config.json'),
|
|
'{"name": "demo", "version": "1.0.0"}\n',
|
|
);
|
|
},
|
|
userPrompt: "What's the version in config.json? Return only a JSON object with the version key and its exact string value. " +
|
|
"The final message is consumed directly by JSON.parse: return the exact JSON object, with no Markdown fences and no other prose.",
|
|
// Use the SDK's reported reasoning tokens. Lookup/tool counts do not
|
|
// measure extended thinking; absent usage metadata is an error.
|
|
metric: reportedThinkingTokens,
|
|
metricName: 'reported_thinking_tokens',
|
|
verify: (r) => assertFinalJson(r, { version: '1.0.0' }),
|
|
comparison: { direction: 'lower_is_better', minimum: 0 },
|
|
pass: lowerIsBetter20Pct,
|
|
},
|
|
|
|
// -------------------------------------------------------------------------
|
|
// opus-4-7.md / "Literal interpretation awareness"
|
|
// -------------------------------------------------------------------------
|
|
{
|
|
id: 'opus-4-7-literal-interpretation',
|
|
overlayPath: 'model-overlays/opus-4-7.md',
|
|
model: 'claude-opus-4-7',
|
|
trials: 10,
|
|
concurrency: 3,
|
|
direction: 'higher_is_better',
|
|
// Allow repairs to real implementations; the public tests stay frozen.
|
|
allowedTools: ['Read', 'Glob', 'Grep', 'Bash', 'Edit', 'Write'],
|
|
maxTurns: 15,
|
|
setupWorkspace: setupLiteralWorkspace,
|
|
userPrompt: 'Fix the failing tests. Preserve the specified behavior and repair the implementation.',
|
|
metric: (_r, dir, deadlineAt) => {
|
|
if (!dir) throw new Error('literal fixture metric needs its workspace');
|
|
return correctLiteralTargets(dir, deadlineAt);
|
|
},
|
|
metricName: 'correct_target_behaviors',
|
|
taskCorrect: (metric) => metric === 3,
|
|
allowedChanges: ['src/auth.ts', 'src/billing.ts', 'src/notifications.ts'],
|
|
comparison: { direction: 'higher_is_better', minimum: 0, maximum: 3 },
|
|
pass: higherIsBetter20Pct,
|
|
},
|
|
|
|
// =========================================================================
|
|
// Sonnet 4.6 variants of the Opus-4.7 fixtures.
|
|
//
|
|
// Same overlays, prompts, metrics and trial counts; different pinned model.
|
|
// Model effects remain separate instead of pooling their observations.
|
|
// =========================================================================
|
|
|
|
{
|
|
id: 'claude-dedicated-tools-vs-bash-sonnet',
|
|
overlayPath: 'model-overlays/claude.md',
|
|
model: 'claude-sonnet-4-6',
|
|
trials: 10,
|
|
concurrency: 3,
|
|
direction: 'lower_is_better',
|
|
maxTurns: 15,
|
|
setupWorkspace: (dir) => {
|
|
fs.mkdirSync(path.join(dir, 'src'), { recursive: true });
|
|
fs.writeFileSync(path.join(dir, 'src', 'index.ts'), "export const x = 1;\n");
|
|
fs.writeFileSync(path.join(dir, 'src', 'util.ts'), "export function util() { return 42; }\n");
|
|
fs.writeFileSync(path.join(dir, 'src', 'types.ts'), "export type Foo = { a: number };\n");
|
|
fs.writeFileSync(path.join(dir, 'src', 'config.ts'), "export const c = { n: 'demo' };\n");
|
|
fs.writeFileSync(path.join(dir, 'src', 'api.ts'), "export async function fetchFoo() { return null; }\n");
|
|
},
|
|
userPrompt:
|
|
"List every TypeScript file under src/ and tell me what each exports. " +
|
|
"Return only a JSON object mapping each src/ path to an array of its exported symbol names. " +
|
|
"The final message is consumed directly by JSON.parse: return the exact JSON object, with no Markdown fences and no other prose. " +
|
|
"You may use any tools available.",
|
|
metric: bashToolCallCount,
|
|
metricName: 'bash_tool_calls',
|
|
verify: (r) => assertFinalJson(r, { 'src/index.ts': ['x'], 'src/util.ts': ['util'], 'src/types.ts': ['Foo'], 'src/config.ts': ['c'], 'src/api.ts': ['fetchFoo'] }),
|
|
taskCorrect: (metric) => metric === 0,
|
|
comparison: { direction: 'lower_is_better', minimum: 0 },
|
|
pass: lowerIsBetter20Pct,
|
|
},
|
|
|
|
];
|
|
|
|
// Validate at module load so a broken fixture fails fast at test startup,
|
|
// not mid-run after burning API dollars.
|
|
validateFixtures(OVERLAY_FIXTURES);
|