fix(recall): dart/typescript/lua reach 100% function recall — close the last residuals - #2470
Merged
Merged
Conversation
…he last residuals 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. 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
…discrepancies (#2473) Follow-up to #2470. dart was the only language below 100.0% validated function precision. All 9 `agree[gitgalaxy]_vs[tree_sitter]` discrepancies are now resolved; the shape flips to `still_reproduces: false`. Every tree-sitter- comparable language is now at 100.0% on both function recall and precision. Three root causes: 1. **Redirecting factory constructors (2) — audit blind spot, not an engine bug.** `factory Foo.named(...) = _NamedFoo;` parses as `redirecting_factory_constructor_signature`, a node type absent from the audit's `NODE_MAPS["dart"]["func_node_types"]` and unhandled in `_get_node_name` / `_get_param_count`. GitGalaxy's `func_start` finds all of them; the audit just wasn't counting them, so they read as phantom `extra_functions` (`flutter/navigator.dart`'s `_RestorationInformation.named` / `.anonymous`). Registered the node type — the redirect target is a `type_identifier` child after `=`, never an `identifier`, so the existing join-direct-`identifier`-children logic already yields the right `Foo.named`. Same mechanism as Claim 5 (getter/setter/operator); documented there. 2. **`in` / `on` leaking through the return-type token loop (2).** Both are dart keywords the interior keyword-exclusion lists omitted, so `in nodeToEnsureGeometry.toList()...` and `on RenderObject {` (a mixin `on` clause) got consumed as type tokens and the next identifier named. Added to all 8 exclusion lists (same spots as #2462's `extension` narrowing). 3. **Expression-position matches across a continuation line (5).** The return-type-prefix token class (`.`, `?`, balanced `(...)`) swallows a whole method-call chain: `x?.foo(a) ??\n Type.method(b)` reads as `<return type> <name>(`. New detector guard (dart, mirroring the existing TS `?`/`(`-preceded guards): drop a match whose consumed return-type prefix contains `??` / `&&` / `||` / `..` / a bare `!` / a spaced ternary `?` / a lowercase `.method(` call, or whose name is directly preceded by one of those operators. A real dart return type is a single type expression and never contains any of them; `Foo? bar()` (attached `?`) is unaffected. (`TextStyle`, `TextInput.attach`, `_scrollableNotificationIsFromSameSubtree`, `_intersectRects`, `targetFrameMatch.group`.) dart: extra_functions 9 -> 0, found_functions 1748 -> 1750, args_exact_match 1748 -> 1750. Regenerated: dart baseline + summary table (Dart precision 99.5% -> 100.0%), both golden masters (editable_text.dart, object.dart, navigator.dart), tri-comparison chart/ledger/report. Docs: RECALL_AUDIT block, why_gitgalaxy_beats_ast_here.md Claim 5. Full Differential Scan: pytest tests/extraction/ tests/core_engine/ (6808 passed), dart _strict (198 passed) + ReDoS timing check, audit_check clean, tree_sitter_accuracy_audit --all --ci clean (dart only), crucible_check --mode both re-blessed and green. 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.
Follow-up to #2467. Closes every remaining tree-sitter-comparable function-recall gap: all 31 languages with a tree-sitter baseline now measure 100.0% function recall against the pinned corpus. GitGalaxy ties or beats tree-sitter and Universal Ctags on function detection everywhere.
Changes
#2462 dart — a method named
extensionT? extension<T>() => …(theme_data.dart:993).extensionis a built-in identifier, excluded across all 8 of dartfunc_start's keyword lists to reject realextension Foo on Bar {/extension typedeclarations. Narrowed toextension(?![ \t\n]*[(<])— a real declaration is alwaysextension <name>/extension type/extension on, neverextension(orextension<. Verified: real extension decls (named, anonymous, generic, extension-type) still route toclass_start, notfunc_start.#2464 typescript — two 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; alternatives stay mutually exclusive on their first char (=>vs=(?!>)vs[^<>=]vs<), so still linear (Rule 11). The mandatory:Type;/{terminator keeps a bare generic call statement (useCallback<() => void>(cb);) from matching.cursorStateComputer = () => null;(codeEditorWidget.ts:1295) — GitGalaxy counted= () => endCursorStatebut not= () => nullbecausenull/undefinedwere blacklisted as arrow-body-start tokens. In theIDENT =(assignment) branch the body is always a value, so those two are no longer excluded there; the:-annotated member-signature branch (where() => nullcan be a real return type) keeps them.#2461 / #2437 lua —
local function lexerrorerased before extractionliterals.luais the escape-sequence torture fixture.t("[=[alo]]")puts a[=[inside a string literal;_LUA_LONG_BRACKET_REmatched it 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 —lexerror's declaration among them. The long-bracket shield now skips an opener sitting inside an unclosed single-line quote (_lua_lb_opener_in_string, applied in both_apply_literal_shieldand_mask_lua_long_brackets/ prism).Also closes #2437: its symptom class (Mode-D
_[Truncated]satellites) was already gone corpus-wide; this removes the last real miss it accounted for.Differential Scan
pytest tests/extraction/ tests/core_engine/— 6808 passed_strictReDoS gauntlets (dart/typescript/javascript/lua) — 649 passed; explicit ReDoS timing check on the new TS generic step-over — linearaudit_check.py— clean (ruff formatapplied to detector.py)tree_sitter_accuracy_audit --all --ci— 31 languages OK, only dart/lua/typescript improved; baselines + summary table regeneratedcrucible_check.py --mode both— both golden masters re-blessed (theme_data.dart, instantiationService.ts, codeEditorWidget.ts, literals.lua) and re-verified green--all --write— the three "GG behind tree-sitter" existence shapes (dart/lua/typescript) all flip tostill_reproduces: false; every other movement is an improvementCloses #2462, closes #2464, closes #2437.
🤖 Generated with Claude Code
https://claude.ai/code/session_019Zm1uVBpVEZJ9SB7bWFR8S