Skip to content

fix: preserve Windows drive paths in bundle catalog config - #5205

Open
chelsealong wants to merge 1 commit into
github:mainfrom
chelsealong:fix/codex-spec-kit-5204
Open

chelsealong wants to merge 1 commit into
github:mainfrom
chelsealong:fix/codex-spec-kit-5204

Conversation

@chelsealong

Copy link
Copy Markdown
Contributor

Description

Fixes #5204. Preserve Windows drive paths verbatim when a POSIX host adds a bundle catalog, preventing the host’s Path.resolve() from rewriting them into project-relative paths. Native paths retain their existing behavior.

Testing

  • Regression test: 2 failures before the fix; 2 passes after.
  • Bundle suite: 1,272 passed.
  • Sample CLI project: add, repeat add, and remove passed; the stored URL matched the input.
  • Ruff, specify --help, and git diff --check passed.

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance

AI disclosure: OpenAI Codex (GPT-6, reasoning effort setting not exposed) worked autonomously to investigate the issue, generate the code and test, and run validation. This does not claim human review or testing.

@chelsealong
chelsealong requested a review from mnriem as a code owner November 1, 2026 01:15

@yxshee yxshee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this against main (7370e59). On main, add_source(project, r"C:\catalog.json", ...) on Linux stores /<project>/C:\catalog.json with id c--catalog, as #5204 describes. With the change, the URL is stored verbatim and the id becomes catalog, which is the id the same input gets on Windows, so a config is now consistent across hosts.

Two things I noticed, neither blocking:

  • On a POSIX host the preserved C:\catalog.json entry still can't be read. adapters.py opens it as Path(url) relative to the working directory and raises Catalog file not found: C:\catalog.json. That's a clear error, so it's fine. If you'd rather catch it at bundle catalog add time, the issue's other option (reject a foreign drive path on POSIX) would do that.
  • C:\catalog.json and C:/catalog.json are the same file on Windows, where both canonicalize to C:\catalog.json and the second add returns unchanged. On POSIX they're now stored verbatim, so the second add fails with "already exists" because the id catalog collides. remove_source(project, "C:/catalog.json") also won't remove an entry stored as C:\catalog.json on POSIX. Normalizing with str(PureWindowsPath(url)) instead of returning url unchanged would make both spellings behave the same way on every host.

Posted on behalf of @yxshee. AI disclosure: Claude Code (model: Claude Opus 5.5, autonomous) reproduced the issue on main, checked the change's behavior by applying the same two-line logic to main, and drafted this review. I did not run the PR branch itself.


Generated by Claude Code

@mnriem mnriem added the triage-must-have Verdict: high-value, important work for Spec Kit — do first label Nov 1, 2026

This branch has not been deployed

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

Labels

triage-must-have Verdict: high-value, important work for Spec Kit — do first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bundle catalog add rewrites Windows drive paths as POSIX paths

3 participants