mirror of
https://github.com/garrytan/gstack.git
synced 2026-10-02 17:40:02 +02:00
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.
This commit is contained in:
1 parent
53e7f3212f
commit
6415690a18
317 files changed
+315
-54111
No files matched your search
@@ -809,7 +809,7 @@ function hasCompleteCiSummary(outcome: FreeShardOutcome): boolean {
|
||||
|
||||
export const QUICK_CORE = [
|
||||
'test/strict-output.test.ts', 'test/gen-skill-docs.test.ts',
|
||||
'test/skill-check-driver.test.ts', 'test/ceo-native-ledger-replay.test.ts',
|
||||
'test/skill-check-driver.test.ts',
|
||||
'test/skill-ceo-section-ordering.test.ts',
|
||||
];
|
||||
|
||||
|
||||
+14
-68
@@ -65,7 +65,7 @@ import {
|
||||
} from './test-strict-output';
|
||||
import { PAID_TEST_GLOBS, isPaidTestFile } from '../test/helpers/paid-test-set';
|
||||
import { PERIODIC_CI_EXCLUDE } from '../test/helpers/periodic-exclude-data';
|
||||
import { AUTOPLAN_CHAIN_BUDGET, FILE_RETRY_BUDGETS, STRICT_RETRY_CASE_BUDGETS } from '../test/helpers/eval-budgets';
|
||||
import { FILE_RETRY_BUDGETS, STRICT_RETRY_CASE_BUDGETS } from '../test/helpers/eval-budgets';
|
||||
import { getProjectEvalDir, getClaudeCliVersion, isFinalizedEvalResultFile, evalEntryOutcome } from '../test/helpers/eval-store';
|
||||
import { manualReviewProblem } from '../test/helpers/cookie-workflow-manual-review';
|
||||
import { preflightAnthropicApi } from '../test/helpers/anthropic-preflight';
|
||||
@@ -464,7 +464,7 @@ export function planPaidShards(
|
||||
const shards: string[][] = [];
|
||||
let pending: string[] = [];
|
||||
for (const file of unique) {
|
||||
if (isOverlayTestFile(file) || file === AUTOPLAN_CHAIN_BUDGET.file || FILE_RETRY_BUDGETS.some(budget => budget.file === file)) {
|
||||
if (isOverlayTestFile(file) || FILE_RETRY_BUDGETS.some(budget => budget.file === file)) {
|
||||
if (pending.length) shards.push(pending);
|
||||
pending = [];
|
||||
shards.push([file]);
|
||||
@@ -485,8 +485,6 @@ export interface PaidShardBudget {
|
||||
|
||||
/** Explicit caller limits win; registered supervision preserves existing attempts. */
|
||||
export function resolvePaidShardBudget(files: string[], overrideMs?: number): PaidShardBudget {
|
||||
const autoplan = files.map(normalizeRelativePath).includes(AUTOPLAN_CHAIN_BUDGET.file);
|
||||
if (autoplan && files.length !== 1) throw new Error('Autoplan budget requires its own shard');
|
||||
const finding = FILE_RETRY_BUDGETS.find(budget => files.map(normalizeRelativePath).includes(budget.file));
|
||||
if (finding && files.length !== 1) throw new Error('Registered retry budget requires its own shard');
|
||||
if (overrideMs !== undefined && (!Number.isSafeInteger(overrideMs) || overrideMs <= 0 || overrideMs > 2_147_483_647)) {
|
||||
@@ -498,9 +496,9 @@ export function resolvePaidShardBudget(files: string[], overrideMs?: number): Pa
|
||||
throw new Error(`Overlay shard requires at least ${OVERLAY_MIN_FILE_WALL_MS}ms; explicit wall ${overrideMs}ms cannot preserve its work and finalization budget`);
|
||||
}
|
||||
return {
|
||||
timeoutMs: overrideMs ?? (autoplan ? AUTOPLAN_CHAIN_BUDGET.shardMs : finding ? finding.shardMs : overlay ? OVERLAY_MIN_FILE_WALL_MS : DEFAULT_SHARD_TIMEOUT_MS),
|
||||
source: overrideMs !== undefined ? 'explicit' : autoplan || finding ? 'registered' : 'default',
|
||||
policyId: autoplan ? AUTOPLAN_CHAIN_BUDGET.id : finding?.id ?? null,
|
||||
timeoutMs: overrideMs ?? (finding ? finding.shardMs : overlay ? OVERLAY_MIN_FILE_WALL_MS : DEFAULT_SHARD_TIMEOUT_MS),
|
||||
source: overrideMs !== undefined ? 'explicit' : finding ? 'registered' : 'default',
|
||||
policyId: finding?.id ?? null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -602,8 +600,6 @@ export function paidShardWallUpperBoundMs(files: string[], jobs: number, overrid
|
||||
|
||||
export interface RunShardsOptions {
|
||||
timeoutMs?: number;
|
||||
/** Legacy Autoplan allocation; callers may supply registered per-file allocations. */
|
||||
autoplanBudget?: PaidShardBudget;
|
||||
registeredBudgets?: Record<string, PaidShardBudget>;
|
||||
jobs?: number;
|
||||
/** bun --max-concurrency inside each shard (EVALS_CONCURRENCY). */
|
||||
@@ -660,8 +656,7 @@ export async function runPaidShard(
|
||||
): Promise<ShardOutcome> {
|
||||
if (files.length === 0) throw new Error('Cannot run an empty paid-test shard.');
|
||||
const rootDir = options.rootDir ?? ROOT;
|
||||
const planned = options.registeredBudgets?.[normalizeRelativePath(files[0]!)] ??
|
||||
(files.map(normalizeRelativePath).includes(AUTOPLAN_CHAIN_BUDGET.file) ? options.autoplanBudget : undefined);
|
||||
const planned = options.registeredBudgets?.[normalizeRelativePath(files[0]!)];
|
||||
const budget = resolvePaidShardBudget(files, options.timeoutMs ??
|
||||
(planned?.source === 'explicit' ? planned.timeoutMs : undefined));
|
||||
const timeoutMs = budget.timeoutMs;
|
||||
@@ -981,7 +976,7 @@ export interface ManifestEntry {
|
||||
slice: number;
|
||||
status: 'planned' | 'skipped-by-diff' | 'excluded';
|
||||
reason?: string;
|
||||
/** Required when the registered Autoplan workflow is planned. */
|
||||
/** Required when a registered retry-budget file is planned. */
|
||||
budget?: PaidShardBudget;
|
||||
}
|
||||
|
||||
@@ -995,8 +990,6 @@ export interface PaidRunManifest {
|
||||
profile?: PaidProfile;
|
||||
selection?: PaidCaseSelection;
|
||||
prCoverage?: PrProfileSelection;
|
||||
/** Dedicated last slice; preceding slices retain ordinary round-robin work. */
|
||||
autoplanSlice?: number;
|
||||
entries: ManifestEntry[];
|
||||
}
|
||||
|
||||
@@ -1063,7 +1056,6 @@ export function buildRunManifest(opts: {
|
||||
profile?: PaidProfile;
|
||||
sliceCount: number;
|
||||
evalsAll: boolean;
|
||||
dedicatedAutoplanSlice?: boolean;
|
||||
timeoutMs?: number;
|
||||
discovered?: string[];
|
||||
env?: NodeJS.ProcessEnv;
|
||||
@@ -1075,9 +1067,6 @@ export function buildRunManifest(opts: {
|
||||
if (!Number.isInteger(opts.sliceCount) || opts.sliceCount <= 0) {
|
||||
throw new Error(`--slices needs a positive integer. Received: ${opts.sliceCount}`);
|
||||
}
|
||||
if (opts.dedicatedAutoplanSlice && (opts.tier !== 'periodic' || opts.sliceCount < 2)) {
|
||||
throw new Error('Dedicated Autoplan slice requires periodic tier and at least two total slices');
|
||||
}
|
||||
const rootDir = opts.rootDir ?? ROOT;
|
||||
const env = opts.env ?? process.env;
|
||||
const profile = opts.profile ?? validatedProfile(env.EVALS_PROFILE, 'EVALS_PROFILE');
|
||||
@@ -1095,16 +1084,14 @@ export function buildRunManifest(opts: {
|
||||
}
|
||||
|
||||
const entries: ManifestEntry[] = [];
|
||||
const overlaySlice = opts.sliceCount - (opts.dedicatedAutoplanSlice ? 1 : 0);
|
||||
const overlaySlice = opts.sliceCount;
|
||||
const reserveOverlaySlice = overlaySlice > 1 && runnable.some(files => files.some(isOverlayTestFile));
|
||||
const ordinarySlices = overlaySlice - Number(reserveOverlaySlice);
|
||||
// Spread registered long files by supervised load. Keep one ordinary-only
|
||||
// lane when possible, so every lane does not inherit a long-workflow tail.
|
||||
// Reserved overlay and dedicated Autoplan slices retain their ownership.
|
||||
const ordinary = runnable.filter(files => !files.some(isOverlayTestFile) &&
|
||||
!(opts.dedicatedAutoplanSlice && files[0] === AUTOPLAN_CHAIN_BUDGET.file));
|
||||
const registered = ordinary.filter(files => files[0] === AUTOPLAN_CHAIN_BUDGET.file ||
|
||||
FILE_RETRY_BUDGETS.some(budget => budget.file === files[0]));
|
||||
// The reserved overlay slice retains its ownership.
|
||||
const ordinary = runnable.filter(files => !files.some(isOverlayTestFile));
|
||||
const registered = ordinary.filter(files => FILE_RETRY_BUDGETS.some(budget => budget.file === files[0]));
|
||||
const allocations = new Map<string, number>();
|
||||
if (registered.length && ordinarySlices > 1) {
|
||||
const loads = Array<number>(ordinarySlices).fill(0);
|
||||
@@ -1173,12 +1160,9 @@ export function buildRunManifest(opts: {
|
||||
return new Map(lanes.flatMap((files, lane) => files.map(file => [file, lane + 1] as const)));
|
||||
}
|
||||
runnable.forEach((files) => {
|
||||
const autoplan = files[0] === AUTOPLAN_CHAIN_BUDGET.file;
|
||||
const slice = opts.dedicatedAutoplanSlice && autoplan ? opts.sliceCount
|
||||
: files.some(isOverlayTestFile) ? overlaySlice
|
||||
: (packed ?? allocations).get(files[0])!;
|
||||
const slice = files.some(isOverlayTestFile) ? overlaySlice : (packed ?? allocations).get(files[0])!;
|
||||
entries.push({ file: files[0], slice, status: 'planned',
|
||||
...(autoplan || FILE_RETRY_BUDGETS.some(budget => budget.file === files[0])
|
||||
...(FILE_RETRY_BUDGETS.some(budget => budget.file === files[0])
|
||||
? { budget: resolvePaidShardBudget(files, opts.timeoutMs) } : {}) });
|
||||
});
|
||||
for (const s of skipped) entries.push({ file: s.files[0], slice: 0, status: 'skipped-by-diff', reason: s.reason });
|
||||
@@ -1194,7 +1178,6 @@ export function buildRunManifest(opts: {
|
||||
profile,
|
||||
selection: cases.selection,
|
||||
...(cases.coverage ? { prCoverage: cases.coverage } : {}),
|
||||
...(opts.dedicatedAutoplanSlice ? { autoplanSlice: opts.sliceCount } : {}),
|
||||
entries,
|
||||
};
|
||||
return parseRunManifest(JSON.stringify(manifest));
|
||||
@@ -1254,7 +1237,7 @@ export function parseRunManifest(raw: string): PaidRunManifest {
|
||||
}
|
||||
}
|
||||
}
|
||||
const overlaySlice = parsed.sliceCount - (parsed.autoplanSlice !== undefined ? 1 : 0);
|
||||
const overlaySlice = parsed.sliceCount;
|
||||
const plannedOverlays = parsed.entries.filter(entry => entry.status === 'planned' && isOverlayTestFile(entry.file));
|
||||
if (plannedOverlays.some(entry => entry.slice !== overlaySlice)) {
|
||||
throw new Error('Overlay manifest entries must share the final ordinary slice to preserve one-process API admission');
|
||||
@@ -1263,23 +1246,6 @@ export function parseRunManifest(raw: string): PaidRunManifest {
|
||||
entry.status === 'planned' && !isOverlayTestFile(entry.file) && entry.slice === overlaySlice)) {
|
||||
throw new Error('The final ordinary manifest slice is reserved for overlay files');
|
||||
}
|
||||
const autoplan = parsed.entries.filter(entry => normalizeRelativePath(entry.file) === AUTOPLAN_CHAIN_BUDGET.file);
|
||||
if (autoplan.length > 1) throw new Error('Duplicate Autoplan manifest entry');
|
||||
if (parsed.autoplanSlice !== undefined) {
|
||||
if (parsed.tier !== 'periodic' || parsed.autoplanSlice !== parsed.sliceCount || parsed.sliceCount < 2 || autoplan.length !== 1 || autoplan[0].status !== 'planned') {
|
||||
throw new Error('Dedicated Autoplan slice is missing or malformed');
|
||||
}
|
||||
for (const entry of parsed.entries.filter(entry => entry.status === 'planned')) {
|
||||
if ((entry.file === AUTOPLAN_CHAIN_BUDGET.file) !== (entry.slice === parsed.autoplanSlice)) {
|
||||
throw new Error('Dedicated Autoplan slice contains missing or unrelated work');
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const entry of autoplan.filter(entry => entry.status === 'planned')) {
|
||||
if (!entry.budget) throw new Error('Autoplan manifest needs an explicit budget record; emit a fresh plan');
|
||||
const expected = resolvePaidShardBudget([entry.file], entry.budget.source === 'explicit' ? entry.budget.timeoutMs : undefined);
|
||||
if (!sameBudget(entry.budget, expected)) throw new Error('Autoplan manifest budget differs from declared policy');
|
||||
}
|
||||
for (const budget of FILE_RETRY_BUDGETS) {
|
||||
const entries = parsed.entries.filter(entry => normalizeRelativePath(entry.file) === budget.file);
|
||||
if (entries.length > 1) throw new Error(`Duplicate registered manifest entry: ${budget.file}`);
|
||||
@@ -1334,9 +1300,6 @@ export function verifySliceResults(
|
||||
const reported = new Map<string, { slice: number; status: ShardStatus }>();
|
||||
for (const result of results) {
|
||||
for (const outcome of result.outcomes) {
|
||||
if (outcome.files.map(normalizeRelativePath).includes(AUTOPLAN_CHAIN_BUDGET.file) && outcome.files.length !== 1) {
|
||||
problems.push('Autoplan result must report its own shard');
|
||||
}
|
||||
if (outcome.files.some(file => FILE_RETRY_BUDGETS.some(budget => budget.file === normalizeRelativePath(file))) && outcome.files.length !== 1) {
|
||||
problems.push('Registered result must report its own shard');
|
||||
}
|
||||
@@ -1370,17 +1333,6 @@ export function verifySliceResults(
|
||||
if (!sameBudget(outcome.budget, expected)) problems.push(`Registered effective result budget differs from its planned/explicit allocation: ${file}`);
|
||||
} catch { problems.push(`Invalid registered effective result budget: ${file}`); }
|
||||
}
|
||||
if (file === AUTOPLAN_CHAIN_BUDGET.file) {
|
||||
if (outcome.exitCode !== 0 || outcome.executedTests !== 1 || outcome.skippedTests !== 0) {
|
||||
problems.push('Autoplan must execute exactly one unskipped case with exit zero');
|
||||
}
|
||||
try {
|
||||
const planned = manifest.entries.find(entry => entry.file === file)?.budget;
|
||||
const expected = resolvePaidShardBudget([file], result.timeoutOverrideMs ??
|
||||
(planned?.source === 'explicit' ? planned.timeoutMs : undefined));
|
||||
if (!sameBudget(outcome.budget, expected)) problems.push('Autoplan effective result budget differs from its planned/explicit allocation');
|
||||
} catch { problems.push('Invalid Autoplan effective result budget'); }
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const entry of manifest.entries) {
|
||||
@@ -1432,7 +1384,6 @@ type CliOptions = {
|
||||
listOnly: boolean;
|
||||
timeoutMs: number;
|
||||
timeoutExplicit: boolean;
|
||||
dedicatedAutoplanSlice: boolean;
|
||||
jobs: number;
|
||||
withinShardConcurrency: number;
|
||||
maxFilesPerShard: number;
|
||||
@@ -1481,7 +1432,6 @@ export function parseCliOptions(argv: string[], env: NodeJS.ProcessEnv = process
|
||||
profileExplicit: !!env.EVALS_PROFILE,
|
||||
listOnly: false,
|
||||
timeoutExplicit: !!env.EVALS_SHARD_TIMEOUT_MS,
|
||||
dedicatedAutoplanSlice: false,
|
||||
timeoutMs: env.EVALS_SHARD_TIMEOUT_MS
|
||||
? parsePositiveInt(env.EVALS_SHARD_TIMEOUT_MS, 'EVALS_SHARD_TIMEOUT_MS')
|
||||
: DEFAULT_SHARD_TIMEOUT_MS,
|
||||
@@ -1517,7 +1467,6 @@ export function parseCliOptions(argv: string[], env: NodeJS.ProcessEnv = process
|
||||
options.profile = validatedProfile(value, '--profile'); options.profileExplicit = true; continue;
|
||||
}
|
||||
if (arg === '--timeout') { options.timeoutMs = parsePositiveInt(argv[index += 1], '--timeout') * 1000; options.timeoutExplicit = true; continue; }
|
||||
if (arg === '--autoplan-slice') { options.dedicatedAutoplanSlice = true; continue; }
|
||||
if (arg === '--jobs') { options.jobs = parsePositiveInt(argv[index += 1], '--jobs'); continue; }
|
||||
if (arg === '--files-per-shard') { options.maxFilesPerShard = parsePositiveInt(argv[index += 1], '--files-per-shard'); continue; }
|
||||
if (arg === '--emit-plan') {
|
||||
@@ -1541,7 +1490,6 @@ export function parseCliOptions(argv: string[], env: NodeJS.ProcessEnv = process
|
||||
throw new Error(`Unknown argument: ${arg}`);
|
||||
}
|
||||
if (options.writeDurations && !options.reportDir) throw new Error('--write-durations requires --report');
|
||||
if (options.dedicatedAutoplanSlice && !options.emitPlanPath) throw new Error('--autoplan-slice requires --emit-plan');
|
||||
if (options.profile === 'pr' && options.tier !== 'gate') throw new Error('PR profile requires gate tier');
|
||||
if (options.profile === 'pr' && options.maxFilesPerShard !== 1) throw new Error('PR profile requires one file per shard to preserve case accounting');
|
||||
return options;
|
||||
@@ -1557,7 +1505,6 @@ async function main(): Promise<number> {
|
||||
tier: options.tier,
|
||||
profile: options.profile,
|
||||
sliceCount: options.slices,
|
||||
dedicatedAutoplanSlice: options.dedicatedAutoplanSlice,
|
||||
timeoutMs: options.timeoutExplicit ? options.timeoutMs : undefined,
|
||||
evalsAll: process.env.EVALS_ALL === '1',
|
||||
});
|
||||
@@ -1724,7 +1671,6 @@ async function main(): Promise<number> {
|
||||
timeoutMs: options.timeoutExplicit ? options.timeoutMs : undefined,
|
||||
jobs: options.jobs,
|
||||
withinShardConcurrency: options.withinShardConcurrency,
|
||||
autoplanBudget: mine.find(entry => entry.file === AUTOPLAN_CHAIN_BUDGET.file)?.budget,
|
||||
registeredBudgets: Object.fromEntries(mine.filter(entry => entry.budget).map(entry => [normalizeRelativePath(entry.file), entry.budget!])),
|
||||
...(manifest.prCoverage?.mode === 'pr' ? {
|
||||
expectedCases: Object.fromEntries(mine.map(entry => [entry.file, expectedPrCaseCount(entry.file, manifest.selection!)])),
|
||||
|
||||
Reference in new issue
Block a user