fix(ci): add createWorkflowAuthoringTools to partial engine mocks; bump roadmap schema assertion to 109

This commit is contained in:
gsxdsm
2026-06-05 01:45:48 -07:00
parent 27d3763db5
commit dfe8dfd70a
23 changed files with 26 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
}));
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
createFnAgent: mockCreateFnAgent,
}));

View File

@@ -25,6 +25,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
// Mock the engine module to avoid dynamic import issues in tests
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
createFnAgent: mockCreateFnAgent,
}));

View File

@@ -43,7 +43,7 @@ const { mockChatStreamManager, mockSendMessage, mockCancelGeneration, mockBeginG
};
});
vi.mock("@fusion/engine", () => ({ createFnAgent: vi.fn() }));
vi.mock("@fusion/engine", () => ({ createFnAgent: vi.fn(), createWorkflowAuthoringTools: vi.fn(() => []) }));
vi.mock("../planning.js", () => ({
getSession: vi.fn(), cleanupSession: vi.fn(), __setCreateFnAgent: vi.fn(), __resetPlanningState: vi.fn(), setAiSessionStore: vi.fn(), rehydrateFromStore: vi.fn().mockReturnValue(0),
}));

View File

@@ -21,6 +21,7 @@ const mockErrors = vi.hoisted(() => ({
}));
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
defaultGitOps: vi.fn(() => ({})),
ExperimentFinalizeService: vi.fn(() => ({ previewPlan: previewPlanMock, finalize: finalizeMock })),
ExperimentFinalizeStateError: mockErrors.StateError,

View File

@@ -7,6 +7,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
}));
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
createFnAgent: mockCreateFnAgent,
}));

View File

@@ -7,6 +7,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
}));
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
createFnAgent: mockCreateFnAgent,
}));

View File

@@ -14,6 +14,7 @@ vi.mock("node:child_process", () => ({
}));
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
createFnAgent: vi.fn(async () => ({
session: {
prompt: promptMock,

View File

@@ -33,6 +33,7 @@ vi.mock("@fusion/core", async () => {
});
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
createFnAgent: vi.fn(async () => ({
session: {
state: { messages: [] as Array<{ role: string; content: string }> },

View File

@@ -55,6 +55,7 @@ vi.mock("@fusion/core", async () => {
});
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
executeApprovedAgentProvisioning: vi.fn(async () => undefined),
}));

View File

@@ -38,6 +38,7 @@ class MockApprovalRequestStore {
vi.mock("@fusion/core", async (importOriginal) => ({
...(await importOriginal<typeof import("@fusion/core")>()), ApprovalRequestStore: MockApprovalRequestStore, AgentStore: class { async init() {} async getAgent() { return null; } } }));
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
executeApprovedAgentProvisioning: vi.fn(),
executeApprovedWorktrunkInstall: vi.fn(),
assertNoSecretPlaintext: (metadata?: Record<string, unknown>) => {

View File

@@ -86,6 +86,7 @@ vi.mock("@fusion/core", async (importOriginal) => ({
const executeApprovedWorktrunkInstall = vi.fn(async () => ({ binaryPath: "~/.fusion/bin/wt", source: "installed-release" }));
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
executeApprovedAgentProvisioning,
executeApprovedWorktrunkInstall,
}));

View File

@@ -26,6 +26,7 @@ class MockApprovalRequestStore {
}
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
WORKTRUNK_INSTALL_PATH: "~/.fusion/bin/wt",
WORKTRUNK_PINNED_RELEASE: {
source: "upstream-pending-verification",

View File

@@ -45,6 +45,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
}));
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
createFnAgent: mockCreateFnAgent,
}));

View File

@@ -38,6 +38,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
}));
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
createFnAgent: mockCreateFnAgent,
}));

View File

@@ -41,6 +41,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
}));
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
createFnAgent: mockCreateFnAgent,
createResolvedAgentSession: vi.fn(async () => ({
session: { state: { messages: [] }, prompt: vi.fn(), dispose: vi.fn() },

View File

@@ -38,6 +38,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
}));
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
createFnAgent: mockCreateFnAgent,
}));

View File

@@ -34,6 +34,7 @@ vi.mock("@fusion/core", async () => {
});
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
createFnAgent: vi.fn(async () => ({
session: {
state: { messages: [] as Array<{ role: string; content: string }> },

View File

@@ -9,6 +9,7 @@ const { mockCreateFnAgent } = vi.hoisted(() => ({
}));
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
createFnAgent: mockCreateFnAgent,
}));

View File

@@ -49,6 +49,7 @@ vi.mock("@fusion/core", async () => {
});
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
createFnAgent: vi.fn(async () => ({ session: { state: { messages: [] }, prompt: vi.fn(), dispose: vi.fn() } })),
createResolvedAgentSession: vi.fn(async () => ({
session: { state: { messages: [] }, prompt: vi.fn(), dispose: vi.fn() },

View File

@@ -28,6 +28,7 @@ vi.mock("@fusion/core", async () => {
});
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
createFnAgent: vi.fn(async () => ({ session: { state: { messages: [] }, prompt: vi.fn(), dispose: vi.fn() } })),
createResolvedAgentSession: vi.fn(async () => ({
session: { state: { messages: [] }, prompt: vi.fn(), dispose: vi.fn() },

View File

@@ -34,6 +34,7 @@ vi.mock("@fusion/core", async () => {
});
vi.mock("@fusion/engine", () => ({
createWorkflowAuthoringTools: vi.fn(() => []),
createFnAgent: vi.fn(async () => ({ session: { state: { messages: [] }, prompt: vi.fn(), dispose: vi.fn() } })),
createResolvedAgentSession: vi.fn(async () => ({
session: { state: { messages: [] }, prompt: vi.fn(), dispose: vi.fn() },

View File

@@ -47,6 +47,9 @@ export function createEngineMock(overrides: AnyModule = {}): AnyModule {
return withFallbackFunctions(actual, {
createFnAgent: vi.fn(),
promptWithFallback: vi.fn(),
// Returns an iterable tool list; dashboard code spreads its result
// (`...createWorkflowAuthoringTools(...)`), so it must not be undefined.
createWorkflowAuthoringTools: vi.fn(() => []),
...overrides,
});
}