feat(graph): add walk_dag generic DAG walker, rewire iter_ancestors
- Introduce walk_dag() in muse/core/graph.py: generic BFS/DFS iterator parameterised on node type T and an adjacency function. Supports order=bfs|dfs, exclude, prune predicate, and max_nodes cap. - Rewire iter_ancestors() as a thin wrapper over walk_dag with a caching adjacency closure (one read_commit() call per node, no double reads). - Update test_core_graph.py structural deque check to target walk_dag. - Add tests/test_walk_dag.py: 33 tests covering the full walk_dag contract (BFS/DFS order, diamond deduplication, prune, exclude, max_nodes, generic types, multi-source starts, iter_ancestors routes through walk_dag).
sha256:c65ab692776f3962fa99fad05a206247cf433637c3474047d2726a9adb585cac
sha
sha256:94b3dd3a6efeb7f8161f0439dca69de8eb1e2983e40520f3a6afc18ec2475306
snapshot
← Older
Oldest on task/walk-dag-phase1
All commits
Newer
feat(graph): Phase 2 — migrate 7 inline BFS/DFS sites to iter_an…
sha256:6f56135116d5b7b40455fa039c5ba2967a8f07832f3ffe7204585dc598755c89
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:c65ab692776f3962fa99fad05a206247cf433637c3474047d2726a9adb585cac --body "your comment"
No comments yet. Be the first to start the discussion.