feat(FN-2855): route scheduled tasks using effective node resolution

- Add an effective node resolver with task override, project default, and local fallback precedence.
- Wire scheduler dispatch to persist effectiveNodeId/effectiveNodeSource and log resolved node routing.
- Add coverage for effective node resolution and scheduler node routing integration behavior.
- Stabilize workspace test resolution by adding @fusion/core and @fusion/plugin-sdk aliases across Vitest configs.
This commit is contained in:
Fusion
2026-04-28 07:39:05 -07:00
committed by gsxdsm
parent c9f75a3aad
commit 0c241b017f
16 changed files with 296 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import type { ProjectSettings, Task } from "@fusion/core";
export type EffectiveNodeSource = "task-override" | "project-default" | "local";
export interface EffectiveNode {
nodeId: string | undefined;
source: EffectiveNodeSource;
}
function isSetNodeId(nodeId: string | null | undefined): nodeId is string {
return typeof nodeId === "string" && nodeId.trim().length > 0;
}
export function resolveEffectiveNode(
task: Pick<Task, "nodeId">,
settings: Pick<ProjectSettings, "defaultNodeId">,
): EffectiveNode {
if (isSetNodeId(task.nodeId)) {
return { nodeId: task.nodeId, source: "task-override" };
}
if (isSetNodeId(settings.defaultNodeId)) {
return { nodeId: settings.defaultNodeId, source: "project-default" };
}
return { nodeId: undefined, source: "local" };
}