From 52694529832f44a56cb5fe1097152dc091ac3133 Mon Sep 17 00:00:00 2001 From: garrytan Date: Tue, 29 Sep 2026 19:15:06 +0000 Subject: [PATCH] test(eng-batching): grade the floor once the review report is complete A completed GSTACK REVIEW REPORT ends the review, so the review-question count is final there. Run 36606688266 wrote its report at 1,248 s and closed the session at 1,318 s; the case now stops collection and applies the unchanged floor at the report instead of waiting out the session. No budget changes. --- test/helpers/claude-pty-runner.ts | 2 +- test/skill-e2e-plan-eng-multi-finding-batching.test.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/helpers/claude-pty-runner.ts b/test/helpers/claude-pty-runner.ts index 541373a4d..e6540e106 100644 --- a/test/helpers/claude-pty-runner.ts +++ b/test/helpers/claude-pty-runner.ts @@ -1987,7 +1987,7 @@ function conflictingDesignClosure(text: string): boolean { new RegExp(`(?:^|[.!?;]\\s+|\\n)(?:If|When|Once|Unless|Assuming|Provided)\\b[^.!?\\n]*\\b${owner}\\b`, 'i').test(text); } -function hasCompletePlanReport(expectedPlanPath: string, minimumMtime: number, maximumMtime: number, +export function hasCompletePlanReport(expectedPlanPath: string, minimumMtime: number, maximumMtime: number, allowRunHeaderForFailure = false, requiredReview?: 'Design'): boolean { if (!path.isAbsolute(expectedPlanPath)) return false; try { diff --git a/test/skill-e2e-plan-eng-multi-finding-batching.test.ts b/test/skill-e2e-plan-eng-multi-finding-batching.test.ts index 7c94803f1..198641581 100644 --- a/test/skill-e2e-plan-eng-multi-finding-batching.test.ts +++ b/test/skill-e2e-plan-eng-multi-finding-batching.test.ts @@ -35,6 +35,7 @@ import { engStep0Boundary, engSetupAUQ, engFirstReviewAUQ, + hasCompletePlanReport, } from './helpers/claude-pty-runner'; import { FORCING_BATCHING_ENG } from './fixtures/forcing-finding-seeds'; import { createEngBatchingIssueCounter } from './helpers/eng-seeded-coverage'; @@ -53,6 +54,7 @@ describeE2E('/plan-eng-review multi-finding batching regression (periodic)', () test( `4-finding plan emits >= ${FLOOR} review-phase AskUserQuestions (no batching)`, async () => { + const startedAt = Date.now(); const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gstack-e2e-plan-eng-batching-')); const planPath = path.join(tmpDir, 'gstack-test-plan-eng-batching.md'); const followUpPrompt = FORCING_BATCHING_ENG.replaceAll(FIXTURE_PLAN_PATH, planPath); @@ -85,8 +87,12 @@ describeE2E('/plan-eng-review multi-finding batching regression (periodic)', () // review decisions exist, a batching regression can no longer occur // in this attempt; stop instead of letting the review run to the // ceiling (run 36385945043: floor at 6m41s, ceiling at 12m13s). + // A completed report ends the review, so the count is final there: + // grade it now rather than waiting out the session (run 36606688266 + // wrote its report at 1,248 s and closed at 1,318 s). isCollectionComplete: (_transcript, fingerprints) => - fingerprints.filter(fp => !fp.preReview && !fp.administrative).length >= FLOOR, + fingerprints.filter(fp => !fp.preReview && !fp.administrative).length >= FLOOR || + hasCompletePlanReport(planPath, startedAt, Date.now()), reviewCountCeiling: N + 3, // hard cap above floor + tolerance // Supplied prerequisites: routing setup and cross-project learnings are // already declined, so the attempt starts at the review (setup answers