test: enforce Scene 11 decision navigation

This commit is contained in:
lda
2026-07-12 09:06:29 +07:00 Verified
parent 3efb51672b
commit 552869c96f
3 changed files with 23 additions and 5 deletions
@@ -12,7 +12,6 @@ describe("requirementForDemoBeat", () => {
["run-from-deployment", "graph", "run_start"], ["run-from-deployment", "graph", "run_start"],
["typed-human-boundary", "interrupt", "interrupt"], ["typed-human-boundary", "interrupt", "interrupt"],
["typed-human-boundary", "approval", "interrupt"], ["typed-human-boundary", "approval", "interrupt"],
["typed-human-boundary", "cancel", "interrupt"],
["resume-output-evidence", "resume", "run_resume"], ["resume-output-evidence", "resume", "run_resume"],
["resume-output-evidence", "output", "run_resume"], ["resume-output-evidence", "output", "run_resume"],
["resume-output-evidence", "trace", "trace_read"], ["resume-output-evidence", "trace", "trace_read"],
@@ -20,6 +19,13 @@ describe("requirementForDemoBeat", () => {
expect(requirementForDemoBeat(sceneId, beatId).requiredStage).toBe(stage); expect(requirementForDemoBeat(sceneId, beatId).requiredStage).toBe(stage);
}); });
it("has no requirement for the removed Scene 11 cancel beat", () => {
expect(requirementForDemoBeat("typed-human-boundary", "cancel")).toEqual({
requiredStage: null,
reason: "No demo replay state needed.",
});
});
it("returns no required stage for non-demo beats", () => { it("returns no required stage for non-demo beats", () => {
expect(requirementForDemoBeat("thesis", "title")).toEqual({ expect(requirementForDemoBeat("thesis", "title")).toEqual({
requiredStage: null, requiredStage: null,
@@ -42,10 +42,6 @@ const requirements: Readonly<Record<string, DemoBeatRequirement>> = {
requiredStage: "interrupt", requiredStage: "interrupt",
reason: "Approval beat needs the typed review payload before controls can act.", reason: "Approval beat needs the typed review payload before controls can act.",
}, },
"typed-human-boundary/cancel": {
requiredStage: "interrupt",
reason: "Cancel beat needs the review payload but no submitted replay evidence.",
},
"resume-output-evidence/resume": { "resume-output-evidence/resume": {
requiredStage: "run_resume", requiredStage: "run_resume",
reason: "Resume beat needs the recorded resume operation.", reason: "Resume beat needs the recorded resume operation.",
@@ -87,4 +87,20 @@ describe("storyboard navigation", () => {
focusPath: [], focusPath: [],
}); });
}); });
it("advances Scene 11 directly from interrupt to approval, then Scene 12", () => {
const interrupt = { kind: "main", sceneId: "typed-human-boundary", beatId: "interrupt", focusPath: [] } as const;
const approval = { kind: "main", sceneId: "typed-human-boundary", beatId: "approval", focusPath: [] } as const;
expect(nextMainLocation(interrupt)).toEqual(approval);
expect(nextMainLocation(approval)).toMatchObject({
kind: "main",
sceneId: "resume-output-evidence",
beatId: "resume",
});
});
it("fails closed for the removed Scene 11 cancel hash", () => {
expect(locationFromHash("#scene/typed-human-boundary/cancel")).toEqual(defaultMainLocation);
});
}); });