Repository navigation
Description
Summary
args_exact_match for ruby measures 89/117 (76.1%) in docs/self_scan/tree_sitter_accuracy_history.csv. Sampled mismatches undercount real arity, e.g. rails/blob.rb::url real=1 got=4 and rails/blob.rb::create_before_direct_upload! real=0 got=8, where GitGalaxy's own count (got) is correct in every sampled case.
Root cause
Issue #1339 added a per-language node-type whitelist to _get_param_count's counted_types tuple, including ruby's optional_parameter/splat_parameter/hash_splat_parameter/block_parameter -- but missed keyword_parameter, tree-sitter-ruby's node type for keyword arguments (name: value and bare name:), a distinct type from the positional-optional optional_parameter (name = value).
Confirmed via a live parse of:
def url(expires_in: 123, disposition: :inline, filename: nil, **options)method_parameters children are keyword_parameter / keyword_parameter / keyword_parameter / hash_splat_parameter (4 total). Only hash_splat_parameter is in the current whitelist, so _get_param_count returns 1 instead of 4. Also confirmed both the optional form (key: nil) and the required form (filename:, no default) use the identical node type keyword_parameter in rails/blob.rb::create_before_direct_upload!'s 8-keyword-parameter signature -- no value-field branching needed, just add the one type name.
Reproduce: LANGUAGE_CRUCIBLE_PATH=/home/joe/nyx_projects/language-crucible python tests/tools/tree_sitter_accuracy_audit.py --lang ruby (no --ci) and read the "Sample args-count mismatches" section.
Suggested fix
Add "keyword_parameter" to the counted_types tuple in _get_param_count (tests/tools/tree_sitter_accuracy_audit.py), alongside the existing ruby entries, with a comment noting it covers both the optional (k: v) and required (k:) keyword-arg forms since tree-sitter-ruby uses one node type for both.
Out of scope
The "Sample extra" false-positive names in the same audit run (Anonymous_Block, __global_context__, module/class names like ActiveStorage::Blob appearing in the function list) are a separate func_start/class_start scoping issue, not part of this args-counting fix -- do not touch in this PR.
This only affects tests/tools/tree_sitter_accuracy_audit.py's own measurement accuracy (epic #1227/#1261), not GitGalaxy's actual args structural signature or risk scoring in any way.
Activity
fix(tree_sitter_accuracy_audit): args ground-truth counter missing so…
fix(haskell): args regex misses signature-less equations and truncate…
squid-protocol commentedon Aug 14, 2026
Fixed by #1507 ('keyword_parameter' added to the ruby whitelist, see
tests/tools/tree_sitter_accuracy_audit.pyline ~1198). Closing as already resolved -- found while triaging the sweep backlog, PR merged but issue was never auto-closed.