Skip to content

[Detection] Default-import context threading in resolveExportedMatches (A3 follow-up) #114

Description

@AndresL230

Summary

PR #110's A3 barrel re-export work added handling for export { default } from "./a", but the default-import context threading in resolveExportedMatches is fragile when a barrel mixes a default re-export with named re-exports whose source happens to call the default's provider.

Repro shape

// barrel.ts
export { default } from "./a";   // a.ts default-exports an OpenAI client
export { ask } from "./b";       // b.ts also makes openai calls via a different path

// consumer.ts
import client, { ask } from "./barrel";
client.chat.completions.create(...);
ask(...);

When the barrel mixes shapes, the resolver may incorrectly attribute one to the other's provider context. The tested fixture in PR #110 works; the failure mode appears when barrels are heterogeneous.

What to do

  • Add an explicit "default vs. named" disambiguation pass in src/ast/cross-file-resolver.ts.
  • Each re-export entry should carry its own provider-resolution context — don't share state across the barrel.
  • Audit fixture in src/test/fixtures/a3-followup/.
  • Test in src/test/a3-default-import-threading.test.ts.

Acceptance criteria

Reference

Memory: a3_a5_pr_status.md — "Default-import context threading in resolveExportedMatches — works for tested fixture but fragile when a barrel mixes…"

Activity

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

    area/detectiondocs/accuracy/detection.md — finding every call site, attributing correctlyenhancementNew feature or requestwave/3-resolver-followupsA3/A5 incremental fixes: default-import threading, factory-with-args, images.generate narrowing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions