fix(core): normalize coding-session paths to POSIX form - #1127
Merged
Conversation
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>
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
tests/cli/test_coding_session_context.py::test_coding_profile_writes_required_git_and_pull_request_frontmatterfails on the Windows matrix:repo_rootcomes fromgit rev-parse --show-toplevel(forward slashes on every platform) while the checkpointcwdcomes from the hook event in native form (C:\Users\...), so the coding-session identity invariantrepo_root == cwdbreaks.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_contextstoresrepo_rootviaPath(...).as_posix()(no-op on POSIX; pins the canonical form).cwdfrontmatter is stored in the same POSIX form, after redaction (the[redacted-path]sentinel has no separators and passes through unchanged).Path identity for
coding_sessionnotes is now comparable and queryable cross-platform. General (non-coding) session notes keep nativecwd— 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 checkclean🤖 Generated with Claude Code
https://claude.ai/code/session_01A2bgrGfWiL4izcjj66u9R8