Files
gstack/test/plan-count-truncated-border.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

44 lines
2.5 KiB
TypeScript

import { expect, test } from 'bun:test';
import captured from './fixtures/eng-d2-truncated-border-0bcd.json';
import { capturePlanCountQuestion, matchesNativePlanQuestion } from './helpers/claude-pty-runner';
import type { NativePlanQuestionCall } from './helpers/plan-count-transcript';
const screen = captured.screen;
const pending = (): NativePlanQuestionCall => structuredClone(captured.call);
const withoutBorder = screen.slice(screen.indexOf('\n') + 1);
test('removing only native top chrome preserves the previously supported complete prefix', () => {
expect(screen.endsWith(withoutBorder)).toBe(true);
expect(matchesNativePlanQuestion(withoutBorder, pending())).toBe(true);
});
for (const [name, visible] of [
['CRLF transport', screen.replaceAll('\n', '\r\n')],
['blank viewport padding', '\n \n' + screen],
['blank rail padding', '│\n' + screen],
] as const) test(`native truncated border preserves ${name}`, () => {
const call = pending();
expect(matchesNativePlanQuestion(visible, call)).toBe(true);
expect(capturePlanCountQuestion(visible, new Set(), 0, true, call)?.nativeCall).toBe(call);
});
const negatives: [string, (value: string) => string][] = [
['foreign introduction', value => 'Quoted earlier menu:\n' + value],
['foreign introduction inside border', value => value.replace('\n', '\nQuoted earlier menu:\n')],
['fenced copy', value => '```text\n' + value + '\n```'],
['competing header', value => value.replace(' ☐ Layout', ' ☐ Other\n ☐ Layout')],
['foreign header', value => value.replace('☐ Layout', '☐ Other')],
['changed visible question prefix', value => value.replace('D2 — Complexity gate', 'D2 — Different gate')],
['missing native elision', value => value.replace('❌ two …', '❌ two')],
['changed offered label', value => value.replace('1. Simplify class layout', '1. Expand feature scope')],
['extra offered action', value => value.replace('4. Type something.', '4. New action')],
['missing footer', value => value.replace(' · Esc to cancel', '')],
['later prose', value => value + '\nAnother unrelated prompt'],
['duplicate border', value => value.split('\n')[0] + '\n' + value],
];
for (const [name, mutate] of negatives) test(`native border cannot authorize ${name}`, () => {
const changed = mutate(screen), call = pending();
expect(changed).not.toBe(screen);
expect(matchesNativePlanQuestion(changed, call)).toBe(false);
expect(capturePlanCountQuestion(changed, new Set(), 0, true, call)?.nativeCall).toBeUndefined();
});