Repository navigation
Description
Summary
args_exact_match for tcl measures 42/141 (29.8%) in docs/self_scan/tree_sitter_accuracy_history.csv. Every sampled mismatch is real=0 got=N where GitGalaxy's own count (N) is correct -- the tool's tree-sitter ground truth is under-measuring.
Root cause
tests/tools/tree_sitter_accuracy_audit.py::_get_param_count looks for a field literally named parameters:
params_node = node.child_by_field_name("parameters")tree-sitter-tcl's procedure node (GitGalaxy's func_node_types entry for tcl) exposes its parameter list under a field named arguments, not parameters. Confirmed via a live parse of:
proc do_write_test {name expr result} {
puts "hi"
}procedure's children are proc / simple_word (field name) / arguments (field arguments) / braced_word (field body). The arguments node wraps one argument child per parameter, each wrapping a simple_word. Since child_by_field_name("parameters") returns None and none of the existing fallback branches (C-style declarator, matlab's function_arguments) apply to tcl's shape, _get_param_count returns 0 for every tcl proc regardless of real arity.
Reproduce: LANGUAGE_CRUCIBLE_PATH=/home/joe/nyx_projects/language-crucible python tests/tools/tree_sitter_accuracy_audit.py --lang tcl (no --ci) and read the "Sample args-count mismatches" section.
Suggested fix
Same shape as issue #1503 (solidity's own _get_param_count field-name gap) and the existing matlab branch/issue #1339 precedent: when node.type == "procedure", read node.child_by_field_name("arguments") instead of "parameters", then count its argument-typed children (each wraps exactly one simple_word, no destructuring/default-value shapes to special-case in Tcl). Verify against a zero-arg proc (proc no_args {} { ... }, empty arguments node with no argument children) to confirm it still returns 0 cleanly, and against args-as-final-parameter (Tcl's variadic-capture convention, still just a plain argument/simple_word like any other -- no special counting needed).
Out of scope
The "Sample missing"/"Sample extra" func-name mismatches shown in the same audit run (drop_all_indexes/do_test etc.) are a separate func_start-naming concern, not part of this args-counting fix.
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…
squid-protocol commentedon Aug 14, 2026
Fixed by #1507 (tcl procedure's param list field is 'arguments', not 'parameters' --
_get_param_countnow handles it, seetests/tools/tree_sitter_accuracy_audit.pyline ~1272). Closing as already resolved -- found while triaging the sweep backlog, PR merged but issue was never auto-closed.