feat(graph): Phase 4 — prune gate in pack.py walks and walk_dag in _is_ancestor
collect_object_ids and walk_commits now pass prune=lambda cid: cid in have_set to iter_ancestors instead of exclude=have_set. Semantically equivalent but makes early-termination intent explicit and consistent with the walk_dag API.
_is_ancestor in transport.py replaces the inline while-queue BFS with walk_dag using a bundle-overlay adjacency closure. The closure reads from bundle_by_id first (new push commits) and falls back to read_commit on the remote store (existing commits) — the same two-source logic as before, now routed through the canonical DAG walker.
Tests: 7 new in test_phase4_dag_prune_push.py (P4-1 through P4-7).
sha256:c4cb7dacb49f281563b5e0ac1d2ca8688046850df3e341c3f74add9306b1c608
sha
+26
~3
symbols
sha256:16c9a7913e8833c6ed4c8cf42e724e76d6404b343e4fd3017a60d45aab40a578
snapshot
+26
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes
29 symbols
+
test_p4_1_collect_object_ids_uses_prune
function
function test_p4_1_collect_object_ids_uses_prune L106–119
+
test_p4_3_collect_object_ids_stops_at_have_boundary
function
function test_p4_3_collect_object_ids_stops_at_have_boundary L141–177
+
test_p4_4_is_ancestor_uses_walk_dag
function
function test_p4_4_is_ancestor_uses_walk_dag L184–202
+
test_p4_5_is_ancestor_finds_candidate_in_bundle
function
function test_p4_5_is_ancestor_finds_candidate_in_bundle L209–238
+
test_p4_6_is_ancestor_finds_candidate_in_store
function
function test_p4_6_is_ancestor_finds_candidate_in_store L245–269
+
test_p4_7_is_ancestor_returns_false_for_unreachable
function
function test_p4_7_is_ancestor_returns_false_for_unreachable L276–303
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:c4cb7dacb49f281563b5e0ac1d2ca8688046850df3e341c3f74add9306b1c608 --body "your comment"
No comments yet. Be the first to start the discussion.