gabriel / muse public
feat BREAKING mpack task/mpack-protocol #3 / 4
AI Agent gabriel · 163 days ago · Apr 17, 2026 · Diff

feat(mpack): wire MPackStreamWriter/Reader into transport push_stream and fetch_stream

- push_stream: replaced inline msgpack.packb frame construction with MPackStreamWriter — H frame now carries v=mpack/1.0 and op=push, O frames carry sz (uncompressed byte count), compression uses choose_compression() (zstd when available, zlib fallback) - fetch_stream: replaced manual zlib-only decompression with MPackStreamReader.decompress_object() — now handles both zstd and zlib - Both methods flip Content-Type and Accept headers to application/x-muse-mpack (was application/x-muse-packstream) - LocalFileTransport.push_stream: new method — mirrors push_pack but accepts the objects/commits/snapshots lists used by the streaming path; includes fast-forward check and branch ref update - tests/test_mpack_transport.py: 28 TDD tests covering content-type, H/O/E frame fields, frame sequence, response parsing (P/X/R), zstd decompression, and all LocalFileTransport.push_stream behaviours

sha256:67412443a7c7cb446b2b87fb467f126a68a1e4b5e33867dd1280ad33e4cb3d6a sha
+60 ~4 symbols
sha256:a894379be9bd128f1134cf2015509ba32c9acb3f3dcff6163604ed6fe60b559b snapshot
+60
symbols added
~4
symbols modified
0
dead code introduced
Semantic Changes 64 symbols
~ tests/test_mpack_transport.py .py 59 symbols added
+ TestFetchStreamContentType class class TestFetchStreamContentType L448–463
+ test_fetch_stream_accept_uses_mpack_content_type method method test_fetch_stream_accept_uses_mpack_content_type L457–463
+ test_fetch_stream_uses_mpack_content_type method method test_fetch_stream_uses_mpack_content_type L449–455
+ TestFetchStreamDecompression class class TestFetchStreamDecompression L471–559
+ _make_fetch_response_with_object method method _make_fetch_response_with_object L472–492
+ test_fetch_stream_decompresses_zlib_objects method method test_fetch_stream_decompresses_zlib_objects L494–514
+ test_fetch_stream_decompresses_zstd_objects method method test_fetch_stream_decompresses_zstd_objects L516–540
+ test_fetch_stream_objects_received_count method method test_fetch_stream_objects_received_count L542–559
+ TestLocalFileTransportPushStream class class TestLocalFileTransportPushStream L567–758
+ test_push_stream_method_exists method method test_push_stream_method_exists L568–574
+ test_push_stream_returns_push_result method method test_push_stream_returns_push_result L742–758
+ test_push_stream_updates_branch_ref method method test_push_stream_updates_branch_ref L689–740
+ test_push_stream_writes_commit_to_remote method method test_push_stream_writes_commit_to_remote L576–630
+ test_push_stream_writes_objects_to_remote method method test_push_stream_writes_objects_to_remote L632–687
+ TestPushStreamContentType class class TestPushStreamContentType L182–197
+ test_push_stream_accept_uses_mpack_content_type method method test_push_stream_accept_uses_mpack_content_type L191–197
+ test_push_stream_uses_mpack_content_type method method test_push_stream_uses_mpack_content_type L183–189
+ TestPushStreamFrameSequence class class TestPushStreamFrameSequence L333–375
+ test_e_frame_n_objects_matches_actual method method test_e_frame_n_objects_matches_actual L364–375
+ test_frame_sequence_h_c_e method method test_frame_sequence_h_c_e L334–344
+ test_frame_sequence_h_o_c_e_with_objects method method test_frame_sequence_h_o_c_e_with_objects L346–362
+ TestPushStreamHFrame class class TestPushStreamHFrame L205–249
+ test_h_frame_branch_matches method method test_h_frame_branch_matches L232–238
+ test_h_frame_has_op_push method method test_h_frame_has_op_push L224–230
+ test_h_frame_has_protocol_version method method test_h_frame_has_protocol_version L214–222
+ test_h_frame_is_first method method test_h_frame_is_first L206–212
+ test_h_frame_n_objects_advisory_count method method test_h_frame_n_objects_advisory_count L240–249
+ TestPushStreamOFrames class class TestPushStreamOFrames L257–325
+ test_multiple_objects_all_have_sz method method test_multiple_objects_all_have_sz L313–325
+ test_o_frame_content_decompresses_to_original method method test_o_frame_content_decompresses_to_original L284–295
+ test_o_frame_has_sz_field method method test_o_frame_has_sz_field L258–271
+ test_o_frame_id_matches_object_id method method test_o_frame_id_matches_object_id L273–282
+ test_o_frame_uses_best_compression method method test_o_frame_uses_best_compression L297–311
+ TestPushStreamResponseParsing class class TestPushStreamResponseParsing L383–440
+ test_error_frame_raises_transport_error method method test_error_frame_raises_transport_error L395–416
+ test_progress_frame_does_not_raise method method test_progress_frame_does_not_raise L384–393
+ test_result_frame_ok_returns_push_result method method test_result_frame_ok_returns_push_result L418–440
+ _capture_fetch_request function function _capture_fetch_request L124–162
+ _capture_push_request function function _capture_push_request L67–121
+ _make_repo function function _make_repo L165–174
+ _make_signing function function _make_signing L48–50
+ _mock_stream_response function function _mock_stream_response L53–64
+ BytesIO import import BytesIO L23–23
+ HttpTransport import import HttpTransport L34–34
+ LocalFileTransport import import LocalFileTransport L34–34
+ MPACK_CONTENT_TYPE import import MPACK_CONTENT_TYPE L28–28
+ MPACK_VERSION import import MPACK_VERSION L28–28
+ MPackStreamReader import import MPackStreamReader L28–28
+ MPackStreamWriter import import MPackStreamWriter L28–28
+ PushResult import import PushResult L34–34
+ SigningIdentity import import SigningIdentity L34–34
+ TransportError import import TransportError L34–34
+ annotations import import annotations L17–17
+ hashlib import import hashlib L19–19
+ json import import json L20–20
+ msgpack import import msgpack L25–25
+ pathlib import import pathlib L21–21
+ pytest import import pytest L26–26
+ mock import import unittest.mock L22–22
~ muse/core/transport.py .py 1 symbol added, 4 symbols modified
+ push_stream method method push_stream L2151–2260

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