feat(coverage): test-coverage mapping — TestNode + covered-by (5.4)#37
Merged
officialCodeWork merged 1 commit intoJul 15, 2026
Merged
Conversation
New `TestNode` (kind `test`, framework vitest/jest/unknown) and `covered-by` edge in core; lineage-graph schema regenerated, drift gate green. A `detectTests` parser pass excludes test files from the component/instance scan (isTestFile) so they never emit spurious nodes, then sweeps them: every component a test renders (JSX tag) or imports becomes a covered-by edge. Imports are resolved to their source file for precise attribution, with a name fallback. The context bundle populates its `tests` section from the matched component's render subtree (componentSubtree) and pushes an `untested` warning when the matched component has no coverage; blastRadius counts a test as a dependent of the component it covers. New f3-test-coverage fixture + GoldenCoverage / `coverage` check kind (UserList covered, Sidebar untested). 6 parser unit tests incl. two bundle-level. eval 262/0/0, gate OK. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
TRACKER step 5.4 — Test coverage mapping (failure mode F3).
TestNode(kindtest,framework: vitest | jest | unknown) and acovered-byedge (component → test). Lineage-graph JSON schema regenerated; drift gate green.detectTests): test files (*.test.*,*.spec.*,__tests__/) are excluded from the component/instance scan viaisTestFile, so a test'srender(<UserList/>)never materializes a spurious component or instance. They're then swept separately: each component a test renders (JSX tag head) or imports becomes acovered-byedge. Imports are resolved to their source file for precise attribution (so two same-named components don't cross-link), with a name fallback for unresolved JSX tags.testssection is populated from the matched component's render subtree (componentSubtreewalksrenders → instance-of), and anuntestedwarning is pushed when the matched component itself has no coverage.blastRadiusnow counts a test as a dependent of the component it covers.Accept
f3-test-coveragefixture:UserListhas a co-locatedUserList.test.tsxthat renders it;Sidebarhas none.bundle "Ada Lovelace"→ matches UserList,tests: [components/UserList.test.tsx], no untested warning.bundle "Dashboard Settings"→ matches Sidebar,tests: [],warnings: ["untested — no test renders Sidebar"].New
GoldenCoveragetype +coveragecheck kind in the eval harness.Verification
coverage.test.tswith 6 tests, core 46, agent-sdk 14, vision 3)🤖 Generated with Claude Code