gabriel / musehub public
feat patch quota task/phase4-quota-via-refs #1 / 1
gabriel · 67 days ago · Apr 13, 2026 · Diff

feat(quota): phase 4 — all storage accounting joins through musehub_object_refs

Three quota sites updated to JOIN through musehub_object_refs instead of filtering on musehub_objects.repo_id (legacy column, wrong for dedup):

- wire_push per-repo quota: JOIN object_refs WHERE ref.repo_id = ? - musehub_mcp_executor per-user quota: JOIN object_refs JOIN repos WHERE owner_user_id = ? - get_repo_home_stats object count + size: JOIN object_refs WHERE ref.repo_id = ?

Also updated docs/db-query-runbook.md Q8 and Q10 to reflect the new query shapes.

Added 5-test suite in tests/test_quota_via_refs.py covering: - shared object counted independently per repo - idempotent push does not inflate quota - push rejected when quota exceeded (wire_push direct call) - get_repo_home_stats uses refs join for total_objects and total_size_bytes - shared object appears correctly in each repo's stats

sha256:4e36235e03452e7bd80851b2fea5fdd72a5a929a712d4464f70af2b36314f487 sha
sha256:913c88152164f88a3079c8d9e7e731631f946298c8969e7dbe80b5a1fbbfff0a snapshot
← Older Oldest on task/phase4-quota-via-refs
All commits
Newer → Latest on task/phase4-quota-via-refs

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