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

feat(graph): Phase 3 — migrate non-commit graph DFS sites to walk_dag

- shard._connected_components: replace inline stack DFS with walk_dag(order='dfs'); global_seen passed as exclude so each component walk stops at already-visited nodes - identity/dag._DAG.would_cycle: replace inline stack DFS with walk_dag(order='dfs'); early-return on first node == frm

Intentional exceptions (not migrated): - callgraph.transitive_callers / transitive_callees: output is {depth: [names]}, depth tracking is incompatible with walk_dag's flat node stream

Add tests/test_phase3_noncmt_bfs_migration.py: 18 tests (2 structural + 16 behavioral). 104/104 passing across all graph test files.

sha256:c2222f4fd565546c032d4c542bc1186f453a8760a667a152a8d0f85ea8081573 sha
+24 ~3 symbols
sha256:d0f15bd8ab9cd03dc671a70935858102e0e6b7d773af86e4da635a82eec5ad23 snapshot
+24
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes 27 symbols
+ TestDagWouldCycle class class TestDagWouldCycle L91–150
+ _cls method method _cls L92–94
+ test_back_edge_is_cycle method method test_back_edge_is_cycle L118–122
+ test_diamond_cycle_detection method method test_diamond_cycle_detection L138–145
+ test_direct_forward_edge_no_cycle method method test_direct_forward_edge_no_cycle L112–116
+ test_no_edges_no_cycle method method test_no_edges_no_cycle L108–110
+ test_no_transitive_cycle method method test_no_transitive_cycle L131–136
+ test_self_loop_is_cycle method method test_self_loop_is_cycle L104–106
+ test_structural_no_inline_dfs method method test_structural_no_inline_dfs L96–102
+ test_transitive_cycle method method test_transitive_cycle L124–129
+ test_unrelated_nodes_no_cycle method method test_unrelated_nodes_no_cycle L147–150
+ TestShardConnectedComponents class class TestShardConnectedComponents L26–84
+ _fn method method _fn L27–29
+ test_edges_are_undirected method method test_edges_are_undirected L68–72
+ test_empty_input method method test_empty_input L74–75
+ test_no_node_duplicated_across_components method method test_no_node_duplicated_across_components L77–84
+ test_single_node_single_component method method test_single_node_single_component L39–42
+ test_structural_no_inline_dfs method method test_structural_no_inline_dfs L31–37
+ test_triangle_one_component method method test_triangle_one_component L56–59
+ test_two_connected_nodes_one_component method method test_two_connected_nodes_one_component L44–47
+ test_two_disconnected_nodes_two_components method method test_two_disconnected_nodes_two_components L49–54
+ test_two_disconnected_pairs method method test_two_disconnected_pairs L61–66
+ annotations import import annotations L17–17
+ inspect import import inspect L19–19
~ muse/plugins/identity/dag.py .py 2 symbols modified

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:c2222f4fd565546c032d4c542bc1186f453a8760a667a152a8d0f85ea8081573 --body "your comment"