Skip to content

fix(extract): emit Java annotation type references - #2448

Open
oleksii-tumanov wants to merge 1 commit into
Graphify-Labs:v8from
oleksii-tumanov:fix/java-annotation-type-references
Open

fix(extract): emit Java annotation type references#2448
oleksii-tumanov wants to merge 1 commit into
Graphify-Labs:v8from
oleksii-tumanov:fix/java-annotation-type-references

Conversation

@oleksii-tumanov

Copy link
Copy Markdown
Contributor

Summary

  • emit references edges for class literals inside Java type and method annotation arguments
  • emit return-type references for Java annotation members, including array component types
  • cover the reciprocal @Repeatable relationship with cross-file resolution to source-backed nodes

Fixes #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 in tests/test_security.py)
  • pytest tests/test_security.py -q --tb=short with normal DNS resolution (60 passed)
  • python -m tools.skillgen --check (134 artifacts matched)
  • ruff check graphify/extractors/engine.py tests/test_languages.py (passed)

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.

Java annotation arguments (@Repeatable(RubricsFor.class)) emit no reference edge, leaving the container annotation disconnected

1 participant