feat: rewrite GravityProvider as SQL derivation — no muse CLI required
Derives gravity scores from existing blast columns written by intel.code, using the exact formula from muse code gravity:
denom = max(1, total_tracked_symbols - 1) gravity_pct = round(blast / denom * 100, 1)
Column mapping: gravity_direct_dependents ← blast_direct gravity_transitive_dependents ← blast gravity_pct ← derived formula
gravity_max_depth and gravity_depth_distribution are not derivable from blast data and remain NULL.
Deletes 8 obsolete Phase 3 provider tests that mocked the muse CLI. Adds 20 Phase 5 TDD tests covering formula, mapping, denominator scoping, edge cases, idempotency, and preservation.
sha256:f3e8273e1ddb5b20fc5f671bc02850e808b7bc5d9f998411d0e662428566c791
sha
+44
~2
−17
symbols
sha256:81bf30fea6376a833b8dd5d3176f81bd1ed48421b750e5909d8ec14d3124aa9d
snapshot
+44
symbols added
~2
symbols modified
−17
symbols removed
0
dead code introduced
Semantic Changes
63 symbols
+
test_P5_05_gravity_direct_dependents_equals_blast_direct
method
async_method test_P5_05_gravity_direct_dependents_equals_blast_direct L226–242
+
test_P5_06_gravity_transitive_dependents_equals_blast
method
async_method test_P5_06_gravity_transitive_dependents_equals_blast L245–261
+
test_P5_07_import_kind_excluded_from_denominator
method
async_method test_P5_07_import_kind_excluded_from_denominator L271–297
+
test_P5_08_null_kind_excluded_from_denominator
method
async_method test_P5_08_null_kind_excluded_from_denominator L300–321
+
test_P5_09_all_tracked_kinds_count_in_denominator
method
async_method test_P5_09_all_tracked_kinds_count_in_denominator L324–349
+
test_P5_10_single_symbol_denom_is_one
method
async_method test_P5_10_single_symbol_denom_is_one L359–377
+
test_P5_11_zero_blast_yields_zero_pct
method
async_method test_P5_11_zero_blast_yields_zero_pct L380–398
+
test_P5_18_only_import_kind_rows_returns_empty
method
async_method test_P5_18_only_import_kind_rows_returns_empty L570–587
+
test_P5_02_gravity_pct_matches_formula
method
async_method test_P5_02_gravity_pct_matches_formula L136–164
+
test_P5_03_gravity_pct_fractional_rounding
method
async_method test_P5_03_gravity_pct_fractional_rounding L167–192
+
test_P5_04_all_symbols_get_gravity_pct
method
async_method test_P5_04_all_symbols_get_gravity_pct L195–216
+
test_P5_16_second_run_yields_same_pct
method
async_method test_P5_16_second_run_yields_same_pct L521–546
+
test_P5_01_compute_never_spawns_subprocess
method
async_method test_P5_01_compute_never_spawns_subprocess L96–126
+
test_P5_19_gravity_max_depth_stays_null
method
async_method test_P5_19_gravity_max_depth_stays_null L597–614
+
test_P5_20_gravity_depth_distribution_stays_null
method
async_method test_P5_20_gravity_depth_distribution_stays_null L617–634
+
test_P5_14_churn_preserved_after_compute
method
async_method test_P5_14_churn_preserved_after_compute L472–490
+
test_P5_15_blast_columns_preserved_after_compute
method
async_method test_P5_15_blast_columns_preserved_after_compute L493–511
+
test_P5_12_row_count_unchanged_after_compute
method
async_method test_P5_12_row_count_unchanged_after_compute L408–440
+
test_P5_13_returns_intel_results_tuple
method
async_method test_P5_13_returns_intel_results_tuple L443–462
~
compute
−
test_P3_42_empty_symbols_returns_empty_list
method
async_method test_P3_42_empty_symbols_returns_empty_list L382–394
−
test_P3_43_missing_symbols_key_returns_empty_list
method
async_method test_P3_43_missing_symbols_key_returns_empty_list L397–408
−
test_P3_44_nonzero_exit_returns_empty_list
method
async_method test_P3_44_nonzero_exit_returns_empty_list L418–430
−
test_P3_40_gravity_upsert_idempotent
method
async_method test_P3_40_gravity_upsert_idempotent L307–326
−
test_P3_41_gravity_upsert_overwrites_stale_value
method
async_method test_P3_41_gravity_upsert_overwrites_stale_value L329–372
−
test_P3_38_depth_dist_stored_as_dict
method
async_method test_P3_38_depth_dist_stored_as_dict L249–271
−
test_P3_39_depth_dist_shallow_broad_shape
method
async_method test_P3_39_depth_dist_shallow_broad_shape L274–297
−
test_P3_37_gravity_upsert_preserves_churn
method
async_method test_P3_37_gravity_upsert_preserves_churn L201–239
−
test_P3_34_gravity_upserts_symbol_intel_rows
method
async_method test_P3_34_gravity_upserts_symbol_intel_rows L125–145
−
test_P3_35_gravity_all_six_columns_written
method
async_method test_P3_35_gravity_all_six_columns_written L148–173
−
test_P3_36_gravity_returns_non_empty_intel_results
method
async_method test_P3_36_gravity_returns_non_empty_intel_results L176–191
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:f3e8273e1ddb5b20fc5f671bc02850e808b7bc5d9f998411d0e662428566c791 --body "your comment"
No comments yet. Be the first to start the discussion.