Repository navigation
Commit 9c18d41
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
- .github/workflows
- docs
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
123 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| |||
1147 | 1150 | | |
1148 | 1151 | | |
1149 | 1152 | | |
1150 | | - | |
1151 | | - | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
1152 | 1158 | | |
1153 | 1159 | | |
1154 | 1160 | | |
| |||
1361 | 1367 | | |
1362 | 1368 | | |
1363 | 1369 | | |
1364 | | - | |
1365 | | - | |
1366 | | - | |
1367 | | - | |
1368 | | - | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
1369 | 1375 | | |
1370 | | - | |
| 1376 | + | |
1371 | 1377 | | |
1372 | | - | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
1373 | 1400 | | |
1374 | 1401 | | |
1375 | 1402 | | |
| |||
0 commit comments