Skip to content

Commit 9c18d41

Browse files
luisleo526claude
andauthored
ci(release): read-only ruleset probe for the release gate (CR-245 F1) (#488)
* ci(release): accept a release-bump commit on main when the release App pushed it (CR-245, round 1) The release workflow pushes a version-bump commit to main; no PR head has that tree, so the next release run refused at phase 1. The gate now also accepts main's head when it is a bump commit that (a) every push-event run of the sha on main records as pushed by the release App (actor and triggering_actor both pineforge-app[bot], at least one run, all pages read, a run by any other actor refuses), (b) has a single parent that itself passes phase 1 (a bump on a bump or a merge commit refuses), and (c) touches exactly the files the workflow writes and stages, VERSION and docker/run_failure_codes_diff.json, as modifications with unchanged mode 100644 and nothing else. Red-first tests through gate() with the injected API for the accepted path and each refusal, a mutation control per condition, preflight pins and docs. Commit metadata is not used for identity: it is forgeable. Round 2 adds the branch-ruleset check that makes the App the only possible pusher. Lane: ci-fu-cr245b (Codex gpt-6.1-sol). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * ci(release): the bump exemption also requires that only the release App can push to main (CR-245, round 2) The actor check of round 1 is only as strong as the guarantee that nobody else can produce a push run as the release App. The gate now reads the repository's branch rulesets at gate time and requires that the cumulative bypass of every ACTIVE ruleset that applies to main and carries a pull_request or required_status_checks rule is exactly the release App (Integration 4105147, bypass mode always). It refuses when no push-blocking ruleset applies to main, when one is disabled or evaluate-only, when another actor or a pull-request-only bypass appears, when bypass_actors is not returned, when an inventory or detail response is malformed or incomplete (every page is read and linked), when an applicable ref pattern is not understood, and on any API error. No ruleset id or name is hard-coded. The gate relies on the App installation permission `administration: read`; release.yml, docs/ci.md and the preflight pins say so, so removing the permission is a visible breaking change. Nineteen ruleset tests and thirteen source mutation controls; preflight workflow mutations for the gate token wiring. Rounds 1 and 2 land together. Lane: ci-fu-cr245c (Codex gpt-6.1-sol). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * ci(release): the bump exemption needs one active pull_request ruleset restricted to the release App; Actions pagination honours Link (CR-245, round 3) Replaces the round-2 barrier of a8b1276 ("the bump exemption also requires that only the release App can push to main"): it removes the round-2 bypass-intersection sentences and the status-only acceptance that a8b1276 added to docs/ci.md, and rewrites its tests. Fresh sol read of the round-2 head: intersecting bypass descriptors across rulesets does not prove an App-only barrier (a person who holds a role and a team bypasses two rulesets whose lists share only the App entry), and a required_status_checks rule alone is not a push barrier. The condition is now: at least one ACTIVE branch ruleset applies to main, carries a pull_request rule, and its OWN bypass list is exactly the release App (Integration 4105147, bypass mode always); other rulesets, such as the broad default one, no longer matter. required_status_checks no longer counts. The Actions workflow-runs reader also proves completeness with the Link header (an advertised unread next page refuses), as the rulesets reader already did. The round-2 tests that encoded the intersection and the status-only acceptance are rewritten (status-only now refuses) and new red rows cover overlapping role/team principals, a hybrid PR/status pair, a valid barrier beside broader rulesets, a second bypass actor, a non-always mode and the unread-page input; docs, preflight pins and the release.yml comment follow the new wording. Two refusal-text expectations in test_ci_release_gate.py were wrong, not the gate: the pagination row lacked "returned" and the empty-payload row doubled it. Both now assert the text the gate emits. A second fresh sol read found that the HTTP page check and the JSON page check counted different populations: one HTTP body could carry several JSON documents, so a valid page followed by a headerless document still returned the green bump verdict (for the runs reader and the rulesets reader alike). Each framed HTTP body must now be exactly one JSON document, checked before the pages are joined and before the Link relations are trusted; extra or trailing data, an empty body and a partially headerless response refuse with the endpoint named. New red rows cover the runs example, the rulesets analogue, an extra document on page 2, trailing garbage, partially missing headers, an empty body with a next Link and the PR/status bodies; two new full-source mutants remove the check and must go green on the mutant only. Lane: ci-fu-cr245d, ci-fu-cr245e and ci-fu-cr245f (Codex gpt-6.1-sol). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * ci(release): a read-only probe of the bump's ruleset barrier, run once with the release App token (CR-245 F1) REV finding F1 on the CR-245 release-bump exemption (#486): the gate validates bypass_actors and ref patterns of EVERY branch ruleset in the includes_parents inventory before it decides which one is the barrier. GitHub returns bypass_actors only to a caller with write access to the ruleset, so if the release App token cannot see them on a ruleset (for example the organization ruleset), every release bump is refused. A dry_run of release.yml cannot test this: the ruleset reads happen only for a sha with no merged pull request. New subcommand `ci_release_gate.py rulesets-probe --repo OWNER/REPO` runs ONLY the ruleset reader the bump uses (no sha, ref, git, commit or run reads; GET requests for the repository, the ruleset inventory and the ruleset details), prints the barrier ruleset and one line per branch ruleset saying whether its bypass_actors were visible, and refuses with the same error text as `gate`. The gate's verdicts are unchanged: the reader now also returns the evidence it already validated. New workflow release-ruleset-probe.yml (workflow_dispatch only, contents: read) mints the App token with the same action, secrets and scope as release.yml, checks out without persisting credentials, and runs only the probe with that token. docs/ci.md says how to read its output. Tests: a token that cannot see bypass_actors is refused with the ruleset named; a visible green barrier is accepted with the exact two lines and only ruleset reads; the probe equals the real reader on every existing ruleset fixture; a source mutant that skips the reader goes green only on the mutant; workflow and preflight pins, each with mutation controls. The preflight and its tests pin the new workflow and runner label. Lane: ci-fu-cr486p (Codex gpt-6.1-sol). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * ci(release): the ruleset probe gets the canon authz job; stop claiming which App permission exposes bypass_actors (CR-245 F1, round 2) Fresh sol + argon reads of the probe commit 6adae66: - P1 (both): test_gcp_sites_reject_cross_class_routes asserted 29 routed GCP sites; the probe workflow adds one, and the authz job it now carries adds another, so the derived count is 31 (ci 5, ci-post 8, native 3, corpus 3, subset 2, docs 2, docs-post 2, release 3 + prebuilt matrix site, promotion 1, probe 2). The PF_CI_LABELS subset stays 15. - P2 (sol): release-ruleset-probe.yml had no authz job. It now has the canonical authz job, the probe job needs it and carries the canonical step guards; the preflight pin and its mutation controls refuse a probe workflow without authz or without the dependency. The App-token mint step is unchanged and still byte-identical to release.yml's (the probe must use the same token path as the bump). - P2 (sol): docs/ci.md, the release.yml comment (comment lines only) and the binding release-gate test stated as fact that the App permission administration: read exposes bypass_actors. That is not verified: GitHub's documentation says bypass_actors is returned only to a caller with write access to the ruleset, and what an installation token sees on an inherited organization ruleset is exactly what the probe measures. All three now say what is true (the gate needs bypass_actors visible on every branch ruleset in the inventory; if the release App token cannot see them the bump is refused; the probe reports whether it can), and the test pins that wording, so it fails if the unsupported claim comes back. - P3 (sol): docs/ci.md said every probe refusal names an endpoint; only API/response failures do. Narrowed. Names the docs/ci.md sentences this commit removes or rewrites, all introduced by a8b1276 ("ci(release): the bump exemption also requires that only the release App can push to main"), as a deliberate revert of their unverified claim: "The gate relies on the release App permission `administration: read` to read `bypass_actors`." "The App installation has that permission and `contents: write`; the workflow-level `contents: write` setting scopes GITHUB_TOKEN and does not grant App permissions." "Tokens without administration access may receive a ruleset response with `bypass_actors` omitted; a missing field refuses, and the guard never assumes an unreadable list is empty or App-only." "Removing this App permission makes every release-bump exemption refuse." They are replaced by the verified wording above; the guard behaviour (a missing bypass_actors field refuses) is unchanged. Open decision, not changed here: the probe and release.yml use the tag references actions/create-github-app-token@v1 and actions/checkout@v4 where the CI canon wants full-SHA pins; the probe keeps the same mint as the bump on purpose. Lane: ci-fu-cr486q (Codex gpt-6.1-sol). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * ci(release): the probe's hidden-bypass_actors refusal states what was observed, not a permission; dispatch from main (CR-245 F1, round 3) REV (Opus + sol, static) on the probe: NO-GO, small. P1: the refusal text printed exactly when a ruleset's bypass_actors is hidden, which is the probe's decisive output, ended "(App requires administration: read)". That is the permission claim round 2 removed from the docs, the release.yml comment and the binding test; it was introduced by a8b1276 ("the bump exemption also requires that only the release App can push to main") as a fifth place and it is unverified (GitHub's documentation says bypass_actors is returned only to a caller with write access to the ruleset). The text is now "(token cannot see this ruleset's bypass_actors)", the two assertions that pinned the old text pin the new exact text, and the absence guard now scans the WHOLE source of ci_release_gate.py (strings and code, not only comment lines) for the forbidden phrases in every spelling, with restoration controls that reinsert the old refusal text and seven spelling variants. F4: docs/ci.md says the one-time dispatch must run from main with main's copy of the workflow, lists the probe on the isolated pf-gcp-main fleet, and scopes the FLEET-POST=A routing sentence (authz on pf-gcp-pr, the probe job on pf-gcp-main). F2: comments in ci_preflight.py, its tests and release-ruleset-probe.yml claimed a pin binds the authz header byte for byte; for this workflow the pin binds the normalised executable lines (comments and blank lines removed), and the comments now say so. F3: the display branch for a hidden ruleset is unreachable (the reader refuses first); kept, and docs/ci.md says two hidden rulesets need two dispatches because the first refusal names only the first. Rewrites that replace earlier sentences (named for the doc-reverts check): docs/ci.md "FLEET-POST=A splits routing at the file boundary: PR jobs use" (introduced by 3a0d150); docs/ci.md "Release and promotion use the isolated release fleet: `release`, `notify-hub`, Linux x64" (opening from 833f7ac, second line from 3a0d150); docs/ci.md "Dispatch **Release ruleset probe** (`release-ruleset-probe.yml`) once to check" (6adae66); ci_preflight.py "The canon header is text, not a decoded array" (a8089b2) and "Canon authz keeps its space after the comma" (1d5dfd6); the "GCP fleet (owner #1050): non-release jobs on pf-gcp-pr; release-class jobs only on pf-gcp-main" copies in the probe workflow, ci_preflight.py and test_ci_preflight.py (1d5dfd6). Not changed here: the tag-pinned actions (repo-wide card) and the dispatch exposure of the App secrets (separate L6 card). Lane: ci-fu-cr486r (Codex gpt-6.1-sol). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * ci(release): the permission-claim absence guard also sees concatenated string literals, quoted and line-wrapped claims (CR-245 F1, round 3b) Fresh sol and argon reads of the round-3 commit 5ce34fc: the whole-source guard assert_ruleset_visibility_documentation only removed backticks and folded case before matching the forbidden phrases, so a claim that Python joins from adjacent string literals ("App " "requires administration:" " read"), a claim in single or double quotes ('administration': 'read'), or a claim wrapped over two comment lines still passed. The guard now also scans the string constants of the Python source (folding adjacent literals, constant additions and the literal parts of f-strings through ast) and a normalised view of every text with comment markers, quotes, backticks, line breaks and runs of whitespace collapsed, in addition to the existing contiguous scan. The forbidden patterns are unchanged and the three real texts (the gate source, docs/ci.md, release.yml) still pass. Seventeen restoration controls (concatenated literals, f-string and + variants, quoted and wrapped-comment variants) were added: each fails against the old guard and is rejected by the new one; every existing control is kept. Test-only change: scripts/test_ci_release_gate.py. Lane: ci-fu-cr486s (Codex gpt-6.1-sol). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * ci(release): the ruleset probe job runs on pf-gcp-post; pf-gcp-main admits only allowlisted workflows (CR-245 F1) The org runner group pf-gcp-main (id 9) is restricted to workflows on an allow-list that does not name release-ruleset-probe.yml, so a dispatch of the probe on ["self-hosted","pf-gcp-main"] would queue forever. The allow-list is the owner's org security setting and is not widened; the one-time probe uses the unrestricted pf-gcp-post group (the canon fleet for engine post-merge and manual jobs) instead. Everything else is unchanged: workflow_dispatch from main, the App-token mint byte-identical to release.yml's, contents: read, persist-credentials: false, the authz job on pf-gcp-pr, the probe command, release.yml. Changes: the probe job's runs-on (workflow file and the whole-file template RELEASE_RULESETS_PROBE_WORKFLOW), RELEASE_JOB_RUNNERS['release-ruleset-probe.yml'] = {'authz': PR_RUNNER, 'probe': POST_RUNNER} (the per-job map already accepts a non-release label), the fleet tests (the helper now recognises a post override; the probe on pf-gcp-main or pf-gcp-pr is refused with the specific finding; the post label is accepted; the site counts stay 31 and 15, derived from the workflow files), and docs/ci.md with one added sentence saying why. Red-first rows and deletion controls for the new doc sentences. Rewrites that replace earlier text (named for the doc-reverts check), all introduced by 5ce34fc ("the probe's hidden-bypass_actors refusal states what was observed...", round 3 of the probe): docs/ci.md "The manual `release-ruleset-probe.yml` workflow runs `authz` on" ... "and `probe` on `["self-hosted","pf-gcp-main"]`." (only the probe's label changes); docs/ci.md "Release, promotion and the release ruleset probe use the isolated release fleet:" (the probe leaves the pf-gcp-main list; release, notify-hub, Linux x64 prebuilt and promote stay); the comment "# authz uses pf-gcp-pr; the App-token probe uses pf-gcp-main." in the workflow, in ci_preflight.py and in test_ci_preflight.py (now pf-gcp-post), which also touches the comment lines of 6adae66 and 1d5dfd6 that 5ce34fc had rewritten. Also named for the doc-reverts check: the docs/ci.md sentence "`release`, `notify-hub`, Linux x64 `prebuilt`, baseline `promote` and `release-ruleset-probe.yml`'s `probe` job use `["self-hosted","pf-gcp-main"]`." (the second half of the sentence above) was introduced by 49a55b5 ("Merge main (a2bb907, the squash of #483) into the ruleset probe branch", which carried the round-3 probe text) and is rewritten here on purpose: the probe job leaves the pf-gcp-main list because that group admits only allowlisted workflows. Lane: ci-fu-cr486t (Codex gpt-6.1-sol). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * ci(release): the ruleset probe refuses any dispatch ref other than main before it mints the App token; the runner refusal no longer calls the post fleet isolated (CR-245 F1) Fresh sol read of the pf-gcp-post move (065826e): moving the probe job to the unrestricted pf-gcp-post group removed the only thing that kept it on main, the restricted pf-gcp-main group's workflow and ref allow-list. A workflow_dispatch with ref=refs/heads/<topic> would run that branch's copy of the workflow, pass authz (which accepts any workflow_dispatch), mint the release App token and run the branch's script; neither the workflow nor the probe checked GITHUB_REF. The CI canon requires manual dispatch to satisfy the same ref restriction and to refuse an unsupported ref before checkout or repository-code execution. The probe job now starts with a step that has no secrets and no token: [ "$REF" = refs/heads/main ] || fail, modelled on promote-baseline.yml's own ref refusal, before the App-token mint and before checkout. The whole-file template and release_rulesets_probe_workflow_findings require that step first and refuse a probe workflow that lacks it, has it after the mint or checkout, in the authz job only, compares another ref, or neutralises its exit (|| true, continue-on-error, if:); 13 mutation rows plus an ordering control and a behavioural dispatch control (a topic ref exits 1 before the mint boundary). The App-token mint step is still byte-identical to release.yml's. docs/ci.md says the dispatch must run from main and the workflow itself refuses any other ref. The guard lives in the workflow file, so it stops mistakes, not a writer who edits the file on their own branch; the lock against that is the environment work (CR-304) that keeps the App secrets away from non-main refs. The per-job runner checker's refusal printed " (isolated release)" for a probe pinned to pf-gcp-post; the post fleet is shared. The suffix is now derived from the pinned label (none for the PR fleet, " (post fleet)" for the post fleet, " (isolated release)" only for the release label) and the pins that expected the old suffix (test_gcp_sites_pin_probe_to_the_dispatch_fleet, test_release_ruleset_probe_refuses_release_and_pr_fleets) expect the new one. Rewrites named for the doc-reverts check: the suffix expression and its test expectations came from 1d5dfd6 and 065826e; the pf-gcp-post routing and allow-list sentences of 065826e and the main-copy dispatch wording of 5ce34fc are kept; the generic probe refusal of 6adae66 is kept verbatim. No prose sentence or comment is deleted. Lane: ci-fu-cr486u (Codex gpt-6.1-sol). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> --------- Co-authored-by: Claude Sonnet 5.5 <[email protected]>
1 parent a2bb907 commit 9c18d41

7 files changed

Lines changed: 1126 additions & 52 deletions

File tree

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Release ruleset probe
2+
3+
# Read the bump's ruleset barrier with the release App installation token.
4+
# Keep the mint step identical to release.yml, including its permission set.
5+
on:
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
authz:
13+
name: authz
14+
# Preflight pins executable workflow lines after removing comment-only lines.
15+
# authz uses pf-gcp-pr; the App-token probe uses pf-gcp-post.
16+
runs-on: ["self-hosted", "pf-gcp-pr"]
17+
permissions: {}
18+
# No timeout-minutes: the owner's no-time-limits rule (check-no-time-limits refuses new ones).
19+
steps:
20+
- name: Only our own pull requests and our own events run CI
21+
env:
22+
EVENT: ${{ github.event_name }}
23+
REPO: ${{ github.repository }}
24+
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
25+
HEAD_IS_FORK: ${{ github.event.pull_request.head.repo.fork }}
26+
ASSOCIATION: ${{ github.event.pull_request.author_association }}
27+
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
28+
WR_HEAD_REPO: ${{ github.event.workflow_run.head_repository.full_name }}
29+
WR_ACTOR: ${{ github.event.workflow_run.triggering_actor.login }}
30+
GH_TOKEN: ${{ github.token }} # read-only use: one permission lookup for workflow_run
31+
# Bot logins whose same-repository pull requests count as ours: dependabot[bot] (CI-DEPBOT A)
32+
# and the org's own GitHub App bot logins by name (space-separated), nothing else.
33+
ALLOWED_BOTS: "dependabot[bot] pineforge-app[bot]"
34+
run: |
35+
set -eu
36+
fail() { echo "::error title=authz::$1"; echo "authz: REFUSED: $1" >> "$GITHUB_STEP_SUMMARY"; exit 1; }
37+
case "$EVENT" in
38+
push|workflow_dispatch|schedule|merge_group|release|workflow_call|repository_dispatch)
39+
# Only someone with write access to this repository (or our App's token) can cause these
40+
# events; none of them runs pull-request code.
41+
;;
42+
workflow_run)
43+
# LB-437: bind identity to the triggering run and its re-runner.
44+
# These two App bots are fixed canon policy; ALLOWED_BOTS is PR-only.
45+
[ -n "${WR_HEAD_REPO:-}" ] || fail "workflow_run head repository is missing"
46+
[ -n "${WR_ACTOR:-}" ] || fail "workflow_run triggering actor is missing"
47+
[ "$WR_HEAD_REPO" = "$REPO" ] || fail "workflow_run head repository does not match this repository"
48+
case "$WR_ACTOR" in
49+
"pineforge-app[bot]"|"pineforge-ci-dispatcher[bot]") ;;
50+
*"[bot]") fail "workflow_run bot is not on the canon allowlist" ;;
51+
*)
52+
perm=$(gh api "repos/$REPO/collaborators/$WR_ACTOR/permission" --jq .permission 2>/dev/null) || fail "workflow_run permission lookup failed"
53+
case "$perm" in admin|maintain|write) ;; *) fail "workflow_run triggering actor does not have write permission" ;; esac ;;
54+
esac ;;
55+
pull_request)
56+
[ "$HEAD_REPO" = "$REPO" ] || fail "pull request from another repository (${HEAD_REPO:-unknown})"
57+
[ "$HEAD_IS_FORK" = "false" ] || fail "pull request from a fork"
58+
case "$ASSOCIATION" in
59+
OWNER|MEMBER|COLLABORATOR) ;;
60+
*)
61+
case " $ALLOWED_BOTS " in
62+
*" $PR_AUTHOR "*) ;;
63+
*)
64+
# A member whose org membership is private shows as CONTRIBUTOR: ask GitHub for the
65+
# author's permission on this repository; anything but admin/maintain/write (or a
66+
# failed call) refuses.
67+
perm=$(gh api "repos/$REPO/collaborators/$PR_AUTHOR/permission" --jq .permission 2>/dev/null || echo none)
68+
case "$perm" in admin|maintain|write) ;; *) fail "author ${PR_AUTHOR:-unknown} (${ASSOCIATION:-NONE}) has permission '$perm', not write, and is not an allowlisted bot" ;; esac ;;
69+
esac ;;
70+
esac ;;
71+
*) fail "event $EVENT does not run CI (pull_request_target and other events are not allowed)" ;;
72+
esac
73+
echo "authz: allowed ($EVENT${PR_AUTHOR:+ by $PR_AUTHOR})" >> "$GITHUB_STEP_SUMMARY"
74+
75+
probe:
76+
needs: [authz]
77+
runs-on: ["self-hosted","pf-gcp-post"]
78+
steps:
79+
- name: Refuse a dispatch ref other than main
80+
env:
81+
REF: ${{ github.ref }}
82+
run: |
83+
set -euo pipefail
84+
fail() { echo "::error title=rulesets-probe::$1"; echo "rulesets-probe: REFUSED: $1" >> "$GITHUB_STEP_SUMMARY"; exit 1; }
85+
[ "$REF" = refs/heads/main ] || fail "release ruleset probe requires refs/heads/main"
86+
87+
- name: Mint org App token
88+
id: app
89+
uses: actions/create-github-app-token@v1
90+
with:
91+
app-id: ${{ secrets.PINEFORGE_APP_ID }}
92+
private-key: ${{ secrets.PINEFORGE_APP_PRIVATE_KEY }}
93+
owner: ${{ github.repository_owner }}
94+
repositories: pineforge-engine
95+
96+
- name: Checkout
97+
if: ${{ needs.authz.result == 'success' }}
98+
uses: actions/checkout@v4
99+
with:
100+
persist-credentials: false
101+
102+
- name: Probe release ruleset barrier
103+
if: ${{ needs.authz.result == 'success' }}
104+
env:
105+
GH_TOKEN: ${{ steps.app.outputs.token }}
106+
run: python3 scripts/ci_release_gate.py rulesets-probe --repo "${GITHUB_REPOSITORY}"

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ jobs:
118118
# The gate requires one active main pull_request ruleset whose own
119119
# bypass_actors is exactly Integration 4105147 with bypass_mode always.
120120
# Other rulesets' bypass lists do not supply or invalidate that barrier.
121-
# Its App permission administration: read exposes bypass_actors; removing
122-
# that permission makes the release-bump exemption refuse every release.
123-
# The workflow-level contents: write scope belongs to GITHUB_TOKEN.
121+
# The gate needs bypass_actors visible on every branch ruleset in the inventory.
122+
# If the release App token cannot see them, the bump is refused.
123+
# release-ruleset-probe.yml reports whether it can. contents: write scopes GITHUB_TOKEN.
124124
- name: Refuse unless pineforge/verify and pineforge/parity are green
125125
id: gate
126126
env:

