Repository navigation
CU-1: Windows write-gate path matrix (Cursor + Copilot); the witnessed allow does not reproduce - #253
Merged
Merged
Conversation
Drives the built Cursor plugin with a path-scoped gate, a payload with no cwd, and the hook run from a folder outside the workspace. On Windows it crosses file_path spellings (C:/, C:\, c:\, c:/) with workspace_roots spellings (/c:/, /C:/, c:\, C:/). A new windows-paths CI job runs this one file on windows-latest, since PR CI is Linux-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
The plugin hook command is a POSIX launcher that cmd.exe cannot parse, so every Windows case failed before reaching the gate. The launcher only locates Python; the test now runs the bundled cursor.py with this interpreter, which is the code under test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
… Cursor
Runs each client's hook command through Git Bash, as the repo's other
hook tests do, and adds Copilot CLI create {path, file_text} payloads
with cwd and path in C:\, c:\ and C:/ spellings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
ci.yml is held to the 300-line review budget; the job pushed it to 326. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
The shared hook runner writes stdin in the locale encoding, cp1252 on a Windows runner, which cannot encode U+FEFF. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
…ythons Merges the repo's own pin-github-actions into a bundle as Cursor and Copilot (Claude format) install it and feeds the witnessed content, an indented unpinned uses: in a new workflow of a committed repository, across the Windows path spellings. The Windows job now runs on Python 3.12, 3.13 and 3.14. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
The owner's witness repos were git init only, and their interpreter is CPython 3.12.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
jothimani-rajendran
marked this pull request as ready for review
October 9, 2026 01:44
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.
What
CU-1 (org-plan
plan/cursor-windows-write-gate.md). On the owner's Windows machine, Cursor'spreToolUselet a write to.github/workflows/witness.ymlthrough, even thoughpin-github-actionscovers that path. Copilot CLI did the same. The plan's hypothesis: a case-sensitive or slash-sensitive path comparison on Windows.This PR adds a Windows reproduction matrix and a CI job that runs it on every PR. It changes no gate code, because the matrix shows main's code already refuses every case.
tests/test_cursor_windows_write_gate.py, run through each client's real hook command (Git Bash, as Cursor and Copilot run it):cwd, hook run from another folder or from home. Everyfile_pathspelling (C:/,C:\,c:\,c:/) against everyworkspace_rootsspelling (/c:/,/C:/,c:\,C:/).createwith{path, file_text}.cwdasC:\orc:\, against the 4 path spellings.pin-github-actions, merged into a bundle as each client installs it. The witnessed content is an indenteduses: actions/checkout@v4in a new workflow. HEAD is unborn (git initonly, as in the owner's repos) or committed..github/workflows/windows-paths.ymlruns that file onwindows-latestwith Python 3.12.0 (the owner's interpreter), 3.12, 3.13 and 3.14. It is a separate file becauseci.ymlis held to 300 lines.Runs
3e219accmd.execannot parse the POSIX launcher571b6a6993a8a704edfd18795295There is no failing-then-passing pair: the matrix never fails on main's code. Something in the owner's environment differs from all of the above; that is still to be found.
Measured on Linux, not Windows-specific: if the target file is already on disk, uncommitted, with the unpinned line, a write of the same content is allowed at
preToolUse. The write-time baseline is the file on disk, while the turn-end gate's baseline is HEAD and it refuses. The orchestrator says this did not apply to the owner's runs. It is reported for a separate decision.Definition of done
pyteston the touched test file: green on Linux and on Windows (4 Pythons)ruff checkandruff format --checkcleanactionlintandzizmor --offlineclean; actions pinned by SHA;permissions: contents: read; no secrets; nopull_request_target🤖 Generated with Claude Code