gabriel / musehub public
fix patch task/presign-preregister #1 / 1
AI Agent gabriel · 56 days ago · Apr 24, 2026 · Diff

fix: pre-register presigned object IDs in musehub_objects to fix push 422

Root cause: POST /presign issued R2 PUT URLs but wrote no DB rows. When push/stream checked snapshot referential integrity it found the presigned objects missing from musehub_objects and rejected with 422.

Fix: presign_and_register_objects(session, repo_id, oids) writes placeholder rows (storage_uri='pending', size_bytes=0) and ref rows before returning presigned URLs. The integrity check finds the rows and the push succeeds.

TDD: 4 new tests (PI-1 through PI-4) written first, all failing, then made green by the implementation.

sha256:156ce285c8b517e0d76bc47837eda3c24b0ba42095c4433a2e35ef74662b6c50 sha
sha256:07267ef088b6e2a46589ae99965902d350df8b63c5c6327d4e0f96b9214007b8 snapshot
← Older Oldest on task/presign-preregister
All commits
Newer → Latest on task/presign-preregister

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