Files
fusion/packages/engine/src/node-dispatch-validation.ts
Fusion a1354685d0 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
2026-05-07 23:21:05 -07:00

20 lines
593 B
TypeScript

export type NodeDispatchValidationResult =
| { allowed: true }
| { allowed: false; code: "missing-project-mapping"; reason: string };
export function validateProjectNodeMapping(params: {
nodeId: string;
mappedPath: string | undefined;
}): NodeDispatchValidationResult {
const { nodeId, mappedPath } = params;
if (typeof mappedPath !== "string" || mappedPath.trim().length === 0) {
return {
allowed: false,
code: "missing-project-mapping",
reason: `Execution blocked: project has no path mapping for node ${nodeId}`,
};
}
return { allowed: true };
}