/** * computeCriticalPath — pure-functional longest-path finder for a dependency DAG. * * Uses Kahn's topological sort + dynamic programming to find the longest path. * Returns an empty array when the graph contains a cycle. * * @arch SDK Tool (Category B) — pure, no side effects, contracts-typed * @task T10068 * @epic T9835 */ import type { CriticalPathEdge, CriticalPathNode, CriticalPathResult } from '@cleocode/contracts'; /** * Compute the critical (longest) path through a dependency DAG. * * The `epicId` node is excluded from end-node selection so the path represents * the deepest leaf work, not the epic container itself. Returns task IDs from * path start to end; returns an empty path when the graph has cycles. * * @param nodes - All task nodes in the scoped graph * @param edges - Directed edges (dependency → dependent) * @param epicId - Epic container ID to exclude from end-node selection * @returns Critical path result with ordered IDs and length * * @example * ```typescript * const nodes = [ * { id: 'T1', title: 'Setup', status: 'done', depends: [] }, * { id: 'T2', title: 'Build', status: 'pending', depends: ['T1'] }, * { id: 'T3', title: 'Test', status: 'pending', depends: ['T2'] }, * ]; * const edges = [{ from: 'T1', to: 'T2' }, { from: 'T2', to: 'T3' }]; * const { path } = computeCriticalPath(nodes, edges, 'E1'); * // path === ['T1', 'T2', 'T3'] * ``` */ export declare function computeCriticalPath(nodes: CriticalPathNode[], edges: CriticalPathEdge[], epicId: string): CriticalPathResult; //# sourceMappingURL=compute-critical-path.d.ts.map