Files
gstack/test/plan-count-truncated-question.test.ts
T
garrytan 6415690a18 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.
2026-09-29 06:08:49 +00:00

43 lines
2.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describe, expect, test } from 'bun:test';
import fs from 'node:fs';
import path from 'node:path';
import { capturePlanCountQuestion, matchesNativePlanQuestion } from './helpers/claude-pty-runner';
import type { NativePlanQuestionCall } from './helpers/plan-count-transcript';
import completed from './fixtures/ceo-approach-z-call.json';
const screen = fs.readFileSync(path.join(import.meta.dir, 'fixtures/ceo-approach-z-screen.txt'), 'utf8');
function pending(): NativePlanQuestionCall {
// No pending-only version survived the live capture. This is an explicit
// projection for replay, not evidence of metadata availability at input time.
const { answers, answeredAt, unansweredQuestionIndices, ...call } = structuredClone(completed);
return { ...call, answered: false, failed: false };
}
describe('native question truncated before its routing id', () => {
test('changed or incomplete panels cannot borrow pending metadata', () => {
for (const visible of [
screen.replace('☐ Approach', '☐ Other'),
screen.replace('SQL injection bug', 'different defect'),
screen.replace('Dela…', 'Different…'),
screen.replace('Dela…', 'Dela'),
screen.replace('B — Proper Integration (recommended)', 'B — Different Integration (recommended)'),
screen.replace('3. C — Reject and Redesign', '3. Changed choice'),
screen.replace('4. Type something.', '4. Extra operation'),
screen.replace('↑/↓ to navigate', '↑/↓ to navigte'),
screen.replace(' · Esc to cancel', ''),
screen + '\nA later question?',
'Quoted earlier menu:\n' + screen,
screen.slice(screen.indexOf('❯ 1.')),
screen.replace(/\n\n│[\s\S]*?\n\n❯/, '\n\n│ Which approach…\n\n❯'),
screen.replace('☐ Approach', '← ☐ Approach ☐ Other ✔ Submit →'),
]) {
expect(visible).not.toBe(screen);
const call = pending();
expect(matchesNativePlanQuestion(visible, call), visible).toBe(false);
expect(capturePlanCountQuestion(visible, new Set(), 0, true, call)?.nativeCall).toBeUndefined();
}
const packet = pending(); packet.questions.push(structuredClone(packet.questions[0]!));
expect(matchesNativePlanQuestion(screen, packet)).toBe(false);
});
});