Skip to content

dart func_start: audit tool's NODE_MAPS/ _get_node_name ground truth omits all 3 constructor node types #1477

Closed

Description

@squid-protocol

Summary

`tests/tools/tree_sitter_accuracy_audit.py`'s dart entry had no coverage for any of dart's
three constructor node types (`constructor_signature`, `constant_constructor_signature`,
`factory_constructor_signature` -- distinct from `function_signature`/`method_signature` in
tree-sitter-dart's grammar). None were in `func_node_types`, and even
`factory_constructor_signature` (nested inside a `method_signature` node that is already
covered) resolved to `None` via `_get_node_name`'s fast path since it has no `"name"` field.
Every real dart constructor in the corpus was therefore invisible to `real_functions`, scoring
as a false `extra_functions` hit -- not a GitGalaxy regex bug, a ground-truth/measurement
scope mismatch. Same class of issue as #1314 (csharp's missing `constructor_declaration`).

Confirmed repro

`flutter/theme_data.dart`: `factory ThemeData.dark(...)` and `const ThemeData.raw(...)` were
both entirely absent from ground truth. Measured before/after adding all 3 node types to
`func_node_types` plus a `_get_node_name` branch that joins their plainly-typed `identifier`
children with `.` (reconstructing "ThemeData.dark" the same way GitGalaxy's own func_start regex
names it): `found_functions` 677->705, `extra_functions` 309->281, `real_functions` 722->884.

Fix

Already implemented directly (audit-tool-only, no engine change) -- see PR referencing this issue.

Out of scope / noted but not chased

281 `extra_functions` remain after this ground-truth fix. Root-caused four distinct real
GitGalaxy `dart` `func_start` regex bugs behind the remainder, filed separately as they need an
actual engine fix (not an audit-tool correction): see the follow-up issue linked from this one's
comments once filed.

Scope note

This only affects extraction-pillar naming-accuracy measurement (the tree-sitter-accuracy-audit
tool, epic #1227), not GitGalaxy's actual risk-scoring engine.

Activity

  1. added
    bug
    testing
    core-engine
    threat: false-positive
    on Aug 13, 2026
  2. added this to the v2.4.8 milestone on Aug 16, 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-enginetestingthreat: false-positive

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions