fix(recall): close the 5 step-2.6 recall-audit gaps — shell/cpp/lua/dart/typescript - #2467
Merged
Conversation
…art/typescript 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. * `<T extends State<StatefulWidget>>` 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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019Zm1uVBpVEZJ9SB7bWFR8S
Contributor
squid-protocol
added a commit
that referenced
this pull request
Aug 30, 2026
…he last residuals (#2470) 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<T>() =>`, 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 <name>` / `extension type` / `extension on`, never `extension(` or `extension<`. dart func recall 99.9% → 100.0%. - #2464 typescript, two more shapes: * `createInstance<Ctor extends new (...args: any[]) => unknown, R extends InstanceType<Ctor>>(...): 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. Claude-Session: https://claude.ai/code/session_019Zm1uVBpVEZJ9SB7bWFR8S Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The tri-comparison recall audit (skill step 2.6,
tests/tools/recall_audit.py) filed five real GitGalaxy function-recall gaps: #2459 (shell), #2460 (cpp/c), #2461 (lua), #2462 (dart), #2464 (typescript). This closes all five.Measured function recall after the fixes (31-language
tree_sitter_accuracy_audit --all --ciclean, no precision loss, no cross-language regression):runulp.sh::tnow resolved correctly (wast_[Truncated])DllCanUnloadNowextensionHow
for/if/while/until/caseused as a plain argument word (quoted or not) was counted byopen_patternand permanently desynced the Mode-D depth stack. New Command-Position Guard recounts only occurrences in real command position (line start / after;|&(`&&||/thendoelseelif).func_start's compiler-attribute shield now also consumes a__-lowercase /_Uppercase_SAL / entry-point annotation macro with an optional bracketed arg (naming-shape bounded so it can't eat a real call).func_start/function_openernow also anchor after a bare;statement separator, not only start-of-line.func_startmatch on a multi-line arrow body's continuation line to the first genuine top-level;, marking the span covered; (b) one level of generic-argument nesting in the name-following lookaheads (<T extends State<Widget>>); (c)func_startbranch D accepts empty parens for bodyless constructors, with detector.py gating that shape on real brace-depth tracking (name's leading segment must be the nearest enclosing class/mixin/enum).<comparison in a preceding sibling arrow body (if (i < n)) no longer reads as an enclosing generic.Differential Scan
pytest tests/extraction/ tests/core_engine/— 6808 passed_strictReDoS gauntlets for all touched languages — passaudit_check.py(ruff / mypy / dead-key / ast-accuracy) — cleantree_sitter_accuracy_audit --all --ci— all OK; baselines regenerated for cpp/dart/lua/shell/typescript + summary tablecrucible_check.py --mode both— both golden masters re-blessed (see commit body for why the output changed) and re-verified green--all --write(every moved shape isvalidated; movements are all improvements — one shell GG-only phantom shape stopped reproducing)tri_comparison_README.mdRECALL_AUDIT block;docs/language_status/{c,cpp,lua}.mdCloses #2459, closes #2460, closes #2461. Advances #2462 (8/9) and #2464 (1 real gap of 2) — residuals documented on each issue.
🤖 Generated with Claude Code
https://claude.ai/code/session_019Zm1uVBpVEZJ9SB7bWFR8S