feat
BREAKING
graph
task/walk-dag-phase1
#3 / 3
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
+57
~6
symbols
sha256:94b3dd3a6efeb7f8161f0439dca69de8eb1e2983e40520f3a6afc18ec2475306
snapshot
+57
symbols added
~6
symbols modified
0
dead code introduced
Semantic Changes
63 symbols
+
test_exclude_start_node_yields_nothing
method
method test_exclude_start_node_yields_nothing L258–261
+
test_multi_source_exclude_applies_to_all
method
method test_multi_source_exclude_applies_to_all L347–355
+
test_multi_source_shared_ancestor_once
method
method test_multi_source_shared_ancestor_once L338–345
+
test_multi_source_visits_all_reachable
method
method test_multi_source_visits_all_reachable L329–336
← 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.