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
1.3 KiB
ADR-007: Subgraph returns internal-only edges
Status: Accepted
Context
When filtering a graph to a subset of nodes, what happens to edges where only one endpoint is in the filtered set? Options: include cross-boundary edges (external dependencies visible), or strict internal-only (only edges where both endpoints are in the filtered set).
Decision
Strict internal-only. subgraph(filter) returns a new TaskGraph with matching nodes and only edges where both endpoints are in the filtered set. This matches graphology-operators subgraph behavior and produces valid subgraphs for all algorithms (topo sort, betweenness, etc.).
Consequences
Positive
- Result is always a valid (potentially disconnected) subgraph — all algorithms work correctly
- Matches graphology's built-in subgraph behavior
- No surprise external references in analysis results
Negative
- External dependency information is lost — you can't see "what does this subgraph depend on outside itself" from the subgraph alone
Mitigation
External dependency information is available on the original graph via dependencies()/dependents(). A separate externalDependencies(filter) utility can be added later if consumers need "show me what this subgraph depends on outside itself."