Skip to content

fix(tools): ruby singleton_class ground-truth name resolution - #1407

Merged
squid-protocol merged 3 commits into
mainfrom
fix/ruby-1406-singleton-class-ground-truth
Aug 13, 2026
Merged

squid-protocol merged 3 commits into
mainfrom
fix/ruby-1406-singleton-class-ground-truth

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

  • tree_sitter_accuracy_audit.py's _get_node_name had no case for ruby's singleton_class node (class << self), so it resolved to None even though NODE_MAPS["ruby"]["class_node_types"] already includes it.
  • GitGalaxy's own class_start regex already correctly names this construct "<< self" -- the ground-truth mismatch was miscounting a correct extraction as an extra_classes false positive.
  • Added a singleton_class branch mirroring the existing media_statement precedent (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.text from the node's children.
  • Regenerated tests/tree_sitter_accuracy_baseline_ruby.json: class recall/precision both now 100% (previously 100%/83.3%, extra_classes 3→0).

This is a test-tooling-only fix (tests/tools/tree_sitter_accuracy_audit.py) -- no changes to gitgalaxy/core/ or gitgalaxy/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.json confirmed untouched.

Closes #1406.

Test plan

  • tests/tools/tree_sitter_accuracy_audit.py --lang ruby re-run independently, confirms 100%/100% class recall/precision, no other metric regressed
  • Baseline regenerated and matches the re-run exactly

🤖 Generated with Claude Code

squid-protocol and others added 2 commits August 12, 2026 21:25
…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]>
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

Class precision 83.3% -> 100.0%, per #1406's fix.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@squid-protocol
squid-protocol merged commit 065cacc into main Aug 13, 2026
30 checks passed
@squid-protocol
squid-protocol deleted the fix/ruby-1406-singleton-class-ground-truth branch August 13, 2026 02:03
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.

tree_sitter_accuracy_audit.py: ruby's singleton_class ground truth resolves to no name, inflating extra_classes

1 participant