feat(git): coupling score weights -> config (bo-y1kd)#34
Merged
Conversation
calculate_coupling_score baked in 0.7*freq + 0.3*recency with a 30-day recency knee. Surface both as [git] config: - coupling_freq_weight (default 0.7; recency weight = 1 - this) - coupling_recency_days (default 30.0; recency decay knee) Threaded through analyze_coupling + reindex_coupling (calibrate). Defaults reproduce prior behavior exactly (zero change). Non-positive recency_days falls back to 30 to guard the decay. Tests cover default + custom weights and custom knee; docs updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GuQ96t4m1vzFQ6v72btayV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
calculate_coupling_score(src/index/git.rs) hardcoded0.7*freq + 0.3*recencywith a 30-day recency knee. Surfaces both as[git]config:coupling_freq_weight(default 0.7; recency weight =1 - this)coupling_recency_days(default 30.0; recency decay knee — a pair last changed N days ago scores 0.5 on recency)Affects
bobbin related+ PPR seeding scores.How
Threaded the two weights through
analyze_coupling→calculate_coupling_score, and throughreindex_couplingin the calibrate path. Index + calibrate call sites read fromconfig.git.Safety
coupling_recency_daysfalls back to 30 to guard the decay denominator.Tests
test_calculate_coupling_scoreextended: default weights (3 cases, unchanged), custom recency-dominant weights, and custom 60-day knee. Config round-trip + legacy-git-config tests green. Docs[git]block updated.🤖 Generated with Claude Code