fix(extract): emit Java annotation type references - #2448
Conversation
There was a problem hiding this comment.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
This PR extends the Java extraction logic in graphify/extractors/engine.py to capture type references from annotation arguments. It adds a helper (_java_annotation_nodes) to enumerate annotation nodes and refactors the existing _java_annotation_names to use it, then introduces _java_annotation_class_literal_refs to collect type names used in class-literal annotation arguments (e.g. @UsesRules(Foo.class)). New extraction branches wire these class-literal references into references/attribute edges for classes and functions, and add handling for annotation_type_element_declaration return-type references. The test file adds two new tests covering class-literal annotation arguments and repeatable-annotation container/element type references across multiple files. I've described the intent and surface area only, without evaluating correctness.
No blocking issues surfaced.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 808 functions depend on the 608 functions this change touches.
Health — grade A; 10 existing hotspot(s) in the area this change touches (pre-existing, not introduced here):
_extract_generic()— 18 callers, 15 callees (high)extract_xaml()— 19 callers, 12 callees (high)extract_objc()— 27 callers, 5 callees (high)extract_julia()— 16 callers, 4 callees (high)extract_vue()— 10 callers, 6 callees (high)extract_groovy()— 14 callers, 3 callees (high)extract_astro()— 6 callers, 5 callees (medium)_js_extra_walk()— 2 callers, 6 callees (medium)- …and 2 more
Verification — 808 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 766 function(s) in the blast radius were not formally verified this run
Summary
referencesedges for class literals inside Java type and method annotation arguments@Repeatablerelationship with cross-file resolution to source-backed nodesFixes #2426
Result
Label-normalized edges from the issue reproducer:
[ { "source": "RubricFor", "target": "RubricsFor", "relation": "references", "context": "attribute", "confidence": "EXTRACTED" }, { "source": "RubricsFor", "target": "RubricFor", "relation": "references", "context": "return_type", "confidence": "EXTRACTED" } ]Testing
pytest tests/test_languages.py tests/test_java_type_resolution.py tests/test_java_member_calls.py -q --tb=short(341 passed, 13 skipped)pytest tests/ -q --tb=short(3902 passed, 36 skipped; 7 DNS-resolution-only failures intests/test_security.py)pytest tests/test_security.py -q --tb=shortwith normal DNS resolution (60 passed)python -m tools.skillgen --check(134 artifacts matched)ruff check graphify/extractors/engine.py tests/test_languages.py(passed)