‎docs/ci.md‎

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,17 @@ or `slow` rows. The target rebuilds those executables with their library.
6060
PRs restore the newest compatible default-branch compiler cache, and only
6161
successful runs on `main` save that cache namespace.
6262

63-
FLEET-POST=A splits routing at the file boundary: PR jobs use
64-
`["self-hosted","pf-gcp-pr"]`, and push/schedule/manual jobs use
65-
`["self-hosted","pf-gcp-post"]`. No job chooses its label by event.
63+
FLEET-POST=A splits verification and documentation routing at the file boundary:
64+
PR jobs use `["self-hosted","pf-gcp-pr"]`, and post-merge push/schedule/manual
65+
jobs use `["self-hosted","pf-gcp-post"]`. No job chooses its label by event.
6666
`corpus-parity-subset.yml` is reusable only from the PR pipeline;
6767
`corpus-parity.yml` keeps full parity and the full-event subset on the post
6868
fleet. The checker follows local reusable calls, so a PR caller cannot borrow
6969
a post workflow even behind a job condition.
7070

71+
The manual `release-ruleset-probe.yml` workflow runs `authz` on
72+
`["self-hosted","pf-gcp-pr"]` and `probe` on `["self-hosted","pf-gcp-post"]`.
73+
7174
`docs.yml` retains the PR build name and `.github/**` exclusion.
7275
`docs-post.yml` builds and deploys on main pushes and manual dispatch.
7376
Tag pushes no longer trigger docs: the post fleet admits only engine `main`.
@@ -1147,8 +1150,11 @@ pins that one job name and image, and the exception never applies to a
11471150
workflow reachable from `pull_request`. The PR build remains
11481151
`build (ubuntu-24.04, Release)` and its aggregate remains `build`.
11491152

