Skip to content

typescript: func_start recall gaps — object-literal method shorthand & complex-generic overload signatures #2464

Closed

Description

@squid-protocol

Summary

The 2026-08-29 tri-comparison recall audit (tests/tools/recall_audit.py typescript) found 3
functions tree-sitter reports that GitGalaxy does not (ts func recall 99.9%). Two are real
GitGalaxy gaps:

1. Object-literal method shorthand — partial detection, async variant missed

language-crucible/data/typescript/vscode/async.ts implements the ES AsyncIterator protocol as
object literals:

private readonly _iterator: AsyncIterator<T, void, void> = {
    next: () => this._producerConsumer.consume(),
    return: () => { this._onReturn?.(); return Promise.resolve({ done: true, value: undefined }); },
    throw: async (e) => { this._finishError(e); return { done: true, value: undefined }; },
};

and a second one around line 2053 whose return: is async () => { ... }.

func_start matches each of these in isolation (next, return, return with async, throw)
— but the pipeline emits only one return for the first object (mis-lined to the next:
line) and nothing for the second object's return: async () => { (async.ts:2059).
tree-sitter finds all of them. return / throw are real method names here (the iterator
protocol), not statement keywords.

2. Bodyless overload signature with a generic type-parameter list containing => / nested <>

vscode/instantiationService.ts:117:

createInstance<Ctor extends new (...args: any[]) => unknown, R extends InstanceType<Ctor>>(ctor: Ctor, ...args: GetLeadingNonServiceArgs<ConstructorParameters<Ctor>>): R;

func_start matches the sibling overload (createInstance<T>(descriptor: SyncDescriptor0<T>): T;,
line 116) and the impl (line 118) but not this one — the <Ctor extends new (...args: any[]) => unknown, R extends InstanceType<Ctor>> type-parameter list (a => function type and a nested
<> inside <...>) isn't handled by the generic-args step-over.

Not a GitGalaxy gap (noted for the audit)

vscode/codeEditorWidget.ts — let cursorStateComputer: ICursorStateComputer; ... cursorStateComputer = () => null; ... cursorStateComputer = () => endCursorState; — tree-sitter
counts each branch's = () => reassignment as a function (2); GitGalaxy counts the one variable
(1). Variable reassignment, not a second definition — tree-sitter over-count, left as a
tri-comparison note.

Found by

tri-comparison-ledger-sweep step 2.6 recall audit, 2026-08-29.

Activity

  1. added
    bug
    core-engine
    on Aug 29, 2026
  2. squid-protocol commented on Aug 29, 2026

    @squid-protocol
    OwnerAuthor

    PR #2467 fixes the object-literal method case:

    • ✅ return: async () => { (vscode/async.ts:2059, AsyncIterator protocol) — 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 < this._results.length)) as an enclosing generic, because it never cross-checked the other bracket depths. An opener now names the container only when every other depth (paren/bracket/brace/angle) is also zero.

    typescript func recall 99.9% → 99.97%, no precision loss.

    Residuals (still open)

    • vscode/instantiationService.ts:117 — createInstance<Ctor extends new (...args: any[]) => unknown, R extends InstanceType<Ctor>>(...): R; — a bodyless overload signature whose generic type-parameter list contains a => and nested <>. func_start doesn't match it. The implementation at line 118 (same name, real body) is captured, so the symbol isn't lost — only the separate overload-signature occurrence. Loosening the nested-bracket handling in the (already very large) TS func_start for one occurrence carries real ReDoS/false-positive risk; deferred.
    • vscode/codeEditorWidget.ts:1295 — cursorStateComputer = () => endCursorState; is a local variable reassignment in one of three if/else if branches, not a declaration. tree-sitter counts every = () => as a function expression; GG counts one of the two branch reassignments. Measurement artifact (occurrence-alignment on a conditionally-reassigned local), not a real recall gap.
  3. added this to the v2.4.9 milestone on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-engine

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions