Skip to content

fix(core): normalize coding-session paths to POSIX form - #1127

Merged
phernandez merged 1 commit into
mainfrom
fix/coding-session-windows-paths
Jul 21, 2026
Merged

fix(core): normalize coding-session paths to POSIX form#1127
phernandez merged 1 commit into
mainfrom
fix/coding-session-windows-paths

Conversation

@phernandez

Copy link
Copy Markdown
Member

Why

tests/cli/test_coding_session_context.py::test_coding_profile_writes_required_git_and_pull_request_frontmatter fails on the Windows matrix: repo_root comes from git rev-parse --show-toplevel (forward slashes on every platform) while the checkpoint cwd comes from the hook event in native form (C:\Users\...), so the coding-session identity invariant repo_root == cwd breaks.

Main never surfaced this: the #1125 push run was cancelled (superseded by the follow-up merge push) and the follow-up run skipped the Python matrix (plugins-only change), so the first full Windows runs happened on PR branches rebased onto main (#1090, #1088) — both red through no fault of their own.

What Changed

  • _coding_context stores repo_root via Path(...).as_posix() (no-op on POSIX; pins the canonical form).
  • The coding checkpoint's cwd frontmatter is stored in the same POSIX form, after redaction (the [redacted-path] sentinel has no separators and passes through unchanged).

Path identity for coding_session notes is now comparable and queryable cross-platform. General (non-coding) session notes keep native cwd — unchanged behavior.

Verification

  • uv run pytest tests/cli/test_coding_session_context.py tests/cli/test_hook_command.py — 100 passed (POSIX; the conversion no-ops here — the Windows matrix on this PR is the real proof)
  • ruff format --check / ruff check clean

🤖 Generated with Claude Code

https://claude.ai/code/session_01A2bgrGfWiL4izcjj66u9R8

Git emits repo_root with forward slashes on every platform, while the
hook event cwd arrives in native form — on Windows that is C:/Users vs
C:\Users, so the coding checkpoint's repo_root == cwd identity broke and
tests/cli/test_coding_session_context.py failed on the Windows matrix.
Main never saw it: the #1125 push run was cancelled by the follow-up
merge and the next run skipped the Python matrix (plugins-only change).

Store both fields in POSIX form so coding-session path identity is
comparable and queryable cross-platform.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A2bgrGfWiL4izcjj66u9R8
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez
phernandez merged commit 6189de8 into main Jul 21, 2026
22 checks passed
@phernandez
phernandez deleted the fix/coding-session-windows-paths branch July 21, 2026 03:07
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