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:
@@ -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",
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user