Skip to content

fix(recall): close the 5 step-2.6 recall-audit gaps — shell/cpp/lua/dart/typescript - #2467

Merged
squid-protocol merged 1 commit into
mainfrom
func-recall-gap-fixes
Aug 30, 2026
Merged

fix(recall): close the 5 step-2.6 recall-audit gaps — shell/cpp/lua/dart/typescript#2467
squid-protocol merged 1 commit into
mainfrom
func-recall-gap-fixes

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

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 --ci clean, no precision loss, no cross-language regression):

Language func recall note
shell 99.6% → 99.8% runulp.sh::t now resolved correctly (was t_[Truncated])
cpp 99.9% → 100.0% DllCanUnloadNow
c 100.0% parity change only (corpus doesn't exercise it)
lua 99.7% → 99.8% residual: 1 lexer-torture fixture
dart 99.5% → 99.9% 8/9 occurrences; residual: a method named extension
typescript 99.9% → 99.97% residual: 1 bodyless overload signature

How

Differential Scan

  • pytest tests/extraction/ tests/core_engine/ — 6808 passed
  • per-language _strict ReDoS gauntlets for all touched languages — pass
  • audit_check.py (ruff / mypy / dead-key / ast-accuracy) — clean
  • tree_sitter_accuracy_audit --all --ci — all OK; baselines regenerated for cpp/dart/lua/shell/typescript + summary table
  • crucible_check.py --mode both — both golden masters re-blessed (see commit body for why the output changed) and re-verified green
  • tri-comparison chart / ledger / report regenerated --all --write (every moved shape is validated; movements are all improvements — one shell GG-only phantom shape stopped reproducing)
  • recall-audit docs updated: tri_comparison_README.md RECALL_AUDIT block; docs/language_status/{c,cpp,lua}.md

Closes #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

…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
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 236bdec into main Aug 30, 2026
42 of 43 checks passed
@squid-protocol
squid-protocol deleted the func-recall-gap-fixes branch August 30, 2026 00:04
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant