5 Commits

Author SHA1 Message Date
039a6ccfe1 fix: address review findings — CJS build (tsup), workflowCost signature, bottlenecks empty-graph test
- C1(critical): Replace tsc build with tsup for dual ESM + CJS output
- W2(warning): Change workflowCost to accept TaskGraph instead of TaskGraphInner
- S1(suggestion): Add test for bottlenecks empty-graph early return
- S2(suggestion): Document dangling-reference detection is unreachable via public API
2026-04-27 19:56:43 +00:00
cedbf3098b Merge analysis/bottlenecks: betweenness centrality bottlenecks, 20 tests
# Conflicts:
#	test/analysis.test.ts
2026-04-27 12:46:12 +00:00
62e23b5989 feat(analysis/bottlenecks): implement bottlenecks function using graphology-metrics betweenness centrality
- Implements bottlenecks(graph: TaskGraph): BottleneckResult[] with normalized scores (0.0-1.0)
- Uses graphology-metrics centrality.betweenness with normalized: true
- Returns array sorted by score descending, includes all nodes (even score 0)
- Handles empty graph edge case (returns empty array)
- 20 unit tests covering: linear chain, star graph, independent nodes,
  disconnected graph, diamond, empty graph, single node
2026-04-27 12:35:48 +00:00
4fe8532176 feat(analysis/critical-path): implement criticalPath and weightedCriticalPath
Implement longest-path-in-DAG algorithms using topological order + dynamic programming.

- criticalPath(graph): finds unweighted longest path (each node = weight 1)
- weightedCriticalPath(graph, weightFn): finds path with highest cumulative weight
- Both throw CircularDependencyError on cyclic graphs
- Empty graph returns [], single-node graph returns [nodeId]
- 20 unit tests covering linear chains, diamonds, weighted variants, cyclic detection
2026-04-27 12:34:35 +00:00
bd8a7b06d0 feat(setup/project-init): initialize TypeScript ESM project skeleton
- package.json with @alkdev/taskgraph, ESM primary, CJS compat exports
- tsconfig.json targeting Node 18+, strict mode, declaration output
- All production deps: graphology suite, @alkdev/typebox, yaml
- Dev deps: typescript, vitest, @types/node
- src/ skeleton: schema, graph, analysis, frontmatter, error modules
- test/ directory with 5 placeholder test files
- .gitignore and vitest.config.ts
2026-04-27 09:54:01 +00:00