From 36785eff7da682577ff656221a62c6f3bfda1d77 Mon Sep 17 00:00:00 2001 From: squid-protocol Date: Sat, 29 Aug 2026 19:31:18 -0400 Subject: [PATCH] =?UTF-8?q?fix(recall):=20close=20the=205=20step-2.6=20rec?= =?UTF-8?q?all-audit=20gaps=20=E2=80=94=20shell/cpp/lua/dart/typescript?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tri-comparison recall audit (skill step 2.6) filed five real GitGalaxy function-recall gaps. This fixes all five; measured func recall rises for every touched language with no precision loss and no cross-language regression (31-language `tree_sitter_accuracy_audit --all --ci` clean). - #2459 shell — a control-flow keyword (`for`/`if`/`while`/`until`/`case`) used as a plain argument word, quoted or not (`echo "... limit for $x ..."`), was counted by `open_pattern` and permanently desynced the Mode-D depth stack for the rest of the enclosing function (`freebsd-src/runulp.sh::t` emitted as `t_[Truncated]`, swallowing `check` and the file's top-level blocks). New Command-Position Guard in the net_changes loop recounts only the occurrences in real command position (line start / after `;`/`|`/`&`/`(`/`&&`/`||` or `then`/`do`/`else`/`elif`). shell func recall 99.6% → 99.8%. - #2460 cpp/c — a SAL / entry-point annotation macro supplying the return type (`__control_entrypoint(DllExport) STDAPI DllCanUnloadNow()`) sat before `func_start`'s compiler-attribute shield. The shield now also consumes a `__`-lowercase / `_Uppercase_` prefixed identifier with an optional bracketed arg, naming-shape bounded so it can't eat an ordinary lowercase call as a phantom prefix. cpp func recall 99.9% → 100.0% (c corpus doesn't exercise it; added for parity). - #2461 lua — `func_start` / `function_opener` were start-of-line anchored, so a `local function` that isn't the first statement on its line (`local a; local function f(x) ... end`) was missed. Both now also anchor after a bare `;` statement separator. lua func recall 99.7% → 99.8% (residual: one adversarial lexer-torture fixture with nested long brackets). - #2462 dart — 8 of 9 occurrences: * multi-line arrow methods (`Type _foo() =>\n cond ? _A(x) : _B(y);`) — the ternary on a continuation line false-matched `func_start`, capping the `;` search at that phantom and dropping the whole method. The arrow-terminator scan now walks past such phantoms to the first genuine top-level `;` (dart arrow bodies hold only anonymous closures), and marks the span covered. * `>` generic methods — one level of generic-argument nesting in the three name-following lookaheads. * bodyless default/named constructors (`_Foo();`) — `func_start` branch D now accepts empty parens; detector.py gates that shape on real brace-depth tracking (kept only when the name's leading segment is the nearest enclosing class/mixin/enum), so it can't fire on a bare zero-arg call statement. dart func recall 99.5% → 99.9% (residual: a method literally named `extension`, 1 occ.). - #2464 typescript — the enclosing-container backward scan (object-literal method vs. parameter-list type annotation) treated a bare `<` comparison in a preceding sibling arrow body (`if (i < n)`) as an enclosing generic because it never cross-checked the other bracket depths, dropping a real object-literal method (`return: async () => {`, AsyncIterator protocol). An opener now names the container only when every other depth is also zero. typescript func recall 99.9% → 99.97% (residual: a bodyless overload signature with `=>` inside its generic bound, 1 occ.; the implementation line is captured). Regenerated: tree-sitter baselines (cpp/dart/lua/shell/typescript) + summary table, both golden masters (runulp.sh now resolves `t`/`check` correctly plus its top-level blocks as Anonymous_Blocks; DllCanUnloadNow, the dart methods, and the ts method now appear), tri-comparison chart/ledger/report. Recall-audit docs updated (tri_comparison_README RECALL_AUDIT block; c/cpp/lua status docs). Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_019Zm1uVBpVEZJ9SB7bWFR8S --- docs/language_status/c.md | 4 +- docs/language_status/cpp.md | 5 +- docs/language_status/lua.md | 18 +- docs/self_scan/tri_comparison_README.md | 19 +- docs/self_scan/tri_comparison_chart.svg | 54 +- docs/self_scan/tri_comparison_ledger.json | 595 +- .../tri_comparison_points_of_interest.md | 269 +- gitgalaxy/core/detector.py | 168 +- gitgalaxy/standards/language_standards.py | 77 +- tests/golden_master_audit.json | 16356 +++++++-------- tests/golden_master_zero_dep_audit.json | 16358 ++++++++-------- tests/tree_sitter_accuracy_baseline_cpp.json | 4 +- tests/tree_sitter_accuracy_baseline_dart.json | 8 +- tests/tree_sitter_accuracy_baseline_lua.json | 6 +- .../tree_sitter_accuracy_baseline_shell.json | 6 +- ...e_sitter_accuracy_baseline_typescript.json | 6 +- 16 files changed, 17101 insertions(+), 16852 deletions(-) diff --git a/docs/language_status/c.md b/docs/language_status/c.md index 265f3cffe..2db899bb9 100644 --- a/docs/language_status/c.md +++ b/docs/language_status/c.md @@ -289,7 +289,9 @@ does not (6 occurrences) was individually read. **All 6 are inside `#if 0` dead (`sqlite/lemon.c:3443`, K&R-style *and* dead). tree-sitter-c has no preprocessor model and parses the dead branch; GitGalaxy correctly skips it (Claim 8). The accuracy audit was corrected to drop `#if 0` / `#if false` function definitions from ground truth — **C func recall 99.7% → -100.0%**, zero real recall gaps. +100.0%**, zero real recall gaps. The C `func_start` compiler-attribute shield also picked up the +same [#2460](https://github.com/squid-protocol/gitgalaxy/issues/2460) SAL / entry-point +annotation-macro prefix as C++ (for consistency; the C corpus does not currently exercise it). (found and fixed as part of the same pass) or a known tree-sitter-c/ctags limitation — never GitGalaxy's regex engine itself. Current measured numbers (`tests/tools/tri_comparison_chart.py --languages c`, `language-crucible/data/c/` — diff --git a/docs/language_status/cpp.md b/docs/language_status/cpp.md index d4b954e39..086824cb9 100644 --- a/docs/language_status/cpp.md +++ b/docs/language_status/cpp.md @@ -312,7 +312,10 @@ breakdown: tree-sitter has no preprocessor model (Claim 8). - **1 real GitGalaxy recall gap** — `__control_entrypoint(DllExport) STDAPI DllCanUnloadNow()` in `powertoys/ImageResizerExt.cpp`: a macro-supplied return type `func_start` doesn't admit. - → [#2460](https://github.com/squid-protocol/gitgalaxy/issues/2460). + → [#2460](https://github.com/squid-protocol/gitgalaxy/issues/2460). **Fixed** (2026-08-29): the + `func_start` compiler-attribute shield now also consumes a `__`- / `_Uppercase`-prefixed + SAL / entry-point annotation macro (naming-shape bounded so it can't eat a real call). Cpp func + recall 99.9% → 100.0%. Six real GitGalaxy engine defects were confirmed and filed in this sweep — more than any other language this sweep methodology has been run against so far, though that reflects C++'s syntactic diff --git a/docs/language_status/lua.md b/docs/language_status/lua.md index 16a470523..510700b30 100644 --- a/docs/language_status/lua.md +++ b/docs/language_status/lua.md @@ -60,11 +60,12 @@ tradeoff. ## 5. Known limitations (accepted / tracked) -- **Two recall misses** (skill step 2.6 recall audit, 2026-08-29 — func recall 99.7%), both - filed as [#2461](https://github.com/squid-protocol/gitgalaxy/issues/2461): - - `constructs.lua:105` — `local a; local function f(x) ... end`. `func_start` is - start-of-line anchored, so a `local function` that is not the first statement on its line is - missed. GitGalaxy finds the other 4 `function f` in the file; this is a real, narrow gap. +- **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 @@ -267,9 +268,10 @@ 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 `