Skip to content

fix(rust): hand on-file hooks non-verbatim Windows paths - #1211

Merged
6 commits merged into
mainfrom
claude/1208-win-nonverbatim-paths
Oct 2, 2026
Merged

6 commits merged into
mainfrom
claude/1208-win-nonverbatim-paths

Conversation

@thekevinbot

@thekevinbot thekevinbot commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1208
Part of #1191

On-file hooks and parsed() parsers now receive {path} and {root} in plain form: \\?\C:\x becomes C:\x and \\?\UNC\server\share\x becomes \\server\share\x. Verbatim forms with no plain equivalent (\\?\GLOBALROOT, \\?\Volume{...}, ./.. or empty components, trailing dot/space, reserved device names, invalid characters, paths of 260+ UTF-16 units) pass through unchanged.

The conversion is a pure string function (command::non_verbatim), so its tests run on Linux. dunce is not a dependency; a small local function covers it. Argv quoting (#1207) and the root-relative path column (#1189) are untouched.

E2E Verification

  • Ran e2e suites locally for every affected SDK
  • Python SDK e2e: pass (38 passed, 4 xfailed)
  • TypeScript SDK e2e: pass (18 passed)
  • Rust core e2e (if applicable): pass (cargo test --workspace --features cli)
  • packages/python/e2e-attestations/<branch>.json receipt written if packages/python changed (just e2e-attest-python)
  • packages/ts/e2e-attestations/<branch>.json receipt written if packages/ts changed (just e2e-attest-ts)
  • Command(s) run: cargo test --workspace --features cli, just e2e-attest-python, just e2e-attest-ts, just preflight
  • Result summary: all pass; preflight 0 failing pairs, rust mutation 37 mutants, all caught.

Manual run (Linux): dirsql -c .dirsql.toml "SELECT p, r FROM seen" with on-file = "sh -c '...' sh {path} {root}" returned [{"p":"/tmp/ex1208/data/a.txt","r":"/tmp/ex1208"}], unchanged on Unix. The Windows conversion is covered by Linux-run unit tests; there is no cfg(windows) code, so no Windows-target compile check was needed. Not run on a Windows host (that CI job is in #1178).

Changelog / Migrations

  • Changelog fragment added under <root>/<pkg>/changelog.d/ for each changed package (or: skip-changelog trailer on a commit with reason)
  • Migration fragment added under <root>/<pkg>/migrations.d/ (or: not required -- additive/bugfix only)

@thekevinbot
thekevinbot marked this pull request as ready for review October 2, 2026 11:32
MSYS sh collapses a leading \\ even when quoted; UNC conversion stays covered by the non_verbatim unit tests.
@thekevinscott thekevinscott closed this pull request by merging all changes into main in 8979b6f Oct 2, 2026
@thekevinscott
thekevinscott deleted the claude/1208-win-nonverbatim-paths branch October 2, 2026 15:48
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.

Windows: hand on-file hooks non-verbatim paths

2 participants