Repository navigation
fix(tree_sitter_accuracy_audit): args ground-truth gaps for solidity/tcl/haskell/ruby - #1507
Merged
squid-protocol merged 1 commit intoAug 13, 2026
Conversation
…lidity/tcl/haskell param-list shapes + ruby keyword_parameter _get_param_count() only checked for a "parameters" field or a C-style declarator, which left four real per-language parameter-list shapes silently measuring 0 real params regardless of true arity: - solidity: function/modifier/constructor nodes have no "parameters" field at all -- params are bare, field-less "parameter" children. Also fixes objc's C-style function_definition fallback as a side effect (110/149 -> 148/149), since both share the same node type. - tcl: procedure's param list field is named "arguments", not "parameters". - haskell: the real function-equation "function" node's params live in a "patterns" field (distinct from the same-named arrow-chain type-expression node, which has no "name" field and was already correctly excluded). - ruby: "keyword_parameter" was missing from the counted_types whitelist, a follow-on gap from #1339. args_exact_match: solidity 22/95 -> 95/95, tcl 42/141 -> 118/141, haskell 31/81 -> 43/81, ruby 89/117 -> 106/117, objective-c 110/149 -> 148/149 (bonus). Fixes #1503, #1504, #1505, #1506. Co-Authored-By: Claude Sonnet 5 <[email protected]>
squid-protocol
deleted the
fix/args-ground-truth-solidity-tcl-haskell-ruby
branch
August 13, 2026 23:29
Contributor
squid-protocol
added a commit
that referenced
this pull request
Aug 13, 2026
…s qualified/dotted type signatures (#1513) Two distinct bugs in the haskell "args" engine regex, found while verifying #1503-#1506's ground-truth fixes: 1. Typeclass instance methods and where/let-local helpers routinely have no restated `::` signature (same shape #1435/#1442 taught func_start to recognize) -- args_count fell back to 0 regardless of true arity. Added a new capture-group alternative for the equation's own LHS pattern list (`name pat1 pat2 = ...`), routed through a new detector.py _count_haskell_pattern_list (depth-aware, so a parenthesized compound pattern like `(MetaList xs)` counts as one argument, not two via naive whitespace-split). Explicitly excludes Haskell reserved keywords so `let x = 1` is never mistaken for a function equation. 2. The `::` signature capture's character classes never included "." -- real-world qualified/imported type names (`T.Text`, `IO.Newline`) truncated the whole captured signature at the first dot, silently dropping every arrow after it (confirmed: `inquotes :: T.Text -> T.Text` captured only "T", zero arrows from a real 1-arrow signature). This affected the majority of real corpus mismatches. args_exact_match: 31/81 -> 43/81 (ground-truth fix alone, #1507) -> 70/81 (86.4%) with both fixes here. Remaining known gap (documented, not fixed): arrow-count vs. actual-binding-arity diverges for point-free/partially-applied equations (e.g. `writerFn`'s signature has 3 arrows but its equations only bind 2 patterns, since the body itself returns a function value) -- not fixable without real type inference. tcl's own separate default-value-parameter overcount bug filed as #1512, not fixed here. Fixes #1511. Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Sonnet 5 <[email protected]>
This was referenced Aug 14, 2026
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
_get_param_count()intests/tools/tree_sitter_accuracy_audit.py(the args-counting ground truth, not GitGalaxy's actual engine) only knew how to find a parameter list via aparametersfield or a C-style declarator. Four real per-language shapes fell through and silently measured0real params regardless of true arity:function_definition/modifier_definition/constructor_definitionhave noparametersfield -- params are bare, field-lessparameterchildren.args_exact_match: 22/95 → 95/95.procedure's param-list field is namedarguments, notparameters.args_exact_match: 42/141 → 118/141.functionnode's params live in apatternsfield (distinct from the same-named arrow-chain type-expression node inside asignature, which has nonamefield and was already correctly excluded fromreal_funcs).args_exact_match: 31/81 → 43/81.keyword_parameterwas missing from thecounted_typeswhitelist -- a follow-on gap from tree_sitter_accuracy_audit: _get_param_count node-type whitelist missing real per-language parameter node types (11 languages) #1339 (which added ruby's other parameter wrapper types but missed this one).args_exact_match: 89/117 → 106/117.Bonus: the solidity fix's fallback branch is gated on the shared node type
function_definition, which objective-c also uses for its C-style plain functions -- some objc functions whose declarator-based extraction failed also now resolve correctly via the same fallback:args_exact_match110/149 → 148/149.Process note
All 4 were originally scoped as separate issues for a 4-way parallel Gemini dispatch (this repo's usual pattern for independent per-language fixes), but since all 4 land in the exact same function and I'd already fully root-caused each one, implementing them directly was faster and avoided guaranteed same-function merge conflicts across 4 PRs -- so this is one PR covering all 4 issues plus the objc bonus.
Remaining gaps (filed separately, not fixed here)
Fixing the ground truth surfaced two genuine GitGalaxy engine-side bugs that were previously masked by the ground truth itself under-measuring:
let/where-local functions with no::type signature (e.g.isPandocCiteproc) measurereal=1 got=0-- GitGalaxy's args regex relies on arrow-counting a::signature that doesn't exist for these.proc foo {{db db}}) measurereal=1 got=2-- GitGalaxy's args regex appears to split on whitespace inside the default-value braces instead of treating{db db}as one parameter.Out of scope for this PR (ground-truth-only fix); will file follow-ups.
Verification
No
crucible_check.py/golden-master diffing needed -- this only touches the accuracy-measurement tool itself, not GitGalaxy's parsing engine.Fixes #1503, #1504, #1505, #1506.
🤖 Generated with Claude Code