Skip to content

Withdrawn by author#836

Closed
tecnos-okazaki wants to merge 2 commits into
DeusData:mainfrom
tecnos-okazaki:fix/tsjs-receiver-weak-suppression
Closed

Withdrawn by author#836
tecnos-okazaki wants to merge 2 commits into
DeusData:mainfrom
tecnos-okazaki:fix/tsjs-receiver-weak-suppression

Conversation

@tecnos-okazaki

@tecnos-okazaki tecnos-okazaki commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

No description provided.

tecnos-okazaki and others added 2 commits July 4, 2026 12:37
…od calls

A JS/TS/TSX member call `x.foo()` whose receiver is not `this`/`super` now
sets CBMCall.is_method, mirroring the existing Perl arrow/method flag. This
lets the call-resolution passes recognise a member call whose receiver type
the TS-LSP could not resolve, so they can decline to bind it to an unrelated
project symbol by a weak short-name guess (#592/#606; precedent PR #477 for
Perl).

`this`/`super` receivers are left unflagged — their target is the enclosing
class, where a namespace-proximity weak match is usually right. Bare calls and
new-expressions have no member receiver, so they stay is_method=false; every
non-TS/JS/Perl language is byte-identical (the struct is zero-init).

The pre-#592 test that asserted a JS member call never sets is_method inverts;
it is replaced by TS and JS flagging tests plus a Go test that keeps the
"flag-exempt languages are unaffected" contract, and the cbm.h field comment
is updated to describe both the Perl and TS/JS semantics.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Hitoshi Okazaki <okazaki.hitoshi@tecnos.co.jp>
A member call `x.foo()` reaches the registry's weak textual cascade only when
the TS-LSP could not resolve the receiver type — type-resolved calls win via
lsp_* strategies before the registry runs. Binding such a call to a project
symbol by a weak short-name strategy fabricates a CALLS edge (`re.test()` ->
SalesforceRestClient.test, `date.toISOString()` -> any project toISOString).
On a 6k-file monorepo this produced ~21.6k false edges (~12.6% of CALLS).

Add cbm_tsjs_suppress_weak_method_match: for a TS/JS/TSX member call flagged
is_method, the weak strategies (suffix_match, unique_name, field_type_hint,
fuzzy) are noise. It uses an EXPLICIT drop-list, not keep-list + default-drop,
because the resolver runs lsp_* through the same code path — a default-drop
would silently kill lsp_ts_method. Gated on the file language so no other
language is affected.

The suppression is applied at the PLAIN-CALLS emission point, not before it:
emit_classified_edge (sequential) and emit_service_edge (parallel) take a
suppress_plain_calls flag and skip ONLY the final plain CALLS fall-through
(and emit_http_async_edge's no-URL fall-through). Every service classification
that runs first — the #523 callee-name HTTP/ASYNC bypass, route registration,
gRPC/GraphQL/tRPC/CONFIG, and emit_service_edge's unconditional
detect_url_in_args — is therefore byte-identical to main by construction. This
replaces an earlier attempt that dropped the call at a language guard and tried
to re-derive "is this a service edge?" with a predicate: that predicate drifted
from the emit path's classification and lost ~399 HTTP_CALLS (verb-suffix
clients like api.patch / page.goto / request(app).get, whose HTTP signal is not
a library name in the callee) plus ~63 CONFIGURES on the monorepo. Suppressing
at the emit point cannot drift.

Tests: unit tests pin the keep/drop split (including lsp_* -> keep). A
reproduce-first sequential E2E fixture asserts the regex-receiver false edge is
gone while a typed-receiver call (lsp_ts_method) and a bare local call survive.
A >=50-file parallel fixture (CBM_WORKERS forces the parallel resolver) asserts
that axios.get and dev.load('/api/data') keep their HTTP_CALLS (the latter via
detect_url_in_args — the class the old predicate lost), that api.patch,
request(app).get and router.get keep their Route registrations, and that the
regex and dev.load weak plain-CALLS edges stay suppressed. The ts/S6
inherited-method probe, which used to pass via a fragile unique_name fallback,
now asserts exactly zero CALLS with a store-opened guard (the INHERITS edge IS
extracted; the gap is ts_lsp_cross's cross-file resolution, which the guard
keeps once wired).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Hitoshi Okazaki <okazaki.hitoshi@tecnos.co.jp>
@DeusData DeusData mentioned this pull request Jul 4, 2026
@DeusData DeusData added bug Something isn't working parsing/quality Graph extraction bugs, false positives, missing edges priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker. labels Jul 4, 2026
@DeusData

DeusData commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Thanks for opening the TS/JS resolver fix for #835. Triage: high-priority parsing/call-graph correctness.

Since this is currently a draft, we will wait for it to be marked ready before full review. The review focus will be narrow: suppress weak short-name strategies for unresolved TS/JS member receivers without dropping resolved LSP-backed calls or bare calls.

@tecnos-okazaki tecnos-okazaki marked this pull request as ready for review July 4, 2026 08:09
@tecnos-okazaki tecnos-okazaki requested a review from DeusData as a code owner July 4, 2026 08:09
@tecnos-okazaki tecnos-okazaki changed the title fix(resolver): suppress weak short-name strategies for TS/JS method calls with unresolved receivers Withdrawn by author Jul 4, 2026
@tecnos-okazaki tecnos-okazaki deleted the fix/tsjs-receiver-weak-suppression branch July 4, 2026 08:18
@DeusData

DeusData commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Thank you — this is exactly the graph-quality work we want: the drop-list construction is provably right (a keep-list would have killed lsp_ts_method), the emit-point gating spares every Route/HTTP/ASYNC branch by structure, and disclosing the discarded draft that lost 399 HTTP_CALLS edges is model engineering transparency. The ts/S6 probe flip is approved — its old green was a false guard by our own annotation; we're adding a RED reproduction for the TS cross-file inheritance gap on our side so the gap stays visible. Merging.

@DeusData

DeusData commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Heads-up for the record: your fork was deleted while we were merging, which made GitHub auto-close this PR in a way that cannot be reopened. No action needed — we recovered your exact commits (authorship and sign-offs intact) from the preserved PR ref and they are landing via the recovery PR referenced above. Thank you again for excellent work — this closes #835 as intended, fully credited to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working parsing/quality Graph extraction bugs, false positives, missing edges priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants