Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ describe("FN-5715 reliability: mission validation trigger gap", () => {
completeValidatorRun: vi.fn(),
getSlice: vi.fn(() => ({ id: "SL-001", milestoneId: "MS-001", status: "active" })),
getMilestone: vi.fn(() => ({ id: "MS-001", missionId: "M-001" })),
// resolveFeatureMission (reached via processTaskOutcome during recovery)
// walks getSlice → getMilestone → getMission to gate on mission.status.
// Without getMission the walk throws and recovery aborts before it can
// ensure assertions / start the validator run this test asserts on.
getMission: vi.fn(() => ({ id: "M-001", status: "active" })),
logMissionEvent: vi.fn(),
transitionLoopState: vi.fn(),
setFeatureCurrentTaskRunId: vi.fn(),
Expand Down Expand Up @@ -277,6 +282,11 @@ describe("FN-5715 reliability: mission validation trigger gap", () => {
completeValidatorRun: vi.fn(),
getSlice: vi.fn(() => ({ id: "SL-001", milestoneId: "MS-001", status: "active" })),
getMilestone: vi.fn(() => ({ id: "MS-001", missionId: "M-001" })),
// resolveFeatureMission (reached via processTaskOutcome during recovery)
// walks getSlice → getMilestone → getMission to gate on mission.status.
// Without getMission the walk throws and recovery aborts before it can
// ensure assertions / start the validator run this test asserts on.
getMission: vi.fn(() => ({ id: "M-001", status: "active" })),
logMissionEvent: vi.fn(),
transitionLoopState: vi.fn(),
setFeatureCurrentTaskRunId: vi.fn(),
Expand Down
6 changes: 6 additions & 0 deletions packages/engine/src/__tests__/restart.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ vi.mock("../pi.js", () => ({
// session. The mock must expose the export so the resume/triage paths can
// reach finalization instead of throwing on a missing mock member.
formatModelMarkerDetails: vi.fn((model: string) => model),
// triage.ts guards its catch block with `err instanceof ModelFallbackExhaustedError`
// (imported from pi.js). Because this factory replaces pi.js wholesale, the class
// must be exported or evaluating the `instanceof` throws "No ModelFallbackExhaustedError
// export is defined on the mock". No restart test enters the fallback-exhausted branch,
// so a plain Error subclass is a faithful stub (instanceof simply returns false).
ModelFallbackExhaustedError: class ModelFallbackExhaustedError extends Error {},
}));
vi.mock("../reviewer.js", () => ({
reviewStep: vi.fn(),
Expand Down
Loading