Repository navigation
Mint the merge-master token with pull_requests: write only — the App holds no issues permission - #781
Merged
Conversation
The codeXfactory App (App ID 4312542, installation 159938946 on opensoft) holds exactly `checks: write, contents: write, metadata: read, pull_requests: write` — no `issues` permission at all. PR #735's verify-and-fix round added `permission-issues: write` to the mint step in `.github/workflows/merge-master-approval.yml` on the belief that posting the sticky comment through the Issues Comments API needs an `issues` scope; GitHub accepts EITHER `issues: write` OR `pull_requests: write` on that endpoint when the target is a pull request, so the extra scope was never needed, and requesting a permission the installation does not grant makes `create-github-app-token` refuse the mint outright rather than merely omit an unused scope. xFactory's production `merge-master-approval.yml` mints with `permission-pull-requests: write` only and posts its own sticky comment through the same endpoint. codexFactory's `merge-master-approval` spec requires the runtime installation token request "only `pull_requests: write` and mandatory Metadata read". Remove `permission-issues: write` from the mint step, correct the three comment blocks that claimed both scopes, and narrow `tests/review_lane_pin/test_review_lane_caller.py`'s mint-scope test back to asserting `pull-requests: write` alone with nothing wider (`permission-issues` included). Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_013zUwKfdNgAyNuUAUs3WTDU
There was a problem hiding this comment.
Hi @brettheap! 👋
Your private repo does not have access to Sourcery.
Please upgrade to continue using Sourcery ✨
There was a problem hiding this comment.
🟢 Approval recommended
The changes are narrowly scoped to removing an invalid requested permission and updating the corresponding assertions/documentation, with no remaining workflow scope mismatches observed.
Pull request overview
This PR fixes the merge-master-approval lane’s GitHub App token minting so it no longer requests issues: write, aligning the requested scopes with the merge-master App installation’s actual permissions and preventing token-mint failure.
Changes:
- Removed
permission-issues: writefrom theactions/create-github-app-token@v2mint step, leavingpermission-pull-requests: writeonly. - Updated workflow commentary to reflect that PR sticky comments can be posted via the issues-comments endpoint using
pull_requests: write(withoutissues: write). - Updated the review-lane pinning test to assert
permission-issuesis not requested and to document why.
File summaries
| File | Description |
|---|---|
.github/workflows/merge-master-approval.yml |
Removes permission-issues from the App token mint and updates explanatory comments to match the installation’s permission set. |
tests/review_lane_pin/test_review_lane_caller.py |
Tightens the mint-scope assertion to require only permission-pull-requests: write and explicitly forbid permission-issues. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Sep 8, 2026
brettheap
added a commit
that referenced
this pull request
Sep 9, 2026
…1/5.2 ticked on the D-2 evidence) (#832) Path A PR-5, the last of the 2026-09-06 plan memo's sequence, on Brett Heap's word "merge pr-5 when green" (2026-09-09). Authority: his ruling of 2026-09-05T23:38Z "rule path A, 4.5 is a deferred successor" (#656) and ruling D-2 (the live exercise). - tasks.md: § 4.4 / § 5.1 / § 5.2 ticked on the D-2 evidence (three `- [ ]` heads removed, every ratified sentence kept byte-identical); § 4.5 untouched as a DEFERRED SUCCESSOR (#714 → 3d1b8cc). - Archived WITH promotion via `scripts/proposal-support.py . archive --date 2026-09-09` under the pinned @fission-ai/[email protected] (never a bare `openspec archive`); origin retained (declaration unchanged since da1b0e9); six frozen files R100. - Promoted: `openspec/specs/ideation-intent-plane/spec.md` NEW (7 requirements / 11 scenarios, every block byte-identical to the archived delta) and `openspec/specs/document-lifecycle/spec.md` 18 → 19 requirements ("Gates happen on main"); the new capability's `## Purpose` written by this act (no SHALL; replaces the CLI's TBD stub). openspec/specs 60 → 61; floor regeneration OWED (GRACED covered-pending 1, `created_by_candidate`), `contracts/review-lane-floor-snapshot.yaml` deliberately not edited here. - README OpenSpec Records row → archived; sweep-ledger row re-seeded with the tool (`--seed-ledger --moved-by '#832'`, one line moved); no thirteenth archive-date disposition. - Evidence (merged + green): #718 d179cc0, #727 07624d5, #735 6d3237e, xFactory #304 b2db7e47, #313 ddd19650, #345 90435875, #781 450bb60, #808 2ef7d8c, #814 c991c0f, #816 8924230, xFactory #362 119280a8, #830 202c170, xFactory #369 c2313277; D-2 live exercise: act B refusal 36d07ec, act A apply e970dfe, first autonomous merge #176 → 7681e40 (codexfactory[bot] APPROVED 2026-09-09T06:37:22Z). - Copilot round 1: one factual finding taken (a missing "where" in Purpose); two wording findings answered and resolved. Refs #656 (stays OPEN). Rule 6 LANDING window observed. Lane: openxfactory-4-opendox-extraction Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_012LiNG5Ume1boEfxSNeCmpu
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.
Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox)
The defect
.github/workflows/merge-master-approval.ymlminted the merge-master Apptoken with BOTH
permission-pull-requests: writeANDpermission-issues: write. The merge-master identity is the codeXfactoryGitHub App (App ID 4312542), installed on
opensoftas installation159938946. That installation's live permission set is exactly:No
issuespermission at all. Requestingpermission-issues: writeon themint does not merely ask for an unused scope —
actions/create-github-app-tokenrefuses the mint outright ("requested permission not granted") when a
requested permission is not held by the installation, failing the whole
approval lane at the mint step before any review or comment is attempted.
permission-issues: writewas added by PR #735's verify-and-fix round on thebelief that posting the sticky comment via
POST/PATCH /repos/{o}/{r}/issues/{n}/commentsrequires anissuespermission. It does not: GitHub accepts EITHER
Issues: writeORPull requests: writefor issue-comment endpoints on a pull request, eventhough the endpoint path is
/issues/.... xFactory's productionmerge-master-approval.ymlproves this live — it mints withpermission-pull-requests: writeonly (nopermission-issues) and posts itsown sticky comment through the identical
/issues/{n}/commentsendpoint:codexFactory's
merge-master-approvalspec is explicit on this too: "Theruntime installation token SHALL request only
pull_requests: writeandmandatory Metadata read, scoped to the xFactory repository"
(
opensoft/codexFactory:openspec/specs/merge-master-approval/spec.md).Fix
permission-issues: writefrom the mint step; keptpermission-pull-requests: write.permissions:block header, and the mint step's own "PER-MINT NARROWING"comment) that claimed both scopes are needed — they now state that
pull-requests: writealone covers the review AND the sticky comment(GitHub accepts either permission on the issue-comments endpoint), and
that the App holds no
issuespermission by design.tests/review_lane_pin/test_review_lane_caller.py's mint-scopetest back to asserting exactly
permission-pull-requests: write, with anexplicit
assertNotIn("permission-issues", ...)and nothing wider(contents/administration/actions/workflows still refused). Docstring
cites the live installation's permission set as the reason.
Nothing else changed — no envelope change, no other workflow.
Proof
actionlint .github/workflows/merge-master-approval.yml— clean, exit 0.python3 -m pytest -q tests/review_lane_pin—156 passed, 2 skipped, 48 subtests passed.permission-issues: writeto the mint step redstest_the_app_token_mint_is_scoped_to_pull_requests_onlywithAssertionError: 'permission-issues' unexpectedly found in {...};reverting restores green. Confirmed locally before this push.
Refs #656
Awaiting Brett's word before this merges — no auto-merge, no ruleset touch,
no merge performed by this lane.
🤖 Generated with Claude Code
https://claude.ai/code/session_013zUwKfdNgAyNuUAUs3WTDU