Repository navigation
fix(vetted-ops): grant pr-management-code-review every read code review needs - #2131
Merged
Merged
Conversation
…ew needs Code review's disposition reads the head commit's check runs before it offers APPROVE (apache#2072), but the canonical [callers] example in the vetted-ops README did not grant check-runs to pr-management-code-review. Adopters and setup config derive their policy from that example, so the read was refused and code review never offered APPROVE, even on a green PR. Magpie's own policy had the mirror-image gap: it lacked runs-at-head, which `code-review runs` asks for. Both policies now grant the reads, and a test checks that every op the code-review CLI can list under `needs` is granted to the caller in the README template and in Magpie's own policy. Generated-by: Claude Opus 5
potiuk
enabled auto-merge (squash)
November 16, 2026 00:53
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.
Summary
pr-management code-review dispositionread the head commit's check runs (check-runs) before it offers APPROVE, and fail closed while that read is missing.It granted
check-runstopr-management-code-reviewin Magpie's own policy, but not in the canonical[callers]example intools/vetted-ops/README.md.Adopters, and
setup config/setup reconcile, derive their policy from that example, so the read is refused (caller 'pr-management-code-review' is not permitted to run 'check-runs') and code review never offers APPROVE, even on a fully green PR.check-runs, with the same comment as Magpie's own policy.Magpie's own policy had the mirror-image gap: it lacked
runs-at-head, whichcode-review runsasks for; it now grants it.tools/pr-management/tests/code_review/test_policy_grants.py, collects every op the code-review CLI can list underneedsand checks that both the README template and Magpie's own policy grant it topr-management-code-review.It fails on
mainfor both files, and errors out on a_need(...)call whose op it cannot resolve, so a new read cannot slip past it.Type of change
tools/<system>/*.md)tools/*/withpyproject.toml) — test only.apache-magpie-overrides/tools/vetted-ops/config.toml)Test plan
prek run --all-files --skip workspace-pytestpasses, exceptspec-validate, whose runner-fixture test fails locally because it cannot sign a git commit in the sandbox (unrelated to this change)prek run workspace-pytest --from-ref upstream/main --to-ref HEADpassestools/vetted-ops/README.md does not grant pr-management-code-review: ['check-runs'], and['runs-at-head']for the own policy) and passes with itsetup configandsetup reconcilederive grants from the README example (no second hard-coded mapping), so they need no changeRFC-AI-0004 compliance
writes=False), run throughvetted-op-read; no new write is grantedLinked issues
Refs #2072, #2034
Notes for reviewers (optional)
Seen on an adopter running framework
0.9.0.dev202611151633: code review on a green PR refused thecheck-runsread and so never offered APPROVE.🤖 Generated with Claude Code