fix(tree_sitter_accuracy_audit): csharp ground truth misses methods after a ref-struct parse error - #1551
Merged
Merged
Conversation
…fter a ref-struct parse error #1427: tree-sitter-c-sharp's bundled grammar fails to parse C# 7.2+ `ref struct` syntax (`private ref struct DisposableResetPoint` at roslyn/LanguageParser.cs:14575), producing a cascading ERROR node that swallows a large downstream region of the file. Ground truth extraction then has zero method_declaration nodes for several real methods buried in that region, so the audit tool's set-difference "extra" classification misclassifies GitGalaxy's own correct matches for those names as false positives. This is a measurement-tool ground-truth gap, not a GitGalaxy precision defect -- same class as the Flow-typed JS ground-truth gap already handled in this tool. True recovery isn't feasible (the ERROR node has no salvageable structural subtree, just flat tokens); narrow exclusion for the three confirmed-affected real names follows the established precedent. extra_functions: 319 -> 316 (csharp corpus), no other GitGalaxy code changed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rebased onto current main and regenerated the csharp baseline + summary table against the combined state. No additional code change. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
squid-protocol
added a commit
that referenced
this pull request
Aug 14, 2026
Per CLAUDE.md's standing instruction to log evidenced cases of GitGalaxy beating tree-sitter ground truth as their own dated claim. #1427 (merged #1551) is a genuinely new mechanism, distinct from the existing two claims: tree-sitter-c-sharp fails to parse valid C# 7.2+ `ref struct` syntax, and the resulting ERROR node cascade swallows unrelated real methods elsewhere in the file -- a grammar parse-error/version-gap corrupting ground truth for syntactically-unrelated code, not a dialect the grammar has no concept of (Claim 2) or a language-design absence of formal syntax (Claim 1). Co-authored-by: Joe Esquibel <squid-protocol@users.noreply.github.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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.
Fixes #1427.
Summary
tree-sitter-c-sharp's bundled grammar fails to parse C# 7.2+ref structsyntax -- specificallyprivate ref struct DisposableResetPointatroslyn/LanguageParser.cs:14575. This triggers a cascadingERRORnode in the parse tree that swallows a large downstream region of the file, so tree-sitter ground-truth extraction produces zeromethod_declarationnodes for several real methods buried in that region (not just the one originally reported:AccumulateExplicitInterfaceName,CanFollowCast,CanReuseVariableDeclaratorall confirmed affected). The audit tool's set-difference "extra" classification then misclassifies GitGalaxy's own correct matches for those names as false positives.This is a measurement-tool ground-truth gap (
tests/tools/tree_sitter_accuracy_audit.py), not a GitGalaxy precision defect -- same class as the existing Flow-typed-JS ground-truth gap already handled in this tool. True recovery isn't feasible: theERRORnode has no salvageable structural subtree, just flat unstructured tokens (would require writing a mini C# parser). Narrow, file+name-scoped exclusion follows the established precedent instead.Numbers
extra_functions: 319 -> 316 (csharp corpus). Nogitgalaxy/code changed.Test plan
tree_sitter_accuracy_audit.py --lang csharp-- confirmedAccumulateExplicitInterfaceNameetc. no longer misclassifiedtree_sitter_accuracy_audit.py --all --ci-- clean across all 31 languagescrucible_check.py --mode both-- PASS/PASS (no drift, audit-tool-only change)audit_check.py --ci-- all clear🤖 Generated with Claude Code