Repository navigation
CU-1: regression test, Cursor write from a HOME holding .chock is judged in the workspace - #257
Merged
Merged
Conversation
…workspace Regression test for the CU-1 witness: the hook runs from HOME, which holds .chock/, the repo sits beside it with HEAD unborn or committed, and the payload has no cwd, only workspace_roots. Fails on the engine before 9914aa7 (allow), passes on main (deny). Adds CPython 3.14.3, the owner's hook interpreter, to the Windows path matrix. 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 11, 2026 18:52
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 root cause. On the owner's Windows machine, the installed
chock-witnessCursor plugin was built by an engine older than9914aa7("fix(gate): take Cursor's repository root from workspace_roots", 2026-10-07). The owner's diagnostic shows that build has noworkspace_root. Cursor sendspreToolUsewithoutcwd, so that build'srepo_root_forfell back to the hook process's cwd. When the hook ran fromC:\Users\jothi, the write becamewitness-repo-cursor/.github/workflows/witness.yml, which is outside.github/workflows/*, so it was allowed. Main has had the fix since9914aa7.This PR adds the regression test for that exact layout, so it can't come back:
.chock/, and the repo sits beside it, with HEAD unborn or committed;cwd, onlyworkspace_roots(spelled/C:/…on Windows);It also adds CPython 3.14.3, the interpreter the owner's hooks launch, to the
windows-pathsmatrix.Fails before, passes after (measured locally, Linux)
9914aa7^(pytest -o pythonpath="<9914aa7^ src> tools" … -k home_with_chock):AssertionError: assert 'allow' == 'deny', 2 failed.a2dd3de): 2 passed.windows-pathsjob.Definition of done
ruff checkandruff formatclean on the touched test fileactionlintclean; matrix change only; no new permissions or actionswindows-pathson 3.12.0 / 3.12 / 3.13 / 3.14.3 / 3.149914aa7withchangelog.d/cursor-windows-workspace-root.md)🤖 Generated with Claude Code
Generated by Claude Code