Repository navigation
feat(review): add opt-in exact-head formal GitHub reviews - #10
Draft
ellmos-multi-bot wants to merge 2 commits into
Draft
ellmos-multi-bot wants to merge 2 commits into
ellmos-multi-bot wants to merge 2 commits into
Conversation
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.
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.
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.