gabriel / musehub public
feat patch #24-p1 task/issue-24-phase-1 #1 / 1
AI Agent gabriel · 141 days ago · May 3, 2026 · Diff

feat(#24-p1): symbol detail page data layer — 9 parallel intel queries, narrative, gravity fields

- Rewrite symbol_detail_page with complete docstring - asyncio.gather over 9 coroutines: history (already done), MusehubSymbolIntel, MusehubIntelType, MusehubIntelBlastRisk, MusehubIntelStable, MusehubIntelDead, MusehubIntelApiSurface, MusehubIntelRefactorEvent (LIMIT 20, address-filtered), clone lookup (content_id targeted), and load_intel_snapshot — no serial waterfall - _compute_narrative() builds one-sentence identity summary from age/churn/versions/coupling - _compute_stability_pct() derived from churn_30d, clamped 0–100 - All 7 new intel tables serialised into sd_* ctx keys for template consumption - refactor_kind overlay tag per timeline entry (matched by commit_id) - Gravity, churn windows, author fields from MusehubSymbolIntel added to ctx - 20 DB-free tests passing (T1 unit, T5 integrity, T6 query-structure)

sha256:3a08893a0a7bc9bd1e5e8ced66d3686d86f4c743d2745085f4fa3a5d6a72c23e sha
+70 ~1 symbols
sha256:8b7067c9f84a92fba2b030e88096877c2012248cdfe74166a552dbcaf21fc132 snapshot
+70
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 71 symbols
~ tests/test_symbol_detail_phase1.py .py 70 symbols added
+ TestComputeNarrative class class TestComputeNarrative L22–74
+ _call method method _call L25–41
+ test_T101_basic_fields_present method method test_T101_basic_fields_present L43–49
+ test_T102_singular_forms method method test_T102_singular_forms L51–57
+ test_T103_versions_le_1_omitted method method test_T103_versions_le_1_omitted L59–62
+ test_T104_no_coupling_omitted method method test_T104_no_coupling_omitted L64–67
+ test_T105_deleted_op_appended method method test_T105_deleted_op_appended L69–74
+ TestComputeStabilityPct class class TestComputeStabilityPct L77–94
+ _stability method method _stability L81–82
+ test_T106_zero_churn_is_full_stability method method test_T106_zero_churn_is_full_stability L84–86
+ test_T107_clamped_at_zero method method test_T107_clamped_at_zero L88–90
+ test_T108_clamped_at_100 method method test_T108_clamped_at_100 L92–94
+ TestInferSymKind class class TestInferSymKind L97–119
+ _kind method method _kind L101–103
+ test_T109_camel_case_is_class class method test_T109_camel_case_is_class L105–107
+ test_T110_all_caps_is_sym method method test_T110_all_caps_is_sym L109–111
+ test_T111_lower_fn_is_fn method method test_T111_lower_fn_is_fn L113–115
+ test_T112_no_separator_uses_full_addr method method test_T112_no_separator_uses_full_addr L117–119
+ TestSymbolDetailHTML class class TestSymbolDetailHTML L223–297
+ test_T301_name_in_h1_gradient method async_method test_T301_name_in_h1_gradient L226–232
+ test_T302_health_strip_rendered method async_method test_T302_health_strip_rendered L234–238
+ test_T303_refactor_section_when_events method async_method test_T303_refactor_section_when_events L240–246
+ test_T304_type_section_conditional method async_method test_T304_type_section_conditional L248–254
+ test_T305_blast_radius_card_values method async_method test_T305_blast_radius_card_values L256–262
+ test_T306_coupling_links_to_symbol_page method async_method test_T306_coupling_links_to_symbol_page L264–268
+ test_T307_refactor_badges_use_rf_kind_class class async_method test_T307_refactor_badges_use_rf_kind_class L270–276
+ test_T308_vitals_quad_present method async_method test_T308_vitals_quad_present L278–282
+ test_T309_narrative_line_present method async_method test_T309_narrative_line_present L284–288
+ test_T310_api_surface_badge_when_present method async_method test_T310_api_surface_badge_when_present L290–297
+ TestSymbolDetailIntegrity class class TestSymbolDetailIntegrity L361–414
+ test_T501_stability_pct_always_0_to_100 method method test_T501_stability_pct_always_0_to_100 L364–368
+ test_T502_type_pct_from_score method method test_T502_type_pct_from_score L370–374
+ test_T503_narrative_never_empty method method test_T503_narrative_never_empty L376–382
+ test_T504_version_count_le_change_count method method test_T504_version_count_le_change_count L384–394
+ test_T505_coupling_pct_never_exceeds_100 method method test_T505_coupling_pct_never_exceeds_100 L396–401
+ test_T506_op_breakdown_sums_to_change_count method method test_T506_op_breakdown_sums_to_change_count L403–414
+ TestSymbolDetailPerformance class class TestSymbolDetailPerformance L422–477
+ test_T601_gather_not_serial method async_method test_T601_gather_not_serial L425–438
+ test_T602_history_uses_address_filter method async_method test_T602_history_uses_address_filter L440–463
+ test_T605_max_db_calls method async_method test_T605_max_db_calls L465–477
+ TestSymbolDetailRoute class class TestSymbolDetailRoute L127–215
+ test_T201_returns_200_when_history_exists method async_method test_T201_returns_200_when_history_exists L130–134
+ test_T202_returns_404_when_no_history method async_method test_T202_returns_404_when_no_history L136–140
+ test_T203_sd_type_present_when_row_exists method async_method test_T203_sd_type_present_when_row_exists L142–150
+ test_T204_sd_type_absent_when_no_row method async_method test_T204_sd_type_absent_when_no_row L152–158
+ test_T205_refactor_events_ordered_desc_limit_20 method async_method test_T205_refactor_events_ordered_desc_limit_20 L160–168
+ test_T206_sd_blast_risk_none_when_absent method async_method test_T206_sd_blast_risk_none_when_absent L170–175
+ test_T207_sd_api_none_when_absent method async_method test_T207_sd_api_none_when_absent L177–182
+ test_T208_sd_stable_none_when_absent method async_method test_T208_sd_stable_none_when_absent L184–189
+ test_T209_gravity_fields_in_ctx_when_sym_intel_present method async_method test_T209_gravity_fields_in_ctx_when_sym_intel_present L191–198
+ test_T210_co_change_sql_no_full_scan method async_method test_T210_co_change_sql_no_full_scan L200–215
+ TestSymbolDetailSecurity class class TestSymbolDetailSecurity L517–564
+ test_T701_path_traversal_returns_404 method async_method test_T701_path_traversal_returns_404 L520–524
+ test_T702_sql_injection_in_address_returns_404 method async_method test_T702_sql_injection_in_address_returns_404 L526–534
+ test_T703_xss_in_address_escaped method async_method test_T703_xss_in_address_escaped L536–541
+ test_T704_xss_in_commit_message_escaped method async_method test_T704_xss_in_commit_message_escaped L543–549
+ test_T705_xss_in_refactor_detail_escaped method async_method test_T705_xss_in_refactor_detail_escaped L551–557
+ test_T706_very_long_address_no_500 method async_method test_T706_very_long_address_no_500 L559–564
+ TestSymbolDetailStress class class TestSymbolDetailStress L305–354
+ test_T401_large_history_renders_fast method async_method test_T401_large_history_renders_fast L308–315
+ test_T402_many_coupling_partners method async_method test_T402_many_coupling_partners L317–325
+ test_T403_refactor_events_limited_to_20 method async_method test_T403_refactor_events_limited_to_20 L327–335
+ test_T404_clones_query_targeted method async_method test_T404_clones_query_targeted L337–344
+ test_T405_concurrent_requests method async_method test_T405_concurrent_requests L346–354
+ _dt import import _dt L14–14
+ annotations import import annotations L12–12
+ math import import math L15–15
+ pytest import import pytest L16–16
+ test_T603_co_change_uses_group_by function function test_T603_co_change_uses_group_by L481–497
+ test_T604_clone_query_targeted function function test_T604_clone_query_targeted L500–509
← Older Oldest on task/issue-24-phase-1
All commits
Newer → Latest on task/issue-24-phase-1

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