Skip to content

fix(ts): tsconfig alias imports to dotted basenames, and calls through constructor-injected fields - #2

Open
thientrile wants to merge 4 commits into
mainfrom
fix/ts-alias-dotted-and-param-properties
Open

thientrile wants to merge 4 commits into
mainfrom
fix/ts-alias-dotted-and-param-properties

Conversation

@thientrile

Copy link
Copy Markdown
Owner

Two TypeScript resolution bugs from a NestJS repo (40k nodes, re-indexed with mode=full, tsconfig "paths": { "src/*": ["src/*"] }).

1. Alias imports to x.service.ts resolve to the wrong file

import { ConversationsService } from 'src/conversations/conversations.service' bound to src/tasks/capabilities/task-write-capabilities.spec.ts.

The alias branch of cbm_pipeline_resolve_module passed the already extension-stripped target to cbm_pipeline_fqn_module, which stripped .service a second time. The module QN missed, and resolution fell back to an unrelated file that mentions the class. The relative branch had the same bug and was fixed in DeusData#1682. The alias branch now resolves the same way, and strip_resolved_ext strips the same extension list as the relative resolver (.mjs, .cts, .json, …), since nothing strips after it any more.

2. this.<injected>.method() produces no CALLS edge

constructor(private readonly svc: Svc) declares the field svc, but ast_sweep_shapes collected only public_field_definition. this.svc had no type, so the call never resolved. Parameters with an accessibility modifier, readonly or override are now registered as typed fields. Plain constructor parameters stay local.

Verification

  • ei_typescript_dotted_alias_import_targets_source_module (edge_imports) and tslsp_constructor_parameter_property_resolution (ts_lsp) fail on main and pass with the fix.
  • test-runner edge_imports ts_lsp → 368 passed, 0 failed (gcc 14, ASan).
  • Full local run in a gcc:14 container: extract_spill_round_trip_keeps_every_field fails at cbm_result_spill_open (Python spill dir, untouched by this PR). This looks environmental; CI on this PR settles it.

…ases

The alias branch passed the already extension-stripped target to
cbm_pipeline_fqn_module, which stripped `.service` from
`src/conversations/conversations.service` a second time. The module was
missed and the import bound to an unrelated file mentioning the class, so
every aliased import in a NestJS `x.service.ts` layout pointed at the wrong
file. Resolve it like the relative branch (DeusData#1682) does, and strip the same
extension list there.

Signed-off-by: Liguni <thientrile2003@gmail.com>
`constructor(private readonly svc: Svc)` declares the field `svc`, but only
public_field_definition was collected, so `this.svc.method()` had no
receiver type and produced no CALLS edge. NestJS injects every service this
way, so impact analysis missed most cross-class callers.

Signed-off-by: Liguni <thientrile2003@gmail.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 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-10-12T07:01:04.472260Z 72d5d33 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 72d5d33686

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/pipeline/pass_pkgmap.c Resolved
Signed-off-by: Liguni <thientrile2003@gmail.com>
Signed-off-by: Liguni <thientrile2003@gmail.com>

This branch has not been deployed

No deployments
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