gabriel / muse public
feat BREAKING transport task/fetch-phase2-tdd #2 / 2
AI Agent gabriel · 120 days ago · May 16, 2026 · Diff

feat(transport): Phase 2 fetch protocol — single presigned URL, sha256 integrity gate

Replace the three old fetch branches (pack_fetch multi-URL, presign flag, inline bytes) with the single Phase 2 shape: server returns {mpack_url, mpack_id, commit_count, object_count}. Client GETs mpack_url directly, verifies blob_id(bytes) == mpack_id before unpacking, raises TransportError on mismatch or non-200. Null mpack_url = up-to-date, returns empty result.

Adds TDD suite (FM-1 through FM-6) — all 6 pass. Removes unused hashlib import; adds blob_id to types import.

sha256:e2565387467fbe2db8d97866d9f57c693cf0f6a6421379a89b60952fbf05504a sha
+23 ~3 −1 symbols
sha256:d2763a3a27e12488ee11aa7e655db47623988b87ad7ee130e638c03cd477da79 snapshot
+23
symbols added
~3
symbols modified
−1
symbol removed
0
dead code introduced
Semantic Changes 27 symbols
~ tests/test_transport_fetch_phase2.py .py 22 symbols added
+ _Resp class class _Resp L77–80
+ __init__ method method __init__ L78–80
+ _URL variable variable _URL L39–39
+ _fetch_response function function _fetch_response L66–74
+ _make_mpack function function _make_mpack L44–63
+ _mock_client function function _mock_client L83–91
+ FetchMPackResult import import FetchMPackResult L36–36
+ HttpTransport import import HttpTransport L36–36
+ MagicMock import import MagicMock L31–31
+ TransportError import import TransportError L36–36
+ annotations import import annotations L29–29
+ blob_id import import blob_id L37–37
+ fake_id import import fake_id L37–37
+ msgpack import import msgpack L33–33
+ patch import import patch L31–31
+ pytest import import pytest L34–34
+ test_fm1_normal_fetch_returns_result function function test_fm1_normal_fetch_returns_result L96–112
+ test_fm2_sha256_mismatch_raises function function test_fm2_sha256_mismatch_raises L117–131
+ test_fm3_non200_get_raises function function test_fm3_non200_get_raises L136–149
+ test_fm4_non200_post_raises function function test_fm4_non200_post_raises L154–165
+ test_fm5_null_mpack_url_means_up_to_date function function test_fm5_null_mpack_url_means_up_to_date L170–182
+ test_fm6_on_object_callback_called_for_each_object function function test_fm6_on_object_callback_called_for_each_object L187–205
~ muse/core/transport.py .py 1 symbol added, 1 symbol removed, 3 symbols modified
hashlib import import hashlib L41–41
+ blob_id import import blob_id L83–83

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