fix(automation): recover organization loop without maintainer PAT - #1577
Closed
seonghobae wants to merge 4 commits into
Closed
fix(automation): recover organization loop without maintainer PAT#1577seonghobae wants to merge 4 commits into
seonghobae wants to merge 4 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Sep 1, 2026
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.
Root cause
Protected-main scheduled run
33483275421failed before the organization coordinator started becausePR_REVIEW_MERGE_TOKENwas absent and the workflow accepted no other bounded maintainer credential. The job log showsGH_TOKENempty and exits withPR_REVIEW_MERGE_TOKEN is required; the subsequent receipt upload also fails because the coordinator never creates its JSON receipt.This is a central control-plane credential-availability defect, not a product test failure, provider/model failure, or downstream repository defect. Protected
mainat branch creation (8e04ab8f5f70b1c3c7f19211f2041570ae53b2f8) still had the same PAT-only workflow. The broader #1545 branch already contained a reviewed OIDC fallback, but it was a stale, non-mergeable 17-file DDD feature bundle. This PR extracts only that credential-recovery boundary onto current main so production recovery is not coupled to unrelated DDD work.Test-first evidence
RED exact head
d6a726219bb317f12748006acbce050b27715bbcadded only the missing-credential contract. HostedOrganization Commercial Readiness Loop Quality CIrun33490804781, job99801577027, checked out that exact head and failed exactly the new assertion becauseid-token: writewas absent: 1 failed, 34 passed.The minimal implementation then:
PR_REVIEW_MERGE_TOKENas first choice;id-token: writeonly to the coordinator job;api.opencode.ai:443to the blocked-egress allowlist;GH_TOKENonly when the explicit maintainer secret is absent;${{ github.token }}nor aGITHUB_TOKEN:binding as mutation authority.The first GREEN attempt correctly exposed a test-only false positive: a blanket
"GITHUB_TOKEN" not in dispatch_stepassertion matched the diagnostic sentence saying repository-scopedGITHUB_TOKENis not accepted. The regression was narrowed to forbid actual${{ github.token }}andGITHUB_TOKEN:bindings instead of harmless diagnostic prose.Final exact head
46261f201ba5d1dde7c40023dc6bd7097240abb9: hosted quality run33491063381, job99802413728, completed success with 35 passed,organization_commercial_readiness_loop.py382/382 statements and 88/88 branches (100%), compileall, and clean-tree verification.Documentation / operational acceptance
docs/doctoring/organization-commercial-readiness-loop.mdrecords the production RCA, security boundary, focused extraction from #1545, and post-integration acceptance criteria. The pull-request quality job deliberately does not exercise a real mutation-capable OIDC identity; that credential must remain unavailable to untrusted PR code.Operational closure therefore requires a scheduled run from protected
mainafter integration whose exact workflow source contains this fallback, proceeds beyond the missing-PAT guard, emits the deterministic JSON fleet receipt, and preserves downstream fail-closed governance.Merge boundary
This source repair is ready for independent review, not automatically merge-authorized. Broad security/review/provenance checks and any qualifying independent approval remain authoritative on the unchanged exact head. Queued, pending, cancelled, skipped-required, predecessor-head, model-only, or author-only evidence is non-passing. No gate weakening, repository-token fallback, self-approval, force push, destructive rebase, or downstream source mutation is introduced.