You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tree_sitter_accuracy_audit.py: ruby's singleton_class ground truth resolves to no name, inflating extra_classes #1406
tests/tree_sitter_accuracy_baseline_ruby.json shows ruby class_start precision at 83.3% with extra_classes=9, but this is a ground-truth measurement gap in tests/tools/tree_sitter_accuracy_audit.py itself (Class 6 bug type per tests/extraction/how_to_extend_class_start_named_extraction.md's checklist), not a real GitGalaxy engine false-positive. Already flagged as a known, low-priority follow-up in a prior session but never formally filed.
Evidence
NODE_MAPS["ruby"]["class_node_types"] already includes "singleton_class" (the class << self node type), but _get_node_name (~line 638) has no case for singleton_class -- it has no name field at all. Confirmed by walking a real parse tree: a singleton_class node's children are literally class, <<, and self (or an arbitrary target expression), with no name-field child. The function falls through every existing branch and resolves to None.
Meanwhile, GitGalaxy's own class_start regex for ruby (gitgalaxy/standards/language_standards.py) already correctly matches class << self and captures its name as the literal string "<< self" (confirmed: re.finditer against " class << self\n" returns group 1 = '<< self'). Because ground truth produces None for the same real class GitGalaxy correctly names "<< self", the diff logic can't match them up, and GitGalaxy's correct extraction gets miscounted as an extra_classes false positive.
Suggested fix shape
Add a singleton_class branch to _get_node_name, mirroring the existing media_statement → "media" precedent (#1313) a few lines below it: reconstruct the exact string "<< " + <target>.text from the node's children (the target is almost always self in real code; the regex supports << @ivar too, so handle that shape if easy, but note that self is the only shape confirmed in the corpus -- 3 occurrences total, all << self) so the resolved name exactly matches what GitGalaxy's own regex captures.
Related
#1261 (parent epic), #1295 (class_start named-extraction epic, where this gap was first noticed and documented as a quick pickup), #1313 (the media_statement precedent to mirror).
Activity
chore(ruby): refresh tree-sitter accuracy summary table
fix(tools): ruby singleton_class ground-truth name resolution (#1407)
chore(kotlin): re-bless golden master + ruff baseline after merging o…
fix(kotlin): recognize expression-bodied and bodyless func_start bodi…
docs(skills): add tree-sitter-accuracy-sweep skill