-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
milestone:M10M10 LENS — Composable View ProjectionsM10 LENS — Composable View ProjectionsrefactoringCode refactoring without changing functionalityCode refactoring without changing functionalitywave:1Wave 1 — Foundation (lenses + context + contracts)Wave 1 — Foundation (lenses + context + contracts)
Description
LNS-001: Extract DAG Utilities
Parent: #227 (M10 LENS)
What
Extract DAG utilities from src/views.js (lines 305-446) into src/dag.js:
- Adjacency builder (from edge list → adjacency maps)
- Topological sort (Kahn's algorithm)
- Cycle detection
- Chain walking (follow edges from a start node)
- Root finding (nodes with no incoming edges)
Why
These utilities are needed by lenses (LNS-004) and are currently buried in views.js. Extracting them makes them composable and testable in isolation.
Acceptance Criteria
-
src/dag.jsexports:buildAdjacency,topoSort,detectCycles,walkChain,findRoots -
src/views.jsimports fromsrc/dag.js(no duplication) - All existing view tests still pass
- New unit tests for each DAG utility
- No dependencies on graph internals — pure functions on edge arrays
Dependencies
None — can start immediately.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
milestone:M10M10 LENS — Composable View ProjectionsM10 LENS — Composable View ProjectionsrefactoringCode refactoring without changing functionalityCode refactoring without changing functionalitywave:1Wave 1 — Foundation (lenses + context + contracts)Wave 1 — Foundation (lenses + context + contracts)