gabriel / musehub public
feat BREAKING symbols-v2-p1 feat/symbols-v2-p1-coupling-count #1 / 1
AI Agent gabriel · 129 days ago · May 6, 2026 · Diff

feat(symbols-v2-p1): add coupling_count to MusehubSymbolVitals

Pre-computed at push time: the number of distinct symbols a given symbol co-changes with. Populated by _update_coupling_counts() after _upsert_symbol_coupling() runs — a single UPDATE...FROM subquery that syncs vitals from the coupling table.

Enables the symbol list page to show a per-row coupling score via a simple LEFT JOIN — no aggregation at request time.

- musehub_symbol_vitals.coupling_count INT NOT NULL DEFAULT 0 - Migration 0032 (adds column to existing table) - 7 TDD tests (V101–V107) all green

sha256:f52795a1fb17d4849fe51225587f7303ba2da54d5f82911630ec77fa46d76d3f sha
+36 ~2 symbols
sha256:de498586197e88c4ed0804de77133ac102715544b1fb08ccc9152d27b843d79b snapshot
+36
symbols added
~2
symbols modified
0
dead code introduced
Semantic Changes 38 symbols
+ branch_labels variable variable branch_labels L17–17
+ depends_on variable variable depends_on L18–18
+ down_revision variable variable down_revision L16–16
+ downgrade function function downgrade L28–29
+ annotations import import annotations L10–10
+ op import import op L12–12
+ sa import import sa L13–13
+ revision variable variable revision L15–15
+ upgrade function function upgrade L21–25
+ _cid function function _cid L51–52
+ _lid function function _lid L55–56
+ _make_commit function async_function _make_commit L59–85
+ _now function function _now L47–48
+ _push_index function async_function _push_index L88–91
+ AsyncSession import import AsyncSession L35–35
+ annotations import import annotations L28–28
+ blob_id import import blob_id L38–38
+ build_symbol_index import import build_symbol_index L39–39
+ create_repo import import create_repo L40–40
+ datetime import import datetime L31–31
+ db import import db L37–37
+ long_id import import long_id L38–38
+ pytest import import pytest L33–33
+ secrets import import secrets L30–30
+ select import import select L34–34
+ text import import text L34–34
+ timezone import import timezone L31–31
+ test_v101_coupling_count_column_exists function async_function test_v101_coupling_count_column_exists L99–107
+ test_v102_coupling_count_default_zero_not_nullable function async_function test_v102_coupling_count_default_zero_not_nullable L115–129
+ test_v103_coupling_count_populated_after_index function async_function test_v103_coupling_count_populated_after_index L137–158
+ test_v104_coupling_count_matches_distinct_co_address_count function async_function test_v104_coupling_count_matches_distinct_co_address_count L166–205
+ test_v105_coupling_count_idempotent function async_function test_v105_coupling_count_idempotent L213–230
+ test_v106_isolated_symbol_has_zero_coupling_count function async_function test_v106_isolated_symbol_has_zero_coupling_count L238–254
+ test_v107_cascade_delete_removes_vitals function async_function test_v107_cascade_delete_removes_vitals L262–288
~ musehub/services/musehub_symbol_indexer.py .py 2 symbols added, 1 symbol modified
+ _update_coupling_counts function async_function _update_coupling_counts L569–603
+ sa import import sa L37–37
← Older Oldest on feat/symbols-v2-p1-coupling-count
All commits
Newer → Latest on feat/symbols-v2-p1-coupling-count

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