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 f3da97963..a4096773a 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 @@ -40,8 +40,23 @@ around that through the body file. **Where it runs.** `--repo-dir` is a checkout of the code under review — the reviewers can read every file in it. Never the project's private tracker: the tool refuses that checkout. With `--target pr:` and -no such checkout, create an empty temporary directory first, as its own -command, and pass its path. When the change is not a committed local +no such checkout, export the PR's head into a new temporary directory and +pass that: an empty directory leaves the reviewers only the diff, so they +cannot check a claim against the surrounding code, and no findings from them +is not a clean review. Run each line as its own command, in a throwaway +repository so nothing lands in the current one: + +```bash +git init -q /pr- +git -C /pr- fetch --depth=1 https://github.com/.git pull//head +git -C /pr- archive FETCH_HEAD -- . ':(exclude).apache-magpie-overrides/tools/vetted-ops' | tar -x -C +``` + +Keep the exclusion: the secure setup denies writes to that path wherever it +appears, so a full export fails partway through. The exported tree reaches +the reviewers' providers, so export only a PR that is already public. + +When the change is not a committed local branch — a helper builds it elsewhere, or the skill applies file diffs through the API — save the diff to a file in a temporary directory and review it with `--target diff:`. diff --git a/plugins/magpie-release-management/skills/announce-draft/site-bump.md b/plugins/magpie-release-management/skills/announce-draft/site-bump.md index 99ac41a8b..5cf048d61 100644 --- a/plugins/magpie-release-management/skills/announce-draft/site-bump.md +++ b/plugins/magpie-release-management/skills/announce-draft/site-bump.md @@ -70,8 +70,23 @@ around that through the body file. **Where it runs.** `--repo-dir` is a checkout of the code under review — the reviewers can read every file in it. Never the project's private tracker: the tool refuses that checkout. With `--target pr:` and -no such checkout, create an empty temporary directory first, as its own -command, and pass its path. When the change is not a committed local +no such checkout, export the PR's head into a new temporary directory and +pass that: an empty directory leaves the reviewers only the diff, so they +cannot check a claim against the surrounding code, and no findings from them +is not a clean review. Run each line as its own command, in a throwaway +repository so nothing lands in the current one: + +```bash +git init -q /pr- +git -C /pr- fetch --depth=1 https://github.com/.git pull//head +git -C /pr- archive FETCH_HEAD -- . ':(exclude).apache-magpie-overrides/tools/vetted-ops' | tar -x -C +``` + +Keep the exclusion: the secure setup denies writes to that path wherever it +appears, so a full export fails partway through. The exported tree reaches +the reviewers' providers, so export only a PR that is already public. + +When the change is not a committed local branch — a helper builds it elsewhere, or the skill applies file diffs through the API — save the diff to a file in a temporary directory and review it with `--target diff:`. diff --git a/plugins/magpie-release-management/skills/audit-report/audit-log-pr.md b/plugins/magpie-release-management/skills/audit-report/audit-log-pr.md index 7b3f84449..322c4969c 100644 --- a/plugins/magpie-release-management/skills/audit-report/audit-log-pr.md +++ b/plugins/magpie-release-management/skills/audit-report/audit-log-pr.md @@ -56,8 +56,23 @@ around that through the body file. **Where it runs.** `--repo-dir` is a checkout of the code under review — the reviewers can read every file in it. Never the project's private tracker: the tool refuses that checkout. With `--target pr:` and -no such checkout, create an empty temporary directory first, as its own -command, and pass its path. When the change is not a committed local +no such checkout, export the PR's head into a new temporary directory and +pass that: an empty directory leaves the reviewers only the diff, so they +cannot check a claim against the surrounding code, and no findings from them +is not a clean review. Run each line as its own command, in a throwaway +repository so nothing lands in the current one: + +```bash +git init -q /pr- +git -C /pr- fetch --depth=1 https://github.com/.git pull//head +git -C /pr- archive FETCH_HEAD -- . ':(exclude).apache-magpie-overrides/tools/vetted-ops' | tar -x -C +``` + +Keep the exclusion: the secure setup denies writes to that path wherever it +appears, so a full export fails partway through. The exported tree reaches +the reviewers' providers, so export only a PR that is already public. + +When the change is not a committed local branch — a helper builds it elsewhere, or the skill applies file diffs through the API — save the diff to a file in a temporary directory and review it with `--target diff:`. diff --git a/plugins/magpie-release-management/skills/prepare/automated-signing.md b/plugins/magpie-release-management/skills/prepare/automated-signing.md index 97971def6..49871c64d 100644 --- a/plugins/magpie-release-management/skills/prepare/automated-signing.md +++ b/plugins/magpie-release-management/skills/prepare/automated-signing.md @@ -95,8 +95,23 @@ around that through the body file. **Where it runs.** `--repo-dir` is a checkout of the code under review — the reviewers can read every file in it. Never the project's private tracker: the tool refuses that checkout. With `--target pr:` and -no such checkout, create an empty temporary directory first, as its own -command, and pass its path. When the change is not a committed local +no such checkout, export the PR's head into a new temporary directory and +pass that: an empty directory leaves the reviewers only the diff, so they +cannot check a claim against the surrounding code, and no findings from them +is not a clean review. Run each line as its own command, in a throwaway +repository so nothing lands in the current one: + +```bash +git init -q /pr- +git -C /pr- fetch --depth=1 https://github.com/.git pull//head +git -C /pr- archive FETCH_HEAD -- . ':(exclude).apache-magpie-overrides/tools/vetted-ops' | tar -x -C +``` + +Keep the exclusion: the secure setup denies writes to that path wherever it +appears, so a full export fails partway through. The exported tree reaches +the reviewers' providers, so export only a PR that is already public. + +When the change is not a committed local branch — a helper builds it elsewhere, or the skill applies file diffs through the API — save the diff to a file in a temporary directory and review it with `--target diff:`. diff --git a/plugins/magpie-release-management/skills/prepare/post.md b/plugins/magpie-release-management/skills/prepare/post.md index dc093d397..99866dc4f 100644 --- a/plugins/magpie-release-management/skills/prepare/post.md +++ b/plugins/magpie-release-management/skills/prepare/post.md @@ -63,8 +63,23 @@ around that through the body file. **Where it runs.** `--repo-dir` is a checkout of the code under review — the reviewers can read every file in it. Never the project's private tracker: the tool refuses that checkout. With `--target pr:` and -no such checkout, create an empty temporary directory first, as its own -command, and pass its path. When the change is not a committed local +no such checkout, export the PR's head into a new temporary directory and +pass that: an empty directory leaves the reviewers only the diff, so they +cannot check a claim against the surrounding code, and no findings from them +is not a clean review. Run each line as its own command, in a throwaway +repository so nothing lands in the current one: + +```bash +git init -q /pr- +git -C /pr- fetch --depth=1 https://github.com/.git pull//head +git -C /pr- archive FETCH_HEAD -- . ':(exclude).apache-magpie-overrides/tools/vetted-ops' | tar -x -C +``` + +Keep the exclusion: the secure setup denies writes to that path wherever it +appears, so a full export fails partway through. The exported tree reaches +the reviewers' providers, so export only a PR that is already public. + +When the change is not a committed local branch — a helper builds it elsewhere, or the skill applies file diffs through the API — save the diff to a file in a temporary directory and review it with `--target diff:`. diff --git a/plugins/magpie-release-management/skills/prepare/prep.md b/plugins/magpie-release-management/skills/prepare/prep.md index b11213cbb..aad2a557c 100644 --- a/plugins/magpie-release-management/skills/prepare/prep.md +++ b/plugins/magpie-release-management/skills/prepare/prep.md @@ -134,8 +134,23 @@ around that through the body file. **Where it runs.** `--repo-dir` is a checkout of the code under review — the reviewers can read every file in it. Never the project's private tracker: the tool refuses that checkout. With `--target pr:` and -no such checkout, create an empty temporary directory first, as its own -command, and pass its path. When the change is not a committed local +no such checkout, export the PR's head into a new temporary directory and +pass that: an empty directory leaves the reviewers only the diff, so they +cannot check a claim against the surrounding code, and no findings from them +is not a clean review. Run each line as its own command, in a throwaway +repository so nothing lands in the current one: + +```bash +git init -q /pr- +git -C /pr- fetch --depth=1 https://github.com/.git pull//head +git -C /pr- archive FETCH_HEAD -- . ':(exclude).apache-magpie-overrides/tools/vetted-ops' | tar -x -C +``` + +Keep the exclusion: the secure setup denies writes to that path wherever it +appears, so a full export fails partway through. The exported tree reaches +the reviewers' providers, so export only a PR that is already public. + +When the change is not a committed local branch — a helper builds it elsewhere, or the skill applies file diffs through the API — save the diff to a file in a temporary directory and review it with `--target diff:`. diff --git a/plugins/magpie-repo-health/skills/audit-finding-fix/pre-pr-adversarial-review.md b/plugins/magpie-repo-health/skills/audit-finding-fix/pre-pr-adversarial-review.md index c8a83f4b6..22ca046e1 100644 --- a/plugins/magpie-repo-health/skills/audit-finding-fix/pre-pr-adversarial-review.md +++ b/plugins/magpie-repo-health/skills/audit-finding-fix/pre-pr-adversarial-review.md @@ -40,8 +40,23 @@ around that through the body file. **Where it runs.** `--repo-dir` is a checkout of the code under review — the reviewers can read every file in it. Never the project's private tracker: the tool refuses that checkout. With `--target pr:` and -no such checkout, create an empty temporary directory first, as its own -command, and pass its path. When the change is not a committed local +no such checkout, export the PR's head into a new temporary directory and +pass that: an empty directory leaves the reviewers only the diff, so they +cannot check a claim against the surrounding code, and no findings from them +is not a clean review. Run each line as its own command, in a throwaway +repository so nothing lands in the current one: + +```bash +git init -q /pr- +git -C /pr- fetch --depth=1 https://github.com/.git pull//head +git -C /pr- archive FETCH_HEAD -- . ':(exclude).apache-magpie-overrides/tools/vetted-ops' | tar -x -C +``` + +Keep the exclusion: the secure setup denies writes to that path wherever it +appears, so a full export fails partway through. The exported tree reaches +the reviewers' providers, so export only a PR that is already public. + +When the change is not a committed local branch — a helper builds it elsewhere, or the skill applies file diffs through the API — save the diff to a file in a temporary directory and review it with `--target diff:`. diff --git a/plugins/magpie-security-tools/tools/security-management/src/security_management/cve_allocate/title.py b/plugins/magpie-security-tools/tools/security-management/src/security_management/cve_allocate/title.py index 7acc513f6..6f6fd113a 100644 --- a/plugins/magpie-security-tools/tools/security-management/src/security_management/cve_allocate/title.py +++ b/plugins/magpie-security-tools/tools/security-management/src/security_management/cve_allocate/title.py @@ -59,6 +59,8 @@ def _patterns(names: Sequence[str], short: Sequence[str], prefixes: Sequence[str for name in short: leading.append(rf"^[ \t]*{re.escape(name)}{_VERSION}[ \t]*{_MARK}[ \t]*") trailing.append(rf"[ \t]*\({re.escape(name)}{_VERSION}\)\.?[ \t]*$") + # The version is required: a bare short name may be a real noun in the title. + trailing.append(rf"[ \t]+in[ \t]+{re.escape(name)}[ \t]+v?\d+(?:\.\d+)*(?:\.x)?[ \t]*\.?$") # Reporter attribution belongs in the credits field; kept end-anchored because # the pattern is loose enough to eat a substantive clause mid-title. trailing.append(r"[ \t]*\([\w.][\w. -]*[ \t]+follow-up\)\.?[ \t]*$") diff --git a/plugins/magpie-security/skills/issue-fix/pre-pr-adversarial-review.md b/plugins/magpie-security/skills/issue-fix/pre-pr-adversarial-review.md index 382479e22..8c612ce64 100644 --- a/plugins/magpie-security/skills/issue-fix/pre-pr-adversarial-review.md +++ b/plugins/magpie-security/skills/issue-fix/pre-pr-adversarial-review.md @@ -40,8 +40,23 @@ around that through the body file. **Where it runs.** `--repo-dir` is a checkout of the code under review — the reviewers can read every file in it. Never the project's private tracker: the tool refuses that checkout. With `--target pr:` and -no such checkout, create an empty temporary directory first, as its own -command, and pass its path. When the change is not a committed local +no such checkout, export the PR's head into a new temporary directory and +pass that: an empty directory leaves the reviewers only the diff, so they +cannot check a claim against the surrounding code, and no findings from them +is not a clean review. Run each line as its own command, in a throwaway +repository so nothing lands in the current one: + +```bash +git init -q /pr- +git -C /pr- fetch --depth=1 https://github.com/.git pull//head +git -C /pr- archive FETCH_HEAD -- . ':(exclude).apache-magpie-overrides/tools/vetted-ops' | tar -x -C +``` + +Keep the exclusion: the secure setup denies writes to that path wherever it +appears, so a full export fails partway through. The exported tree reaches +the reviewers' providers, so export only a PR that is already public. + +When the change is not a committed local branch — a helper builds it elsewhere, or the skill applies file diffs through the API — save the diff to a file in a temporary directory and review it with `--target diff:`. diff --git a/plugins/magpie-security/skills/issue-import-from-pr/SKILL.md b/plugins/magpie-security/skills/issue-import-from-pr/SKILL.md index 83ba0fe29..c4cfb906d 100644 --- a/plugins/magpie-security/skills/issue-import-from-pr/SKILL.md +++ b/plugins/magpie-security/skills/issue-import-from-pr/SKILL.md @@ -20,7 +20,7 @@ argument-hint: "[pr-number] [repo:owner/name]" capability: capability:intake surface_hash: sha256:26be912ca52168e5 license: Apache-2.0 -measured_tokens: 6431 +measured_tokens: 6441 --- + +An open tracker labelled `fix released`. +This pass proposes no label change, the CVE record is `REVIEW`, and no comment carries an `apache-magpie` marker. diff --git a/tools/skill-evals/evals/security-issue-sync/pointer-routing/fixtures/case-9-release-shipped-record-draft/expected.json b/tools/skill-evals/evals/security-issue-sync/pointer-routing/fixtures/case-9-release-shipped-record-draft/expected.json new file mode 100644 index 000000000..e6ffacf61 --- /dev/null +++ b/tools/skill-evals/evals/security-issue-sync/pointer-routing/fixtures/case-9-release-shipped-record-draft/expected.json @@ -0,0 +1 @@ +{"files_to_open": ["release-manager-comments.md"]} diff --git a/tools/skill-evals/evals/security-issue-sync/pointer-routing/fixtures/case-9-release-shipped-record-draft/report.md b/tools/skill-evals/evals/security-issue-sync/pointer-routing/fixtures/case-9-release-shipped-record-draft/report.md new file mode 100644 index 000000000..18ee5d82d --- /dev/null +++ b/tools/skill-evals/evals/security-issue-sync/pointer-routing/fixtures/case-9-release-shipped-record-draft/report.md @@ -0,0 +1,6 @@ + + +An open tracker labelled `pr merged`. +The release carrying the fix has shipped, but the CVE record is still `DRAFT` because *Severity* is empty, so the `fix released` label cannot be flipped. +No comment carries an `apache-magpie` marker. diff --git a/tools/spec-loop/specs/adversarial-review.md b/tools/spec-loop/specs/adversarial-review.md index 31a1488c3..07c671143 100644 --- a/tools/spec-loop/specs/adversarial-review.md +++ b/tools/spec-loop/specs/adversarial-review.md @@ -219,9 +219,11 @@ before the PR is created, through one shared block. plugin skips with one line. A `security`-family skill runs whenever at least one reviewer is listed, whatever `mode` says; any other skill runs only on `mode: on-pr-create`. - `--repo-dir` is never the tracker (an empty temporary directory for - `pr:` with no checkout), and a change that is not a committed local - branch is reviewed as a diff file. + `--repo-dir` is never the tracker (an export of the PR's head in a + temporary directory for `pr:` with no checkout), and a change that is + not a committed local branch is reviewed as a diff file. + An empty `--repo-dir` adds a report warning, because reviewers given only + the diff cannot read the code around it, so no findings is not a clean review. The findings are shown as untrusted, advisory data, never block the flow, and add nothing to a step's structured output; a finding the human wants fixed sends the flow back to the fix, the skill's own checks, and a fresh