Conversation
TESTED_BY edges can store bare source names while the query uses path-qualified names, so tests_for returned 0 for symbols that are covered (tirth8205#903). A fallback retry with the bare name catches this mismatch.
code-review-graph reviewOverall risk: 0.75 (HIGH) — 3 changed function(s)/class(es), 1 affected flow(s), 1 test gap(s) Risk-scored changes
Affected execution flows
Test gaps
Token savings: this graph-backed report used ~12,878 fewer tokens (~81%) than reading every changed file in full (estimated, chars/4 approximation). Powered by code-review-graph — local-first analysis; no code leaves the CI runner. |
|
Changes required: the extra bare-name retry bypasses the evidence safeguards already used by |
|
Holding this one: the problem is the change, not the tests. Reject: the change is wrong on staging. (1) Issue #903's root cause (file paths compared against dotted module names in the evidence gate) was already fixed by PR #960 (commit 3d6e303 on staging) with proper tests; the probe shows the PR changes nothing for the #903 scenario. (2) The added retry calls store.get_transitive_tests(node.name) with the BARE name, whose direct lookup What would change our mind:
Checks pass, so this only showed up when we probed the behaviour directly. Push back here if you think that is wrong. PRs now target |
|
The bare-name retry invents test attributions. I built graphs on both branches over psf/requests and scrapy/scrapy and swept One I checked by hand: That test instantiates a subclass of The unevidenced rows also consume the The stored graph is untouched. Both branches produce identical node and edge tables on both repos, 8027 nodes and 53764 edges on scrapy, with zero node or edge identities differing. Existing databases are safe. Gates are green on the head, 4236 passed, ruff clean, mypy clean across 77 files. Nothing has changed since the last review. The only commit added is a staging merge with no code change, so all four requested changes are still outstanding:
|
Summary
TESTED_BYedges can store bare source names while thetests_forquery uses path-qualified names (/abs/path/file.py::ClassName.method). When the qualified-name lookup returns nothing, the query silently reports covered code as uncovered (#903).The fix adds a fallback: when
get_transitive_tests(qualified_name)returns no results and the node has a barenamedifferent from the qualified name, retry with the bare name. This catches the mismatch without changing any edge storage.Testing
New
tests/test_tests_for_bare_name.py— source-level guard verifying the fallback exists:Fixes #903