test: allow approved plan step with dispatch receipt

This commit is contained in:
Eve
2026-04-24 11:56:05 +08:00
parent ded50db9b3
commit eeec38bff6

View File

@@ -126,6 +126,54 @@ const tests = [
} }
}, },
}, },
{
name: 'continuity: passes when task is complete, next action is known, and a dispatch receipt already exists',
run() {
const fixture = createFixture({
'input.json': {
planId: 'plan-existing-dispatch',
currentTask: 'task-6',
taskState: 'complete',
nextDerivedAction: {
type: 'message_subagent',
task: 'continue with task-7',
},
replyClosureState: 'completed',
dispatchReceipt: {
planId: 'plan-existing-dispatch',
currentTask: 'task-6',
nextDerivedAction: {
type: 'message_subagent',
task: 'continue with task-7',
},
dispatchedAt: '2026-04-24T11:55:00+08:00',
},
},
});
try {
const result = runGate({
args: ['--compact', '--input', fixture.path('input.json')],
});
if (result.status !== 0 && result.status !== null) {
throw new Error(`expected controlled execution, got status=${result.status}
${result.stderr || result.stdout}`);
}
if (!result.json || typeof result.json !== 'object') {
throw new Error(`expected JSON output
stdout=${result.stdout}`);
}
if (result.json.ok !== true) {
throw new Error(`expected continuity pass ok=true when dispatch receipt exists, got ${JSON.stringify(result.json)}`);
}
} finally {
fixture.cleanup();
}
},
},
]; ];
const results = []; const results = [];