pin: stop using a token the scope assertion just rejected (#87) - #99
Merged
Merged
Conversation
Two changes, one cause. The `pin` job has never completed a bump: it mints `front-desk`, then 403s on `git push` as bounded-systems-front-desk[bot]. Four hand-bumps so far (#79, #86, #89, #98). 1. Point at `front-desk-pin`, not `front-desk`. The fan-in entry carries no `contents`, so it could never push the branch. It also cannot be given any: it is deliberately unpinned — authorized by allowedOwner alone — and `contents` is a privileged permission, so the broker would refuse the entry outright and take every other consumer down with it. Hence a separate entry pinned to this workflow, the shape `front-desk-schema` and `forge` already have. Added in infra; this is the caller side. 2. Do not use the token when the mint step FAILED. `require: contents, pull_requests` (#93) worked exactly as designed on the merge of #97 — it reported `contents(granted: absent)` and named both places the gap could live. Then `continue-on-error: true` swallowed it, the job used the token anyway, and died on the push it had just been told would fail. An assertion whose verdict nothing consumes is decoration. The fallback is not a downgrade. `github.token` holds contents:write here (see the job's own `permissions:`) and pushed this branch fine before the broker was wired in (#79). So on a scope gap the branch now LANDS with the correct pin and only the PR opening is lost — a click, rather than the full hand-regenerate it costs today. A third annotation distinguishes that case from an unreachable broker, since the two are fixed in different systems. Ordering: this is safe to land before the broker deploys the new entry. An unknown app 404s, the mint step fails, and the job degrades to exactly the github.token path above — strictly better than today either way. Refs #87
bdelanghe
marked this pull request as ready for review
August 3, 2026 19:25
bdelanghe
added a commit
that referenced
this pull request
Aug 3, 2026
…on (#100) The other half of what #87/#99 fixed, on the job #92 predicted would fail. registry-graph's `sync` had all three defects org-defaults' `pin` had, still armed and untouched by #99: it minted the scopeless `front-desk` entry, ignored the require: assertion's verdict via continue-on-error, and would have 403'd on the push. It has not fired only because it early-exits on "in sync" — a green job that did nothing, reported in the colour of evidence. 1. app: front-desk-registry — its own pinned broker entry (infra#176). Not shareable with front-desk-pin: a workflowRef pins exactly one workflow. 2. The token is used only when the mint step actually succeeded. github.token holds contents:write here, so a scope gap still pushes the branch and only loses the PR, which this job already handles with a named annotation. Refs #92, #87
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.
The caller half of #87. The broker half is infra#172.
1. Point at
front-desk-pin, notfront-deskThe mint step's own assertion settled #87's open question on the merge of #97:
Broker registry, not the App installation. And the fan-in entry cannot simply be given
contents: it is deliberately unpinned,contentsis privileged (infra#140), so the broker would refuse the entry outright and take every other consumer with it. infra#172 adds a separate entry pinned to this workflow instead.2. Don't use a token the assertion just rejected
This is the part worth reading.
require: contents, pull_requests(#93) worked exactly as designed — it reportedcontents(granted: absent)and named both places the gap could live, which is why diagnosing this took minutes instead of the half-day #87 describes.Then
continue-on-error: trueswallowed the verdict, the job used the token anyway, and died on the very push the assertion had just said would fail:An assertion whose verdict nothing consumes is decoration. The token is now used only when the mint step actually succeeded.
The fallback is not a downgrade.
github.tokenholdscontents: writehere — see the job's ownpermissions:block — and pushed this exact branch fine before the broker was wired in (#79). So on a scope gap the branch now lands with the correct pin and only opening the PR is lost. That is a click, versus the full hand-regenerate it costs today. Four of those so far: #79, #86, #89, #98.A third annotation distinguishes "broker reachable, scopes insufficient" from "broker unreachable", because the two are fixed in different systems and the existing message only described the second.
Ordering
Safe to land before the broker deploys. An unknown app 404s → the mint step fails → the job takes the
github.tokenpath above. Strictly better than today in every branch: today nothing is pushed at all.Verification
workflows.test.mjs: 27 pass — including the column-0 block-scalar check that the newelifprose could have tripped..claude/suite: 109 pass.One thing I did not change
The
elsebranch still says ``schemais required on this repo. #78's commit message records that it is not — `.github` is absent from the `ci-green` ruleset — but I could not verify the ruleset's current state from a session, and replacing one unverified claim with another seemed worse than leaving it. Flagging rather than silently editing.Generated by Claude Code