feat(FN-3450): add mesh task create replication across nodes
Implements distributed mesh task creation by adding replicated create primitives to the core store, wiring new API routes (`register-mesh-routes.ts`) that replicate task creation across clustered nodes while preserving remote-targeting metadata, and updating the dashboard's task creation flow accord Fusion-Task-Id: FN-3450
This commit is contained in:
@@ -57,7 +57,7 @@ describe("RemoteNodeClient", () => {
|
||||
await expect(client.getMetrics()).resolves.toEqual(metrics);
|
||||
});
|
||||
|
||||
it("createTask() sends POST with JSON body", async () => {
|
||||
it("createTask() sends POST with full JSON body including node targeting metadata", async () => {
|
||||
const createdTask = {
|
||||
id: "KB-001",
|
||||
description: "Create me",
|
||||
@@ -83,7 +83,12 @@ describe("RemoteNodeClient", () => {
|
||||
globalThis.fetch = fetchMock as unknown as typeof fetch;
|
||||
|
||||
const client = new RemoteNodeClient({ baseUrl: BASE_URL, apiKey: API_KEY });
|
||||
await client.createTask({ description: "Create me" });
|
||||
await client.createTask({
|
||||
description: "Create me",
|
||||
title: "Task title",
|
||||
nodeId: "node-exec-1",
|
||||
dependencies: ["KB-010"],
|
||||
});
|
||||
|
||||
const options = fetchMock.mock.calls[0]?.[1] as RequestInit;
|
||||
expect(fetchMock).toHaveBeenCalledWith(`${BASE_URL}/api/tasks`, expect.any(Object));
|
||||
@@ -92,7 +97,12 @@ describe("RemoteNodeClient", () => {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${API_KEY}`,
|
||||
}));
|
||||
expect(options.body).toBe(JSON.stringify({ description: "Create me" }));
|
||||
expect(options.body).toBe(JSON.stringify({
|
||||
description: "Create me",
|
||||
title: "Task title",
|
||||
nodeId: "node-exec-1",
|
||||
dependencies: ["KB-010"],
|
||||
}));
|
||||
});
|
||||
|
||||
it("listTasks() sends optional query params", async () => {
|
||||
|
||||
Reference in New Issue
Block a user