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
20 lines
593 B
TypeScript
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 };
|
|
}
|