Repository navigation
Make Agent Workflows Sandbox-Aware - #803
Conversation
There was a problem hiding this comment.
Pull request overview
Updates fleet operational guidance and skill distributions to behave correctly under restricted/sandboxed executors by (a) keeping tool caches out of the checkout, (b) clarifying how to interpret sandbox denials vs. lint failures, and (c) adding a repo-worktree standalone-clone fallback when linked-worktree Git metadata is not writable (Closes #801).
Changes:
- Document per-task temporary cache directories for uv/ruff and how to treat sandbox denials as execution boundaries (not lint verdicts).
- Extend
repo-worktreeguidance with a standalone-clone fallback for executors that cannot write linked-worktree Git metadata. - Add editorconfig-checker excludes for common generated Python cache directories.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| OPERATIONS.md | Updates local verification runbook to use per-run temp caches and document sandbox-denial rerun procedure. |
| GOVERNANCE.md | Adds governance guidance for cache placement and for reporting sandbox denials vs. lint results. |
| AGENTS.md | Adds agent operating rules for cache placement and for reporting execution boundaries. |
| .github/skills/repo-worktree/SKILL.md | Documents sandbox-aware worktree creation, including standalone-clone fallback and cleanup. |
| .github/skills/python-codestyle/SKILL.md | Adds restricted-executor cache guidance for uv/ruff. |
| .editorconfig-checker.json | Excludes generated Python cache directories from editorconfig-checker scans. |
| .claude-plugin/fleet-skills/skills/repo-worktree/SKILL.md | Synced generated skill copy for repo-worktree. |
| .claude-plugin/fleet-skills/skills/python-codestyle/SKILL.md | Synced generated skill copy for python-codestyle. |
| .claude-plugin/fleet-skills/.source-digest | Updates generated skill distribution digest. |
| .agents/skills/repo-worktree/SKILL.md | Synced generated skill copy for repo-worktree. |
| .agents/skills/python-codestyle/SKILL.md | Synced generated skill copy for python-codestyle. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
Suppressed comments (4)
OPERATIONS.md:13
- The command block is marked as
sh, butset -Eeuo pipefailis bash-specific (not POSIXsh) and will fail if someone runs the snippet under a strict/bin/sh(e.g., dash). Label this block asbash(or avoidpipefail) so the runbook is executable as written.
```sh
set -Eeuo pipefail
.github/skills/repo-worktree/SKILL.md:120
- The standalone-clone example uses a
<origin-url>placeholder without showing how to derive it from the current checkout. This makes the fallback path harder to follow and risks using a different transport/auth method than the base clone. Consider deriving the URL from the current repo’soriginremote and cloning from that.
```sh
git clone --no-checkout <origin-url> <temporary-root>/<Repo>-<task-slug>
git -C <temporary-root>/<Repo>-<task-slug> fetch origin develop
git -C <temporary-root>/<Repo>-<task-slug> switch -c <task-branch> origin/develop
**.agents/skills/repo-worktree/SKILL.md:120**
* The standalone-clone example uses a `<origin-url>` placeholder without showing how to derive it from the current checkout. This makes the fallback path harder to follow and risks using a different transport/auth method than the base clone. Consider deriving the URL from the current repo’s `origin` remote and cloning from that.
git clone --no-checkout <origin-url> <temporary-root>/<Repo>-<task-slug>
git -C <temporary-root>/<Repo>-<task-slug> fetch origin develop
git -C <temporary-root>/<Repo>-<task-slug> switch -c <task-branch> origin/develop**.claude-plugin/fleet-skills/skills/repo-worktree/SKILL.md:120**
* The standalone-clone example uses a `<origin-url>` placeholder without showing how to derive it from the current checkout. This makes the fallback path harder to follow and risks using a different transport/auth method than the base clone. Consider deriving the URL from the current repo’s `origin` remote and cloning from that.
git clone --no-checkout <origin-url> <temporary-root>/<Repo>-<task-slug>
git -C <temporary-root>/<Repo>-<task-slug> fetch origin develop
git -C <temporary-root>/<Repo>-<task-slug> switch -c <task-branch> origin/develop</details>
|
Addressed all 4 suppressed findings from Copilot review round 2.
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
Suppressed comments (2)
OPERATIONS.md:17
- Severity: medium — Clean up the temporary tool cache directory. This runbook creates a new mktemp directory on every verification run but never removes it; repeated runs can accumulate under $TMPDIR and eventually cause disk-pressure or confusion when debugging. Add an EXIT trap to remove the directory after the commands complete.
set -Eeuo pipefail
PROJECTTEMPLATE_TOOL_CACHE="$(mktemp -d "${TMPDIR:-/tmp}/projecttemplate-tools.XXXXXX")"
export UV_CACHE_DIR="$PROJECTTEMPLATE_TOOL_CACHE/uv"
export RUFF_CACHE_DIR="$PROJECTTEMPLATE_TOOL_CACHE/ruff"
.editorconfig-checker.json:7
- Severity: medium — Exclude pycache as part of the generated Python cache defense-in-depth. The PR description says editorconfig-checker should ignore generated Python caches, but pycache/ is still included. In environments where editorconfig-checker falls back to filesystem walking (or doesn’t honor .gitignore), these directories can be scanned and produce false failures.
"Exclude": [
"(^|/)\\.mypy_cache/",
"(^|/)\\.pytest_cache/",
"(^|/)\\.ruff_cache/",
"(^|/)\\.venv/"
],
|
Addressed all 2 suppressed findings from Copilot review round 3. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
Suppressed comments (2)
OPERATIONS.md:18
- The runbook sets
UV_CACHE_DIR/RUFF_CACHE_DIRunder a temp directory, but coverage will still write its data file (default.coverage) into the checkout unless redirected. That contradicts the new guidance about keeping tool state outside restricted checkouts and can still create untracked artifacts for later whole-tree tools.
Consider exporting COVERAGE_FILE into the same temp directory before the coverage runs.
export UV_CACHE_DIR="$PROJECTTEMPLATE_TOOL_CACHE/uv"
export RUFF_CACHE_DIR="$PROJECTTEMPLATE_TOOL_CACHE/ruff"
OPERATIONS.md:21
uvx mypy@latestwill create.mypy_cache/in the current working directory by default (nocache_diris configured inpyproject.toml). If the goal is to keep generated tool state outside the checkout in restricted executors, pass an explicit mypy cache directory underPROJECTTEMPLATE_TOOL_CACHE.
export UV_CACHE_DIR="$PROJECTTEMPLATE_TOOL_CACHE/uv"
export RUFF_CACHE_DIR="$PROJECTTEMPLATE_TOOL_CACHE/ruff"
uvx ruff@latest check .
uvx ruff@latest format --check .
uvx mypy@latest
|
Addressed all 2 suppressed findings from Copilot review round 4.
|
Summary
Root Cause
Restricted executors can expose the checkout, home caches, network, Docker socket, and linked-worktree metadata with different permissions. The prior workflow considered only the visible worktree path. Local validation also let one tool create cache files that a later repository-wide tool inspected.
Validation
Closes #801