Break the @alkdev/taskgraph architecture specs into dependency-ordered implementation tasks across 8 component directories: setup, schema, error, graph, analysis, cost-benefit, frontmatter, api, and review. Each task has clear acceptance criteria referencing specific architecture docs. Three review tasks serve as quality gates at critical junction points (schemas-and-errors, graph-complete, complete-library). The dependency graph is validated acyclic with 9 topological levels enabling significant parallelism across independent work streams.
1.6 KiB
1.6 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | ||
|---|---|---|---|---|---|---|---|---|---|
| analysis/critical-path | Implement criticalPath and weightedCriticalPath functions | pending |
|
moderate | medium | component | implementation |
Description
Implement criticalPath and weightedCriticalPath as standalone functions. criticalPath finds the longest path from sources to sinks using default edge weighting. weightedCriticalPath accepts a custom weight function for per-node weighting.
criticalPath can be implemented via topological order + dynamic programming (longest path in DAG). For unweighted, each edge has weight 1; for weighted, each node contributes a weight.
Acceptance Criteria
criticalPath(graph: TaskGraph): string[]— returns the longest path as an ordered array of task IDsweightedCriticalPath(graph: TaskGraph, weightFn: (taskId: string, attrs: TaskGraphNodeAttributes) => number): string[]— returns the path with the highest cumulative weight- Both functions throw
CircularDependencyErrorif graph is cyclic - When multiple paths tie, returns any one of them (deterministic order preferred)
- Empty graph returns
[]; single-node graph returns[nodeId] - Unit tests: linear chain (the chain itself is critical path), diamond graph (tests path selection), weighted variant with diverse scope values
References
- docs/architecture/api-surface.md — criticalPath, weightedCriticalPath signatures
- docs/architecture/graph-model.md — edge direction (prerequisite→dependent determines source→sink)
Notes
To be filled by implementation agent
Summary
To be filled on completion