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.
38 lines
1.3 KiB
Markdown
38 lines
1.3 KiB
Markdown
---
|
|
id: analysis/parallel-groups
|
|
name: Implement parallelGroups analysis function
|
|
status: pending
|
|
depends_on:
|
|
- graph/construction
|
|
- graph/queries
|
|
scope: narrow
|
|
risk: low
|
|
impact: component
|
|
level: implementation
|
|
---
|
|
|
|
## Description
|
|
|
|
Implement `parallelGroups(graph: TaskGraph): string[][]` in `src/analysis/index.ts` or a dedicated module. This returns groups of tasks that can be executed concurrently — tasks at the same topological depth. Uses `graphology-dag.topologicalGenerations`.
|
|
|
|
## Acceptance Criteria
|
|
|
|
- [ ] `parallelGroups` returns `string[][]` where each inner array is a generation of tasks at the same depth from sources
|
|
- [ ] Uses `graphology-dag.topologicalGenerations()` for the generation computation
|
|
- [ ] Tasks with zero prerequisites are in the first group
|
|
- [ ] Throws `CircularDependencyError` if the graph is cyclic (delegated to `topologicalGenerations` behavior)
|
|
- [ ] Works on disconnected graphs (each connected component sorted independently, then merged by depth)
|
|
- [ ] Unit tests: linear chain (each group size 1), diamond graph, disconnected components
|
|
|
|
## References
|
|
|
|
- docs/architecture/api-surface.md — parallelGroups signature
|
|
- docs/architecture/graph-model.md — parallel groups definition
|
|
|
|
## Notes
|
|
|
|
> To be filled by implementation agent
|
|
|
|
## Summary
|
|
|
|
> To be filled on completion |