[cli] Preserve Ruby singleton_class context in sequential parsing#774
Conversation
|
@ideepakchauhan7 is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
This PR fixes Ruby class << self handling in the sequential parsing fallback so it matches the intended behavior: methods keep the correct enclosing owner (outer class/module) while still preserving the singleton_class context required for isStatic enrichment.
Changes:
- Update sequential enclosing-class traversal to skip Ruby
singleton_classnodes for owner/class resolution. - Introduce a separate sequential traversal for method extraction ownership that can still return
singleton_classsoisStaticis computed correctly. - Add an integration regression test forcing the sequential path (
skipWorkers: true) to validate bothHAS_METHODownership andisStaticforfrom_habitat.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
gitnexus/src/core/ingestion/parsing-processor.ts |
Splits sequential “enclosing class” vs “method owner for extraction” logic to handle Ruby singleton_class correctly. |
gitnexus/test/integration/resolvers/ruby.test.ts |
Adds sequential-path regression coverage for class << self ownership and static detection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CI Report✅ All checks passed Pipeline Status
Test Results
✅ All 6124 tests passed 97 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
xkonjin
left a comment
There was a problem hiding this comment.
Code Review: Ruby singleton_class sequential parsing fix
Solid, targeted fix. Splitting the node-finder into two helpers with distinct roles is the right call.
What works well:
- seqFindEnclosingClassNode now correctly skips singleton_class for owner and name resolution, while seqFindMethodOwnerNode uses it so isStatic extraction still fires. Good separation of concerns.
- Cache key updated correctly to methodOwnerNode.id.
- Integration test assertions are precise and cover the edge case.
Minor suggestions:
- seqFindMethodOwnerNode name does not signal it returns a class node. Consider seqFindEnclosingClassOrModuleNode for consistency with the parallel function, to avoid misleading future readers.
- No coverage for class << self at file-root. The current equals null walk-out is likely correct, but making it explicit via a comment or edge-case test would harden it.
- NOOP_SYMBOL_TABLE_SEQ comment is slightly stale ("for FieldExtractorContext" when it is now used more broadly). Low priority.
Bugs: None.
Security: N/A.
Test coverage: End-to-end integration test added. Could add a unit-level test for the new helper, but not a blocker.
Verdict: LGTM with minor nits.
|
Thanks! I addressed the nits in the latest update: renamed the helper for clarity, clarified the file-root |
|
@ideepakchauhan7 Can you please resolve the merge conflict? |
|
@claude is this pr ready for production? Is this following clean code principles? Are there any performance bottlenecks? Is the code structured in a way that will unlock easy contributions in the future? |
|
Claude finished @magyargergo's task in 2m 1s —— View job PR Review: Ruby singleton_class sequential parsing fixTasks
Production ReadinessNot quite — there is an unresolved merge conflict (flagged by @magyargergo above). That must be resolved before merging. CI was green on the last commit, so the logic itself is sound. Beyond the conflict: the fix is correct and safe to ship once merged. The change is surgical — it only affects the sequential fallback path, which is already a lower-priority code path (workers are used whenever available). Clean Code AssessmentWhat's done well:
Concerns:
PerformanceNo bottlenecks introduced. The changes are neutral or slightly positive:
Contributor FriendlinessModerate. The intent is clear from the PR description and the call-site comments, but there's a discoverability issue for future contributors:
Summary
Recommended before merging:
|
|
@magyargergo I resolved the merge conflict in the latest update and pushed the branch. |
|
@claude I think we are violating the language boundaries here. We need a much better architecture for this thus language providers become responsible for defining this. Need a good architecture diagram so parsing processor just defines what and language providers defines precisely how. |
|
Claude finished @magyargergo's task in 2m 7s —— View job Architectural Analysis: Language Boundary ViolationsTasks
You Are Right — There Are Boundary ViolationsThis PR both fixes a real bug and exposes a deeper architectural problem that predates it. Ruby-specific AST knowledge has leaked into three shared, language-agnostic files. Here is the full picture. Where the Violations Live1.
|
|
The comment I asked from claude will not block your PR, I'm just curious of something. |
|
Thank you for your contribution! |
…higyanpatwari#774) * fix(parsing): preserve ruby singleton class context * refactor(parsing): clarify singleton class helpers
Closes #652
Summary
parsing-processor.tssingleton_classfor enclosing class resolution, but still use thesingleton_classnode when the MethodExtractor needs to detectclass << selfstatic methodsfrom_habitatownership andisStaticbehavior withskipWorkers: trueWhy
The sequential parser was inconsistent with the worker path for Ruby
class << selfblocks. It could either return thesingleton_classwrapper for owner lookup or lose the static-context signal needed by the MethodExtractor. This change keeps those two concerns separate so sequential fallback preserves both correct ownership and static detection.Verification
./node_modules/.bin/vitest run test/integration/resolvers/ruby.test.ts./node_modules/.bin/tsc --noEmitnode dist/cli/index.js impact processParsingSequential --direction upstream --repo GitNexusnode dist/cli/index.js impact seqFindEnclosingClassNode --direction upstream --repo GitNexusdetect_changes(scope: "all", repo: "GitNexus")via LocalBackendRisk
detect_changesreportedmediumbecause the sequential parser participates in sharedprocessParsingflows, but the code change is limited to Rubysingleton_classhandling in the sequential fallback path