fix: decompress zlib-compressed delta bases before apply_delta
Old-wire-path objects were stored zlib-compressed in R2. When a new object is pushed as delta+zlib against such a base, the server fetched the raw R2 bytes (compressed) and passed them directly to apply_delta(). The delta was applied against wrong bytes — producing garbage — and hash verification was skipped for non-sha256:-prefixed IDs, so it passed.
Real-world failure: staging README showed '0!' after a one-line README edit was pushed as delta+zlib against the old zlib-compressed README.
Fix: - Move decompress_if_needed() to muse_contracts/compression.py (canonical home) - Apply decompress_if_needed() to base_raw before apply_delta() in wire_push_object_pack so deltas are always applied against plain bytes - Add POST /{owner}/{slug}/repair-object endpoint (owner/write-only) to replace a corrupt stored object with SHA-256-verified correct bytes - Update ui_tree.py and _ui_helpers.py to import from compression module
Tests: 45 pass — 18 new regression tests cover both delta base scenarios (content_cache path and storage path) and the repair endpoint.
0 comments
muse hub commit comment sha256:aaf5f76dd4004e6d4a0ff70dd68960b118fb032175aef5cb3745e385d9084ebd --body "your comment"
No comments yet. Be the first to start the discussion.