feat(FN-3507): block dispatch when project lacks node mapping

Adds validation to block task dispatch when no project-node mapping exists (FN-3507), including a read helper in CentralCore and a new `node-dispatch-validation` module integrated into the scheduler and in-process runtime, with test coverage across routing and validation scenarios.

Fusion-Task-Id: FN-3507
This commit is contained in:
Fusion
2026-05-07 21:23:26 -07:00
committed by gsxdsm
parent 695cb0bca5
commit 11bf7084e1
9 changed files with 261 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
import { describe, expect, it } from "vitest";
import { validateProjectNodeMapping } from "../node-dispatch-validation.js";
describe("validateProjectNodeMapping", () => {
it("allows dispatch when mapping path is present", () => {
expect(
validateProjectNodeMapping({ nodeId: "node-1", mappedPath: "/work/project" }),
).toEqual({ allowed: true });
});
it("blocks dispatch when mapping is missing or blank", () => {
expect(
validateProjectNodeMapping({ nodeId: "node-1", mappedPath: undefined }),
).toEqual({
allowed: false,
code: "missing-project-mapping",
reason: "Execution blocked: project has no path mapping for node node-1",
});
expect(
validateProjectNodeMapping({ nodeId: "node-1", mappedPath: " " }),
).toEqual({
allowed: false,
code: "missing-project-mapping",
reason: "Execution blocked: project has no path mapping for node node-1",
});
});
});