Repository navigation
Description
Summary
This epic exists because tests/tools/tree_sitter_accuracy_audit.py (built/rolled out in #1227, #1249, #1253) surfaced real, measured func_start/class_start extraction defects in GitGalaxy's structural-signature system.
IMPORTANT SCOPE NOTE: This tool measures ONLY function/class name extraction accuracy (the func_start/args/class_start "extraction gauntlet" pillar from epic #813) -- it does NOT measure GitGalaxy's risk-scoring rules (branch, io, safety_bypasses, concurrency, cryptography, etc.), which are hardened and tested completely separately and are unaffected by anything these measurements show.
What the audit does
- Scans each language's real-world corpus samples in
language-crucible/data/<lang>(pinned corpus snapshot, same onetests/tools/crucible_check.pyuses) - Parses each file with tree-sitter's grammar to extract the "ground truth" function/class count
- Compares against GitGalaxy's regex-based extraction on the same files
- Produces per-language baseline JSON files:
tests/tree_sitter_accuracy_baseline_<lang>.json(keys:files_scanned,real_functions,found_functions,extra_functions,real_classes,found_classes,extra_classes,args_comparable,args_exact_match)
Sub-issues filed
The following 5 issues categorize the gaps found, from highest-severity (100% miss rate) through medium (measurement validation needed) to lowest-severity (narrow but safe broadening opportunity):
- #[ruby] Ruby func_start matches 0/117 real methods in language-crucible corpus
- #[cpp] C++ func_start: 1,147 false positives against only 5/87 real functions found
- #[class-detection] Class detection is 0% across apex/csharp/fortran/solidity despite near-perfect function detection
- #[c-verify] Verify tree-sitter accuracy measurement's own ground truth for C before treating found_functions=0 as a GitGalaxy defect
- #[scala-matlab-haskell] Broaden scala/matlab/haskell func_start regexes -- safe, zero current false positives
References
- Audit tool:
tests/tools/tree_sitter_accuracy_audit.py - Per-language baselines:
tests/tree_sitter_accuracy_baseline_<lang>.json - Extraction methodology:
gitgalaxy/standards/how_to_add_a_language.md - Related epic Epic: Harden the four extraction gauntlets (function/args/class/dependency) per language #813 (extraction-hardening, completed 2026-07-30)
- Related epic Epic: Harden the strict structural-signature test suite (non-extraction-pillar rules) per language #1069 (strict-signature hardening, completed 2026-08-06)
Activity
squid-protocol commentedon Aug 31, 2026
Closing: the audit's gaps are fixed, measured, and now enforced in CI — across three corpus generations
This epic's extraction-accuracy concerns were addressed and re-validated against language-crucible v1.0, v1.1.0, and v1.2.0 (pinned via
LANGUAGE_CRUCIBLE_REF+tests/_crucible_pin.py), with each corpus growth step (152→218 folders, 2,344→3,306 files by v1.2.0) deliberately used to stress the fixes on new real-world code rather than freezing the benchmark at the snapshot that first surfaced the bugs.The original five sub-issues are all closed (#1262 ruby, #1263 c++, #1264 class detection, #1265 C ground-truth verification, #1266 scala/matlab/haskell broadening), along with the ~15 follow-on issues the audit surfaced as it deepened (#1311, #1312, #1314, #1319, #1336, #1338, #1405, #1406, #1504, #1506, #1518, #1608, #1630, #1641, …) — a search for issues referencing this epic returns zero open.
Measured before → after (from the committed history, first audit run 2026-08-11 vs. today's run on v1.2.0):
func_start: 0/117 found, 12 false positives → 124/124, 0 false positivesfunc_start: 5/87 found, 1,147 false positives → 1,370/1,370, 0 false positivesThis is no longer a point-in-time audit.
tree-sitter-accuracy-audit.ymlruns as a baseline-gated CI check on parsing-logic PRs, and the history CSV + chart regenerate on merges to main (latest run today). Where the 2-tool audit's ground truth itself proved wrong, that was verified and documented rather than chased (#1265, #1608, #1641 are all measurement-side fixes — the audit holds itself to the same standard it holds the engine to).The program this epic started also graduated: the 2-tool comparison grew into the tri-comparison (adding Universal Ctags, with a per-disagreement validated ledger — methodology). On the pinned corpus, validated function precision is 100% across all 31 tree-sitter-comparable languages, and GitGalaxy is never the tool found wrong in a validated class or argument disagreement.
Honest residuals, documented not hidden: groovy has no tree-sitter ground truth (recall unmeasurable; its unverified extras are flagged for follow-up, not counted as wins); css's at-rule
args_comparableresidue is documented in the audit's SCOPE docstring; and per this epic's own scope note, none of this measures the risk-scoring layer — cross-language measurement consistency now has its own instrument (#1096 → keyword-rosetta, Phase-5 CI tracked in #2557).