mirror of
https://github.com/garrytan/gstack.git
synced 2026-10-02 17:40:02 +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
385 lines
16 KiB
TypeScript
385 lines
16 KiB
TypeScript
/**
|
|
* AskUserQuestion format regression test for /plan-ceo-review and /plan-eng-review.
|
|
*
|
|
* Context: a user on Opus 4.7 reported the RECOMMENDATION line and the
|
|
* `Completeness: N/10` per-option score stopped appearing on AskUserQuestion
|
|
* prompts. This test captures the agent's AskUserQuestion output verbatim
|
|
* and asserts the format rule is applied.
|
|
*
|
|
* Capture shape: `claude -p` sessions inside this harness do not have the
|
|
* AskUserQuestion MCP tool wired. We instruct the agent to write the verbatim
|
|
* AskUserQuestion text it would have made to $OUT_FILE instead of calling
|
|
* any tool. Assertions read that file.
|
|
*
|
|
* Coverage-vs-kind split: the format rule says to include `Completeness: N/10`
|
|
* only when options differ in coverage. When options differ in kind (mode
|
|
* selection, posture choice, cherry-pick Add/Defer/Skip), the score is
|
|
* intentionally absent and a one-line note explains why. Assertions split
|
|
* accordingly.
|
|
*/
|
|
import { describe, test, expect, beforeAll, afterAll } from 'bun:test';
|
|
import { resolveEvalModel } from '../lib/eval-model';
|
|
import { CAPTURE_MS } from './helpers/eval-budgets';
|
|
import { runSkillTest } from './helpers/session-runner';
|
|
import { runRecordedOfficeHoursAttempt, OFFICE_HOURS_BUN_GRACE_MS } from './helpers/office-hours-attempt';
|
|
import {
|
|
ROOT, runId,
|
|
describeIfSelected, testConcurrentIfSelected,
|
|
logCost, assertRecommendationQuality,
|
|
createEvalCollector, finalizeEvalCollector,
|
|
} from './helpers/e2e-helpers';
|
|
import type { EvalTestEntry } from './helpers/eval-store';
|
|
import { spawnSync } from 'child_process';
|
|
import * as fs from 'fs';
|
|
import * as path from 'path';
|
|
import * as os from 'os';
|
|
|
|
const evalCollector = createEvalCollector('e2e-plan-format');
|
|
|
|
// Regex predicates applied to captured AskUserQuestion content.
|
|
// Recommendation-line presence + substance is now graded by judgeRecommendation
|
|
// (deterministic regex for present/commits/has_because, Haiku for substance);
|
|
// the prior strict `[Rr]ecommendation:[*\s]*Choose` regex pinned down a
|
|
// template-example wording ("Choose [X]") that the format spec doesn't require
|
|
// — the canonical form per generate-ask-user-format.ts is just
|
|
// `Recommendation: <choice> because <reason>`, where <choice> is the bare
|
|
// option label. judgeRecommendation.present covers the canonical shape.
|
|
// COMPLETENESS regex matches both legacy bare form (`Completeness: 10/10`) and
|
|
// the canonical option-prefixed form (`Completeness: A=10/10, B=7/10`) per
|
|
// scripts/resolvers/preamble/generate-ask-user-format.ts. The optional
|
|
// `[A-Z]=` prefix tolerates either shape; both are acceptable spec output.
|
|
const COMPLETENESS_RE = /Completeness:\s*(?:[A-Z]=)?\d{1,2}\/10/;
|
|
const KIND_NOTE_RE = /options differ in kind/i;
|
|
|
|
// v1.7.0.0 Pros/Cons format tokens. Tests are additive: existing
|
|
// RECOMMENDATION / Completeness / kind-note assertions still hold; new
|
|
// format tokens are asserted ONLY when the capture is from a v1.7+
|
|
// skill rendering. Presence is optional for backward compatibility during
|
|
// rollout; the periodic-tier cadence+format eval (see skill-e2e-plan-cadence)
|
|
// is the strict gate for the new format.
|
|
const PROS_CONS_HEADER_RE = /Pros\s*\/\s*cons:/i;
|
|
const PRO_BULLET_RE = /^\s*✅\s+\S/m;
|
|
const CON_BULLET_RE = /^\s*❌\s+\S/m;
|
|
const NET_LINE_RE = /^Net:\s+\S/m;
|
|
const D_NUMBER_RE = /^D\d+\s+—/m;
|
|
const STAKES_RE = /Stakes if we pick wrong:/i;
|
|
|
|
const SAMPLE_PLAN = `# Plan: Add User Dashboard
|
|
|
|
## Context
|
|
We're building a new user dashboard that shows recent activity, notifications, and quick actions.
|
|
|
|
## Changes
|
|
1. New React component \`UserDashboard\` in \`src/components/\`
|
|
2. REST API endpoint \`GET /api/dashboard\` returning user stats
|
|
3. PostgreSQL query for activity aggregation
|
|
4. Redis cache layer for dashboard data (5min TTL)
|
|
|
|
## Architecture
|
|
- Frontend: React + TailwindCSS
|
|
- Backend: Express.js REST API
|
|
- Database: PostgreSQL with existing user/activity tables
|
|
- Cache: Redis for dashboard aggregates
|
|
`;
|
|
|
|
function setupPlanDir(tmpPrefix: string, skillName: 'plan-ceo-review' | 'plan-eng-review'): string {
|
|
const planDir = fs.mkdtempSync(path.join(os.tmpdir(), tmpPrefix));
|
|
const run = (cmd: string, args: string[]) =>
|
|
spawnSync(cmd, args, { cwd: planDir, stdio: 'pipe', timeout: 5000 });
|
|
|
|
run('git', ['init', '-b', 'main']);
|
|
run('git', ['config', 'user.email', 'test@test.com']);
|
|
run('git', ['config', 'user.name', 'Test']);
|
|
|
|
fs.writeFileSync(path.join(planDir, 'plan.md'), SAMPLE_PLAN);
|
|
run('git', ['add', '.']);
|
|
run('git', ['commit', '-m', 'add plan']);
|
|
|
|
fs.mkdirSync(path.join(planDir, skillName), { recursive: true });
|
|
fs.copyFileSync(
|
|
path.join(ROOT, skillName, 'SKILL.md'),
|
|
path.join(planDir, skillName, 'SKILL.md'),
|
|
);
|
|
|
|
return planDir;
|
|
}
|
|
|
|
// The capture instruction passed to every case. Tells the agent to dump
|
|
// AskUserQuestion content to a file instead of calling a tool.
|
|
function captureInstruction(outFile: string): string {
|
|
return `Write the verbatim text of every AskUserQuestion you would have made to ${outFile} (one question per session, full text including options and recommendation line). Do NOT call any tool to ask the user. Do NOT paraphrase — include the exact prose you would have shown. This is a format-capture test, not an interactive session.`;
|
|
}
|
|
|
|
// --- Case 1: plan-ceo-review mode selection (kind-differentiated) ---
|
|
|
|
describeIfSelected('Plan Format — CEO Mode Selection', ['plan-ceo-review-format-mode'], () => {
|
|
let planDir: string;
|
|
let outFile: string;
|
|
|
|
beforeAll(() => {
|
|
planDir = setupPlanDir('skill-e2e-plan-format-ceo-mode-', 'plan-ceo-review');
|
|
outFile = path.join(planDir, 'ask-capture.md');
|
|
});
|
|
|
|
afterAll(() => {
|
|
try { fs.rmSync(planDir, { recursive: true, force: true }); } catch {}
|
|
});
|
|
|
|
testConcurrentIfSelected('plan-ceo-review-format-mode', async () => {
|
|
const judgeMetadata: Pick<EvalTestEntry, 'judge_scores' | 'judge_reasoning'> = {};
|
|
await runRecordedOfficeHoursAttempt({
|
|
collector: evalCollector, name: '/plan-ceo-review-format-mode', suite: 'Plan Format — CEO Mode Selection',
|
|
model: resolveEvalModel('capture'), budgetMs: CAPTURE_MS,
|
|
judgeMetadata,
|
|
run: signal => runSkillTest({
|
|
signal,
|
|
prompt: `Read plan-ceo-review/SKILL.md for the review workflow.
|
|
|
|
Read plan.md — that's the plan to review. This is a standalone plan document, not a codebase — skip any codebase exploration or system audit steps.
|
|
|
|
Proceed to Mode Selection. This is where the skill presents 4 mode options (SCOPE EXPANSION, SELECTIVE EXPANSION, HOLD SCOPE, SCOPE REDUCTION) to the user via AskUserQuestion. These options differ in kind (review posture), not in coverage.
|
|
|
|
${captureInstruction(outFile)}
|
|
|
|
After writing the file, stop. Do not continue the review.`,
|
|
workingDirectory: planDir,
|
|
maxTurns: 10,
|
|
timeout: CAPTURE_MS,
|
|
testName: 'plan-ceo-review-format-mode',
|
|
runId,
|
|
model: resolveEvalModel('capture'),
|
|
}),
|
|
validate: async (result, signal) => {
|
|
logCost('/plan-ceo-review format (mode)', result);
|
|
expect(['success', 'error_max_turns']).toContain(result.exitReason);
|
|
|
|
expect(fs.existsSync(outFile)).toBe(true);
|
|
const captured = fs.readFileSync(outFile, 'utf-8');
|
|
expect(captured.length).toBeGreaterThan(100);
|
|
|
|
// Kind-differentiated: Completeness: N/10 must NOT appear, "options differ
|
|
// in kind" note must appear. Recommendation presence is checked by the judge.
|
|
expect(captured).not.toMatch(COMPLETENESS_RE);
|
|
expect(captured).toMatch(KIND_NOTE_RE);
|
|
|
|
await assertRecommendationQuality({
|
|
captured,
|
|
signal,
|
|
record: metadata => Object.assign(judgeMetadata, metadata),
|
|
evalCollector,
|
|
evalId: '/plan-ceo-review-format-mode',
|
|
evalTitle: 'Plan Format — CEO Mode Selection',
|
|
result,
|
|
passed: ['success', 'error_max_turns'].includes(result.exitReason),
|
|
});
|
|
},
|
|
});
|
|
}, CAPTURE_MS + OFFICE_HOURS_BUN_GRACE_MS);
|
|
});
|
|
|
|
// --- Case 2: plan-ceo-review approach menu (coverage-differentiated) ---
|
|
|
|
describeIfSelected('Plan Format — CEO Approach Menu', ['plan-ceo-review-format-approach'], () => {
|
|
let planDir: string;
|
|
let outFile: string;
|
|
|
|
beforeAll(() => {
|
|
planDir = setupPlanDir('skill-e2e-plan-format-ceo-approach-', 'plan-ceo-review');
|
|
outFile = path.join(planDir, 'ask-capture.md');
|
|
});
|
|
|
|
afterAll(() => {
|
|
try { fs.rmSync(planDir, { recursive: true, force: true }); } catch {}
|
|
});
|
|
|
|
testConcurrentIfSelected('plan-ceo-review-format-approach', async () => {
|
|
const judgeMetadata: Pick<EvalTestEntry, 'judge_scores' | 'judge_reasoning'> = {};
|
|
await runRecordedOfficeHoursAttempt({
|
|
collector: evalCollector, name: '/plan-ceo-review-format-approach', suite: 'Plan Format — CEO Approach Menu',
|
|
model: resolveEvalModel('capture'), budgetMs: CAPTURE_MS,
|
|
judgeMetadata,
|
|
run: signal => runSkillTest({
|
|
signal,
|
|
prompt: `Read plan-ceo-review/SKILL.md for the review workflow.
|
|
|
|
Read plan.md — that's the plan to review. This is a standalone plan document, not a codebase — skip any codebase exploration or system audit steps.
|
|
|
|
Proceed to Alternatives (the implementation approach menu). This is where the skill generates 2-3 approaches (minimal viable vs ideal architecture) and presents them via AskUserQuestion. These options differ in coverage (complete vs shortcut), so Completeness: N/10 applies.
|
|
|
|
${captureInstruction(outFile)}
|
|
|
|
After writing the file, stop. Do not continue the review.`,
|
|
workingDirectory: planDir,
|
|
maxTurns: 10,
|
|
timeout: CAPTURE_MS,
|
|
testName: 'plan-ceo-review-format-approach',
|
|
runId,
|
|
model: resolveEvalModel('capture'),
|
|
}),
|
|
validate: async (result, signal) => {
|
|
logCost('/plan-ceo-review format (approach)', result);
|
|
expect(['success', 'error_max_turns']).toContain(result.exitReason);
|
|
|
|
expect(fs.existsSync(outFile)).toBe(true);
|
|
const captured = fs.readFileSync(outFile, 'utf-8');
|
|
expect(captured.length).toBeGreaterThan(100);
|
|
|
|
// Coverage-differentiated: Completeness: N/10 required. Recommendation
|
|
// presence checked by the judge.
|
|
expect(captured).toMatch(COMPLETENESS_RE);
|
|
|
|
await assertRecommendationQuality({
|
|
captured,
|
|
signal,
|
|
record: metadata => Object.assign(judgeMetadata, metadata),
|
|
evalCollector,
|
|
evalId: '/plan-ceo-review-format-approach',
|
|
evalTitle: 'Plan Format — CEO Approach Menu',
|
|
result,
|
|
passed: ['success', 'error_max_turns'].includes(result.exitReason),
|
|
});
|
|
},
|
|
});
|
|
}, CAPTURE_MS + OFFICE_HOURS_BUN_GRACE_MS);
|
|
});
|
|
|
|
// --- Case 3: plan-eng-review coverage-differentiated per-issue AskUserQuestion ---
|
|
|
|
describeIfSelected('Plan Format — Eng Coverage Issue', ['plan-eng-review-format-coverage'], () => {
|
|
let planDir: string;
|
|
let outFile: string;
|
|
|
|
beforeAll(() => {
|
|
planDir = setupPlanDir('skill-e2e-plan-format-eng-cov-', 'plan-eng-review');
|
|
outFile = path.join(planDir, 'ask-capture.md');
|
|
});
|
|
|
|
afterAll(() => {
|
|
try { fs.rmSync(planDir, { recursive: true, force: true }); } catch {}
|
|
});
|
|
|
|
testConcurrentIfSelected('plan-eng-review-format-coverage', async () => {
|
|
const judgeMetadata: Pick<EvalTestEntry, 'judge_scores' | 'judge_reasoning'> = {};
|
|
await runRecordedOfficeHoursAttempt({
|
|
collector: evalCollector, name: '/plan-eng-review-format-coverage', suite: 'Plan Format — Eng Coverage Issue',
|
|
model: resolveEvalModel('capture'), budgetMs: CAPTURE_MS,
|
|
judgeMetadata,
|
|
run: signal => runSkillTest({
|
|
signal,
|
|
prompt: `Read plan-eng-review/SKILL.md for the review workflow.
|
|
|
|
Read plan.md — that's the plan to review. This is a standalone plan document, not a codebase — skip any codebase exploration steps.
|
|
|
|
During your review (Section 3 Test Review is the natural place), generate ONE AskUserQuestion about test coverage depth where the options are clearly coverage-differentiated. For example:
|
|
A) Full coverage: happy path + edge cases + error paths (Completeness 10/10)
|
|
B) Happy path only (Completeness 7/10)
|
|
C) Smoke test (Completeness 3/10)
|
|
|
|
${captureInstruction(outFile)}
|
|
|
|
After writing the file with that ONE question, stop. Do not continue the review.`,
|
|
workingDirectory: planDir,
|
|
maxTurns: 10,
|
|
timeout: CAPTURE_MS,
|
|
testName: 'plan-eng-review-format-coverage',
|
|
runId,
|
|
model: resolveEvalModel('capture'),
|
|
}),
|
|
validate: async (result, signal) => {
|
|
logCost('/plan-eng-review format (coverage)', result);
|
|
expect(['success', 'error_max_turns']).toContain(result.exitReason);
|
|
|
|
expect(fs.existsSync(outFile)).toBe(true);
|
|
const captured = fs.readFileSync(outFile, 'utf-8');
|
|
expect(captured.length).toBeGreaterThan(100);
|
|
|
|
// Coverage-differentiated: Completeness: N/10 required. Recommendation
|
|
// presence checked by the judge.
|
|
expect(captured).toMatch(COMPLETENESS_RE);
|
|
|
|
await assertRecommendationQuality({
|
|
captured,
|
|
signal,
|
|
record: metadata => Object.assign(judgeMetadata, metadata),
|
|
evalCollector,
|
|
evalId: '/plan-eng-review-format-coverage',
|
|
evalTitle: 'Plan Format — Eng Coverage Issue',
|
|
result,
|
|
passed: ['success', 'error_max_turns'].includes(result.exitReason),
|
|
});
|
|
},
|
|
});
|
|
}, CAPTURE_MS + OFFICE_HOURS_BUN_GRACE_MS);
|
|
});
|
|
|
|
// --- Case 4: plan-eng-review kind-differentiated per-issue AskUserQuestion ---
|
|
|
|
describeIfSelected('Plan Format — Eng Kind Issue', ['plan-eng-review-format-kind'], () => {
|
|
let planDir: string;
|
|
let outFile: string;
|
|
|
|
beforeAll(() => {
|
|
planDir = setupPlanDir('skill-e2e-plan-format-eng-kind-', 'plan-eng-review');
|
|
outFile = path.join(planDir, 'ask-capture.md');
|
|
});
|
|
|
|
afterAll(() => {
|
|
try { fs.rmSync(planDir, { recursive: true, force: true }); } catch {}
|
|
});
|
|
|
|
testConcurrentIfSelected('plan-eng-review-format-kind', async () => {
|
|
const judgeMetadata: Pick<EvalTestEntry, 'judge_scores' | 'judge_reasoning'> = {};
|
|
await runRecordedOfficeHoursAttempt({
|
|
collector: evalCollector, name: '/plan-eng-review-format-kind', suite: 'Plan Format — Eng Kind Issue',
|
|
model: resolveEvalModel('capture'), budgetMs: CAPTURE_MS,
|
|
judgeMetadata,
|
|
run: signal => runSkillTest({
|
|
signal,
|
|
prompt: `Read plan-eng-review/SKILL.md for the review workflow.
|
|
|
|
Read plan.md — that's the plan to review. This is a standalone plan document, not a codebase — skip any codebase exploration steps.
|
|
|
|
During your review (Section 1 Architecture), generate ONE AskUserQuestion about an architectural choice where the options differ in kind, not in coverage. For example, "should we use Redis or Postgres for the cache layer?" — the options are different kinds of systems with different tradeoffs, not more-or-less-complete versions of the same thing.
|
|
|
|
${captureInstruction(outFile)}
|
|
|
|
After writing the file with that ONE question, stop. Do not continue the review.`,
|
|
workingDirectory: planDir,
|
|
maxTurns: 10,
|
|
timeout: CAPTURE_MS,
|
|
testName: 'plan-eng-review-format-kind',
|
|
runId,
|
|
model: resolveEvalModel('capture'),
|
|
}),
|
|
validate: async (result, signal) => {
|
|
logCost('/plan-eng-review format (kind)', result);
|
|
expect(['success', 'error_max_turns']).toContain(result.exitReason);
|
|
|
|
expect(fs.existsSync(outFile)).toBe(true);
|
|
const captured = fs.readFileSync(outFile, 'utf-8');
|
|
expect(captured.length).toBeGreaterThan(100);
|
|
|
|
// Kind-differentiated: Completeness: N/10 must NOT appear, "options differ
|
|
// in kind" note must appear. Recommendation presence checked by the judge.
|
|
expect(captured).not.toMatch(COMPLETENESS_RE);
|
|
expect(captured).toMatch(KIND_NOTE_RE);
|
|
|
|
await assertRecommendationQuality({
|
|
captured,
|
|
signal,
|
|
record: metadata => Object.assign(judgeMetadata, metadata),
|
|
evalCollector,
|
|
evalId: '/plan-eng-review-format-kind',
|
|
evalTitle: 'Plan Format — Eng Kind Issue',
|
|
result,
|
|
passed: ['success', 'error_max_turns'].includes(result.exitReason),
|
|
});
|
|
},
|
|
});
|
|
}, CAPTURE_MS + OFFICE_HOURS_BUN_GRACE_MS);
|
|
});
|
|
|
|
afterAll(async () => {
|
|
await finalizeEvalCollector(evalCollector);
|
|
});
|