Repository navigation
plugin: enrich lines say why a count is 0, and an edit gets one line of tests (#1507) - #1617
Merged
Merged
Conversation
…of tests (#1507, #1546, #1604) Read/Grep enrichment: - A method with no resolved caller no longer prints a bare "<- 0". It prints "<- entry (http)" from entry_points, "<- ? framework (@x)" from a non-inert decoration on the method, "<- 0 resolved, N by name" from unresolved call sites that write its name, "? framework (overrides a library method)" for an @OverRide with no base in the repo, and "? framework (@x on Owner)" from a class annotation. With no signal it still reads "<- 0". - The Grep caller preview names production callers before test callers and counts the tests apart (#1507). - A name declared several times lists the base first with its override count, production before tests, then by path; same-named files print with the path suffix that tells them apart, and the rest are counted (#1546). - A shell grep after a pipe, or over files no graph indexes, adds nothing; a constant-shaped word (FAIL, DONE) is not looked up; a shell grep matches whole names; the Grep tool's prefix match is case-sensitive (GLOB) instead of LIKE (#1604). - A Read whose callables have no edges no longer prints a header over no lines. Edit hooks (enrich.py and changes.py): - An edit that changes no declaration prints nothing. - A declaration already reported this session is not reported again on the PostToolUse Edit path. - A body-only change prints one line: the tests that reach it and the command test-impact would print for them. - Impact is asked with the target as `changed` prints it; the package-qualified target was refused, so every Java signature edit said "(impact unavailable)". tests/enrich_lines.py: 28 checks with near-miss controls; 21 fail on the base branch, all controls hold there.
swapnilpaliwal-sd
requested review from
JaredHLZhang,
Whua689 and
suyashpaliwal26
as code owners
September 28, 2026 08:12
This was referenced Sep 28, 2026
java: the Grep caller preview names test callers and hides production callers, ordered by name
#1507
Closed
Merged
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.
Fixes #1507, #1546, #1604
What was wrong
The PostToolUse enrichment is what agents read after every Read, Grep and Edit, and most of it went unused:
← 0on framework-called methods. A route handler, a scheduled job, an@app.before_requesthook or a library override printed← 0, which reads as dead code. The graph already stores why (entry_points,decorations, unresolved call sites by name), and the hook never read it.displayorder, so test methods took both name slots and production callers hid behind the count.adapter-*took both lines (printed identically) and the base, the main-source override and the count were dropped.LIKE, soFAILnamedfailandPARSERnamedparserPresent.changed, which impact refuses, so every Java signature edit said "(impact unavailable)".The change
hooks/_graphline.py(new):zero_label()printsentry (<reason>),? framework (@X),0 resolved, N by name,? framework (overrides a library method),? framework (extends B)or? framework (@X on Owner), in that order of strength. With no signal it prints0. Each is one indexed query.body_line()prints the tests that reach a body edit and the command, usingcommand_forfrom test-impact.distinct_paths()gives the shortest path suffix that tells same-named files apart.hooks/enrich.py:ORDER BY is_test, displayand count test callers separately.⇣ N override(s)), then production, then path, with(+N more declaration(s)).|, or over non-source files, is silent. Constant-shaped words are skipped, a shell grep matches whole names, and the prefix match usesGLOB.hooks/changes.py: the same one line for body-only changes on the Bash and UserPromptSubmit paths.shown_target.graph_sql.impactalso returnstest_ids, an additive key.Tests
tests/enrich_lines.py: 28 checks, each silence paired with a near-miss control. 21 fail on0.1.4, and all controls hold there. Suites:enrich_budget17/17,hosts,fastpath4/4,directive12/12, andrun.py: java 119/119, python 71/71, csharp 14/14.Smoke (corpus copies, fresh index, before vs after)
←0. After: 3←entry (http), 3←? framework (@ModelAttribute / @InitBinder)and 1 more entry. Grep previews now name production callers first (<two production callers>, …; 5 in tests), and the base interface comes first with its override count.graph: body edit of <Service>.<method>: 3 test(s) reach it; run: mvn test -Dtest=<TestClass>. A comment-only edit is silent before and after.←0to←? framework (@app.before_request).pytest | grep -E 'FAILED|ERROR'used to name an unrelatederror_...helper, and is now silent. A grep over source is still annotated.Deep scan deferred: no full-corpus or held-out measurement was run; the smoke numbers above are the only corpus numbers.