gabriel / musehub public
feat coupling dev
AI Agent gabriel · 139 days ago · May 3, 2026 · Diff

feat(coupling): Phase 5 — 53-case test suite (CP_01–CP_49 + TestCpShort, 7 tiers)

Unit (CP_01-08): file derivation, heat modifier, pair canonicalisation Integration (CP_09-18): provider upserts, re-runs, counts, ref column E2E (CP_19-25): full seeded scenarios, min_co filter, top limit Performance (CP_26-32): timing bounds under realistic load State (CP_33-38): idempotency, stale-row purge, incremental updates Security (CP_39-44): injection strings, repo isolation, unicode paths Stress (CP_45-49): MAX_PAIRS cap, mass-commit exclusion, BFS cap

All 53 tests pass.

sha256:d3060644b846b7d00523a3499691ed45f8ec603601dc454f5295448f740d5a76 sha
+85 symbols
sha256:822cac3fbf034ac417a889c2e09a5d7503e1271761692ab6056da4fc3f49882d snapshot
+85
symbols added
0
dead code introduced
Semantic Changes 85 symbols
~ tests/test_coupling_provider.py .py 85 symbols added
+ TestCouplingE2E class class TestCouplingE2E L338–506
+ test_CP_19_three_files_correct_ranking method async_method test_CP_19_three_files_correct_ranking L341–364
+ test_CP_20_result_count_matches_stored_rows method async_method test_CP_20_result_count_matches_stored_rows L367–382
+ test_CP_21_truncated_true_over_max_pairs method async_method test_CP_21_truncated_true_over_max_pairs L385–403
+ test_CP_22_min_co_filter_in_route_helpers method async_method test_CP_22_min_co_filter_in_route_helpers L406–440
+ test_CP_23_top_limit_respected method async_method test_CP_23_top_limit_respected L443–465
+ test_CP_24_heat_high_on_stored_pairs method async_method test_CP_24_heat_high_on_stored_pairs L468–485
+ test_CP_25_bar_pct_100_for_top_pair method async_method test_CP_25_bar_pct_100_for_top_pair L488–506
+ TestCouplingIntegration class class TestCouplingIntegration L176–331
+ test_CP_09_empty_repo_returns_empty method async_method test_CP_09_empty_repo_returns_empty L179–185
+ test_CP_10_no_history_entries_returns_empty method async_method test_CP_10_no_history_entries_returns_empty L188–196
+ test_CP_11_single_co_change_below_threshold method async_method test_CP_11_single_co_change_below_threshold L199–209
+ test_CP_12_two_co_changes_produces_one_pair method async_method test_CP_12_two_co_changes_produces_one_pair L212–226
+ test_CP_13_three_files_produces_three_pairs method async_method test_CP_13_three_files_produces_three_pairs L229–243
+ test_CP_14_same_file_symbols_no_pair method async_method test_CP_14_same_file_symbols_no_pair L246–259
+ test_CP_15_pair_stored_canonical_a_lt_b method async_method test_CP_15_pair_stored_canonical_a_lt_b L262–276
+ test_CP_16_ref_column_populated method async_method test_CP_16_ref_column_populated L279–292
+ test_CP_17_co_changes_count_exact method async_method test_CP_17_co_changes_count_exact L295–311
+ test_CP_18_result_key_correct method async_method test_CP_18_result_key_correct L314–331
+ TestCouplingPerformance class class TestCouplingPerformance L513–639
+ test_CP_26_ten_commits_ten_files_under_500ms method async_method test_CP_26_ten_commits_ten_files_under_500ms L516–532
+ test_CP_27_100_commits_20_files_under_2s method async_method test_CP_27_100_commits_20_files_under_2s L535–551
+ test_CP_28_empty_repo_fast_path_under_50ms method async_method test_CP_28_empty_repo_fast_path_under_50ms L554–560
+ test_CP_29_rerun_not_5x_slower method async_method test_CP_29_rerun_not_5x_slower L563–576
+ test_CP_30_point_lookup_under_10ms method async_method test_CP_30_point_lookup_under_10ms L579–593
+ test_CP_31_200_pairs_query_fast method async_method test_CP_31_200_pairs_query_fast L596–614
+ test_CP_32_dashboard_preview_query_fast method async_method test_CP_32_dashboard_preview_query_fast L617–639
+ TestCouplingSecurity class class TestCouplingSecurity L781–884
+ test_CP_39_sql_injection_stored_verbatim method async_method test_CP_39_sql_injection_stored_verbatim L784–798
+ test_CP_40_xss_payload_stored_safely method async_method test_CP_40_xss_payload_stored_safely L801–815
+ test_CP_41_repo_isolation_strict method async_method test_CP_41_repo_isolation_strict L818–831
+ test_CP_42_two_repos_independent_pairs method async_method test_CP_42_two_repos_independent_pairs L834–851
+ test_CP_43_rerun_updates_ref_column method async_method test_CP_43_rerun_updates_ref_column L854–869
+ test_CP_44_unicode_in_path_handled method async_method test_CP_44_unicode_in_path_handled L872–884
+ TestCouplingState class class TestCouplingState L646–774
+ test_CP_33_idempotent_two_runs method async_method test_CP_33_idempotent_two_runs L649–666
+ test_CP_34_stale_rows_purged_on_rerun method async_method test_CP_34_stale_rows_purged_on_rerun L669–690
+ test_CP_35_incremental_new_pair_appears method async_method test_CP_35_incremental_new_pair_appears L693–716
+ test_CP_36_no_duplicate_pairs_after_3_runs method async_method test_CP_36_no_duplicate_pairs_after_3_runs L719–734
+ test_CP_37_co_changes_increases_with_new_commits method async_method test_CP_37_co_changes_increases_with_new_commits L737–758
+ test_CP_38_truncated_false_when_under_cap method async_method test_CP_38_truncated_false_when_under_cap L761–774
+ TestCouplingStress class class TestCouplingStress L891–995
+ test_CP_45_max_pairs_cap_respected method async_method test_CP_45_max_pairs_cap_respected L894–912
+ test_CP_46_mass_commit_excluded method async_method test_CP_46_mass_commit_excluded L915–937
+ test_CP_47_500_commits_completes method async_method test_CP_47_500_commits_completes L940–955
+ test_CP_48_result_count_matches_stored method async_method test_CP_48_result_count_matches_stored L958–975
+ test_CP_49_bfs_walk_cap method async_method test_CP_49_bfs_walk_cap L978–995
+ TestCouplingUnit class class TestCouplingUnit L123–169
+ test_CP_01_file_from_symbol_address method method test_CP_01_file_from_symbol_address L126–130
+ test_CP_02_bare_path_is_file method method test_CP_02_bare_path_is_file L132–136
+ test_CP_03_pair_key_canonical_a_lt_b method method test_CP_03_pair_key_canonical_a_lt_b L138–142
+ test_CP_04_same_file_pair_excluded method method test_CP_04_same_file_pair_excluded L144–150
+ test_CP_05_heat_low method method test_CP_05_heat_low L152–155
+ test_CP_06_heat_medium method method test_CP_06_heat_medium L157–160
+ test_CP_07_heat_high method method test_CP_07_heat_high L162–165
+ test_CP_08_min_co_changes_constant method method test_CP_08_min_co_changes_constant L167–169
+ TestCpShort class class TestCpShort L1002–1015
+ test_deep_path_truncated_to_two_parts method method test_deep_path_truncated_to_two_parts L1005–1006
+ test_single_component_unchanged method method test_single_component_unchanged L1008–1009
+ test_two_components_unchanged method method test_two_components_unchanged L1011–1012
+ test_very_deep_path method method test_very_deep_path L1014–1015
+ _cid function function _cid L42–43
+ _fetch function async_function _fetch L94–100
+ _run function async_function _run L90–91
+ _seed_commit function async_function _seed_commit L46–66
+ _seed_history function async_function _seed_history L69–87
+ AsyncSession import import AsyncSession L29–29
+ CouplingProvider import import CouplingProvider L33–33
+ _cp_heat import import _cp_heat L34–34
+ _cp_short import import _cp_short L34–34
+ annotations import import annotations L18–18
+ create_repo import import create_repo L35–35
+ datetime import import datetime L23–23
+ db import import db L32–32
+ defaultdict import import defaultdict L22–22
+ fake_id import import fake_id L31–31
+ pg_insert import import pg_insert L28–28
+ pytest import import pytest L25–25
+ pytest_asyncio import import pytest_asyncio L26–26
+ sa import import sa L27–27
+ secrets import import secrets L20–20
+ time import import time L21–21
+ timezone import import timezone L23–23
+ repo function async_function repo L108–109
+ two_repos function async_function two_repos L113–116
← Older Oldest on dev
All commits
Newer → Latest on dev

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