Skip to content

tree_sitter_accuracy_audit.py: java varargs (spread_parameter) undercounted by _get_param_count #2090

Closed

Description

@squid-protocol

Summary

_get_param_count's counted_types whitelist in tests/tools/tree_sitter_accuracy_audit.py
(the same recurring per-grammar node-type gap as #1339/#1506/#1570/#1319) is missing java's
varargs parameter wrapper node type, spread_parameter -- tree-sitter-java wraps a varargs
parameter (Type... name) in this distinct node type rather than the plain formal_parameter
already in the whitelist.

Evidence

Confirmed via docs/self_scan/tri_comparison_ledger.json's
java/function/args/agree[ctags,gitgalaxy]_vs[tree_sitter] shape (12 occurrences, all varargs
methods/constructors in springboot/SpringApplication.java/Binder.java, e.g.
public SpringApplication(Class<?>... primarySources), public void addInitializers(ApplicationContextInitializer<?>... initializers)). GitGalaxy and ctags both
correctly count 1 real parameter; the audit tool's own tree-sitter reading undercounts by exactly
1 every time. Direct tree-sitter-java parse confirms the varargs parameter parses as a
spread_parameter node wrapping a generic_type/.../variable_declarator, not a
formal_parameter:

formal_parameters
  spread_parameter
    generic_type ...
    ...
    variable_declarator
      identifier "primarySources"

This is not a GitGalaxy defect -- it's the audit tool's own ground-truth measurement
undercounting java varargs specifically. Fix: add "spread_parameter" to counted_types in
_get_param_count (~detector.py:1420 in tree_sitter_accuracy_audit.py), same shape as the
existing per-grammar entries in that whitelist's own docstring.

Activity

  1. squid-protocol commented on Aug 22, 2026

    @squid-protocol
    OwnerAuthor

    Fixed via PR #2092.

  2. added
    bug
    core-engine
    threat: false-negative
    on Aug 26, 2026
  3. added this to the v2.4.9 milestone on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-enginethreat: false-negative

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions