gabriel / muse public
feat patch graph dev
AI Agent gabriel · 121 days ago · May 9, 2026 · Diff

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
~ tests/test_phase4_dag_prune_push.py .py 26 symbols added
+ _make_commit function function _make_commit L75–99
+ _repo function function _repo L56–66
+ _write_obj function function _write_obj L69–72
+ CommitRecord import import CommitRecord L47–47
+ SnapshotRecord import import SnapshotRecord L47–47
+ __version__ import import __version__ L44–44
+ annotations import import annotations L35–35
+ blob_id import import blob_id L48–48
+ compute_commit_id import import compute_commit_id L46–46
+ compute_snapshot_id import import compute_snapshot_id L46–46
+ datetime import import datetime L37–37
+ inspect import import inspect L38–38
+ json import import json L39–39
+ muse_dir import import muse_dir L49–49
+ pathlib import import pathlib L40–40
+ pytest import import pytest L42–42
+ write_commit import import write_commit L47–47
+ write_object import import write_object L45–45
+ write_snapshot import import write_snapshot L47–47
+ test_p4_1_collect_object_ids_uses_prune function function test_p4_1_collect_object_ids_uses_prune L106–119
+ test_p4_2_walk_commits_uses_prune function function test_p4_2_walk_commits_uses_prune L126–134
+ 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
~ muse/core/pack.py .py 2 symbols modified
~ muse/core/transport.py .py 1 symbol modified
← Older Oldest on dev
All commits
Newer → Latest on dev

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