get_dependencies importers are matched by file stem: 15/30 rows wrong on zod; relative specifiers are never resolved and stem matches are not marked #544

Closed
opened 2026-11-09 08:35:49 +01:00 by buildagent · 1 comment
Member

Summary

get_dependencies lists a file's importers by matching the file stem, and never resolves relative specifiers. On a monorepo with common file names, about half the rows are wrong.

  • ts-zod get_dependencies(v4/classic/schemas.ts): 15/30 importer rows are wrong. They are v4/core/* files importing their own ./schemas.js.
  • external.ts: 8/12 rows are wrong (the v3 and mini external.ts).
  • Fixture: lib/y/util.ts lists src/u.ts, which imports ../lib/x/util.js.
  • Code: importers_of_file (crates/daemon/src/local_index.rs:4755) builds a MatchKey from file_stem. Its doc comment says "Best-effort by design: a file with a very generic stem (mod, index, util) can attract importers of a same-named file elsewhere". The reply does not mark which rows are stem matches, so an agent cannot tell.

Proposal

  • Resolve ./ and ../ specifiers against the importer's directory, with extension and index probing, before any stem fallback. Use the module map (see #543) for bare and aliased specifiers.
  • Any remaining stem-only match is tagged match: "stem" and counted separately, so the disclosure lives in the payload.
  • The same resolution should feed the import refs, so one module-resolution function serves both tools.

Acceptance

  • zod schemas.ts and external.ts importers are exact.
  • The fixture is exact.
  • A mutation forcing the stem path goes red.

Related: #31, #526 (crate/mod edges for get_dependencies).


Filed from the per-language review on 2026-11-09: 8 agents, one per language plus one for Vue/Svelte/XAML/timeline, run against copies of the pinned corpus repos (tests/corpus/corpus.toml) using installed build 2dcfc615, which differs from master only by XAML/CI commits. The top claim of every issue was spot-checked in the main session. Artifacts live under the review session's scratchpad lang-out/<lang>/ and are available on request.

## Summary `get_dependencies` lists a file's **importers** by matching the **file stem**, and never resolves relative specifiers. On a monorepo with common file names, about half the rows are wrong. - ts-zod `get_dependencies(v4/classic/schemas.ts)`: **15/30 importer rows are wrong**. They are `v4/core/*` files importing *their own* `./schemas.js`. - `external.ts`: 8/12 rows are wrong (the v3 and mini `external.ts`). - Fixture: `lib/y/util.ts` lists `src/u.ts`, which imports `../lib/x/util.js`. - Code: `importers_of_file` (`crates/daemon/src/local_index.rs:4755`) builds a `MatchKey` from `file_stem`. Its doc comment says "Best-effort by design: a file with a very generic stem (`mod`, `index`, `util`) can attract importers of a same-named file elsewhere". The reply does **not** mark which rows are stem matches, so an agent cannot tell. ## Proposal - Resolve `./` and `../` specifiers against the importer's directory, with extension and `index` probing, **before** any stem fallback. Use the module map (see #543) for bare and aliased specifiers. - Any remaining stem-only match is tagged `match: "stem"` and counted separately, so the disclosure lives in the payload. - The same resolution should feed the `import` refs, so one module-resolution function serves both tools. ## Acceptance - zod `schemas.ts` and `external.ts` importers are exact. - The fixture is exact. - A mutation forcing the stem path goes red. Related: #31, #526 (crate/mod edges for `get_dependencies`). --- _Filed from the per-language review on 2026-11-09: 8 agents, one per language plus one for Vue/Svelte/XAML/timeline, run against copies of the pinned corpus repos (`tests/corpus/corpus.toml`) using installed build `2dcfc615`, which differs from master only by XAML/CI commits. The top claim of every issue was spot-checked in the main session. Artifacts live under the review session's scratchpad `lang-out/<lang>/` and are available on request._
Author
Member

Consolidated into #543 during the 2026-11-09 triage. The remaining scope of this issue is tracked there as a checklist item; this report stays as the detailed evidence.

Consolidated into **#543** during the 2026-11-09 triage. The remaining scope of this issue is tracked there as a checklist item; this report stays as the detailed evidence.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
h-dv/code-index#544
No description provided.