Skip to content

fix(vetted-ops): grant pr-management-code-review every read code review needs - #2131

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/code-review-check-runs-grant
Nov 16, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/code-review-check-runs-grant

Conversation

@potiuk

@potiuk potiuk commented Nov 16, 2026

Copy link
Copy Markdown
Member

Summary

  • feat(code-review): secondary confirmation of real CI on head commit (part 2 of #2034) #2072 made pr-management code-review disposition read the head commit's check runs (check-runs) before it offers APPROVE, and fail closed while that read is missing.
    It granted check-runs to pr-management-code-review in Magpie's own policy, but not in the canonical [callers] example in tools/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.
  • The README example now grants 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, which code-review runs asks for; it now grants it.
  • A new test, tools/pr-management/tests/code_review/test_policy_grants.py, collects every op the code-review CLI can list under needs and checks that both the README template and Magpie's own policy grant it to pr-management-code-review.
    It fails on main for 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

  • Tool / bridge contract (tools/<system>/*.md)
  • Python package (tools/*/ with pyproject.toml) — test only
  • Other: Magpie's own vetted-ops policy (.apache-magpie-overrides/tools/vetted-ops/config.toml)

Test plan

  • prek run --all-files --skip workspace-pytest passes, except spec-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 HEAD passes
  • The new test fails without the fix (tools/vetted-ops/README.md does not grant pr-management-code-review: ['check-runs'], and ['runs-at-head'] for the own policy) and passes with it
  • setup config and setup reconcile derive grants from the README example (no second hard-coded mapping), so they need no change

RFC-AI-0004 compliance

  • Sandbox — both grants are reads (writes=False), run through vetted-op-read; no new write is granted

Linked 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 the check-runs read and so never offered APPROVE.

🤖 Generated with Claude Code

…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 potiuk added family:tools tools/* capability:fix Implement code change to resolve an issue labels Nov 16, 2026
@potiuk
potiuk enabled auto-merge (squash) November 16, 2026 00:53
@github-actions github-actions Bot added family:setup setup-* skills family:docs Docs, MISSION.md, READMEs substrate:analytics Tool substrate: read-only metrics / dashboards / renderers substrate:sandbox Tool substrate: agent isolation, egress control, settings audit labels Nov 16, 2026
@potiuk
potiuk merged commit 94be41e into apache:main Nov 16, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:fix Implement code change to resolve an issue family:docs Docs, MISSION.md, READMEs family:setup setup-* skills family:tools tools/* substrate:analytics Tool substrate: read-only metrics / dashboards / renderers substrate:sandbox Tool substrate: agent isolation, egress control, settings audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant