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.
2.4 KiB
2.4 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | |||
|---|---|---|---|---|---|---|---|---|---|---|
| cost-benefit/dag-propagation | Implement DAG-propagation effective probability computation | pending |
|
moderate | high | phase | implementation |
Description
Implement the DAG-propagation cost model in src/analysis/cost-benefit.ts. This is the core algorithmic contribution beyond the Rust CLI — it captures the structural reality that upstream failures multiply downstream damage.
Per cost-benefit.md, the algorithm:
- Processes tasks in topological order
- For each task with prerequisites, computes
pEffectivefrom intrinsic probability + upstream propagation - Upstream propagation:
parentP + (1 - parentP) × qualityRetentionfor each parent pEffective= intrinsic × product of all inherited quality factors
Acceptance Criteria
computeEffectiveP(taskId, graph, upstreamSuccessProbs, defaultQualityRetention, propagationMode)— internal helper- In
dag-propagatemode: for each task in topological order:- Get intrinsic probability from
resolveDefaults(risk).successProbability - For each prerequisite, compute inherited quality:
parentP + (1 - parentP) × qualityRetention pEffective= intrinsic × product of all inherited quality factors- Store task's actual success probability for downstream propagation (use
pEffectiveif this is the task's real probability)
- Get intrinsic probability from
- In
independentmode:pEffective = pIntrinsic(no propagation) - Completed tasks (
status: "completed"): propagate withp = 1.0whenincludeCompleted: false qualityRetentionper edge defaults to 0.9, can be overridden per-edge viadefaultQualityRetentionoption or edge attributes- Throws
CircularDependencyErrorif graph is cyclic (needs topo sort) - Unit tests: simple chain (verify compounding effect), diamond graph, independent vs dag-propagate comparison matches Python research model results, completed task exclusion/propagation semantics
References
- docs/architecture/cost-benefit.md — DAG-propagation algorithm, qualityRetention semantics
- docs/architecture/decisions/004-workflow-cost-dag-propagation.md — ADR-004
- docs/architecture/decisions/005-no-depth-escalation-v1.md — no depth escalation in v1
Notes
To be filled by implementation agent
Summary
To be filled on completion