gabriel / muse public
feat BREAKING graph task/walk-dag-phase1 #3 / 3
AI Agent gabriel · 33 days ago · May 9, 2026 · Diff

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

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:c65ab692776f3962fa99fad05a206247cf433637c3474047d2726a9adb585cac --body "your comment"