potiuk opened a new pull request, #157:
URL: https://github.com/apache/airflow-steward/pull/157

   ## Summary
   - `claude -w` (and `claude --worktree`) materialises a new worktree at
     `<main>/.claude/worktrees/<name>` and chdirs into it before sandbox
     init. The sandbox's relative `"."` allowRead rule then covers only
     the worktree subtree, not the main repo — so files outside the
     worktree's own working tree (siblings of `.claude/worktrees/`)
     aren't readable from the session.
   - When `-w` / `--worktree` is in the args, `claude-iso` now resolves
     the main repo via `git rev-parse --git-common-dir` (works from the
     main checkout *and* from nested worktrees) and prepends a one-shot
     `--settings '{"sandbox":{"filesystem":{"allowRead":["<main-repo>"]}}}'`
     to the `claude` argv. `claude` merges this into the loaded settings
     stack at startup, so the path is in scope before the sandbox
     initialises — same session, no on-disk edits, nothing to clean up
     when the worktree is abandoned.
   - A short dimmed stderr banner reports the path added. No prompt.
   - Skipped silently when not inside a git repo, or when `-w` isn't
     passed.
   
   ## Test plan
   - [x] `bash -n` and `zsh -n` both accept the script
   - [x] `prek run --files tools/agent-isolation/claude-iso.sh` passes
   - [x] `-w` detection covers `-w`, `--worktree`, `-w <name>`,
         `--worktree=<name>`, and `-w` mixed with other flags
   - [x] JSON-escaping holds for paths containing `"` and `\` (validated
         with `python3 -c 'import json,sys; json.load(sys.stdin)'`)
   - [ ] Manual end-to-end: `claude-iso -w` from `/path/to/repo`,
         confirm the main-repo path is readable inside the worktree
         session


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to