Skip to content

fix(tools): typescript class_start ground truth was missing interface/enum (#1338) - #1349

Merged
squid-protocol merged 1 commit into
mainfrom
fix/class-start-typescript-1338
Aug 12, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/class-start-typescript-1338

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

  • Closes typescript class_start: 34.7% precision (537 false-positive classes against 285 real) #1338: typescript class_start: 34.7% precision (537 false-positive classes against 285 real)
  • The 537 "extra" classes were never a GitGalaxy defect -- class_start's own module comment
    calls it "Object / Entity Declarations" and its regex deliberately matches
    class|enum|interface (enum TargetEntity { is an explicit "valid" case in
    tests/extraction/languages/test_typescript.py's CLASS_CASES). tree_sitter_accuracy_audit.py's
    typescript class_node_types only counted class_declaration/abstract_class_declaration as
    ground 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_name fix, not a regex bug.
  • Confirmed with a direct breakdown script: all 537 baseline extra_classes trace to real
    interface_declaration (470) and enum_declaration (67) nodes tree-sitter itself parses for
    those same files -- zero unexplained false matches.
  • Added both node types to typescript's class_node_types in tree_sitter_accuracy_audit.py,
    regenerated the baseline (extra_classes 537 -> 0, real_classes 285 -> 842,
    found_classes 285 -> 822) and the summary table in language_standards.py's docstring
    (class precision 34.7% -> 100%, recall 97.6%).
  • Verified --all --ci -- all 31 other baselined languages unaffected.
  • Filed typescript class_start: export/declare const enum not recognized (recall gap) #1348 for the one real gap the fixed measurement surfaced: export/declare const enum
    isn't recognized by class_start's modifier group (20 of 842 real classes), which is a genuine
    parsing-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, matches
    regenerated baseline
  • python tests/tools/tree_sitter_accuracy_audit.py --all --ci -- 31/31 languages OK, no
    regressions
  • python tests/tools/audit_check.py -- ruff/mypy/dead-key/ast-accuracy all clean
  • python -m pytest tests/extraction/languages/test_typescript.py tests/extraction/languages/test_typescript_strict.py -q -- 177 passed
  • No detector.py/language_standards.py regex changes in this PR (audit-tool-only fix), so
    the Differential Scan protocol doesn't apply here

🤖 Generated with Claude Code

…/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]>
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 13b227a into main Aug 12, 2026
30 checks passed
@squid-protocol
squid-protocol deleted the fix/class-start-typescript-1338 branch August 12, 2026 15:31
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.

typescript class_start: 34.7% precision (537 false-positive classes against 285 real)

1 participant