From 89bd680ef143feb420b19e63a62c11fb33ee1fa8 Mon Sep 17 00:00:00 2001 From: squid-protocol Date: Sat, 29 Aug 2026 20:41:16 -0400 Subject: [PATCH] =?UTF-8?q?fix(recall):=20dart/typescript/lua=20reach=2010?= =?UTF-8?q?0%=20function=20recall=20=E2=80=94=20close=20the=20last=20resid?= =?UTF-8?q?uals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to #2467. Clears every remaining tree-sitter-comparable recall gap; `tree_sitter_accuracy_audit --all --ci` is clean across 31 languages and **every one now has 100.0% function recall** against the pinned corpus. - #2462 dart — a method literally named `extension` (`T? extension() =>`, flutter/theme_data.dart:993). `extension` is a built-in identifier, excluded in all 8 of dart `func_start`'s keyword lists to reject real `extension Foo on Bar {` / `extension type` declarations. Narrowed the exclusion to `extension(?![ \t\n]*[(<])` — a real declaration is always `extension ` / `extension type` / `extension on`, never `extension(` or `extension<`. dart func recall 99.9% → 100.0%. - #2464 typescript, two more shapes: * `createInstance unknown, R extends InstanceType>(...): R;` (instantiationService.ts:117) — a bodyless overload signature whose type-parameter list contains a function type. The zero-prefix branch's generic step-over truncated at the `>` of the inner `=>`. Made it `=>`-tolerant (`=>` / lone `=` as explicit tokens, alternatives still mutually exclusive on first char → linear). The mandatory `:Type;`/`{` terminator keeps a bare generic call statement out. * `cursorStateComputer = () => null;` (codeEditorWidget.ts:1295) — GitGalaxy counted `= () => endCursorState` but not `= () => null`, because `null` / `undefined` were blacklisted as arrow-body-start tokens. In the `IDENT =` (assignment) branch the body is always a value, so those two are no longer excluded there (the `:`-annotated member-signature branch keeps them). typescript func recall 99.9% → 100.0%. - #2461 / #2437 lua — `local function lexerror` (literals.lua:80) was erased before extraction. `literals.lua` is the escape-sequence torture fixture: `t("[=[alo]]")` puts a `[=[` INSIDE a string literal, which the long-bracket shield (`_LUA_LONG_BRACKET_RE`) matched as a real opener and scanned 87 lines for its `]=]`; separately, blanking a quoted `"[[...]]"` test string to `""` collapsed it to four bare quotes that then read as a Python triple-quote and swallowed lines 48–114 (the `lexerror` declaration among them). The long-bracket shield now skips an opener that sits inside an unclosed single-line quote (`_lua_lb_opener_in_string`, applied in both `_apply_literal_shield` and `_mask_lua_long_brackets` / prism). lua func recall 99.8% → 100.0%. Closes #2437 (its symptom class — no `_[Truncated]` satellites anywhere in the corpus — was already gone; this removes the last real miss it accounted for). Regenerated: tree-sitter baselines (dart/lua/typescript) + summary table, both golden masters (theme_data.dart, instantiationService.ts, codeEditorWidget.ts, literals.lua), tri-comparison chart/ledger/report — the three "GG behind tree-sitter" existence shapes (dart/lua/typescript) all flip to `still_reproduces: false`. Docs: RECALL_AUDIT block, lua status doc. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_019Zm1uVBpVEZJ9SB7bWFR8S --- docs/language_status/lua.md | 62 +-- docs/self_scan/tri_comparison_README.md | 21 +- docs/self_scan/tri_comparison_chart.svg | 38 +- docs/self_scan/tri_comparison_ledger.json | 412 +++++++++--------- .../tri_comparison_points_of_interest.md | 234 +++++----- gitgalaxy/core/detector.py | 41 +- gitgalaxy/core/prism.py | 25 ++ gitgalaxy/standards/language_standards.py | 45 +- tests/golden_master_audit.json | 208 +++++---- tests/golden_master_zero_dep_audit.json | 208 +++++---- tests/tree_sitter_accuracy_baseline_dart.json | 6 +- tests/tree_sitter_accuracy_baseline_lua.json | 6 +- ...e_sitter_accuracy_baseline_typescript.json | 6 +- 13 files changed, 731 insertions(+), 581 deletions(-) diff --git a/docs/language_status/lua.md b/docs/language_status/lua.md index 510700b30..99a46926f 100644 --- a/docs/language_status/lua.md +++ b/docs/language_status/lua.md @@ -60,16 +60,20 @@ tradeoff. ## 5. Known limitations (accepted / tracked) -- **One residual recall miss** (skill step 2.6 recall audit, 2026-08-29 — func recall 99.7% → - **99.8%** after the fix below), filed as - [#2461](https://github.com/squid-protocol/gitgalaxy/issues/2461): - - `constructs.lua:105` — `local a; local function f(x) ... end`. **Fixed** (2026-08-29): - `func_start` / `function_opener` now also anchor after a bare `;` statement separator, not - only start-of-line. - - `literals.lua:80` — `local function lexerror (s, err)`, inside `test/literals.lua` (the Lua - suite's *lexer-torture fixture*, adversarial nested `[==[[===[[=[…]]=][====[…]` long - brackets that defeat `_LUA_LONG_BRACKET_RE`'s single-backref shielding). Only ever exercised - by this one fixture. +- **Recall audit (skill step 2.6, 2026-08-29): func recall 99.7% → 100.0%.** Two real misses, + both fixed, both filed as [#2461](https://github.com/squid-protocol/gitgalaxy/issues/2461): + - `constructs.lua:105` — `local a; local function f(x) ... end`. **Fixed**: `func_start` / + `function_opener` now also anchor after a bare `;` statement separator, not only + start-of-line. + - `literals.lua:80` — `local function lexerror (s, err)` was erased before extraction. + `literals.lua` is the Lua suite's escape-sequence torture fixture; a line like + `t("[=[alo]]")` has a `[=[` **inside a string literal**, which the long-bracket shield + (`_LUA_LONG_BRACKET_RE`) matched as a real opener and scanned 87 lines for its `]=]`. + Separately, converting a quoted `"[[...]]"` test string to `""` collapsed it to four bare + quotes, which then read as a Python triple-quote and swallowed lines 48–114 (including + `lexerror`'s declaration). **Fixed** (also closes + [#2437](https://github.com/squid-protocol/gitgalaxy/issues/2437)): the long-bracket shield + now skips an opener that sits inside an unclosed single-line quote. - **`class_start` keeps one borderline hit** (`tracegc.lua:M` — `local M = {}` with `function M.start` / `function M.stop` / `return M`, a real module table). #2439's proto-table "tell" gate dropped the other 13 ALL_CAPS-data-table false positives; `M` is legitimately @@ -128,22 +132,23 @@ across `cosmopolitan` (the Lua 5.4 test suite, heavily nested and adversarial by **Summary.** All **8** discrepancy shapes the tri-comparison tool flagged for Lua were investigated and marked `validated` in one pass (2026-08-29) via the -`tri-comparison-ledger-sweep` skill. **Six** confirmed GitGalaxy engine defects were found and -fixed across three PRs (#2441; the #2438/#2439/#2440 follow-up; then a `\z` string-continuation -fix for #2437); the rest are tool-architecture differences or absences with no privileged ground -truth. Cumulative effect, measured by `tree_sitter_accuracy_audit.py --lang lua`: - -| Metric | Baseline | After #2441 | After #2438/9/40 | After #2437 | -|---|---:|---:|---:|---:| -| `found_functions` | 505 | 557 | 618 | **618** | -| `extra_functions` (lower is better) | 12 | 7 | 1 | **0** | -| `extra_classes` (lower is better) | 14 | 14 | 1 | **1** | -| `args_exact_match` | 463 | 516 | 572 | **572** | - -Lua recall 81.5% → **99.7%**, function precision 97.7% → **100.0%**. Both golden masters were +`tri-comparison-ledger-sweep` skill. **Eight** confirmed GitGalaxy engine defects were found and +fixed across four PRs (#2441; the #2438/#2439/#2440 follow-up; the `\z` string-continuation fix +for #2437; then the step-2.6 recall-audit fixes for #2461 + the long-bracket-in-string guard that +finally closes #2437); the rest are tool-architecture differences or absences with no privileged +ground truth. Cumulative effect, measured by `tree_sitter_accuracy_audit.py --lang lua`: + +| Metric | Baseline | After #2441 | After #2438/9/40 | After #2437 | After #2461 | +|---|---:|---:|---:|---:|---:| +| `found_functions` | 505 | 557 | 618 | 618 | **620** | +| `extra_functions` (lower is better) | 12 | 7 | 1 | 0 | **0** | +| `extra_classes` (lower is better) | 14 | 14 | 1 | 1 | **1** | +| `args_exact_match` | 463 | 516 | 572 | 572 | **574** | + +Lua recall 81.5% → **100.0%**, function precision 97.7% → **100.0%**. Both golden masters were re-blessed and `tests/tree_sitter_accuracy_baseline_lua.json` regenerated in each PR. -### Confirmed engine defects (6, all fixed) +### Confirmed engine defects (8, all fixed) Defects 1–2 landed in PR #2441; defects 3–5 in the #2438/#2439/#2440 follow-up; defect 6 in the `\z` fix for #2437. @@ -268,10 +273,11 @@ shared reason." This is the common case per the skill's step 4 guidance. heuristic matched ALL_CAPS data tables. - [#2440](https://github.com/squid-protocol/gitgalaxy/issues/2440) — **fixed**: polyglot segmentation split a function at `