Repository navigation
feat(issue-sync): record a published security entry in the site repository through a pull request - #2229
Merged
Conversation
potiuk
enabled auto-merge (squash)
November 22, 2026 09:40
…itory through a pull request Some site repositories take changes only through reviewed pull requests, so the security-records step that commits straight onto the site's branch cannot be used there. A new opt-in publish mode makes the sync operator commit the record on a new branch, push it to their own fork of the site repository and open a pull request against the base branch; nothing is pushed to the site repository itself. The direct mode stays the default. - The planner takes --publish pull-request with --fork, --fork-remote, --pr-repo (derived from a GitHub repository URL), --pr-branch and --pr-title. It prints eleven confirmed commands: clean, branch, update, new-branch, the --apply run (which also writes the pull-request body file), stage, diff, commit, push to the fork, switch back to the base branch, and gh pr create. The publication gate still runs first, and the body carries no tracker text. - The closed-tracker state step follows the pull request: before the first status comment it looks one up by branch, so an open or merged one is recorded instead of opened twice; the status comment carries the pull request URL; a merged one gets a second marker comment with the ticked security-pages item; a closed one is a blocker. - gh pr create carries MAGPIE_ALLOW_SECURITY_LANG=1, agent-guard's documented exemption for a disclosure that is already public; the public-surface-scrub hook passes a site repository named differently from the source repository, and a site living in the source repository keeps the direct mode. The design doc explains why the mode uses magpie-vcs and gh rather than vetted-op-git. - Per-user fork settings live in user.md (environment.advisory_records_fork, _fork_remote), next to the working-copy override. The sync skill gains the shared pre-PR adversarial review block, run between the commit and the push. - Two eval cases cover the pull-request proposal and the routing for a merged pull request. Generated-by: Claude Opus 5
CodeQL flagged an assert whose expression wrote the record file, so the write would vanish under `python -O`. Write it first, then assert. Generated-by: Claude Opus 5
potiuk
force-pushed
the
feat/advisory-records-pr-mode
branch
from
November 22, 2026 09:53
da176be to
e29c3ae
Compare
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.
Why
Some projects' site repositories take changes only through reviewed pull requests, and some plan to build their security section from one JSON file per published entry.
The security-records step of
issue-synccommits straight onto the configured site branch and pushes it, so those projects cannot use it.What
An opt-in
publish: pull-requestmode for the site-records block inproject.md(the default staysdirect, so nothing changes for existing adopters):pull_request.branch, by default named after the entry), pushes it to their own fork of the site repository, and opens a pull request against the base branch. Nothing is pushed to the site repository itself.clean,branch,update,new-branch, the--applyrun (also writes the pull-request body file),stage,diff --cached,commit,push <fork remote> <branch>,switch <base>,gh pr create. The existing publication gate still runs first; the body carries no tracker text.gh pr list --head), so an open or merged one is recorded, never opened twice; the status comment records the pull request URL; once it merges, sync proposes a second marker comment with the ticked security-pages item; a closed one is a blocker.user.mdgetsenvironment.advisory_records_forkand_fork_remote, next to the existing working-copy override.issue-syncnow opens a pull request, so it carries the shared pre-PR adversarial review block, run between the commit and the push.Guards checked
security-languageguard refuses an entry ID in anygh pr createtitle or body; the planner adds its documented inline exemptionMAGPIE_ALLOW_SECURITY_LANG=1(for a disclosure that is already public) and prints the command only past its publication gate. Verified with the dispatcher: denied without it, allowed with it.public-surface-scrubmod passesgh pr create --repo <site repo>when the site repository is named differently fromupstream_repo; it refuses when the site lives in the source repository orupstream_repois unset (its only exemption is a session-level variable), so the design doc says such projects keep the direct mode.magpie-vcsscrubs only with--scrub, which the planner does not pass, so the commit message and branch name are not refused.vetted-op-gitis not used: its policy pins the source repository and one fork, and itsgit-pr-createhas no post-disclosure exemption. The design doc underdocs/security/explains this.Tests
uv run --group dev pytestin the planner andsecurity-managementpackages (new cases for the command order, body file, settings errors, the Git-only rule, the gate, and every state of the pull-request lookup).prek run --skip workspace-pytest --files <changed files>andprek run workspace-pytest --files <changed files>: all passed.security-issue-sync2b case 13 and pointer-routing case 11 (not run against a model yet).🤖 Generated with Claude Code