Repository navigation
fix(importers): Canonicalize absolute importer paths - #161
Conversation
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>
|
Verified and merged. Canonicalization holds up under the attacks that matter: cross-repo symlink aliasing, nested repo-in-repo, a submodule, and a linked worktree ( One adjacent gap worth a follow-up, pre-existing and not from this PR (confirmed byte-identical on main, so nothing here regressed): in Generated by Claude Code |
What does this PR do?
Makes absolute
--importersqueries use the same canonical project and file roots:Why it matters
On macOS,
/tmpand/private/tmpcan 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
--importersqueries now work consistently with absolute paths.Verification
codemap .andcodemap --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