Skip to content

Drop the TESTS edge kind and its filename-affix machinery#70

Open
janrito wants to merge 2 commits into
feat/lang-plugin-architecturefrom
feat/drop-test-edges
Open

Drop the TESTS edge kind and its filename-affix machinery#70
janrito wants to merge 2 commits into
feat/lang-plugin-architecturefrom
feat/drop-test-edges

Conversation

@janrito

@janrito janrito commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Remove the TESTS edge — the graph link from a test to the code it
exercises — and the per-plugin configuration that drove it.

infer_test_edges linked a test function to the source symbol it tests.
It located the source by filename conventiontest_prefix /
test_suffix stripped test_foo.py down to foo to guess the matching
file — then either linked test functions to the symbols the test actually
imports, or, failing that, fell back to linking every test function to the
first symbol in the file. That fallback is a guess, and the rest is
redundant: the “test imports the code” relationship it leaned on is already
recorded as an IMPORTS edge, independently. So the dedicated TESTS edge
was a noisy, name-matching-dependent layer over a signal the import edge
already carries, and test_prefix / test_suffix were per-plugin
configuration that every one of the ~20 languages still to be packaged
would otherwise have to carry.

Import edges are untouched — including cross-language ones, like an HTML
page's <script> and <link> resolving to js/ts/css, and language
injection — so only the test-specific edge and its configuration go.
Confirming that a language actually produces its edges, the one thing the
removed feature was informally used for, is covered instead by each
package's sample, which pins its real import edges; injection-capable
packages embed other-language code so their cross-language edges are
pinned too.

The docs that advertised the feature — the find-refs edge-kind lists and
the rbtr_find_refs tool description — drop their tests mentions.

No extraction changes. The generated TypeScript EdgeKind type drops
"tests" to match.

janrito added 2 commits July 8, 2026 23:51
infer_test_edges linked a test function to the source symbol it tests,
using test_prefix/test_suffix filename conventions plus import analysis
(with a crude fallback to the first source symbol). The real signal — the
test file importing the code — is already captured as an IMPORTS edge, so
the dedicated TESTS edge was largely redundant and its name-matching was
noise. Remove test_prefix/test_suffix from LanguageRegistration and all
plugins, delete infer_test_edges + _strip_test_affix + the now-orphaned
_find_source_file/_imported_names_from_file, drop EdgeKind.TESTS, and
excise the test-edge cases/tests. Import and cross-language/injection
edges are untouched. Regenerate the pi-rbtr protocol schema.
Commit dropping the feature missed the doc/extension surface that still
advertised it: the find-refs edge-kind lists in both READMEs and the
rbtr_find_refs tool descriptions (kind=imports|tests|docs, 'which tests
cover X'). Update them to imports/docs only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant