gabriel / muse public
fix patch task/push-object-delta #1 / 1
AI Agent gabriel · 150 days ago · Apr 24, 2026 · Diff

fix: push only delta objects — subtract have-snapshot objects in collect_object_ids and walk_commits

A snapshot is a full repo manifest, not a diff. Without subtracting the objects already reachable from have-commits' snapshots, every push sent all ~N objects even when only 1 file changed.

new_objects = objects_in_new_snapshots − objects_in_have_snapshots

Both collect_object_ids and walk_commits now collect have-commit snapshot objects and subtract them before returning. Gracefully skips have-commits whose snapshot is not stored locally (over-sends, does not crash).

Tests: 9 covering unchanged/new/removed/empty delta, walk_commits delta semantics, 10-file and 100-file repos, have=[] regression, missing snapshot.

sha256:9d2b992877f2b4ed7851f806069b17f1cecbe512fd99b507892b87d2925d1581 sha
+36 ~2 symbols
sha256:a207ecbd06e2b8e89af591519983d8667f282a3a8ff1e98d067ece0bc24694bb snapshot
+36
symbols added
~2
symbols modified
0
dead code introduced
Semantic Changes 38 symbols
~ tests/test_push_object_delta.py .py 36 symbols added
+ TestCollectObjectIdsDelta class class TestCollectObjectIdsDelta L117–187
+ test_empty_delta_when_no_changes method method test_empty_delta_when_no_changes L174–187
+ test_new_object_included_when_not_in_have_snapshot method method test_new_object_included_when_not_in_have_snapshot L137–155
+ test_removed_object_excluded method method test_removed_object_excluded L157–172
+ test_unchanged_object_excluded_when_in_have_snapshot method method test_unchanged_object_excluded_when_in_have_snapshot L118–135
+ TestLargeRepoDelta class class TestLargeRepoDelta L259–282
+ test_one_added_file_sends_one_object method method test_one_added_file_sends_one_object L260–282
+ TestMissingHaveSnapshot class class TestMissingHaveSnapshot L313–367
+ test_missing_have_snapshot_treated_as_no_have method method test_missing_have_snapshot_treated_as_no_have L314–367
+ TestMultiFileDelta class class TestMultiFileDelta L224–251
+ test_only_changed_file_sent_in_10_file_repo method method test_only_changed_file_sent_in_10_file_repo L225–251
+ TestNoHaveRegression class class TestNoHaveRegression L290–305
+ test_no_have_sends_all_objects method method test_no_have_sends_all_objects L291–305
+ TestWalkCommitsDelta class class TestWalkCommitsDelta L195–216
+ test_walk_all_object_ids_excludes_have_objects method method test_walk_all_object_ids_excludes_have_objects L196–216
+ _oid function function _oid L54–55
+ _repo function function _repo L58–69
+ _write_commit function function _write_commit L72–103
+ _write_object function function _write_object L106–109
+ CommitRecord import import CommitRecord L40–40
+ Manifest import import Manifest L46–46
+ SnapshotRecord import import SnapshotRecord L40–40
+ __version__ import import __version__ L36–36
+ annotations import import annotations L28–28
+ blob_id import import blob_id L46–46
+ collect_object_ids import import collect_object_ids L38–38
+ compute_commit_id import import compute_commit_id L39–39
+ compute_snapshot_id import import compute_snapshot_id L39–39
+ datetime import import datetime L30–30
+ json import import json L31–31
+ pathlib import import pathlib L32–32
+ pytest import import pytest L34–34
+ walk_commits import import walk_commits L38–38
+ write_commit import import write_commit L40–40
+ write_object import import write_object L37–37
+ write_snapshot import import write_snapshot L40–40
~ muse/core/pack.py .py 2 symbols modified
← Older Oldest on task/push-object-delta
All commits
Newer → Latest on task/push-object-delta

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