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

feat(graph): Phase 2 — migrate 7 inline BFS/DFS sites to iter_ancestors/walk_dag

- bisect._ancestors: replace list+deque DFS with iter_ancestors (BFS), reversed for oldest-first - bisect._reachable_from_good: replace inline DFS with ancestor_ids - branch._commit_ancestors: replace inline DFS with ancestor_ids - pack.build_mpack: replace 15-line BFS block with iter_ancestors(exclude=have_set) - pack.collect_object_ids: replace 15-line BFS block with iter_ancestors(exclude=have_set) - _query.walk_commits_bfs: replace inline BFS with iter_ancestors(prune=stop_at_commit_id) - midi/_query.walk_commits_for_track: replace while-loop with iter_ancestors(first_parent_only=True) - iter_ancestors gains prune= parameter, forwarded to walk_dag

Add tests/test_phase2_bfs_migration.py: 27 tests (7 structural + 20 behavioral) covering all 7 migration sites. 86/86 passing.

sha256:6f56135116d5b7b40455fa039c5ba2967a8f07832f3ffe7204585dc598755c89 sha
sha256:47a29c2b7eb5eb892cf04f64ec2a56a1d505b6ad83b545d5674899babffdd1df 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:6f56135116d5b7b40455fa039c5ba2967a8f07832f3ffe7204585dc598755c89 --body "your comment"