Repository navigation
fix(tools): ruby singleton_class ground-truth name resolution - #1407
Merged
Merged
Conversation
…tter accuracy audit _get_node_name had no case for ruby's `class << self` (singleton_class) node type, which has no name field. Ground truth resolved to None while GitGalaxy's own class_start regex correctly captures "<< self", so the diff logic could never match them up and GitGalaxy's correct extraction was miscounted as an extra_classes false positive. Reconstructs the exact "<< self" / "<< @ivar" string from the node's children instead. Fixes #1406
class_start recall/precision both reach 100% now that singleton_class (`class << self`) ground truth resolves a real name instead of None. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
Class precision 83.3% -> 100.0%, per #1406's fix. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tree_sitter_accuracy_audit.py's_get_node_namehad no case for ruby'ssingleton_classnode (class << self), so it resolved toNoneeven thoughNODE_MAPS["ruby"]["class_node_types"]already includes it.class_startregex already correctly names this construct"<< self"-- the ground-truth mismatch was miscounting a correct extraction as anextra_classesfalse positive.singleton_classbranch mirroring the existingmedia_statementprecedent (tree_sitter_accuracy_audit.py reports real_functions=0 for css/kotlin/powershell/zig despite confirmed function-shaped nodes in real corpus files #1313), reconstructing"<< " + target.textfrom the node's children.tests/tree_sitter_accuracy_baseline_ruby.json: class recall/precision both now 100% (previously 100%/83.3%,extra_classes3→0).This is a test-tooling-only fix (
tests/tools/tree_sitter_accuracy_audit.py) -- no changes togitgalaxy/core/orgitgalaxy/standards/, since the underlying GitGalaxy extraction was already correct.Implemented by Gemini/agy (isolated worktree, root cause + fix shape pre-diagnosed), independently re-verified: diff reviewed line-by-line, accuracy audit re-run from scratch confirming the exact same numbers,
~/.gemini/antigravity-cli/settings.jsonconfirmed untouched.Closes #1406.
Test plan
tests/tools/tree_sitter_accuracy_audit.py --lang rubyre-run independently, confirms 100%/100% class recall/precision, no other metric regressed🤖 Generated with Claude Code