gabriel / muse public
feat patch task/fetch-bundle-transport #1 / 1
AI Agent gabriel · 120 days ago · May 11, 2026 · Diff

feat: fetch_bundle on HttpTransport and LocalFileTransport (issue #47)

Add fetch_bundle(url, signing, want, have, *, on_object, ttl_seconds) to both transport classes and the MuseTransport Protocol.

HttpTransport: - POST /fetch/bundle → msgpack FetchBundleResult - presign=False: bundle bytes inline - presign=True: GET presigned_url for bundle bytes - sha256(bytes) == bundle_id verified before unpack — one hash, all contents - on_object callback dispatched for each object in the bundle - Non-200 from POST or presigned GET → TransportError - Integrity mismatch → TransportError

LocalFileTransport: - Delegates to fetch_stream unconditionally (no presign on loopback)

8 TDD tests (FB0-FB7): inline path, sha256 mismatch, presigned path, presigned mismatch, on_object callback, POST 404, GET 403, local delegate.

sha256:c11c5c2baf74148416c72f75f1b2a0cba802429cd2aaf22cfefe18b8eefa0f50 sha
+30 ~3 symbols
sha256:c9e9b3d1cc849a937690cf293ab55d269666db32d934e0c4c8f6697763a0323c snapshot
+30
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes 33 symbols
~ tests/test_transport_fetch_bundle.py .py 27 symbols added
+ _Resp class class _Resp L93–96
+ __init__ method method __init__ L94–96
+ _URL variable variable _URL L32–32
+ _inline_response function function _inline_response L69–78
+ _make_bundle function function _make_bundle L35–66
+ _mock_client function function _mock_client L99–106
+ _presign_response function function _presign_response L81–90
+ FetchStreamResult import import FetchStreamResult L26–26
+ HttpTransport import import HttpTransport L26–26
+ MagicMock import import MagicMock L20–20
+ ObjectPayload import import ObjectPayload L25–25
+ TransportError import import TransportError L26–26
+ annotations import import annotations L17–17
+ blob_id import import blob_id L27–27
+ fake_id import import fake_id L27–27
+ hashlib import import hashlib L19–19
+ msgpack import import msgpack L22–22
+ patch import import patch L20–20
+ pytest import import pytest L23–23
+ test_fb0_inline_bundle_returns_fetch_result function function test_fb0_inline_bundle_returns_fetch_result L113–127
+ test_fb1_inline_sha256_mismatch_raises function function test_fb1_inline_sha256_mismatch_raises L134–147
+ test_fb2_presigned_url_bundle_returns_fetch_result function function test_fb2_presigned_url_bundle_returns_fetch_result L154–169
+ test_fb3_presigned_sha256_mismatch_raises function function test_fb3_presigned_sha256_mismatch_raises L176–190
+ test_fb4_on_object_called_for_each_bundle_object function function test_fb4_on_object_called_for_each_bundle_object L197–219
+ test_fb5_post_non_200_raises function function test_fb5_post_non_200_raises L226–234
+ test_fb6_presigned_get_non_200_raises function function test_fb6_presigned_get_non_200_raises L241–254
+ test_fb7_local_transport_delegates_to_fetch_stream function function test_fb7_local_transport_delegates_to_fetch_stream L261–284
~ muse/core/transport.py .py 3 symbols added, 3 symbols modified
+ fetch_bundle method method fetch_bundle L1516–1621
+ fetch_bundle method method fetch_bundle L2225–2236
+ fetch_bundle method method fetch_bundle L704–735
← Older Oldest on task/fetch-bundle-transport
All commits
Newer → Latest on task/fetch-bundle-transport

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