gabriel / musehub public
feat BREAKING phase1 task/object-refs-phase1 #1 / 1
gabriel · 164 days ago · Apr 13, 2026 · Diff

feat(phase1): add musehub_object_refs — materialized reachability index

Migration 0044 creates musehub_object_refs (repo_id, object_id) with a composite PK for idempotent upserts, an index on object_id for reverse lookups, and backfills one ref per existing object from the legacy musehub_objects.repo_id column.

ORM: MusehubObjectRef model with FK to both musehub_repos (CASCADE) and musehub_objects. MusehubObject gains a refs relationship. Legacy repo_id column and relationship remain intact until phase 5 (migration 0045).

All 49 migration tests pass.

sha256:d6ce1c5868f7726c7fe8504d9c437eb2f5f5fb66c419faffa021c9c4799b87c7 sha
+12 ~7 −2 symbols
sha256:91b60fa2a84a7466feffdc6419fe7c5a39f0e2717cfb54f172b5629a74ab6892 snapshot
+12
symbols added
~7
symbols modified
−2
symbols removed
0
dead code introduced
Semantic Changes 21 symbols
+ branch_labels variable variable branch_labels L36–36
+ depends_on variable variable depends_on L37–37
+ down_revision variable variable down_revision L35–35
+ downgrade function function downgrade L80–82
+ annotations import import annotations L29–29
+ op import import op L32–32
+ sa import import sa L31–31
+ revision variable variable revision L34–34
+ upgrade function function upgrade L40–77
~ musehub/db/musehub_models.py .py 1 symbol added, 1 symbol modified
+ MusehubObjectRef class class MusehubObjectRef L258–293
~ tests/test_migrations.py .py 2 symbols added, 2 symbols removed, 6 symbols modified
− test_all_42_migrations_present method method test_all_42_migrations_present L267–270
− test_head_revision_is_0042 method method test_head_revision_is_0042 L272–292
+ test_all_44_migrations_present method method test_all_44_migrations_present L267–270
+ test_head_revision_is_0044 method method test_head_revision_is_0044 L272–292
~ _HEAD
← Older Oldest on task/object-refs-phase1
All commits
Newer → Latest on task/object-refs-phase1

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