Repository navigation
fix(tools): typescript class_start ground truth was missing interface/enum (#1338) - #1349
Merged
Merged
Conversation
…/enum (#1338) class_start is deliberately titled "Object / Entity Declarations" and matches class|enum|interface on purpose (enum is an explicit valid test case), but the tree-sitter accuracy audit's typescript class_node_types only counted class_declaration/abstract_class_declaration as "real" classes. Every correctly matched interface/enum was measured as a false-positive extra class -- the same ground-truth-tool-gap shape as #1314's objc fix, not a GitGalaxy regex defect. Confirmed via direct breakdown: all 537 baseline extra_classes trace to real interface_declaration (470) / enum_declaration (67) nodes tree-sitter itself parses, zero unexplained false matches. class precision moves 34.7% -> 100% (recall 97.6%, baseline regenerated). Filed #1348 for the one real gap the fixed measurement surfaced: export/declare const enum isn't recognized by class_start's modifier group. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
6 tasks done
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
typescript class_start: 34.7% precision (537 false-positive classes against 285 real)class_start's own module commentcalls it "Object / Entity Declarations" and its regex deliberately matches
class|enum|interface(enum TargetEntity {is an explicit "valid" case intests/extraction/languages/test_typescript.py'sCLASS_CASES).tree_sitter_accuracy_audit.py'stypescript
class_node_typesonly countedclass_declaration/abstract_class_declarationasground truth, so every correctly-matched interface/enum was measured as a false positive --
same ground-truth-tool-gap shape as objective-c func_start (4.4% precision) and csharp func_start (58.2% precision) have large, confirmed-real false-positive rates #1314's objc
_get_node_namefix, not a regex bug.extra_classestrace to realinterface_declaration(470) andenum_declaration(67) nodes tree-sitter itself parses forthose same files -- zero unexplained false matches.
class_node_typesintree_sitter_accuracy_audit.py,regenerated the baseline (
extra_classes537 -> 0,real_classes285 -> 842,found_classes285 -> 822) and the summary table inlanguage_standards.py's docstring(class precision 34.7% -> 100%, recall 97.6%).
--all --ci-- all 31 other baselined languages unaffected.export/declare const enumisn't recognized by
class_start's modifier group (20 of 842 real classes), which is a genuineparsing-logic fix deserving its own Differential Scan rather than folding into this ground-truth
PR.
Test plan
python tests/tools/tree_sitter_accuracy_audit.py --lang typescript --ci-- OK, matchesregenerated baseline
python tests/tools/tree_sitter_accuracy_audit.py --all --ci-- 31/31 languages OK, noregressions
python tests/tools/audit_check.py-- ruff/mypy/dead-key/ast-accuracy all cleanpython -m pytest tests/extraction/languages/test_typescript.py tests/extraction/languages/test_typescript_strict.py -q-- 177 passeddetector.py/language_standards.pyregex changes in this PR (audit-tool-only fix), sothe Differential Scan protocol doesn't apply here
🤖 Generated with Claude Code