gabriel / musehub public
feat BREAKING phase3 task/phase3-gravity-schema #1 / 1
AI Agent gabriel · 138 days ago · May 3, 2026 · Diff

feat(phase3): gravity schema — migration 0005 + 6 new columns on musehub_symbol_intel

Adds gravity_pct, gravity_direct, gravity_transitive, gravity_max_depth, gravity_depth_dist (JSONB), and symbol_kind to musehub_symbol_intel. New index on (repo_id, gravity_pct DESC) for sub-ms page queries. 28 TDD tests passing (layers: schema, index, write, JSONB, upsert, null-safe, ordering, kind).

Closes: issue #9 phase 1

sha256:29754f12f52098b6d36a298d7c616b39597f08e17db1689587c115d29d41e989 sha
+57 ~1 symbols
sha256:3a0e3ed51925d43d474230623dd67f288adf44701c1c809f0512a44d9c5aef18 snapshot
+57
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 58 symbols
+ branch_labels variable variable branch_labels L28–28
+ depends_on variable variable depends_on L29–29
+ down_revision variable variable down_revision L27–27
+ downgrade function function downgrade L53–60
+ Sequence import import Sequence L21–21
+ Union import import Union L21–21
+ annotations import import annotations L19–19
+ op import import op L24–24
+ sa import import sa L23–23
+ revision variable variable revision L26–26
+ upgrade function function upgrade L32–50
~ tests/test_phase3_gravity_schema.py .py 46 symbols added
+ TestGravityDepthDistJsonb class class TestGravityDepthDistJsonb L185–246
+ test_P3_14_depth_dist_shallow_broad method async_method test_P3_14_depth_dist_shallow_broad L188–200
+ test_P3_15_depth_dist_deep_narrow method async_method test_P3_15_depth_dist_deep_narrow L203–215
+ test_P3_16_depth_dist_single_depth method async_method test_P3_16_depth_dist_single_depth L218–230
+ test_P3_17_depth_dist_nine_levels method async_method test_P3_17_depth_dist_nine_levels L233–246
+ TestGravityIndex class class TestGravityIndex L113–120
+ test_P3_11_gravity_pct_index_defined method method test_P3_11_gravity_pct_index_defined L115–120
+ TestGravityNullSafe class class TestGravityNullSafe L360–411
+ test_P3_20_churn_only_row_valid method async_method test_P3_20_churn_only_row_valid L363–384
+ test_P3_21_gravity_pct_filter_excludes_nulls method async_method test_P3_21_gravity_pct_filter_excludes_nulls L387–411
+ TestGravityOrdering class class TestGravityOrdering L418–476
+ test_P3_22_ordered_by_gravity_pct_desc method async_method test_P3_22_ordered_by_gravity_pct_desc L421–450
+ test_P3_23_top_n_query method async_method test_P3_23_top_n_query L453–476
+ TestGravitySchemaColumns class class TestGravitySchemaColumns L49–106
+ test_P3_01_gravity_pct_column_exists method method test_P3_01_gravity_pct_column_exists L51–54
+ test_P3_02_gravity_direct_column_exists method method test_P3_02_gravity_direct_column_exists L56–59
+ test_P3_03_gravity_transitive_column_exists method method test_P3_03_gravity_transitive_column_exists L61–64
+ test_P3_04_gravity_max_depth_column_exists method method test_P3_04_gravity_max_depth_column_exists L66–69
+ test_P3_05_gravity_depth_dist_column_exists method method test_P3_05_gravity_depth_dist_column_exists L71–74
+ test_P3_06_symbol_kind_column_exists method method test_P3_06_symbol_kind_column_exists L76–79
+ test_P3_07_all_six_columns_present method method test_P3_07_all_six_columns_present L81–91
+ test_P3_08_gravity_pct_is_nullable method method test_P3_08_gravity_pct_is_nullable L93–96
+ test_P3_09_gravity_depth_dist_is_nullable method method test_P3_09_gravity_depth_dist_is_nullable L98–101
+ test_P3_10_symbol_kind_is_nullable method method test_P3_10_symbol_kind_is_nullable L103–106
+ TestGravitySymbolKind class class TestGravitySymbolKind L483–523
+ test_P3_24_symbol_kind_roundtrip method async_method test_P3_24_symbol_kind_roundtrip L487–499
+ test_P3_28_kind_filter_query method async_method test_P3_28_kind_filter_query L502–523
+ TestGravityUpsert class class TestGravityUpsert L253–353
+ test_P3_18_upsert_gravity_preserves_churn method async_method test_P3_18_upsert_gravity_preserves_churn L256–311
+ test_P3_19_upsert_gravity_idempotent method async_method test_P3_19_upsert_gravity_idempotent L314–353
+ TestGravityWrite class class TestGravityWrite L127–178
+ test_P3_12_gravity_full_write method async_method test_P3_12_gravity_full_write L130–157
+ test_P3_13_gravity_write_without_optional_fields method async_method test_P3_13_gravity_write_without_optional_fields L160–178
+ _now function function _now L41–42
+ _uid function function _uid L37–38
+ AsyncSession import import AsyncSession L31–31
+ annotations import import annotations L24–24
+ create_repo import import create_repo L34–34
+ datetime import import datetime L27–27
+ fake_id import import fake_id L33–33
+ inspect import import inspect L30–30
+ pytest import import pytest L29–29
+ secrets import import secrets L26–26
+ select import import select L30–30
+ text import import text L30–30
+ timezone import import timezone L27–27
← Older Oldest on task/phase3-gravity-schema
All commits
Newer → Latest on task/phase3-gravity-schema

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