Skip to content

typescript: a library method redeclared in a test fixture's .d.ts becomes a hub, so reach through .map/.every spans the whole repository #1574

Closed

Description

@swapnilpaliwal-sd

Symptom

A call to a standard-library method in production code (xs.map(cb), xs.every(cb)) resolves to that method's declaration in a test fixture's ambient .d.ts. From there, callback dispatch reaches every callback passed to that method anywhere in the repository, so the reach of any function that calls it becomes most of the codebase.

$ axiomcode path parser/src/parsers/typescript/extractors/ts-declaration-extractor.ts:1756 '*'
everything reached from TsDeclarationExtractor.emitBoundParameterNames: 2140 method(s) in 209 file(s)
  Through exact calls only: 9 production, 2 test; the other 2129 only through a dispatch choice
  files: ... python/extractors/python-declaration-extractor.ts (101), python-resolution-linker.ts (99), ...

$ axiomcode path ts-declaration-extractor.ts:1756 parser/src/parsers/python/extractors/python-declaration-extractor.ts
  → [known_edge] TsMethodParameterRegistry.<constructor>
  → [known_edge] TsMethodParameterRegistry.generateHash
  → [known_edge] keyOf   parser/src/analysis-types/typescript/ts-row.ts:77
  → [multi_inferred · call @ ts-row.ts:78] Array.map   graph/test/typescript/cases/34-callback-of-callback/src/globals.d.ts:17
  → [defines · not a call] <function-type>   .../globals.d.ts:17
  → [dispatch] PythonDeclarationExtractor.<arrow>   parser/src/parsers/python/extractors/python-declaration-extractor.ts:1087

A TypeScript helper thus "reaches" the Python extractor, which it never calls. The same fan-out showed up in three agent sessions: path jsxTagReference '*' reached 2140 methods through Array.every, path '*' TsModuleRegistry returned 1093 reachers, and impact listed every language's extractor through a same-named run.

Expected

  • A declaration inside a test-case fixture tree is not the target of a production call to a library method.
  • A call to a higher-order library method reaches only the callbacks passed at that call site, not every callback ever passed to the same method.

Activity

  1. swapnilpaliwal-sd commented on Sep 28, 2026

    @swapnilpaliwal-sd
    ContributorAuthor

    Fixed by #1693 (merged into 0.1.7).

  2. swapnilpaliwal-sd commented on Sep 28, 2026

    @swapnilpaliwal-sd
    ContributorAuthor

    Fixed by #1693 (merged into 0.1.7).

  3. swapnilpaliwal-sd commented on Sep 29, 2026

    @swapnilpaliwal-sd
    ContributorAuthor

    Fixed by #1779 (merged into 0.1.9).

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

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions