Repository navigation
fix(rank): share one file-classification signal across every surface - #209
Merged
Merged
Conversation
Three faces of one defect: a classification predicate that should be shared was duplicated or only half-wired, so the same question got different answers depending on which surface asked it. `is_test_file` existed twice and disagreed in BOTH directions — the CLI knew `/e2e/` but not `_test.`, the MCP side the reverse. So `affected` reported `affectedTests: []` for a Go package whose `_test.go` file it had just listed under `affectedFiles`, reading as "no coverage" for Go's entire convention. Neither spelling covered a repo-root `e2e/` tree either, since both matched on `/e2e/` with a leading slash: segment-anchored matching fixes a hole the plain union would have left. A third, wider predicate in codegraph-graph answers a different question (FTS relevance damping) and is deliberately left alone. Generated-file demotion was wired into `find_symbol_matches` and `find_all_symbols` but never into `explore`, so `codegraph node` ranked a real implementation above its protobuf stub while `codegraph explore` did the opposite on the same index — and `.pb.go` was already a known pattern. The signal now enters `ExploreSubgraph::finalize` inside the tier, below relevance and above symbol count, so a stub loses to the code it shadows without falling behind an unrelated file, and still renders when it is the only match. It remains a ranking hint, never a filter. The pattern set itself covered 5 suffixes against upstream's table; it now covers Go mockgen, TS/JS codegen, vendored minified bundles, and Python/C++/C# protobuf. `mock_<name>.go` is anchored to the basename, as upstream has it, and the table stays case-sensitive. Ranking and classification only: extraction output, goldens, and CURRENT_EXTRACTION_VERSION are untouched.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #209 +/- ##
==========================================
+ Coverage 95.18% 95.22% +0.03%
==========================================
Files 136 137 +1
Lines 73024 73336 +312
==========================================
+ Hits 69510 69833 +323
+ Misses 3514 3503 -11
... and 4 files with indirect coverage changes 🚀 New features to boost your workflow:
|
h2 accepted and queued empty DATA frames without limit, so a peer that never drained a stream could drive unbounded memory growth or a length overflow panic. Reachable here through hyper under axum, which `serve --http` uses. Advisory published 2026-08-17 and patched in 0.4.16; we were pinned at 0.4.15, so CI's audit job started failing on a lockfile we had not touched. Lockfile only — no manifest change, hyper resolves it transitively.
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.
Three faces of one defect, found while triaging the 104 upstream commits past
v1.5.0. All three are our own internal inconsistencies — the upstream issues only pointed at where to look.is_test_fileexisted twice and disagreed in both directionsGo's convention is
foo_test.go, soaffectedreported no test coverage for a package whose test file it had just listed:Measured before/after on a Go fixture:
affectedTests[]["e2e/flow.go", "math_test.go"]The plain union would not have been enough. Both spellings matched
/e2e/with a leading slash, so a repo-roote2e/tree missed on both sides — including the pattern the CLI supposedly had. Segment-anchored matching is a strict superset and closes that hole too:A third, wider predicate (
codegraph-graph/src/query/scoring.rs:481) answers a different question — FTS relevance damping, includingNON_PRODUCTION_DIRS— and is deliberately left alone.Generated-file demotion never reached
exploreIt was wired into
find_symbol_matchesandfind_all_symbolsbut not into theexploreselection path, so the same index answered two ways — and.pb.gowas already a known pattern, so this was never a coverage miss:node ComputePayzz_real.go,a_gen.pb.goexplore ComputePaya_gen.pb.go,zz_real.gozz_real.go,a_gen.pb.goThe signal now enters
ExploreSubgraph::finalizeas(tier, not_generated, sym_count)— inside the tier, so a stub loses to the code it shadows without falling behind an unrelated file, and above symbol count, so a symbol-dense stub no longer wins on volume. It stays a ranking hint, never a filter: a generated file still renders when it is the only match, pinned by its own guard test.The pattern set was 5 suffixes
Now covers upstream's table: Go mockgen (
_mock.go,_mocks.go,mock_<name>.go), TS/JS codegen (.generated.*,.gen.*,*_pb.*,_grpc_pb.*), vendored.min.js, and Python/C++/C# protobuf.mock_<name>.gois anchored to the basename as upstream has it, and the table stays case-sensitive.Content-header detection (
files.generated, upstream #1500) is deliberately not here — it needs a schema column and gets its own review.Verification
make cigreen: 127 suites / 3172 passed / 0 failed (baseline 3156; the +16 are the new tests).not_generatedto a constant fails with the exact ordering, not a tautology:left: ["payroll/a_gen.pb.go", "payroll/zz_real.go"]/right: ["payroll/zz_real.go", "payroll/a_gen.pb.go"].reference/untouched,CURRENT_EXTRACTION_VERSIONstill 5, noCargo.tomlchange, guardrail passes.Ranking and classification only — no extraction output changes.
Upstream refs: #1507 (Go
affected), #1500-adjacent path table.