gabriel / muse public
feat BREAKING pack task/delta-snapshot-wire #1 / 1
AI Agent gabriel · 120 days ago · May 11, 2026 · Diff

feat(pack): delta-encode snapshots in MPackBundle wire format

Replace full manifest blobs with delta chains in MPackBundle: - Add SnapshotDeltaDict wire type: {snapshot_id, parent_snapshot_id, delta_add, delta_remove} - Add _build_snapshot_deltas: emit only changed paths relative to parent manifest - Add _apply_snapshot_deltas: reconstruct + verify full manifests from delta chain - Update build_mpack and build_mpack_from_walk to emit deltas - Update apply_mpack to reconstruct SnapshotRecords from deltas - Add test_mpack_delta_format.py: 5 tests covering delta correctness and wire size

For a 100-commit chain each touching one file in a 50-file repo, delta snapshots are < 2% of full-manifest size.

sha256:51ce277f663e01a43eaffbe77509b1de7ac2d4251b55d23306304bcdeb92c90d sha
+35 ~5 symbols
1033 changed · 1033 in snapshot files
sha256:dc204c99e9f38b729d378f3190eaf531fa52c1ecad67ee312da2c0b9d61d52a5 snapshot
+35
symbols added
~5
symbols modified
1033
files changed
1033
files in snapshot
0
dead code introduced
Semantic Changes 40 symbols
~ tests/test_mpack_delta_format.py .py 31 symbols added
+ _BLOB_SIZE variable variable _BLOB_SIZE L61–61
+ _N_BASE_FILES variable variable _N_BASE_FILES L59–59
+ _N_COMMITS variable variable _N_COMMITS L60–60
+ _make_blob function function _make_blob L64–66
+ _make_commit_id function function _make_commit_id L125–133
+ _make_repo function function _make_repo L46–56
+ _populate_chain function function _populate_chain L69–122
+ _reconstruct_from_deltas function function _reconstruct_from_deltas L136–154
+ CommitRecord import import CommitRecord L31–31
+ MPackBundle import import MPackBundle L28–28
+ SnapshotRecord import import SnapshotRecord L31–31
+ annotations import import annotations L19–19
+ apply_mpack import import apply_mpack L28–28
+ blob_id import import blob_id L39–39
+ build_mpack import import build_mpack L28–28
+ compute_snapshot_id import import compute_snapshot_id L30–30
+ datetime import import datetime L21–21
+ hashlib import import hashlib L22–22
+ muse_dir import import muse_dir L29–29
+ pathlib import import pathlib L23–23
+ pytest import import pytest L25–25
+ read_snapshot import import read_snapshot L31–31
+ write_branch_ref import import write_branch_ref L31–31
+ write_commit import import write_commit L31–31
+ write_object import import write_object L27–27
+ write_snapshot import import write_snapshot L31–31
+ test_apply_mpack_reconstructs_snapshots_from_deltas function function test_apply_mpack_reconstructs_snapshots_from_deltas L242–261
+ test_bundle_snapshots_are_deltas function function test_bundle_snapshots_are_deltas L161–174
+ test_delta_bundle_smaller_than_full_manifest function function test_delta_bundle_smaller_than_full_manifest L211–239
+ test_delta_reconstruction_proves_snapshot_id function function test_delta_reconstruction_proves_snapshot_id L177–187
+ test_only_first_snapshot_has_full_manifest function function test_only_first_snapshot_has_full_manifest L190–208
~ muse/cli/commands/push.py .py 1 symbol modified
~ muse/core/pack.py .py 4 symbols added, 4 symbols modified
+ SnapshotDeltaDict class class SnapshotDeltaDict L150–176
+ _apply_snapshot_deltas function function _apply_snapshot_deltas L441–476
+ _build_snapshot_deltas function function _build_snapshot_deltas L388–438
+ compute_snapshot_id import import compute_snapshot_id L41–41
Files Changed
+1033
1033 in snapshot
+ .coverage .coverage
+ .cursorrules .cursorrules
+ .museattributes .museattributes
+ .museignore .museignore
+ .windsurfrules .windsurfrules
+ AGENTS.md .md
+ CLAUDE.md .md
+ README.md .md
+ dev-setup.sh .sh
+ out/docs.md .md
+ pyproject.toml .toml
← Older Oldest on task/delta-snapshot-wire
All commits
Newer → Latest on task/delta-snapshot-wire

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