gabriel / muse public
fix push task/fix-presign-delta #1 / 1
AI Agent gabriel · 122 days ago · May 8, 2026 · Diff

fix(push): never PUT delta-encoded objects via presign R2 path

The presign path PUT obj['content'] directly to R2. For delta-encoded objects content = delta bytes (zlib level-1), not raw bytes. R2 key is sha256(raw), so delta bytes were stored under the wrong key. Any later push using that object as a delta base would call apply_delta(delta_bytes_not_raw, new_delta) → hash mismatch on the server.

Fix: partition objects into presign_candidates (encoding != delta*) and stream_only (encoding starts with 'delta'). Only presign_candidates count toward the presign threshold and are sent via presign → R2 PUT. Delta objects are appended to inline_objects and always go through push/stream.

Tests: P8g pins that delta objects are excluded from presign candidates and that the threshold calculation ignores delta objects.

sha256:e84218a2c0d56e41478ebf66dbbe885661d96e0754314810a3a46d3f767c493b sha
+2 ~3 symbols
sha256:c7933bac709738506ce04099601a7d00902a6d5ed6196008de5145c6e1cc07f2 snapshot
+2
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes 5 symbols
~ muse/cli/commands/push.py .py 1 symbol modified
~ tests/test_push_presign_routing.py .py 2 symbols added, 2 symbols modified
+ test_p8g_delta_objects_never_presigned function function test_p8g_delta_objects_never_presigned L196–225
+ test_p8g_delta_threshold_uses_only_presign_candidates function function test_p8g_delta_threshold_uses_only_presign_candidates L228–250
← Older Oldest on task/fix-presign-delta
All commits
Newer → Latest on task/fix-presign-delta

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