gabriel / muse public
refactor BREAKING dev
AI Agent gabriel · 114 days ago · May 16, 2026 · Diff

refactor: delete MWP streaming and LocalFileTransport; wire fetch_bundle into all paths

- Delete MWP (Muse Wire Protocol) streaming machinery from transport.py: _frame_generator, push_stream_coro, fetch_stream, fetch_presign_or_stream, negotiate, NegotiateResponse, negotiate_have, _is_ancestor, _CommitBundle, MAX_C_FRAME_BYTES, COMMIT_CHUNK_SIZE, OC_CHUNK_SIZE, NEGOTIATE_DEPTH - Delete LocalFileTransport (file:// transport, not used in production) - Simplify make_transport() to always return HttpTransport() - Remove MuseTransport.push_stream / fetch_stream / negotiate protocol stubs - pull.py: remove stale LocalFileTransport type annotation on transport var - Delete 5 test files whose sole purpose was MWP/LocalFileTransport coverage: test_fetch_presign_routing.py, test_local_file_transport.py, test_mpack_e2e.py, test_push_object_integrity.py, test_wire_snapshot_delta.py - Rewrite test_cmd_pull_hardening.py: delete TestNegotiateHave, TestStress, two_repos fixture; rewrite TestEndToEnd with mocked transport (36 pass) - Clean test_fetch_bundle_command_wiring.py of MWP references (3 pass) - Clean test_pull_missing_snapshot_guard.py docstrings of LocalFileTransport refs - All 244 tests pass

sha256:f8d688e3d663900a4d2d1103122c004c7ece454c963cf498a9babc29b458a673 sha
+13 ~88 −285 symbols
sha256:d1032d9cc0bd8dc846b709685773c533f35614c0747e6439bbac34f741a47253 snapshot
+13
symbols added
~88
symbols modified
−285
symbols removed
0
dead code introduced
Semantic Changes 386 symbols
~ tests/test_fetch_presign_routing.py .py 32 symbols removed
ObjectMap variable variable ObjectMap L52–52
ObjectUrlMap variable variable ObjectUrlMap L53–53
_COMMIT_ID variable variable _COMMIT_ID L64–64
_REPO_ID variable variable _REPO_ID L63–63
_SNAP_ID variable variable _SNAP_ID L65–65
_is_loopback function function _is_loopback L59–60
_make_objects function function _make_objects L68–70
_make_presign_response function function _make_presign_response L73–98
AsyncMock import import AsyncMock L40–40
MagicMock import import MagicMock L40–40
ObjectPayload import import ObjectPayload L50–50
annotations import import annotations L38–38
call import import call L40–40
fake_id import import fake_id L48–48
io import import io L41–41
msgpack import import msgpack L43–43
muse_dir import import muse_dir L49–49
patch import import patch L40–40
pathlib import import pathlib L46–46
pytest import import pytest L44–44
test_fpr4_server_presign_false_falls_through_to_stream function async_function test_fpr4_server_presign_false_falls_through_to_stream L106–153
test_fpr5_server_presign_true_skips_stream function async_function test_fpr5_server_presign_true_skips_stream L161–199
test_fpr6_presigned_objects_dispatched_via_on_object function function test_fpr6_presigned_objects_dispatched_via_on_object L206–251
test_fpr7_small_repo_delegates_to_fetch_stream function function test_fpr7_small_repo_delegates_to_fetch_stream L258–301
test_fpr8_large_repo_presign_returns_correct_shape function function test_fpr8_large_repo_presign_returns_correct_shape L308–347
test_fpr9_presigned_get_error_raises_transport_error function function test_fpr9_presigned_get_error_raises_transport_error L354–381
test_fprp0_on_object_receives_all_presigned_objects function function test_fprp0_on_object_receives_all_presigned_objects L545–585
test_fprp1_no_on_object_calls_for_empty_presign_response function function test_fprp1_no_on_object_calls_for_empty_presign_response L592–636
test_fprs0_local_transport_never_hits_presign_endpoint function function test_fprs0_local_transport_never_hits_presign_endpoint L392–421
test_fprs1_loopback_url_classification class function test_fprs1_loopback_url_classification L428–434
test_fprst0_one_failing_get_raises_transport_error function function test_fprst0_one_failing_get_raises_transport_error L445–486
test_fprst1_n_parallel_gets_all_dispatched function function test_fprst1_n_parallel_gets_all_dispatched L493–534
~ tests/test_local_file_transport.py .py 59 symbols removed
TestFetchRemoteInfo class class TestFetchRemoteInfo L175–208
test_corrupted_repo_json_raises_transport_error method method test_corrupted_repo_json_raises_transport_error L203–208
test_multiple_branches_returned method method test_multiple_branches_returned L186–193
test_reads_repo_json_and_branch_heads method method test_reads_repo_json_and_branch_heads L176–184
test_token_is_ignored method method test_token_is_ignored L195–201
TestIntegrationRoundTrip class class TestIntegrationRoundTrip L276–338
test_fetch_stream_after_push method method test_fetch_stream_after_push L290–301
test_incremental_push_is_fast_forward method method test_incremental_push_is_fast_forward L321–338
test_multi_branch_round_trip method method test_multi_branch_round_trip L303–319
test_push_then_fetch_info method method test_push_then_fetch_info L277–288
TestMakeTransport class class TestMakeTransport L231–242
test_empty_url_returns_http_transport method method test_empty_url_returns_http_transport L241–242
test_file_url_returns_local_transport method method test_file_url_returns_local_transport L232–233
test_http_url_returns_http_transport method method test_http_url_returns_http_transport L238–239
test_https_url_returns_http_transport method method test_https_url_returns_http_transport L235–236
TestRepoRoot class class TestRepoRoot L124–167
test_invalid_scheme_raises_transport_error method method test_invalid_scheme_raises_transport_error L131–133
test_missing_muse_dir_raises_404 method method test_missing_muse_dir_raises_404 L135–139
test_path_with_double_dots_normalized method method test_path_with_double_dots_normalized L141–148
test_symlink_target_with_no_muse_is_rejected method method test_symlink_target_with_no_muse_is_rejected L150–158
test_symlink_to_valid_repo_is_accepted method method test_symlink_to_valid_repo_is_accepted L160–167
test_valid_url_returns_resolved_path method method test_valid_url_returns_resolved_path L125–129
TestStress class class TestStress L346–410
test_fetch_stream_large_bundle method method test_fetch_stream_large_bundle L394–410
test_push_large_bundle method method test_push_large_bundle L347–392
_add_commit function function _add_commit L77–116
_make_repo function function _make_repo L63–74
_push function function _push L250–273
CommitRecord import import CommitRecord L36–36
HttpTransport import import HttpTransport L47–47
LocalFileTransport import import LocalFileTransport L47–47
Manifest import import Manifest L46–46
Mapping import import Mapping L21–21
SnapshotRecord import import SnapshotRecord L36–36
TransportError import import TransportError L47–47
__version__ import import __version__ L32–32
annotations import import annotations L20–20
base64 import import base64 L23–23
blob_id import import blob_id L46–46
build_mpack import import build_mpack L34–34
compute_commit_id import import compute_commit_id L35–35
compute_snapshot_id import import compute_snapshot_id L35–35
datetime import import datetime L24–24
get_all_branch_heads import import get_all_branch_heads L36–36
get_head_commit_id import import get_head_commit_id L36–36
hashlib import import hashlib L25–25
heads_dir import import heads_dir L53–53
json import import json L26–26
make_transport import import make_transport L47–47
muse_dir import import muse_dir L53–53
os import import os L27–27
pathlib import import pathlib L28–28
pytest import import pytest L30–30
read_commit import import read_commit L36–36
ref_path import import ref_path L53–53
repo_json_path import import repo_json_path L53–53
write_commit import import write_commit L36–36
write_object import import write_object L33–33
write_snapshot import import write_snapshot L36–36
~ tests/test_mpack_e2e.py .py 53 symbols removed
TestObjectIntegrity class class TestObjectIntegrity L391–467
test_dedup_objects_not_resent method method test_dedup_objects_not_resent L440–467
test_multiple_objects_all_transferred method method test_multiple_objects_all_transferred L413–438
test_object_content_survives_push method method test_object_content_survives_push L392–411
TestPullRoundTrip class class TestPullRoundTrip L475–504
test_pull_fetches_commit_and_objects method method test_pull_fetches_commit_and_objects L476–504
TestPushBasic class class TestPushBasic L151–285
test_push_incremental_second_commit method method test_push_incremental_second_commit L262–285
test_push_multi_commit_chain method method test_push_multi_commit_chain L239–260
test_push_reports_compression_type method method test_push_reports_compression_type L196–218
test_push_single_commit method method test_push_single_commit L152–171
test_push_up_to_date method method test_push_up_to_date L220–237
test_push_with_objects method method test_push_with_objects L173–194
TestPushErrors class class TestPushErrors L293–383
test_push_diverged_rejected_without_force method method test_push_diverged_rejected_without_force L336–359
test_push_dry_run method method test_push_dry_run L317–334
test_push_force_overwrites_diverged method method test_push_force_overwrites_diverged L361–383
test_push_no_commits method method test_push_no_commits L306–315
test_push_no_remote_configured method method test_push_no_remote_configured L294–304
_branch_ref function function _branch_ref L141–143
_commit function function _commit L83–108
_make_repo function function _make_repo L51–60
_object_path function function _object_path L135–137
_parse_json_output function function _parse_json_output L33–43
_pull function function _pull L126–132
_push function function _push L117–123
_set_ref function function _set_ref L111–114
_snap function function _snap L72–80
_write_config_toml function function _write_config_toml L63–69
CliRunner import import CliRunner L26–26
CommitRecord import import CommitRecord L25–25
InvokeResult import import InvokeResult L26–26
Mapping import import Mapping L14–14
SnapshotRecord import import SnapshotRecord L25–25
annotations import import annotations L13–13
blob_id import import blob_id L27–27
choose_compression import import choose_compression L22–22
commit_path import import commit_path L25–25
compute_commit_id import import compute_commit_id L24–24
compute_snapshot_id import import compute_snapshot_id L24–24
config_toml_path import import config_toml_path L28–28
datetime import import datetime L16–16
heads_dir import import heads_dir L28–28
json import import json L17–17
muse_dir import import muse_dir L28–28
object_path import import object_path L23–23
pathlib import import pathlib L18–18
pytest import import pytest L20–20
ref_path import import ref_path L28–28
write_commit import import write_commit L25–25
write_object import import write_object L23–23
write_snapshot import import write_snapshot L25–25
runner variable variable runner L30–30
~ tests/test_push_object_integrity.py .py 25 symbols removed
_REMOTE_URL variable variable _REMOTE_URL L30–30
_REPO_ID variable variable _REPO_ID L29–29
_bare_repo function function _bare_repo L38–50
_make_commit function function _make_commit L53–86
_mock_transport function function _mock_transport L89–101
AsyncMock import import AsyncMock L17–17
CommitRecord import import CommitRecord L25–25
MagicMock import import MagicMock L17–17
PushResult import import PushResult L23–23
RemoteInfo import import RemoteInfo L23–23
SnapshotRecord import import SnapshotRecord L25–25
__version__ import import __version__ L21–21
annotations import import annotations L12–12
blob_id import import blob_id L26–26
compute_commit_id import import compute_commit_id L24–24
compute_snapshot_id import import compute_snapshot_id L24–24
datetime import import datetime L14–14
heads_dir import import heads_dir L27–27
json import import json L15–15
muse_dir import import muse_dir L27–27
pathlib import import pathlib L16–16
pytest import import pytest L19–19
write_commit import import write_commit L25–25
write_object import import write_object L22–22
write_snapshot import import write_snapshot L25–25
~ tests/test_wire_snapshot_delta.py .py 20 symbols removed
_build_linear_history function function _build_linear_history L85–108
_build_manifest function function _build_manifest L52–53
_make_commit function function _make_commit L56–70
_make_snapshot function function _make_snapshot L73–82
_parse_mwp_frames function function _parse_mwp_frames L22–38
_parse_mwp_payload function function _parse_mwp_payload L41–49
Manifest import import Manifest L15–15
MsgpackDict import import MsgpackDict L15–15
annotations import import annotations L11–11
blob_id import import blob_id L15–15
long_id import import long_id L15–15
msgpack import import msgpack L14–14
struct import import struct L13–13
test_delta_chain_full_reconstruction function function test_delta_chain_full_reconstruction L222–250
test_delta_chain_references_valid_base function function test_delta_chain_references_valid_base L149–166
test_first_snapshot_is_full function function test_first_snapshot_is_full L115–123
test_single_commit_sends_full_snapshot_no_deltas function function test_single_commit_sends_full_snapshot_no_deltas L173–183
test_subsequent_snapshots_are_deltas function function test_subsequent_snapshots_are_deltas L130–142
test_write_commit_pack_includes_snapshot_deltas function function test_write_commit_pack_includes_snapshot_deltas L190–207
test_write_commit_pack_no_deltas_key_when_empty function function test_write_commit_pack_no_deltas_key_when_empty L210–215
~ muse/cli/commands/fetch.py .py 1 symbol removed, 3 symbols modified
negotiate_have import import negotiate_have L85–85
~ muse/cli/commands/pull.py .py 1 symbol removed, 3 symbols modified
negotiate_have import import negotiate_have L73–73
~ run
~ muse/core/transport.py .py 51 symbols removed, 16 symbols modified
COMMIT_CHUNK_SIZE variable variable COMMIT_CHUNK_SIZE L240–240
fetch_presign_or_stream method method fetch_presign_or_stream L1463–1617
fetch_stream method method fetch_stream L1305–1461
negotiate method method negotiate L1758–1783
push_stream_coro method async_method push_stream_coro L1152–1303
LocalFileTransport class class LocalFileTransport L2207–2665
_repo_root method method _repo_root L2223–2254
create_release method method create_release L2582–2597
delete_branch_remote method method delete_branch_remote L2645–2665
delete_release_remote method method delete_release_remote L2624–2643
fetch_bundle method method fetch_bundle L2361–2372
fetch_presign_or_stream method method fetch_presign_or_stream L2343–2359
fetch_remote_info method method fetch_remote_info L2256–2277
fetch_stream method method fetch_stream L2279–2341
list_releases_remote method method list_releases_remote L2599–2622
negotiate method method negotiate L2523–2554
push_stream method method push_stream L2374–2495
push_stream_coro method async_method push_stream_coro L2497–2521
push_tags method method push_tags L2556–2580
MAX_C_FRAME_BYTES variable variable MAX_C_FRAME_BYTES L236–236
fetch_stream method method fetch_stream L657–702
negotiate method method negotiate L737–763
push_stream method method push_stream L602–655
NEGOTIATE_DEPTH variable variable NEGOTIATE_DEPTH L249–249
NegotiateResponse class class NegotiateResponse L525–530
OC_CHUNK_SIZE variable variable OC_CHUNK_SIZE L244–244
_CommitBundle variable variable _CommitBundle L209–209
_frame_generator function function _frame_generator L257–498
_is_ancestor function function _is_ancestor L2151–2201
AsyncIterator import import AsyncIterator L99–99
FetchRequest import import FetchRequest L114–114
Iterable import import Iterable L99–99
Iterator import import Iterator L99–99
MAX_FETCH_BYTES import import MAX_FETCH_BYTES L133–133
MUSE_DIR import import MUSE_DIR L140–140
_heads_dir import import _heads_dir L141–141
_muse_dir import import _muse_dir L141–141
_ref_path import import _ref_path L141–141
_repo_json_path import import _repo_json_path L141–141
apply_delta import import apply_delta L113–113
base64 import import base64 L88–88
blob_id import import blob_id L140–140
compress_zlib import import compress_zlib L113–113
compute_delta import import compute_delta L113–113
contain_path import import contain_path L133–133
decompress_zlib import import decompress_zlib L113–113
load_json_file import import load_json_file L140–140
short_id import import short_id L140–140
time import import time L97–97
validate_branch_name import import validate_branch_name L133–133
negotiate_have function function negotiate_have L2687–2729
~ MPack
~ tests/test_cli_clone.py .py 1 symbol modified
~ tests/test_clone_partial.py .py 1 symbol modified
~ tests/test_cmd_fetch_hardening.py .py 13 symbols removed, 12 symbols modified
test_negotiate_called_before_fetch_bundle method method test_negotiate_called_before_fetch_bundle L414–449
test_negotiate_failure_falls_back_to_full_have method method test_negotiate_failure_falls_back_to_full_have L451–485
TestNegotiateHave class class TestNegotiateHave L291–336
_make_transport method method _make_transport L292–308
test_empty_local_returns_empty_no_network method method test_empty_local_returns_empty_no_network L310–314
test_falls_back_to_full_list_when_never_ready method method test_falls_back_to_full_list_when_never_ready L322–327
test_single_round_ready_returns_ack method method test_single_round_ready_returns_ack L316–320
test_stress_10k_commits_3_rounds method method test_stress_10k_commits_3_rounds L329–336
TestPerformance class class TestPerformance L743–789
test_large_negotiation_converges_in_3_rounds method method test_large_negotiation_converges_in_3_rounds L775–789
test_negotiate_result_used_as_have_not_all_local method method test_negotiate_result_used_as_have_not_all_local L744–773
test_8_concurrent_negotiate_have_calls method method test_8_concurrent_negotiate_have_calls L819–843
_make_negotiate_response function function _make_negotiate_response L126–130
~ tests/test_cmd_pull_hardening.py .py 2 symbols added, 15 symbols removed, 19 symbols modified
test_ff_only_refuses_diverged method method test_ff_only_refuses_diverged L748–799
test_fetch_stream_error_to_stderr method method test_fetch_stream_error_to_stderr L330–343
TestNegotiateHave class class TestNegotiateHave L238–289
_make_transport method method _make_transport L239–255
test_empty_all_local_returns_empty method method test_empty_all_local_returns_empty L257–261
test_exhausted_returns_full_list method method test_exhausted_returns_full_list L279–289
test_ready_after_two_rounds method method test_ready_after_two_rounds L270–277
test_ready_on_first_round_returns_ack method method test_ready_on_first_round_returns_ack L263–268
TestStress class class TestStress L888–938
test_concurrent_negotiate_have method method test_concurrent_negotiate_have L912–938
test_negotiate_have_10k_commits method method test_negotiate_have_10k_commits L890–909
config_toml_path import import config_toml_path L71–71
heads_dir import import heads_dir L71–71
threading import import threading L62–62
two_repos function function two_repos L652–704
+ _make_transport_mock method method _make_transport_mock L577–581
+ test_fetch_bundle_error_to_stderr method method test_fetch_bundle_error_to_stderr L266–276
~ _run
~ tests/test_cmd_push_hardening.py .py 11 symbols added, 12 symbols removed, 17 symbols modified
test_dry_run_does_not_push method method test_dry_run_does_not_push L557–565
test_dry_run_json_schema method method test_dry_run_json_schema L567–578
test_push_json_schema method method test_push_json_schema L536–547
test_second_push_up_to_date method method test_second_push_up_to_date L529–534
test_up_to_date_json_schema method method test_up_to_date_json_schema L549–555
TestMergeCommitPushBundleSize class class TestMergeCommitPushBundleSize L676–829
_make_two_branch_remote method method _make_two_branch_remote L685–742
test_merge_push_sends_one_commit_exact_heads method method test_merge_push_sends_one_commit_exact_heads L744–769
test_merge_push_sends_only_new_commits_when_branch_is_ahead method method test_merge_push_sends_only_new_commits_when_branch_is_ahead L771–813
test_merge_push_succeeds method method test_merge_push_succeeds L815–829
push_stream_coro method async_method push_stream_coro L316–336
PushResult import import PushResult L667–667
+ _run method method _run L545–560
+ test_dry_run_makes_no_http_calls method method test_dry_run_makes_no_http_calls L573–585
+ test_up_to_date_when_already_pushed method method test_up_to_date_when_already_pushed L566–571
+ _run_with_transport_exc method method _run_with_transport_exc L499–509
+ _FakeHttpxClient class class _FakeHttpxClient L296–330
+ __aenter__ method async_method __aenter__ L302–303
+ __aexit__ method async_method __aexit__ L305–306
+ __init__ method method __init__ L299–300
+ post method async_method post L308–324
+ put method async_method put L326–330
+ _build_request method method _build_request L355–358
~ tests/test_push_have_filter.py .py 1 symbol removed, 3 symbols modified
~ tests/test_transport_fetch_bundle.py .py 1 symbol removed
test_fb7_local_transport_delegates_to_fetch_stream function function test_fb7_local_transport_delegates_to_fetch_stream L261–284
← Older Oldest on dev
All commits
Newer → Latest on dev

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