diff --git a/test/helpers/office-hours-completion.ts b/test/helpers/office-hours-completion.ts index 36dfc21e4..68d1412df 100644 --- a/test/helpers/office-hours-completion.ts +++ b/test/helpers/office-hours-completion.ts @@ -454,28 +454,3 @@ ${JSON.stringify({ throw new Error(`Office-hours review preservation: incomplete; missing=${JSON.stringify(result.missing)}; unsupported=${JSON.stringify(result.unsupported)}; ${result.reasoning}`); } } - -/** Completion contract for the existing spec-review explanation fixture. */ -export function validateOfficeHoursSpecSummary(exitReason: string, summary: string | null): void { - const fail = (message: string): never => { throw new Error(`Office-hours spec summary: ${message}`); }; - if (exitReason !== 'success') fail(`execution failed: ${exitReason}`); - if (summary === null) fail('requested summary file was not written'); - const text = summary!.replace(/\*\*/g, '').toLowerCase(); - const dimensions = ['completeness', 'consistency', 'clarity', 'scope', 'feasibility']; - if (!/\b(?:5|five)\b.*dimension|dimension.*\b(?:5|five)\b/.test(text) - && !dimensions.every(dimension => new RegExp(`\\b${dimension}\\b`).test(text))) { - fail('summary lacks the five review dimensions'); - } - if (!/\b(?:agent|subagent)\b/.test(text)) fail('summary lacks the Agent reviewer dispatch'); - if (!/\b(?:3|three)\b.*iteration|iteration.*\b(?:3|three)\b|maximum.*\b(?:3|three)\b/.test(text)) { - fail('summary lacks the three-iteration limit'); - } - for (const [label, pattern] of [ - ['issues found', /\bfound\b|\bissues_found\b/], - ['issues fixed', /\bfixed\b|\bissues_fixed\b/], - ['remaining issues', /\b(?:remaining|unresolved)\b/], - ['quality score', /\bquality[\s_-]+score\b/], - ] as const) { - if (!pattern.test(text)) fail(`summary lacks the ${label} metric`); - } -} diff --git a/test/office-hours-completion.test.ts b/test/office-hours-completion.test.ts index e16685d7c..336c611d8 100644 --- a/test/office-hours-completion.test.ts +++ b/test/office-hours-completion.test.ts @@ -3,7 +3,7 @@ import { describe, expect, test } from 'bun:test'; import * as fs from 'node:fs'; import * as path from 'node:path'; import * as os from 'node:os'; -import { validateOfficeHoursCompletion, validateOfficeHoursDesignDraft, validateOfficeHoursReviewerHandoffs, validateOfficeHoursReviewArtifacts, validateOfficeHoursReviewPreservation, validateOfficeHoursSpecSummary, type OfficeHoursCompletionEvidence } from './helpers/office-hours-completion'; +import { validateOfficeHoursCompletion, validateOfficeHoursDesignDraft, validateOfficeHoursReviewerHandoffs, validateOfficeHoursReviewArtifacts, validateOfficeHoursReviewPreservation, type OfficeHoursCompletionEvidence } from './helpers/office-hours-completion'; import { E2E_TOUCHFILES } from './helpers/touchfiles-data'; import { selectTests } from './helpers/test-selection'; @@ -703,46 +703,6 @@ describe('office-hours completion eval selection', () => { }); }); -describe('office-hours spec-review summary completion', () => { - const summary = `The Agent dispatches an independent reviewer across five dimensions: -Completeness, Consistency, Clarity, Scope, and Feasibility. Maximum 3 iterations. -Metrics track iterations, issues found, issues fixed, remaining issues, and quality score.`; - - test('accepts a successful written explanation of the loop and metrics', () => { - expect(() => validateOfficeHoursSpecSummary('success', summary)).not.toThrow(); - }); - - test.each(['timeout', 'error_max_turns', 'error_api'])('rejects %s even with a complete summary file', reason => { - expect(() => validateOfficeHoursSpecSummary(reason, summary)).toThrow(`execution failed: ${reason}`); - }); - - test('requires the actual summary file', () => { - expect(() => validateOfficeHoursSpecSummary('success', null)).toThrow('summary file was not written'); - }); - - test('rejects incomplete dimensions, dispatch, and iteration explanations', () => { - expect(() => validateOfficeHoursSpecSummary('success', summary.replace(/five dimensions:[\s\S]*?Feasibility/, 'one dimension: Completeness'))) - .toThrow('five review dimensions'); - expect(() => validateOfficeHoursSpecSummary('success', summary.replace('Agent', 'model'))).toThrow('Agent reviewer dispatch'); - expect(() => validateOfficeHoursSpecSummary('success', summary.replace('Maximum 3 iterations', 'Maximum 4 iterations'))) - .toThrow('three-iteration limit'); - }); - - test('15 dimensions does not satisfy the five-dimension count', () => { - const incorrect = summary.replace(/five dimensions:[\s\S]*?Feasibility/, '15 dimensions'); - expect(() => validateOfficeHoursSpecSummary('success', incorrect)).toThrow('five review dimensions'); - }); - - test('13 iterations does not satisfy the three-iteration limit', () => { - expect(() => validateOfficeHoursSpecSummary('success', summary.replace('Maximum 3 iterations', 'Maximum 13 iterations'))) - .toThrow('three-iteration limit'); - }); - - test.each(['issues found', 'issues fixed', 'remaining issues', 'quality score'])('requires the %s metric', metric => { - expect(() => validateOfficeHoursSpecSummary('success', summary.replace(metric, ''))).toThrow('metric'); - }); -}); - describe('office-hours mechanical review evidence', () => { // The six actual obligations from evidence-final, including Clarity 3 which // disappeared from both the prose report and the judge's accepted inventory.