Skip to content

fix(tsjs): resolve Effect-TS wrapper-named functions and service receivers - #15

Merged
heiyan-2020 merged 1 commit into
mainfrom
fix/effect-ts-wrapper-resolution
Sep 8, 2026
Merged

heiyan-2020 merged 1 commit into
mainfrom
fix/effect-ts-wrapper-resolution

Conversation

@heiyan-2020

Copy link
Copy Markdown

Two uniqueness/scope/import-gated resolution strategies for Effect-TS codebases, plus the pre-filter escape that lets tail-named refs reach them. Full rationale in FORK.md's patch table and CHANGELOG; regression cover in __tests__/effect-ts-resolution.test.ts (8 tests). Verified on an Effect-heavy monorepo: +641/−308 TS call edges, every sampled removal replaced by a demonstrably correct target. Suite: 3065 passed, only the 10 pre-existing environment failures (git-fixture dependent) remain, identical to baseline.

…ivers

Two resolution gaps severed the call graph on Effect-TS codebases:

1. The extractor names a function node after a wrapper debug string
   (Effect.fn("Ns.name")), but call sites use the binding's bare name and
   function-local consts are unindexed — exact-name matching failed or
   bound a same-named function in an unrelated file. matchWrappedLocalName
   bridges the names: a bare call resolves to the unique same-file
   wrapper-named function visible from the call site's scope, and runs
   before global exact-name matching so a same-file target beats a
   cross-file bare name.

2. Member calls on service locals (const x = yield* Ns.Service) had no
   source-level receiver type. The mc-effect-svc branch recovers the
   namespace from the receiver's own declaration (one Ns.create() factory
   hop included), requires the file to import it, and resolves a unique
   Ns.method node. Shadowing and non-service re-binds decline.

A pre-filter escape (matchesWrapperNamedMember) lets tail-named refs reach
these strategies — a pass buys a lookup, not an edge.

On an Effect-heavy repo this replaces hundreds of wrong cross-file
bare-name edges (test helpers, unrelated classes) with correct targets.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T14:54:28.918803Z 93a3e64 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@heiyan-2020
heiyan-2020 merged commit f558dbd into main Sep 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant