mirror of
https://github.com/garrytan/gstack.git
synced 2026-10-03 01:46:55 +02:00
test: supply holdDeferKeepIndex to the CEO routing mocks and follow split-overflow into the marathon lane
The registered-callback fixtures mock ceo-mode-option and lacked the new export; the split fixtures asserted the periodic tier; the registered-budget check looked for split-overflow only in the periodic manifest.
This commit is contained in:
1 parent
bf4667146c
commit
958d1ceba6
6 files changed
+14
-8
No files matched your search
@@ -3,7 +3,7 @@ import * as fs from 'node:fs';
|
||||
import * as path from 'node:path';
|
||||
import captured from './fixtures/ceo-hold-proof-fb10.json';
|
||||
import { buildCeoHoldPostureReview, evaluateCeoHoldPostureReview, type CeoHoldPostureReviewInput } from './helpers/ceo-hold-posture-review';
|
||||
import { hasNativePostAnswerCeoPosture } from './helpers/ceo-mode-option';
|
||||
import { hasNativePostAnswerCeoPosture, holdDeferKeepIndex } from './helpers/ceo-mode-option';
|
||||
import type { PlanReviewDecisionInput, PlanReviewDecisionJudgment } from './helpers/plan-review-decisions';
|
||||
import type { NativePublicToolEvent } from './helpers/plan-count-transcript';
|
||||
import { nativePlanCallFingerprint } from './helpers/claude-pty-runner';
|
||||
@@ -243,7 +243,7 @@ async function registered(scenario:'accept'|'uncertain'|'missing source'|'missin
|
||||
navigateToModeAskUserQuestion:async()=>({modeIndex:3,visibleAtMode:'captured mode',question:{nativeCall:mode(f)}}),
|
||||
planCountQuestionInput:(_v:string,q:any)=>q.nativeCall.toolUseId===modeId?'3':'1',selectPtyNumberedOption:async()=>{throw Error('unexpected legacy key');},
|
||||
hasNativePostAnswerCeoPosture:scenario==='lexical pass'||scenario==='expansion'?()=>true:hasNativePostAnswerCeoPosture,
|
||||
ceoModeSubmissionInput:()=>null,ceoExpansionPacingReady:()=>false,ceoExpansionPacingChoice:()=>null,
|
||||
ceoModeSubmissionInput:()=>null,ceoExpansionPacingReady:()=>false,ceoExpansionPacingChoice:()=>null,holdDeferKeepIndex,
|
||||
nextCeoPostureContinuation:(_a:any,_b:any,_c:any,_d:any,_e:any,continued:boolean)=>continued?null:'question',
|
||||
capturePlanCountQuestion:()=>({nativeCall:pending}),isPlanReadyVisible:()=>false,isNumberedOptionListVisible:()=>false,
|
||||
buildCeoHoldPostureReview,evaluateCeoHoldPostureReview:async(review:PlanReviewDecisionInput)=>{
|
||||
|
||||
@@ -52,6 +52,7 @@ mock.module(path.join(root,'test/helpers/ceo-mode-option.ts'),()=>({
|
||||
ceoExpansionPacingChoice:()=>{current.pacingChoices++;return scenario.startsWith('pacing')&&(!current.pacingSent||scenario==='pacing-repeated')?{call:{questions:[]},index:scenario==='pacing-unsupported'?0:1}:null;},
|
||||
ceoExpansionPacingReady:()=>{current.pacingChecks++;return (scenario==='pacing'||scenario==='pacing-repeated')&¤t.pacingChecks>=3;},
|
||||
ceoModeSubmissionInput:()=>scenario==='mode-submit'&&!current.submitted?'\\r':null,
|
||||
holdDeferKeepIndex:()=>null,
|
||||
nextCeoModeNavigation:(_visible,target)=>{
|
||||
if(scenario==='navigation')throw new Error('fixture navigation failed');
|
||||
current.mode=target; return {kind:'mode',index:target==='HOLD SCOPE'?2:1,question};
|
||||
|
||||
@@ -176,7 +176,7 @@ const state = JSON.parse(fs.readFileSync(${JSON.stringify(inputPath)}, 'utf8'));
|
||||
const facts = { runs: 0, evaluators: 0, judges: 0, directory: '', candidateCalls: 0, suppliedCalls: 0 };
|
||||
const save = () => fs.writeFileSync(${JSON.stringify(factsPath)}, JSON.stringify(facts));
|
||||
mock.module(${JSON.stringify(path.join(ROOT, 'test/helpers/e2e-gate.ts'))}, () => ({
|
||||
describeE2ETier: tier => { expect(tier).toBe('periodic'); return describe; },
|
||||
describeE2ETier: tier => { expect(tier).toBe('marathon'); return describe; },
|
||||
}));
|
||||
mock.module(${JSON.stringify(path.join(ROOT, 'test/helpers/plan-review-decisions.ts'))}, () => ({
|
||||
evaluatePlanReviewDecisions: async input => {
|
||||
|
||||
@@ -300,7 +300,7 @@ mock.module(${JSON.stringify(path.join(ROOT, 'test/helpers/plan-review-decisions
|
||||
},
|
||||
}));
|
||||
mock.module(${JSON.stringify(path.join(ROOT, 'test/helpers/e2e-gate.ts'))}, () => ({
|
||||
describeE2ETier: tier => { expect(tier).toBe('periodic'); return describe; },
|
||||
describeE2ETier: tier => { expect(tier).toBe('marathon'); return describe; },
|
||||
}));
|
||||
const boundary = () => false;
|
||||
mock.module(${JSON.stringify(path.join(ROOT, 'test/helpers/claude-pty-runner.ts'))}, () => ({
|
||||
|
||||
@@ -168,9 +168,14 @@ test('explicit allocation keeps its timer across load scheduling', () => {
|
||||
});
|
||||
|
||||
test('single-slice manifest retains all registered files with one allocation', () => {
|
||||
const m = buildRunManifest({ tier: 'periodic', sliceCount: 1, evalsAll: true, env: { EVALS_ALL: '1' } });
|
||||
expect(m.entries.filter(e => e.status === 'planned').every(e => e.slice === 1)).toBe(true);
|
||||
for (const budget of FINDING_RETRY_BUDGETS) expect(m.entries.find(e => e.file === budget.file)?.budget).toEqual(resolvePaidShardBudget([budget.file]));
|
||||
// A registered file runs in exactly one scheduled lane: periodic, or the marathon lane for full flows.
|
||||
const manifests = (['periodic', 'marathon'] as const).map(tier => buildRunManifest({ tier, sliceCount: 1, evalsAll: true, env: { EVALS_ALL: '1' } }));
|
||||
for (const m of manifests) expect(m.entries.filter(e => e.status === 'planned').every(e => e.slice === 1)).toBe(true);
|
||||
for (const budget of FINDING_RETRY_BUDGETS) {
|
||||
const entries = manifests.flatMap(m => m.entries.filter(e => e.file === budget.file && e.status === 'planned'));
|
||||
expect(entries, budget.file).toHaveLength(1);
|
||||
expect(entries[0]!.budget).toEqual(resolvePaidShardBudget([budget.file]));
|
||||
}
|
||||
});
|
||||
|
||||
test('current detach supervision covers the live-census floor', () => {
|
||||
|
||||
Reference in new issue
Block a user