feat(#550): git co-change ranking signal#609
Merged
Merged
Conversation
git.zig gains parseCoChange — a pure parser over git log --name-only --pretty=format:%H output (commit boundaries detected as 40-hex lines, mega-commits and git-quoted names skipped) — plus buildCoChange (shell out via cio.runCapture, bounded: 500 commits, 32 files/commit, top 8 partners/file) and freeCoChange. Explorer builds the map lazily (ensureCoChange, own mutex, attempted flag so a non-repo never re-shells; root path captured in setRoot) and folds it into both ranking paths as coChangeBoost: files that historically change with the files DEFINING the queried symbol get a >=1 multiplier (noise floor 2 shared commits, saturating at 8 -> x1.25). Seeds are defining files only, so plain-word queries never trigger the one-time git shell-out. CODEDB_NO_COCHANGE opts out. The tier0 defines scan now shares the new fileDefinesSymbol helper. Suite: 813/813. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Benchmark Regression ReportThresholds: 10.00% and 50,000 ns absolute delta
|
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.
Signal 2 of #550 — step 1 of the two-step finish for the ranking lane (#531 pick 4's ranking half).
What
parseCoChange— pure parser overgit log --name-only --pretty=format:%Htext (40-hex lines are commit boundaries; mega-commits >32 files and git-quoted exotic names skipped as co-change noise) → per-file top-8 partner lists by shared-commit count.buildCoChangeshells out via the existingcio.runCapture(bounded: 500 commits, 8 MB output cap);freeCoChangeowns cleanup.ensureCoChange(own mutex + attempted flag — a non-repo root never re-shells;setRootnow also keeps the root path).coChangeBoostfolds it into both ranking paths: files that historically change together with the files defining the queried symbol get a ≥1 multiplier — noise floor 2 shared commits, saturating at 8 → ×1.25. The temporal sibling of the call-graph distance boost from feat(#546,#550): defines-first tier0 candidates + call-graph distance ranking #608.git logshell-out (~200 ms on this repo, once per process; the warm daemon pays it once ever).CODEDB_NO_COCHANGEopts out.fileDefinesSymbolhelper (one impl).Tests
issue-550: parseCoChange builds bounded per-file partner lists— pure-fn parser test: pair counting across commits, mega-commit skip, count-desc ordering, max_partners truncation.issue-550: co-change partner of the defining file outranks an unrelated equal-lexical file— injected co-change map; partner and stranger are lexically identical, only history distinguishes them.CODEDB_NO_COCHANGE=1vs off): identical recall, definition-first order preserved, no crashes against real git history.Suite: 813/813.
🤖 Generated with Claude Code