feat(phase2): wire all push paths to write musehub_object_refs
_upsert_object_refs(session, repo_id, object_ids) — single helper that bulk-upserts (repo_id, object_id) rows ON CONFLICT DO NOTHING. Called at all 6 push entry points:
- wire_push (inline bundle objects) - wire_push_objects (chunked pre-upload) - wire_push_object_pack (small-object pack — primary CLI path) - wire_repair_object - wire_confirm_objects (presigned PUT confirm) - worker_register_objects (Cloudflare Worker callback)
Key correctness invariant: refs are upserted for ALL incoming object_ids (new + already-present/deduplicated). A repo that deduplicates an object from another repo still gets a ref row so per-repo quota, GC, and audit queries return correct results.
Also: object_id FK on musehub_object_refs gains ondelete=CASCADE so deleting a musehub_objects row cascades to its refs cleanly.
Tests (6 new): pack new, pack dedup, push/objects, wire_push bundle, confirm, idempotent re-push. 162 wire-path tests pass.
0 comments
muse hub commit comment sha256:c99042c649dd3f16bf9f914be5f9d147aafa35fe16e497f4da3088e5e525b2f2 --body "your comment"
No comments yet. Be the first to start the discussion.