Repository navigation
Test breadth: count a file as tested only when a same-named test imports it - #43
Merged
Merged
Conversation
Test breadth paired a source file with any same-named test anywhere in the repo, so a test for one page.tsx marked every page.tsx as tested. For JavaScript and TypeScript the scan now builds the code graph and requires the same-named test to import the file. The graph does not resolve every repo's test imports (Vue single-file components, aliases defined only in bundler config, dynamic imports), so each stack checks itself: if the graph sees the import for fewer than half of its same-named test pairs, it falls back to name pairing and the report says so. Other stacks keep name pairing. A system on name pairing scores exactly as before. C1's link rules move into classifyLink so the module graph and the file graph share one definition. The criterion page is updated to match. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…llbacks Review fixes: test pairing reads .vue components and does not apply the stdlib name filter to a test's imports; the graph is only built for stacks that count; the threshold compares the unrounded rate; a fallback is named in the audit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
maciej-szlosarczyk
approved these changes
Oct 13, 2026
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 changes
Test breadth (C6) used to count a source file as tested when any test with the same basename existed anywhere in the repo. One
page.test.tsxmarked everypage.tsxas tested.For JavaScript and TypeScript, a file now counts as tested only when a same-named test imports it, read from the code graph (graphify, already pinned for C1). The C6 scan builds the graph itself when it needs it.
When it falls back
The graph does not resolve every repo's test imports. Vue single-file components, aliases defined only in bundler config and dynamic imports are the known gaps. So each stack checks itself. Of the files that have a same-named test, if the graph sees the import for fewer than half, the stack falls back to name pairing. The report gives the share and the reason.
Every other stack (Elixir, Ruby, Python) keeps name pairing.
What does not change
classifyLink, and C1 reports are byte-identical before and after on the repos tested.Expected effect
On JS/TS repos where the graph resolves well, breadth drops by a few points, because files credited by name alone stop counting.
Checks
Cost: one extra graphify run per scan for repos with JS/TS tests (about a minute on a large monorepo).
🤖 Generated with Claude Code