diff --git a/.claude/settings.json b/.claude/settings.json index 54d23de5e..b8bbae2ee 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -7,7 +7,7 @@ "uv run --project ~/.claude/magpie/vetted-ops vetted-op-read *", "uv run --project ~/.claude/magpie/vetted-ops vetted-op-tracker *", "uvx --from ~/.claude/magpie/vetted-ops vetted-op-read *", - "uvx --from ~/.claude/plugins/cache/apache-magpie/magpie-adversarial-review/*/tools/adversarial-review adversarial-review *", + "uvx --from ~/.claude/magpie/adversarial-review adversarial-review *", "uvx --from ~/.claude/magpie/vetted-ops vetted-op-tracker *", "~/.claude/scripts/magpie-run-evals.sh *" ], diff --git a/docs/setup/secure-agent-setup.md b/docs/setup/secure-agent-setup.md index ef2cda401..cda6660a4 100644 --- a/docs/setup/secure-agent-setup.md +++ b/docs/setup/secure-agent-setup.md @@ -507,13 +507,18 @@ below, annotated. // and their runner refuses any gh call outside repos//. It keeps // its `ask` below. Never exclude `vetted-op`: that runs the whole write // catalogue unsandboxed. + // The adversarial-review tool runs the reviewer CLIs, which need network + // and their own credentials. Like the vetted-ops entries, it names the + // fixed link its plugin's SessionStart hook maintains, never a `*` where + // the plugin version sits: that would also match `uv` options spliced in + // at that position and run them unsandboxed. "excludedCommands": [ "gh *", "uv run --project ~/.claude/magpie/vetted-ops vetted-op-read *", "uvx --from ~/.claude/magpie/vetted-ops vetted-op-read *", "uv run --project ~/.claude/magpie/vetted-ops vetted-op-tracker *", "uvx --from ~/.claude/magpie/vetted-ops vetted-op-tracker *", - "uvx --from ~/.claude/plugins/cache/apache-magpie/magpie-adversarial-review/*/tools/adversarial-review adversarial-review *" + "uvx --from ~/.claude/magpie/adversarial-review adversarial-review *" ], // The `lychee` link-check hook runs in OFFLINE mode (`offline = // true` in `.lychee.toml`): it validates only local cross-file and @@ -3400,13 +3405,17 @@ below and report ✓ done / ✗ missing / ⚠ partial, with the evidence 14. **Adversarial-review exclusion**, if the `magpie-adversarial-review` plugin is installed (n/a otherwise). `sandbox.excludedCommands` contains - `"uvx --from ~/.claude/plugins/cache/apache-magpie/magpie-adversarial-review/*/tools/adversarial-review adversarial-review *"`, + `"uvx --from ~/.claude/magpie/adversarial-review adversarial-review *"`, `permissions.deny` contains `Edit(~/.claude/plugins/cache/apache-magpie/magpie-adversarial-review/**)`, and **no** `permissions.allow` entry covers the tool. A missing exclusion is ⚠ (every reviewer reports `unavailable` from inside - the sandbox); a missing deny is ✗ (the exclusion runs that code - unsandboxed); an `allow` is ✗ (each run sends the change to other + the sandbox); the older `magpie-adversarial-review/*/tools/adversarial-review` + exclusion is ✗ (its `*` also matches options spliced in where the version + sits); a missing deny is ✗ (the exclusion runs that code + unsandboxed); a broken `~/.claude/magpie/adversarial-review` link is ⚠ + (reviews stay sandboxed), and a real file or directory there, or a link + outside the plugin cache, is ✗ (the exclusion would run it unsandboxed); an `allow` is ✗ (each run sends the change to other model providers and must keep its prompt). 15. **Working directories under the read block**, if `permissions.blockReadsOutsideWorkingDirectories` is on in any diff --git a/plugins/magpie-adversarial-review/.claude-plugin/plugin.json b/plugins/magpie-adversarial-review/.claude-plugin/plugin.json index 2e25bbb62..97317eefd 100644 --- a/plugins/magpie-adversarial-review/.claude-plugin/plugin.json +++ b/plugins/magpie-adversarial-review/.claude-plugin/plugin.json @@ -8,5 +8,18 @@ }, "homepage": "https://magpie.apache.org/", "repository": "https://github.com/apache/magpie", - "license": "Apache-2.0" + "license": "Apache-2.0", + "hooks": { + "SessionStart": [ + { + "hooks": [ + { + "type": "command", + "command": "bash \"${CLAUDE_PLUGIN_ROOT}/tools/adversarial-review/hooks/link-stable-path.sh\"", + "timeout": 10 + } + ] + } + ] + } } diff --git a/plugins/magpie-issue/skills/fix-workflow/pre-pr-adversarial-review.md b/plugins/magpie-issue/skills/fix-workflow/pre-pr-adversarial-review.md index ae4f95689..f3da97963 100644 --- a/plugins/magpie-issue/skills/fix-workflow/pre-pr-adversarial-review.md +++ b/plugins/magpie-issue/skills/fix-workflow/pre-pr-adversarial-review.md @@ -52,11 +52,11 @@ exclusion matches; a quoted or expanded path stays sandboxed and every reviewer reports `unavailable`: ```bash -uvx --from ~/.claude/plugins/cache/apache-magpie/magpie-adversarial-review//tools/adversarial-review adversarial-review run --project-root --repo-dir --base --title "" --body-file +uvx --from ~/.claude/magpie/adversarial-review adversarial-review run --project-root --repo-dir --base --title "" --body-file ``` -`` is the newest directory under -`~/.claude/plugins/cache/apache-magpie/magpie-adversarial-review/`. The body +The plugin points `~/.claude/magpie/adversarial-review` at its installed version +at the start of every session. The body file must sit in the checkout or a temporary directory; the tool refuses any other path. For a patch someone else proposed, replace `--base … --body-file …` with `--target pr: --repo `; for a diff file, with diff --git a/plugins/magpie-pr-management/skills/code-review/adversarial.md b/plugins/magpie-pr-management/skills/code-review/adversarial.md index 5d5a9591a..f41ea600c 100644 --- a/plugins/magpie-pr-management/skills/code-review/adversarial.md +++ b/plugins/magpie-pr-management/skills/code-review/adversarial.md @@ -85,11 +85,11 @@ The agent runs the reviewers itself, at Step 5 of exclusion matches: ```bash - uvx --from ~/.claude/plugins/cache/apache-magpie/magpie-adversarial-review//tools/adversarial-review adversarial-review run --reviewers --target pr: --repo --project-root --repo-dir + uvx --from ~/.claude/magpie/adversarial-review adversarial-review run --reviewers --target pr: --repo --project-root --repo-dir ``` - `` is the newest directory under - `~/.claude/plugins/cache/apache-magpie/magpie-adversarial-review/`. Omit + The plugin points `~/.claude/magpie/adversarial-review` at its installed version + at the start of every session. Omit `--reviewers` when the list came from `adversarial-review.md`. - **What leaves the machine.** The PR's diff, title and body go to each diff --git a/plugins/magpie-release-management/skills/announce-draft/SKILL.md b/plugins/magpie-release-management/skills/announce-draft/SKILL.md index 2654581f1..a9f1e928a 100644 --- a/plugins/magpie-release-management/skills/announce-draft/SKILL.md +++ b/plugins/magpie-release-management/skills/announce-draft/SKILL.md @@ -18,7 +18,7 @@ argument-hint: " [--planning-issue ]" capability: capability:resolve surface_hash: sha256:edffafcd9d9948ab license: Apache-2.0 -measured_tokens: 6825 +measured_tokens: 6809 ---