0.3: after-a-repair runs the shard file when --case cannot resolve a case

A case that several files register (carve-section-loading) cannot be selected
by --case; its red line now prints the bun test command for the shard file
that went red, so every printed command selects exactly one case.
This commit is contained in:
garrytan committed 2026-10-04 17:55:00 +00:00
1 parent 4ade622630
commit 6d6c7726ec
2 files changed
+12 -1

No files matched your search

+8 -1
View File
@@ -433,13 +433,20 @@ function trialCause(trial: PanelVerdict['trials'][number] & TrialDiagnosis & { t
* exact test-name filter, a keyless file (its own case) by file.
*/
export function afterRepairCommand(tier: PaidTier, id: string, file: string, trials = 1): string {
if (Object.hasOwn(E2E_TIERS, id)) return `bun run scripts/test-paid-shards.ts --tier ${tier} --case ${id}${trials > 1 ? ` --trials ${trials}` : ''}`;
if (Object.hasOwn(E2E_TIERS, id) && resolvesAlone(id)) return `bun run scripts/test-paid-shards.ts --tier ${tier} --case ${id}${trials > 1 ? ` --trials ${trials}` : ''}`;
if (Object.hasOwn(LLM_JUDGE_TOUCHFILES, id)) {
return `EVALS=1 EVALS_TIER=${tier} EVALS_JUDGE_SELECTION_JSON='${JSON.stringify({ version: 1, selected: [id], reason: 'after a repair' })}' bun test ${file} -t '${caseTestNamePattern([id])}'`;
}
return `EVALS=1 EVALS_TIER=${tier} bun test ${file}`;
}
const resolved = new Map<string, boolean>();
/** Whether --case can select this E2E id (a case several files register runs by its shard file instead). */
function resolvesAlone(id: string): boolean {
if (!resolved.has(id)) { try { caseSelection(id); resolved.set(id, true); } catch { resolved.set(id, false); } }
return resolved.get(id)!;
}
/** One line per non-PASS or split panel verdict. `artifacts` names each slice's artifact (slice -> name). */
export function formatPanelLine(panel: PanelReport, tier: PaidTier, ctx: { artifacts?: Map<number, string>; runId?: string } = {}): string {
const mark = panel.status === 'PASS' ? '⚠' : panel.failsLane ? '✗' : '◌';
+4
View File
@@ -58,6 +58,7 @@ import {
runCaseDiagnosis,
caseFile,
caseSelection,
afterRepairCommand,
parseCliOptions,
loadPaidTestDurations,
shardDurationViolations,
@@ -795,6 +796,9 @@ console.log("Ran 1 tests across 1 files. [1ms]"); process.exit(${fail ? 1 : 0});
expect(caseSelection('review-coverage-audit')).toMatchObject({ file: 'test/skill-e2e-coverage-audit.test.ts', mode: 'name' });
expect(caseSelection('plan-eng-multi-finding-batching').file).toBe('test/skill-e2e-plan-eng-multi-finding-batching.test.ts');
expect(caseSelection('review-sql-injection')).toMatchObject({ file: 'test/skill-e2e-review.test.ts', mode: 'name' });
// The report's after-a-repair command selects exactly one case: --case when it resolves, else that shard's file.
expect(afterRepairCommand('gate', 'plan-mode-no-op', 'test/skill-e2e-plan-mode-no-op.test.ts')).toBe('bun run scripts/test-paid-shards.ts --tier gate --case plan-mode-no-op');
expect(afterRepairCommand('periodic', 'carve-section-loading', 'test/carve-section-loading-qa.test.ts')).toBe('EVALS=1 EVALS_TIER=periodic bun test test/carve-section-loading-qa.test.ts');
});
test('B4: --list prints the selection; an unknown id exits non-zero before any process starts', () => {