Skip to content

test(kotlin): isolate FQ class literals and builtin filtering - #4112

Closed
xiehuanyi wants to merge 1 commit into
Graphify-Labs:v8from
xiehuanyi:test/kotlin-class-literal-boundaries
Closed

xiehuanyi wants to merge 1 commit into
Graphify-Labs:v8from
xiehuanyi:test/kotlin-class-literal-boundaries

Conversation

@xiehuanyi

Copy link
Copy Markdown
Contributor

What does this PR do?

Fully-qualified Kotlin annotation class literals must resolve the class name; builtins such as String::class must not create a target. Add independent fixtures so the existing mixed bare/FQ fixture cannot hide a broken strip branch. The builtin test also requires the legitimate annotation edge, so empty extraction cannot pass.

Closes #4079.

Type of change

  • Tests or CI

Verification & Invariants

This adds isolated boundary coverage for existing extraction behavior. No production extraction or persisted graph schema changes.

  • Read CONTRIBUTING.md and applicable repository instructions.
  • Identified the missing boundary requested in the issue.
  • Kept the change to one test file.
  • Added meaningful positive and negative assertions where applicable.
  • Description matches the final implementation.
  • Test-only coverage; no claim that current production behavior is broken.

How was this tested?

pytest tests/test_kotlin_grammar.py -q: 29 passed.

Full suite: 6554 passed, 14 skipped.

Focused Pyright: 0 errors.

Earlier attempts #4087 and #4103 were closed without merging; no open PR currently covers this issue.

Ruff and AST-only graphify update . pass. Pyright reports the same 598 existing errors as unmodified v8, with an identical error-message multiset and explicit shared Python environment; this is not a clean whole-project typecheck.

Graphify-specific checklist

  • No skill fragments changed; generated skills do not need regeneration.
  • AST/structural extraction stays deterministic.
  • No unsafe shell/Python interpolation introduced.
  • No API keys or local graph outputs committed.
  • AI assistance disclosed in commit metadata.

@xiehuanyi
xiehuanyi requested a review from safishamsi as a code owner October 5, 2026 14:39
Copilot AI balanced review requested due to automatic review settings October 5, 2026 14:39

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Thanks for the pull request, @xiehuanyi. A maintainer will review it soon.

Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions.

A couple of things that speed up review: make sure the test suite passes on Python 3.10 and 3.13, and that the change keeps extraction deterministic.

@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.

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

Adds Kotlin grammar tests for annotation class-literal arguments. A fully qualified literal like com.example.Customer::class must still produce an attribute-context references edge to Customer. A builtin literal like String::class must keep the edge to the annotation itself but never create a String node.

No blocking issues surfaced. 2 lower-confidence candidates did not survive cross-model review.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 43 functions depend on the 43 functions this change touches.

Health — grade A; no new coupling hotspots.

Verification — 43 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: 43 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

1 of 329 test file(s) selected (0%) via static blast radius.

  • tests/test_kotlin_grammar.py — impact, changed-test

Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.

@safishamsi

Copy link
Copy Markdown
Member

Landed in v0.9.77 via an authorship-preserving cherry-pick, so your commit is on v8 with you credited as the author. Closing as shipped — thanks @xiehuanyi!

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.

test(kotlin): assert FQ-strip and builtin-filter for ::class annotation refs

3 participants