From f68a8a94ff34af707a867d17ae37bff30e358faa Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Sun, 8 Nov 2026 18:56:49 -0700 Subject: [PATCH] fix(code-review): keep export-ignore paths in the adversarial export git archive honours export-ignore, so a project that marks a directory that way lost it from the reviewers' export, even when the PR changed files there. Export through a temporary index instead, forcing the removal of the vetted-ops policy path, which a PR may change. Generated-by: Claude Opus 5 --- .../skills/code-review/adversarial.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/magpie-pr-management/skills/code-review/adversarial.md b/plugins/magpie-pr-management/skills/code-review/adversarial.md index 98fbfbde5..3a31639a2 100644 --- a/plugins/magpie-pr-management/skills/code-review/adversarial.md +++ b/plugins/magpie-pr-management/skills/code-review/adversarial.md @@ -90,12 +90,15 @@ The agent runs the reviewers itself, at Step 5 of ```bash git fetch https://github.com/.git pull//head:refs/review/pr- - git archive refs/review/pr- -- . ':(exclude).apache-magpie-overrides/tools/vetted-ops' | tar -x -C + GIT_INDEX_FILE=/review-index git read-tree refs/review/pr- + GIT_INDEX_FILE=/review-index git rm -f --cached -r -q --ignore-unmatch .apache-magpie-overrides/tools/vetted-ops + GIT_INDEX_FILE=/review-index git checkout-index -a -f --prefix=/ ``` - Keep the exclusion: the secure setup denies writes to the vetted-ops policy path wherever it appears, so a full export fails partway through. + Use a temporary index, not `git archive`: `git archive` honours `export-ignore`, so a project that marks a directory that way loses it from the export without a word, even when the PR changes files there. + Keep the `git rm`, and its `-f`, which it needs when the PR changes the policy: the secure setup denies writes to the vetted-ops policy path wherever it appears, so a full export fails partway through. Do not relax that rule to complete the export. - The reviewers therefore never see the policy, and `export-ignore` paths are missing too. + The reviewers therefore never see the policy. When a PR changes the policy, review that file yourself. 2. **Per PR, one line**, unquoted with a literal `~` — the form the sandbox exclusion matches: