Files
taskgraph_ts/docs/architecture/decisions/004-workflow-cost-dag-propagation.md
glm-5.1 bde1cc4e70 Decompose monolithic architecture.md into modular docs/architecture/ documents
The 751-line architecture.md violated the SDD process modular documentation
target (~500 lines). It also had duplicate TaskGraph class definitions (one
monolith, one decomposed) that directly contradicted each other, and embedded
consumer-specific tool dispatch mappings that belong in downstream projects.

Changes:
- Split into 8 focused documents + 7 ADR records + redirect page
- Removed the monolithic TaskGraph class (kept only decomposed version)
- Moved CLI→plugin dispatch mapping out (belongs in plugin architecture)
- Extracted implementation code (frontmatter splitter, findCycles, DAG
  propagation) into WHAT/WHY descriptions per architect role spec
- Added proper ADR format for all resolved design decisions
- Fixed review issues: C_fail mapping, DuplicateNodeError/DuplicateEdgeError
  types, ValidationError/GraphValidationError definitions, mutation error
  handling contract, enum naming convention, validation timing clarification
2026-04-26 06:38:52 +00:00

1.6 KiB

ADR-004: DAG-propagation as default workflow cost model

Status: Accepted

Context

The Rust CLI computes expected value per-task independently — no upstream quality degradation. The Python research model implements DAG-propagation where each parent's failure degrades the child's effective probability. The independent model is dangerously optimistic for non-trivial workflows: poor planning (p=0.65) shows a 213% cost increase vs good planning (p=0.92) with the propagation model, but barely any difference with the independent model.

Decision

DAG-propagation is the default mode. The independent model is a degenerate case accessible via propagationMode: 'independent' or defaultQualityDegradation: 0.

Consequences

Positive

  • More accurate cost estimates — captures the structural reality that upstream failures multiply downstream damage
  • Per-task output includes both pIntrinsic and pEffective so consumers can see the degradation effect
  • The independent model is still available as an opt-in degenerate case
  • Per-edge qualityDegradation allows fine-grained modeling of how much each dependency bleeds failure

Negative

  • More complex implementation than simple sum
  • Results differ from the Rust CLI — consumers migrating from CLI to library will see different numbers
  • Requires qualityDegradation per edge (default 0.9) which adds a concept the Rust CLI didn't have

Mitigation

The propagationMode option allows consumers to start with the independent model and migrate to DAG-propagation when ready. The per-task pIntrinsic/pEffective split makes the propagation effect transparent.