Skip to content

feat(review): add opt-in exact-head formal GitHub reviews - #10

Draft
ellmos-multi-bot wants to merge 2 commits into
mainfrom
multibot/formal-pr-review-20261024
Draft

ellmos-multi-bot wants to merge 2 commits into
mainfrom
multibot/formal-pr-review-20261024

Conversation

@ellmos-multi-bot

Copy link
Copy Markdown
Collaborator

BACH PRs with completed source reviews and green CI still require a formal GitHub review. The current Core can publish only issue conversation comments; it has no typed pr.review capability. This adds that narrow capability without activating it in any running instance.

The new action requires ceiling + enabled permission + multi_bot.policy.publish_reviews, an explicitly configured account, exact 40-hex sha, a nonempty body and COMMENT/APPROVE/REQUEST_CHANGES. It submits commit_id to the reviews endpoint, independently reads the created review's ID/actor/body/commit/state, and checks the current head again. Drafts allow only COMMENT; account self-approval/change requests are refused. Reviewable stacked PRs do not gain merge permission.

Existing reviews are read with pagination before POST. Any review by this account at the same head prevents a duplicate, including retry after a timeout that actually created the review. Unknown records, stale heads and ambiguous readbacks fail closed. Errors after creation include the review ID where known. Concurrent publishers still require scope locks: this is not atomic GitHub-side deduplication. Author-instance independence and full review evidence remain operator responsibilities.

Validation at b92f79e: Windows / Python 3.12, complete default suite 258 passed / 2 skipped (the two existing opt-in wheel/sdist consumer tests; GITHUBBOT_CORE_CONSUMER_TEST was not enabled). Ruff over src/tests and git diff --check passed. New tests cover all three events, permissions/policy, CLI preview/apply/plan mismatch, identity and own-author rejection, stale/moving heads, malformed data, independent readback, receipts and timeout-after-creation recovery. Source import path verified. All review API tests use an in-memory transport; no live formal review was submitted.

Default permissions.enabled is unchanged: pr.review is in the new package ceiling, but remains disabled. Existing installation, private instance configuration, credentials, workflow files and package version are unchanged. This source proposal is not installed or published. README EN/DE explain activation and the caller's remaining responsibilities. REST contract: https://docs.github.com/en/rest/pulls/reviews#create-a-review-for-a-pull-request

Base: 0afab1c (main). Draft for independent review of this permission-sensitive feature. Authored by Codex / GPT-6; this authoring session will not independently approve or merge its own change. Existing Windows process-boundary PR #9 is separate and unchanged.

Add typed pr.review with publish_reviews and permission gates, configured identity, submitted events, exact-head checks, duplicate protection and independent review readback. Keep the action disabled by default and require explicit instance activation after independent acceptance. No runtime configuration or version change.

Generated-with: Codex (GPT-6)
Apply the existing Ruff formatter required by CI; no test logic change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant