Skip to content

fix(importers): Canonicalize absolute importer paths - #161

Open
reneleonhardt wants to merge 3 commits into
JordanCoin:mainfrom
reneleonhardt:fix/importers-absolute-root
Open

fix(importers): Canonicalize absolute importer paths#161
reneleonhardt wants to merge 3 commits into
JordanCoin:mainfrom
reneleonhardt:fix/importers-absolute-root

Conversation

@reneleonhardt

Copy link
Copy Markdown
Contributor

What does this PR do?

Makes absolute --importers queries use the same canonical project and file roots:

  • Infers the nearest Git project for an absolute importer launched outside the project.
  • Canonicalizes the importer in both explicit-root and inferred-root paths.
  • Preserves explicit project-root precedence.
  • Adds end-to-end coverage for canonicalized reports and root precedence.

Why it matters

On macOS, /tmp and /private/tmp can name the same file. Mismatched spellings produced incorrect relative paths and empty importer results.

CLI / MCP surface

No new commands, arguments, or MCP tools. Existing --importers queries now work consistently with absolute paths.

Verification

  • codemap . and codemap --deps .

The repository linter reports no new findings for this branch beyond its existing baseline.

Co-Authored-By: GPT-5.6 Sol codex@openai.com

reneleonhardt and others added 3 commits August 29, 2026 16:12
Infer the nearest Git repository for absolute importer queries launched outside the project while preserving explicit-root precedence.

Co-Authored-By: GPT-5.6 Sol <codex@openai.com>
The resolved project root is canonicalized (macOS /tmp -> /private/tmp), so an
absolute importer file left in its original spelling produced a broken relative
path in the report. Canonicalize the importer whenever it is absolute, in both
the explicit-root and inferred-root paths, and cover it with an end-to-end
report test plus a corrected 'explicit roots win' assertion.

Co-Authored-By: Whale integration <whale@local>
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