gabriel / musehub public
fix BREAKING task/intel-clones-tests #1 / 1
AI Agent gabriel · 138 days ago · May 3, 2026 · Diff

fix: close intel CLI-vs-DB fidelity gaps and fix dashboard gate

- StableProvider: compute days_stable from commit timestamps (calendar days) instead of BFS walk index; days_stable now matches the CLI's time unit - EntangleProvider: fix co_change_rate to use Jaccard (co / |union|) instead of co / min; commits_both_active now stores union cardinality - intel_hotspots_page: migrate off legacy load_intel_snapshot path; now queries MusehubSymbolIntel.churn_30d directly like all other intel routes - intel_dashboard.html: remove index_meta gate that hid all cards when no intel summary existed; no-index notice is now a banner alongside cards so all subpage links are always present and navigable - Delete 8 stale phase2 tests that mocked asyncio.create_subprocess_exec against providers that were already rewritten to use DB queries - Add test_intel_fidelity.py (F01-F07): seven tests covering all three provider fixes and the hotspots route migration

sha256:bafffed4b32c2005a19d6274340a8b08737f10643db41a7f2c412a40d8065d59 sha
+181 ~8 −15 symbols
sha256:9ee5bec61235c5eaaa210b6464a28c4d13181581ae2ea94741defca2bc75649a snapshot
+181
symbols added
~8
symbols modified
−15
symbols removed
−2
dead symbols removed
Semantic Changes 204 symbols
~ tests/test_clones_e2e.py .py 22 symbols added
+ TestClonesE2E class class TestClonesE2E L65–141
+ test_E01_dashboard_links_to_clones method async_method test_E01_dashboard_links_to_clones L69–75
+ test_E02_list_row_links_to_detail method async_method test_E02_list_row_links_to_detail L78–84
+ test_E03_detail_back_link_to_clones method async_method test_E03_detail_back_link_to_clones L87–96
+ test_E04_tier_filter_round_trip method async_method test_E04_tier_filter_round_trip L99–116
+ test_E05_top_filter_round_trip method async_method test_E05_top_filter_round_trip L119–129
+ test_E06_empty_repo_no_500 method async_method test_E06_empty_repo_no_500 L132–141
+ _HASH_A variable variable _HASH_A L28–28
+ _HASH_B variable variable _HASH_B L29–29
+ _REF variable variable _REF L27–27
+ _seed function async_function _seed L32–50
+ empty_repo function async_function empty_repo L61–62
+ AsyncClient import import AsyncClient L20–20
+ AsyncSession import import AsyncSession L22–22
+ annotations import import annotations L14–14
+ create_repo import import create_repo L25–25
+ dbm import import dbm L24–24
+ json import import json L16–16
+ pg_insert import import pg_insert L21–21
+ pytest import import pytest L18–18
+ pytest_asyncio import import pytest_asyncio L19–19
+ repo function async_function repo L54–57
~ tests/test_clones_integration.py .py 35 symbols added
+ TestClonesDetailPage class class TestClonesDetailPage L216–335
+ cross_file_cluster method async_method cross_file_cluster L220–230
+ same_file_cluster method async_method same_file_cluster L233–243
+ test_I08_detail_200_known_hash method async_method test_I08_detail_200_known_hash L246–255
+ test_I09_detail_200_unknown_hash method async_method test_I09_detail_200_unknown_hash L258–267
+ test_I10_detail_200_no_cluster_param method async_method test_I10_detail_200_no_cluster_param L270–276
+ test_I11_dashboard_clones_card_with_data method async_method test_I11_dashboard_clones_card_with_data L279–290
+ test_I12_dashboard_clones_card_empty_state method async_method test_I12_dashboard_clones_card_empty_state L293–299
+ test_I13_detail_files_breakdown_present method async_method test_I13_detail_files_breakdown_present L302–311
+ test_I14_cross_file_badge_present method async_method test_I14_cross_file_badge_present L314–323
+ test_I15_same_file_no_cross_file_badge method async_method test_I15_same_file_no_cross_file_badge L326–335
+ TestClonesListPage class class TestClonesListPage L140–209
+ test_I01_list_200_with_clusters method async_method test_I01_list_200_with_clusters L144–150
+ test_I02_list_200_empty_state method async_method test_I02_list_200_empty_state L153–159
+ test_I03_tier_exact_filter method async_method test_I03_tier_exact_filter L162–170
+ test_I04_tier_near_filter method async_method test_I04_tier_near_filter L173–181
+ test_I05_invalid_tier_coerces_to_all method async_method test_I05_invalid_tier_coerces_to_all L184–192
+ test_I06_top_50_pill_active method async_method test_I06_top_50_pill_active L195–201
+ test_I07_out_of_range_top_clamps_to_default method async_method test_I07_out_of_range_top_clamps_to_default L204–209
+ _REF variable variable _REF L42–42
+ _insert_cluster function async_function _insert_cluster L74–101
+ _members function function _members L45–66
+ _same_file_members function function _same_file_members L69–71
+ AsyncClient import import AsyncClient L31–31
+ AsyncSession import import AsyncSession L33–33
+ annotations import import annotations L24–24
+ create_repo import import create_repo L36–36
+ dbm import import dbm L35–35
+ json import import json L26–26
+ pg_insert import import pg_insert L32–32
+ pytest import import pytest L28–28
+ pytest_asyncio import import pytest_asyncio L29–29
+ sa import import sa L30–30
+ repo function async_function repo L109–111
+ repo_with_clusters function async_function repo_with_clusters L115–133
~ tests/test_clones_performance.py .py 25 symbols added
+ TestClonesPerformance class class TestClonesPerformance L114–244
+ test_P01_list_query_500_rows_under_50ms method async_method test_P01_list_query_500_rows_under_50ms L117–132
+ test_P02_detail_query_single_row_under_10ms method async_method test_P02_detail_query_single_row_under_10ms L135–151
+ test_P03_dashboard_count_10k_rows_under_30ms method async_method test_P03_dashboard_count_10k_rows_under_30ms L154–168
+ test_P04_language_set_200_members_under_2ms method method test_P04_language_set_200_members_under_2ms L170–178
+ test_P05_file_count_200_members_under_2ms method method test_P05_file_count_200_members_under_2ms L180–188
+ test_P06_template_render_20_clusters_under_100ms method async_method test_P06_template_render_20_clusters_under_100ms L191–244
+ _REF variable variable _REF L33–33
+ _bulk_insert function async_function _bulk_insert L50–75
+ _make_members_json function function _make_members_json L36–47
+ detail_repo function async_function detail_repo L95–111
+ AsyncSession import import AsyncSession L24–24
+ _cl_file_count import import _cl_file_count L27–27
+ _cl_language_set import import _cl_language_set L27–27
+ annotations import import annotations L15–15
+ create_repo import import create_repo L31–31
+ dbm import import dbm L26–26
+ json import import json L17–17
+ pg_insert import import pg_insert L23–23
+ pytest import import pytest L20–20
+ pytest_asyncio import import pytest_asyncio L21–21
+ sa import import sa L22–22
+ time import import time L18–18
+ repo_10k function async_function repo_10k L87–91
+ repo_500 function async_function repo_500 L79–83
~ tests/test_clones_security.py .py 23 symbols added
+ TestClonesSecurity class class TestClonesSecurity L110–219
+ test_SEC01_path_traversal_in_cluster_param method async_method test_SEC01_path_traversal_in_cluster_param L119–130
+ test_SEC02_sql_injection_in_tier_param method async_method test_SEC02_sql_injection_in_tier_param L134–142
+ test_SEC03_sql_injection_in_top_param method async_method test_SEC03_sql_injection_in_top_param L151–164
+ test_SEC04_xss_in_cluster_param method async_method test_SEC04_xss_in_cluster_param L168–181
+ test_SEC05_members_json_html_escaped_in_output method async_method test_SEC05_members_json_html_escaped_in_output L184–196
+ test_SEC06_oversized_cluster_param_returns_200 method async_method test_SEC06_oversized_cluster_param_returns_200 L199–207
+ test_SEC07_null_bytes_in_cluster_param method async_method test_SEC07_null_bytes_in_cluster_param L210–219
+ _HASH variable variable _HASH L33–33
+ _REF variable variable _REF L32–32
+ _SQL_PAYLOADS variable variable _SQL_PAYLOADS L42–47
+ _XSS_PAYLOADS variable variable _XSS_PAYLOADS L35–40
+ AsyncClient import import AsyncClient L25–25
+ AsyncSession import import AsyncSession L27–27
+ annotations import import annotations L19–19
+ create_repo import import create_repo L30–30
+ dbm import import dbm L29–29
+ json import import json L21–21
+ pg_insert import import pg_insert L26–26
+ pytest import import pytest L23–23
+ pytest_asyncio import import pytest_asyncio L24–24
+ repo function async_function repo L51–76
+ xss_repo function async_function xss_repo L80–107
~ tests/test_clones_state_integrity.py .py 22 symbols added
+ TestClonesStateIntegrity class class TestClonesStateIntegrity L78–230
+ test_SI01_all_rows_parseable_members_json method async_method test_SI01_all_rows_parseable_members_json L81–104
+ test_SI02_tier_values_in_valid_set method async_method test_SI02_tier_values_in_valid_set L107–124
+ test_SI03_member_count_matches_json_length method async_method test_SI03_member_count_matches_json_length L127–149
+ test_SI04_upsert_is_idempotent method async_method test_SI04_upsert_is_idempotent L152–172
+ test_SI05_upsert_updates_existing_row method async_method test_SI05_upsert_updates_existing_row L175–195
+ test_SI06_cascade_delete_removes_clones method async_method test_SI06_cascade_delete_removes_clones L198–230
+ _REF variable variable _REF L29–29
+ _insert function async_function _insert L46–70
+ _make_members function function _make_members L32–43
+ AsyncMock import import AsyncMock L18–18
+ AsyncSession import import AsyncSession L24–24
+ annotations import import annotations L15–15
+ create_repo import import create_repo L27–27
+ dbm import import dbm L26–26
+ json import import json L17–17
+ patch import import patch L18–18
+ pg_insert import import pg_insert L23–23
+ pytest import import pytest L20–20
+ pytest_asyncio import import pytest_asyncio L21–21
+ sa import import sa L22–22
+ repo function async_function repo L74–75
~ tests/test_clones_stress.py .py 21 symbols added
+ TestClonesStress class class TestClonesStress L119–190
+ test_S01_list_500_clusters_under_500ms method async_method test_S01_list_500_clusters_under_500ms L122–132
+ test_S02_detail_300_members_under_300ms method async_method test_S02_detail_300_members_under_300ms L135–148
+ test_S03_dashboard_10k_clusters_under_500ms method async_method test_S03_dashboard_10k_clusters_under_500ms L151–161
+ test_S04_tier_filter_500_each_under_300ms method async_method test_S04_tier_filter_500_each_under_300ms L164–175
+ test_S05_file_breakdown_50_files_no_truncation method async_method test_S05_file_breakdown_50_files_no_truncation L178–190
+ _REF variable variable _REF L29–29
+ _bulk_insert function async_function _bulk_insert L32–68
+ AsyncClient import import AsyncClient L22–22
+ AsyncSession import import AsyncSession L24–24
+ annotations import import annotations L15–15
+ create_repo import import create_repo L27–27
+ dbm import import dbm L26–26
+ json import import json L17–17
+ pg_insert import import pg_insert L23–23
+ pytest import import pytest L20–20
+ pytest_asyncio import import pytest_asyncio L21–21
+ time import import time L18–18
+ repo_10k function async_function repo_10k L112–116
+ repo_500 function async_function repo_500 L72–76
+ repo_big_cluster function async_function repo_big_cluster L80–108
~ tests/test_intel_fidelity.py .py 31 symbols added
+ TestEntangleJaccard class class TestEntangleJaccard L235–278
+ test_F03_co_change_rate_is_jaccard method async_method test_F03_co_change_rate_is_jaccard L238–259
+ test_F04_commits_both_active_is_union_cardinality method async_method test_F04_commits_both_active_is_union_cardinality L262–278
+ TestHotspotsRoute class class TestHotspotsRoute L303–339
+ test_F05_hotspots_returns_200_without_legacy_snapshot method async_method test_F05_hotspots_returns_200_without_legacy_snapshot L306–311
+ test_F06_hotspots_ranked_by_churn_30d_descending method async_method test_F06_hotspots_ranked_by_churn_30d_descending L314–329
+ test_F07_hotspots_renders_address_and_change_count method async_method test_F07_hotspots_renders_address_and_change_count L332–339
+ TestStableCalendarDays class class TestStableCalendarDays L145–183
+ test_F01_symbol_30d_stale_has_days_stable_approx_30 method async_method test_F01_symbol_30d_stale_has_days_stable_approx_30 L148–165
+ test_F02_symbol_changed_today_has_days_stable_zero method async_method test_F02_symbol_changed_today_has_days_stable_zero L168–183
+ _NOW variable variable _NOW L33–33
+ _insert_history_entry function async_function _insert_history_entry L75–93
+ _insert_symbol_intel function async_function _insert_symbol_intel L44–72
+ _ts function function _ts L40–41
+ entangle_repo function async_function entangle_repo L191–232
+ hotspots_repo function async_function hotspots_repo L286–300
+ AsyncClient import import AsyncClient L25–25
+ AsyncSession import import AsyncSession L27–27
+ EntangleProvider import import EntangleProvider L30–30
+ StableProvider import import StableProvider L30–30
+ annotations import import annotations L18–18
+ create_repo import import create_repo L31–31
+ datetime import import datetime L20–20
+ dbm import import dbm L29–29
+ pg_insert import import pg_insert L26–26
+ pytest import import pytest L22–22
+ pytest_asyncio import import pytest_asyncio L23–23
+ sa import import sa L24–24
+ timedelta import import timedelta L20–20
+ timezone import import timezone L20–20
+ stable_repo function async_function stable_repo L101–142
~ musehub/services/musehub_intel_providers.py .py 2 symbols added, 6 symbols modified
+ _EXT_TO_LANGUAGE variable variable _EXT_TO_LANGUAGE L1397–1404
+ _lang_from_address function function _lang_from_address L1407–1411
~ tests/test_phase2_intel_providers.py .py 15 symbols removed
TestPhase2BlastRiskProvider class class TestPhase2BlastRiskProvider L268–302
test_P2_10_blast_risk_upserts_rows method async_method test_P2_10_blast_risk_upserts_rows L271–302
TestPhase2ClonesProvider class class TestPhase2ClonesProvider L381–412
test_P2_13_clones_upserts_rows method async_method test_P2_13_clones_upserts_rows L384–412
TestPhase2CouplingProvider class class TestPhase2CouplingProvider L141–191
test_P2_06_coupling_upserts_rows method async_method test_P2_06_coupling_upserts_rows L144–166
test_P2_07_coupling_upsert_overwrites_on_re_run method async_method test_P2_07_coupling_upsert_overwrites_on_re_run L169–191
TestPhase2DeadProvider class class TestPhase2DeadProvider L235–261
test_P2_09_dead_upserts_rows method async_method test_P2_09_dead_upserts_rows L238–261
TestPhase2EntangleProvider class class TestPhase2EntangleProvider L198–228
test_P2_08_entangle_upserts_rows method async_method test_P2_08_entangle_upserts_rows L201–228
TestPhase2StableProvider class class TestPhase2StableProvider L309–336
test_P2_11_stable_upserts_rows method async_method test_P2_11_stable_upserts_rows L312–336
TestPhase2VelocityProvider class class TestPhase2VelocityProvider L343–374
test_P2_12_velocity_upserts_rows method async_method test_P2_12_velocity_upserts_rows L346–374
← Older Oldest on task/intel-clones-tests
All commits
Newer → Latest on task/intel-clones-tests

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