feat(skills): adversarial review before every PR a skill opens - #1372
Merged
Merged
Conversation
8 tasks
potiuk
added this pull request to stack #1374
September 24, 2026 16:52
potiuk
force-pushed
the
feat/adversarial-review-pre-pr
branch
from
September 24, 2026 17:05
f396aa4 to
b34496d
Compare
potiuk
force-pushed
the
feat/adversarial-review-pre-pr
branch
from
September 24, 2026 17:14
b34496d to
84b18db
Compare
A shared block (tools/dev/blocks/pre-pr-adversarial-review.md) in each of the ten skills that run `gh pr create`, and in security-issue-import-from-pr, which verifies a patch someone else proposed. It runs the configured reviewers over the diff and the PR title and body exactly as they will be posted — never tracker, CVE, reporter or mail content — shows the findings as untrusted, advisory data, and never blocks the flow. The security family runs it whenever a reviewer is configured, whatever the mode. The skill validator now fails a PR-opening skill that lacks the block, with an explicit, reasoned exemption list. Eval suites: security-issue-fix/step-7-adversarial-review (5 cases) and setup-upstream-fix/step-5-adversarial-review (2). Generated-by: Claude Opus 5
… matches The block now uses the unquoted, literal-~ plugin path with <version> — the form PR 2 settled on — and says the body file must sit in the checkout or a temporary directory. A test pins the block's invocation to the sandbox exclusion pattern. Generated-by: Claude Opus 5
- the tool refuses a --repo-dir that is the project's tracker (reviewers can read every file there) unless --allow-tracker-checkout says the tracker's own code is under review - the block: pass the title and body as posted, after the skill's own public-surface checks — allowed identifiers stay, private content never goes; --repo-dir is never the tracker (an empty temp dir for pr: with no checkout); a change that is not a local branch is reviewed as a diff file; the review adds nothing to a step's JSON; a finding the human wants fixed sends the flow back - hosts: issue-fix runs its 5c check first; model-verify and model-prepare review the helper's dry-run diff; import-from-pr uses an empty temp dir; import-from-scan reviews the scrubbed report inside the report-back bullet; release-prepare gets the block at 2f and 14b too - validator: also scans skill scripts (argv form included) and lists skills that open PRs through another skill's helper - evals check the body file passed and cover the stop, off and empty cases Generated-by: Claude Opus 5
potiuk
force-pushed
the
feat/adversarial-review-pre-pr
branch
from
September 24, 2026 21:44
84b18db to
623a192
Compare
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 3 of 4, stacked on #1371. This PR's base is
feat/adversarial-review-setup, so the diff shows only PR 3. Merge #1371 first; this PR then retargets tomain.Summary
tools/dev/blocks/pre-pr-adversarial-review.md) in every skill that opens a PR, placed where the PR's title and body are final and before the push where the flow allows. Eleven skills carry it, andrelease-preparecarries it at each of its three PRs.security-issue-import-from-pr, which verifies a patch someone else proposed, reviews that PR.--repo-dirthat is the project's private tracker, since reviewers can read every file there.--allow-tracker-checkoutopts out when the tracker's own code is under review.--target pr:<N>from an empty temp directory.mode: on-pr-create. The review is advisory: unavailable reviewers never stop the flow, a finding the human wants fixed sends the flow back, and findings are untrusted data.Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/*/withpyproject.toml)prek, workflows, validators)Test plan
prek run --all-filespassestools/adversarial-review(143 tests) andtools/skill-and-tool-validator(478) passpytest,ruff checkandmypysecurity-issue-fix/step-7-adversarial-review(6 cases): runs undermode: offwith the posted title and body file, never the tracker's title or a draft that quotes the tracker; a silent skip without config; a one-line skip without the plugin; an instruction inside a finding is not followed; all reviewers unavailable still continues; a finding the user wants fixed stops the flow.setup-upstream-fix/step-5-adversarial-review(4 cases):on-pr-createruns;on-demand,offand an empty reviewer list skip silently.validate_pre_pr_review_blockreports 0 violations on the tree. Unit tests cover prose, sibling files, scripts, the exemption and the delegation.RFC-AI-0004 compliance
Linked issues
Stacked on #1371; follows #1368.
Notes for reviewers (optional)
release-announce-draft/step-3-site-bump,security-issue-import-from-pr/step-6-confirmandsetup-override-upstream/step-6-pr-confirm. Their fixtures carry no reviewer config, so the block is a silent skip there. They are worth a live re-run.🤖 Generated with Claude Code