gabriel / musehub public
feat BREAKING feat/wire-compression-tier1-tier2 #1 / 1
gabriel · 166 days ago · Apr 12, 2026 · Diff

feat: add Tier 1 (zlib) and Tier 2 (delta+zlib) server-side decoding

- musehub/muse_contracts/compression.py: server-side decompress_zlib and apply_delta (stdlib only — no client dependency). - musehub/models/wire.py: WireObject gains encoding (raw|zlib|delta+zlib) and base_id fields; WireFilterRequest gains object_hints (oid→path); WireFilterResponse gains bases (missing_oid→base_oid). - musehub/services/musehub_wire.py: wire_push_object_pack decodes all wire encodings into raw bytes before hash/polyglot checks and storage; wire_filter_objects returns delta base suggestions via DISTINCT ON path query when object_hints are provided. - tests/test_wire_compression.py: 13 integration tests covering raw/zlib/ delta+zlib pack push, filter-objects base suggestions, and error paths. - docs/reference/type-contracts.md: updated WireObject, WireFilterRequest, WireFilterResponse field tables.

sha256:c1eb9da58efc63bed6d5422c8bb4c079582770805de0dd3d0a3a3813ec7e91ad sha
+40 ~15 symbols
sha256:5903a96de13c08ff444d838ab3a9cb67f3b825a591f0f68ac8a7d8708a2ced2b snapshot
+40
symbols added
~15
symbols modified
0
dead code introduced
Semantic Changes 55 symbols
+ apply_delta function function apply_delta L29–75
+ decompress_zlib function function decompress_zlib L21–26
+ annotations import import annotations L15–15
+ struct import import struct L17–17
+ zlib import import zlib L18–18
~ tests/test_wire_compression.py .py 30 symbols added
+ _compress_zlib function function _compress_zlib L39–41
+ _compute_delta function function _compute_delta L44–58
+ _make_delta_object function function _make_delta_object L86–100
+ _make_raw_object function function _make_raw_object L66–73
+ _make_zlib_object function function _make_zlib_object L76–83
+ _mp function function _mp L61–63
+ _sha256_oid function function _sha256_oid L34–36
+ AsyncClient import import AsyncClient L25–25
+ AsyncSession import import AsyncSession L26–26
+ StrDict import import StrDict L29–29
+ annotations import import annotations L17–17
+ factory_create_repo import import factory_create_repo L28–28
+ hashlib import import hashlib L19–19
+ msgpack import import msgpack L23–23
+ pytest import import pytest L24–24
+ struct import import struct L20–20
+ zlib import import zlib L21–21
+ test_filter_objects_hint_for_different_path_no_base function async_function test_filter_objects_hint_for_different_path_no_base L339–363
+ test_filter_objects_no_hints_returns_empty_bases function async_function test_filter_objects_no_hints_returns_empty_bases L230–250
+ test_filter_objects_present_object_not_in_bases function async_function test_filter_objects_present_object_not_in_bases L303–335
+ test_filter_objects_returns_bases_for_known_path function async_function test_filter_objects_returns_bases_for_known_path L254–299
+ test_push_object_pack_delta_hash_mismatch_rejected function async_function test_push_object_pack_delta_hash_mismatch_rejected L485–524
+ test_push_object_pack_delta_missing_base_id_rejected function async_function test_push_object_pack_delta_missing_base_id_rejected L423–450
+ test_push_object_pack_delta_nonexistent_base_rejected function async_function test_push_object_pack_delta_nonexistent_base_rejected L454–481
+ test_push_object_pack_delta_zlib_stored function async_function test_push_object_pack_delta_zlib_stored L370–419
+ test_push_object_pack_mixed_encodings function async_function test_push_object_pack_mixed_encodings L528–568
+ test_push_object_pack_raw_encoding_accepted function async_function test_push_object_pack_raw_encoding_accepted L107–127
+ test_push_object_pack_zlib_encoding_stored function async_function test_push_object_pack_zlib_encoding_stored L131–165
+ test_push_object_pack_zlib_hash_mismatch_rejected function async_function test_push_object_pack_zlib_hash_mismatch_rejected L169–198
+ test_push_object_pack_zlib_idempotent function async_function test_push_object_pack_zlib_idempotent L202–223
~ docs/reference/type-contracts.md .md 3 symbols added, 10 symbols modified
+ py`@L3769 section MyModel — `tests/test_api_contracts_section37.py` L3769–3777
+ py`@L3778 section MyModel — `tests/test_api_contracts_section37.py` L3778–3786
+ py`@L3787 section MyModel — `tests/test_api_contracts_section37.py` L3787–3795
~ py`
~ py`
~ py`
~ musehub/services/musehub_wire.py .py 2 symbols added, 2 symbols modified
+ apply_delta import import apply_delta L81–81
+ decompress_zlib import import decompress_zlib L81–81
← Older Oldest on feat/wire-compression-tier1-tier2
All commits
Newer → Latest on feat/wire-compression-tier1-tier2

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