Skip to content

docs: correct Claim 3's csharp parse-cascade root cause (line 5198, not ref struct at 14575) - #1568

Merged
squid-protocol merged 2 commits into
mainfrom
docs/beats-ast-tree-sitter-staleness-m4-batch
Aug 14, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
docs/beats-ast-tree-sitter-staleness-m4-batch

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

  • tree_sitter_accuracy_audit.py: csharp ground truth misses a real method due to a tree-sitter parse error in a large corpus file #1427 attributed csharp's tree-sitter parse cascade in LanguageParser.cs to private ref struct DisposableResetPoint at line 14575 and excluded 3 names on that basis. Tested in isolation, that construct parses cleanly.
  • The real trigger is a C# 11 list pattern + property pattern at line 5198 (modifiers is [.., SyntaxToken { Kind: ... } scopedKeyword]), confirmed to produce has_error == True on its own.
  • Once tree-sitter hits it, recovery never resynchronizes: real_functions ground truth is 157 before line 5198 (near-perfect match with GitGalaxy) and exactly 0 from line 5198 to EOF (14680) — despite hundreds of real methods there. All 316 of csharp's current "extra" false positives fall in that region.
  • Corrects docs/why_gitgalaxy_beats_ast_here.md's Claim 3 in place with the accurate trigger, evidence, and blast radius. The actual tests/tools/tree_sitter_accuracy_audit.py code fix (widening the exclusion from 3 names to the full post-5198 region) is filed separately as a follow-up GitHub issue referencing this correction.

Test plan

  • Doc-only change, no code/behavior change
  • Findings verified directly: isolated construct tests via tree_sitter_language_pack, plus a full corpus re-scan confirming the 157-before/0-after split and the 316-extra overlap

🤖 Generated with Claude Code

squid-protocol and others added 2 commits August 14, 2026 00:34
…der Claim 1

Two additions to why_gitgalaxy_beats_ast_here.md, both from a follow-up
discussion after #1427/Claim 3 landed:

- Claim 3's evidence now includes the actual tree-sitter-c-sharp bug-tracker
  trail for the ref/struct gap (issue #14 fixed 2022, issue #361 still open
  since Dec 2024 documenting the exact "one error corrupts the whole file"
  cascade in the maintainers' own words, PR #439 cataloging 8 more known
  gaps as of Aug 2026) -- answers "how long can tree-sitter be out of date"
  with sourced evidence instead of speculation, and a new subsection
  ("Why GitGalaxy doesn't hit this particular wall") generalizes the
  underlying reason: GitGalaxy's narrow four-signal contract (classes,
  functions, arguments, structural signatures -- never a full parse tree)
  exempts it from the specific constraints that cause this class of failure
  in a real grammar (canonical-tree-for-every-permutation, global
  coherence, full versioned grammar-surface tracking).
- Logs m4 (confirmed, already implemented, same body-read idiom as
  bash/perl) and batch (same shape, but NOT yet implemented -- language_standards.py's
  batch entry has empty rules) as two more instances of Claim 1's shape,
  so batch doesn't get lost as a one-off observation before a future
  harden-language-extraction pass picks it up.

No code change.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…4575)

#1427's ref struct attribution was wrong -- tested in isolation it parses
cleanly. The real trigger is a C# 11 list-pattern + property-pattern
construct at LanguageParser.cs:5198, over 9,000 lines earlier, which
leaves tree-sitter with zero real_functions for the rest of the file
(vs. 157 before it) -- accounting for all 316 of csharp's current
"extra" false positives, not just the 3 names #1427 excluded.

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 e3f28b5 into main Aug 14, 2026
4 checks passed
@squid-protocol
squid-protocol deleted the docs/beats-ast-tree-sitter-staleness-m4-batch branch August 14, 2026 13:00
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.

1 participant