/**
 * Pure DAG node state transitions.
 *
 * Extracted from OrchestrationStateManager (Phase 4b).
 */
export function transitionNode(node, event) {
    switch (event.type) {
        case "start":
            return {
                ...node,
                status: "running",
                startedAt: event.startedAt,
            };
        case "complete":
            return {
                ...node,
                status: event.success ? "done" : "failed",
                completedAt: event.completedAt,
                durationMs: event.durationMs,
                retries: event.retries,
            };
        case "retry":
            return {
                ...node,
                status: "pending",
                retries: event.retries,
            };
        case "fail":
            return {
                ...node,
                status: "failed",
                completedAt: event.completedAt,
            };
    }
}