1150-
Release and promotion use the isolated release fleet: `release`, `notify-hub`, Linux x64
1151-
`prebuilt` and baseline `promote` use `["self-hosted","pf-gcp-main"]`.
1153+
Release and promotion use the isolated release fleet:
1154+
`release`, `notify-hub`, Linux x64 `prebuilt` and baseline `promote` use
1155+
`["self-hosted","pf-gcp-main"]`.
1156+
The release ruleset probe runs `authz` on `["self-hosted","pf-gcp-pr"]` and
1157+
`probe` on `["self-hosted","pf-gcp-post"]`.
11521158
Release's ARM/macOS artifact cells keep their existing hosted pins, and
11531159
promotion runs on a push to `main` plus manual dispatch from `main`.
11541160

@@ -1361,15 +1367,36 @@ changes to the two files whose values the release workflow computes: the next
13611367
version and the reset catalog diff. Preflight pins the exact writer, staging,
13621368
commit and atomic-push step and the App-token checkout wiring.
13631369

1364-
The gate relies on the release App permission `administration: read` to read
1365-
`bypass_actors`. The App installation has that permission and `contents: write`;
1366-
the workflow-level `contents: write` setting scopes GITHUB_TOKEN and does not
1367-
grant App permissions. Tokens without administration access may receive a
1368-
ruleset response with `bypass_actors` omitted; a missing field refuses, and
1370+
The gate needs `bypass_actors` visible on every branch ruleset in the inventory.
1371+
If the release App token cannot see them, the bump is refused.
1372+
`release-ruleset-probe.yml` reports whether that token can see them.
1373+
Visibility with the installation token, including inherited organization
1374+
rulesets, is unverified until the probe runs. A missing field refuses;
13691375
the guard never assumes an unreadable list is empty or App-only.
1370-
Removing this App permission makes every release-bump exemption refuse.
1376+
The workflow-level `contents: write` setting scopes GITHUB_TOKEN.
13711377
Preflight pins the unconditional gate invocation and its App token, and its
1372-
binding release-gate tests pin this permission dependency in code and docs.
1378+
binding release-gate tests pin this visibility requirement in code and docs.
1379+
1380+
Dispatch **Release ruleset probe** (`release-ruleset-probe.yml`) once from
1381+
`main` to check actual ruleset visibility with the same App token mint as
1382+
`release.yml`. The workflow file must be on the default branch, and the run
1383+
must use `main`'s copy.
1384+
The probe job runs on `["self-hosted","pf-gcp-post"]`, with `authz` on
1385+
`["self-hosted","pf-gcp-pr"]`.
1386+
`pf-gcp-main` admits only allowlisted workflows (an org runner-group restriction),
1387+
so the one-time probe uses `pf-gcp-post`.
1388+
The dispatch must run from `main`; the workflow itself refuses any other ref
1389+
before minting the App token or checking out repository code.
1390+
It runs `python3 scripts/ci_release_gate.py rulesets-probe --repo OWNER/REPO`,
1391+
reading only repository metadata, the parent-inclusive ruleset inventory and
1392+
branch details. Success prints the barrier id/name and one compact inventory
1393+
line with enforcement, source and bypass visibility. Refusal exits 1 with empty
1394+
stdout and the reader's `::error::` diagnostic; API/response failures name the endpoint.
1395+
Two hidden rulesets need two dispatches: the first refusal names only the
1396+
first hidden ruleset; make its `bypass_actors` visible before dispatching again
1397+
to identify the second.
1398+
The probe changes no release evidence or gate verdicts. A release `dry_run`
1399+
on a merged PR does not exercise the bump-only ruleset reader.
13731400

13741401
Phase 2 is **not live yet**: `MAIN_PROOF_WATCHER_FIRST_SHA` in
13751402
`scripts/ci_release_gate.py` is `None`. When C2 main-watch (#176) supplies the

0 commit comments

Comments
 (0)