Files
gstack/test/eng-resolution-block-position.test.ts
T
garrytan 5d032ef299 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.
2026-09-29 05:09:36 +00:00

33 lines
1.9 KiB
TypeScript

import {expect,test} from 'bun:test';
import batching from './fixtures/eng-batching-saved-ledger-b176.json';
import {createEngBatchingIssueCounter} from './helpers/eng-seeded-coverage';
import {engSetupAUQ} from './helpers/claude-pty-runner';
// Change placement only. Indented History states remain historical, and invalid
// duplicate current states are preserved rather than silently reconciled.
function resolutionBlock(plan:string):string {
return plan.split(/\n(?=### R[1-9]\d*:)/).map(record=>{
const states=record.match(/^State:.*\n/gm)??[];
if(!states.length)return record;
expect(record).toMatch(/^Actual answer:/m);
return record.replace(/^State:.*\n/gm,'').replace(/^Actual answer:/m,states.join('')+'Actual answer:');
}).join('\n');
}
test('saved native Header and Options remain scoped before the resolution fields',()=>{
for(const index of [3,4,5,6,7,8,9]) {
const f=batching.frames[index]!;
const check=(plan:string)=>createEngBatchingIssueCounter(()=>plan,engSetupAUQ).isReviewAUQ(f.fingerprint,[]);
expect(check(f.preAskPlan)).toBe(true);
expect(check(resolutionBlock(f.preAskPlan))).toBe(true);
for(const state of ['', 'State: pending\nState: pending\n', 'State: pending\nState: approved\n']) {
const question=f.fingerprint.nativeCall.questions[0]!.question.split('\n')[0]!;
const at=f.preAskPlan.indexOf(question),start=f.preAskPlan.lastIndexOf('\n### ',at),next=f.preAskPlan.indexOf('\n### ',at);
expect(at).toBeGreaterThan(0);expect(start).toBeGreaterThanOrEqual(0);
const end=next<0?f.preAskPlan.length:next,record=f.preAskPlan.slice(start,end);
expect(record).toContain('State: pending\n');
const bad=f.preAskPlan.slice(0,start)+record.replace(/^State: pending\n/m,state)+f.preAskPlan.slice(end);
expect(check(bad)).toBe(false);expect(check(resolutionBlock(bad))).toBe(false);
}
}
});