feat(ingestion): add Kotlin scope resolver#1727
Conversation
|
Someone is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
CI Report✅ All checks passed Pipeline Status
Test Results
✅ All 9360 tests passed 1 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
|
Claude finished @magyargergo's task in 12m 7s —— View job PR #1727 Deep Review — Kotlin Scope ResolverTasks:
Review bar for this PR
Current PR state
Branch hygiene assessmentVerdict: clean feature/fix PR Single commit touching only Understanding of the change
FindingsFinding: CI forced-mode Kotlin validation is absent Severity: high File(s): Evidence: Risk: Any regression in the forced/shadow adapter goes undetected until manual re-run before the flip. The 154 passing forced-mode fixtures carry no CI-enforced regression protection. Recommended fix: Add a non-required CI step (e.g., a Blocks merge: maybe — this is the same pattern accepted for Java (#1482), so precedent allows it; but the DoD §12 requires CI scope-parity coverage. Whether the Java precedent overrides the DoD is a maintainer judgment call. Finding: Companion member owner assignment makes companion methods graph-indistinguishable from instance methods Severity: high File(s): Evidence: Risk: In forced mode ( Recommended fix: Distinguish companion methods from instance methods by keeping companion defs under the companion object's nodeId as the primary owner. Add a secondary edge or qualifier (e.g., Blocks merge: maybe — production default is legacy; forced-mode only. Pre-flip blocker per DoD §9. Finding: Severity: medium File(s): Evidence: Risk: No production regression (legacy path uses Recommended fix: Either remove the Blocks merge: no — no production impact. Finding: Severity: medium File(s): Evidence: Risk: In forced mode, complex-receiver member calls generate both a member-call edge AND a spurious free-call edge. If a free-call candidate named identically to the member method exists in scope, a false CALLS edge is emitted. Contributes to the 21 forced-mode fixture failures. Recommended fix: Narrow the guard to only synthesize the free-call fallback when the member's Blocks merge: no — Kotlin not in MIGRATED_LANGUAGES; contributes to known forced-mode gap. Finding: Trailing lambda arguments are not counted by Severity: medium File(s): Evidence: Risk: Very common Kotlin pattern ( Recommended fix: Extend Blocks merge: no — forced-mode only. Pre-flip blocker. Finding: Severity: low File(s): Evidence: The query pattern captures Risk: Currently harmless because Recommended fix: Change Blocks merge: no — harmless under current framework semantics. Finding: Global mutable cache stats in Severity: low File(s): Evidence: Module-level Risk: Metric-only; no resolution correctness impact. Nondeterministic stats if order changes. Not a blocker. Recommended fix: Call Blocks merge: no Kotlin static-analysis semanticsThe lexical scope model (file/class/object/companion/function) is architecturally sound. Key gaps for the flip but acceptable for staged adapter:
Kotlin/JVM interpreter semantics
GitNexus scope-resolution integration
Tests and CI coverage
Security, hidden Unicode, and hygiene
Branch, diff, and review-state confidence
Production readinessnot production-ready Final verdictnot production-ready The PR correctly stages the Kotlin scope resolver as a forced/shadow adapter with no change to default production behavior (Kotlin absent from |
|
@ShiningXu can you please look into claude's findings above? |
|
Thanks for the review. I pushed
Validation after the fix:
On the two larger findings:
|
|
Please open a follow-up ticket with subtasks similarly to #1564 |
|
Opened the follow-up tracking ticket with subtasks here: #1746\n\nIt keeps Kotlin out of |
|
Thank you! Please create subtasks for each items so, we can work on it parallel if possible. Please also use GitHub API to setup the dependencies between each tasks 🙏 |
Summary
Closes #933.
Adds a Kotlin scope-resolution adapter for the RFC #909 Ring 3 pipeline, following the Java migration pattern from #1482:
kotlinScopeResolverinSCOPE_RESOLVERScreateResolverParityIt('kotlin')Kotlin is intentionally not added to
MIGRATED_LANGUAGESyet. Forced registry mode currently passes 154/175 Kotlin resolver fixtures, below the RFC #909 flip threshold, so default behavior remains legacy while the adapter is available for forced/shadow validation.Validation
cd gitnexus && npx --no-install tsc --noEmitcd gitnexus && npx --no-install vitest run test/integration/resolvers/kotlin.test.ts --reporter dot(175/175)cd gitnexus && REGISTRY_PRIMARY_KOTLIN=1 npx --no-install vitest run test/integration/resolvers/kotlin.test.ts --reporter dot(154/175 forced-mode baseline)cd gitnexus && node dist/cli/index.js detect-changes --scope staged --repo GitNexus(low risk, 0 affected processes)Notes
Full
npm test -- --runwas attempted locally before this commit. Kotlin-specific validation passed, but the full suite had unrelated local environment/fixture failures: a corruptedonnxruntime-nodenative binding, existing mini-repo.gitignorestate in CLI e2e, and pipeline golden drift from local fixture state.