Skip to content

Commit 46fe81f

Browse files
luisleo526claude
andcommitted
Merge main (7a7d099, the v1.7.0 tag plus #509) into the PR branch
Two textual conflicts, one semantic follow-up: - .github/workflows/native-live.yml: main added strace to the native build dependencies, this PR added git-lfs; the install line keeps both. - scripts/ci_verify.py EXCLUDED_REGISTERED_MIN: main's native floor is 963, this PR adds one native runner row, so the floor stays 964; main's reworded D1 comment is kept. - scripts/test_ci_verify.py: main's test_the_native_profile_is_not_under_this_rule (not in the PR's base) ran the native profile at 963 registered and 963 rows; with this PR's row the tree registers 964, so the test runs at 964/964. Doc deletions that arrive from main with this merge, named for check_doc_reverts (they are main's own edits to docs/ci.md, not changes made here): six sentences deleted or reworded by 717c75d (promote-baseline refuses untrusted heads and actors, #482) and by 3a0d150 (the CR-233 split of the PR wall from full-event verification, #477): "Only after those checks can an unmerged close pass without a merger lookup and skip `promote`", "The trigger has no `branches:` filter and the guard does not require a `main` base ref", "Release and promotion are unchanged:", "The same stage pins the complete shared `promote-guard` block byte for byte", "Decision tests execute the guard script extracted from the real workflow with bash and an executable `gh` stub first on PATH", "Mutation tests alter the real promotion workflow to replace the script with `exit 0`". Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2 parents 90b97f6 + 7a7d099 commit 46fe81f

701 files changed

Lines changed: 210719 additions & 5406 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.dockerignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ scripts/
2727
tutorial/
2828
.playwright-mcp/
2929
node_modules/
30+
31+
# Frozen Python report producer used only by the L9A comparison tests.
32+
tests/fixtures/run_json_frozen_pre_l9a.py
33+
tests/fixtures/run_json_frozen_pre_l9a.sha256

‎.github/workflows/ci-post.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ jobs:
311311
if: ${{ needs.authz.result == 'success' && runner.os == 'Linux' }}
312312
run: |
313313
sudo apt-get update
314-
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libeigen3-dev tzdata-legacy ccache
314+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libeigen3-dev tzdata-legacy ccache strace
315315
316316
# PRs restore the newest compatible main cache via the default-branch
317317
# fallback. Only main writes this namespace, never a PR merge ref.

‎.github/workflows/ci.yml‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@ name: CI
22

33
on:
44
pull_request:
5+
# LB-387: suite jobs skip on a draft PR (the required aggregate then fails, never passes);
6+
# ready_for_review starts the full run when the PR is marked ready.
7+
# converted_to_draft re-runs the workflow so its failing aggregate supersedes the earlier ready run.
8+
types: [opened, synchronize, reopened, ready_for_review, converted_to_draft]
59

610
permissions:
711
contents: read
812

913
# Post-merge events live in ci-post.yml; this file only schedules PR jobs.
1014
concurrency:
11-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}-${{ github.event.pull_request.draft && 'draft' || 'ready' }}
1216
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
1317

1418
env:
@@ -222,7 +226,7 @@ jobs:
222226
223227
preflight:
224228
needs: [authz, changes]
225-
if: ${{ always() && needs.authz.result == 'success' }}
229+
if: ${{ !github.event.pull_request.draft && (always() && needs.authz.result == 'success') }}
226230
runs-on: ["self-hosted","pf-gcp-pr"]
227231
env:
228232
PF_CI_LABELS: '["self-hosted","pf-ci","pf-ci-x64-16"]'
@@ -282,7 +286,7 @@ jobs:
282286
# successful docs-only or GitHub-only answer skips scheduling; the aggregate
283287
# independently reads the PR diff before accepting the latter skip.
284288
needs: [authz, changes]
285-
if: ${{ always() && needs.authz.result == 'success' && (needs.changes.result != 'success' || (needs.changes.outputs.docs_only != 'true' && (github.event_name != 'pull_request' || needs.changes.outputs.github_only != 'true'))) }}
289+
if: ${{ !github.event.pull_request.draft && (always() && needs.authz.result == 'success' && (needs.changes.result != 'success' || (needs.changes.outputs.docs_only != 'true' && (github.event_name != 'pull_request' || needs.changes.outputs.github_only != 'true')))) }}
286290
# 360 minutes (the platform maximum): a full-set leg waits on the
287291
# test_ci_verify CTest row, 976-1288 s on the standard runners at
288292
# 0d76a099, which more cores do not shorten. No bound of ours may fail a
@@ -384,7 +388,7 @@ jobs:
384388
# separate parity verdict. build-gate independently verifies GitHub-only skips.
385389
corpus-parity-subset:
386390
needs: [authz, changes]
387-
if: ${{ always() && needs.authz.result == 'success' && (needs.changes.result != 'success' || (needs.changes.outputs.docs_only != 'true' && (github.event_name != 'pull_request' || needs.changes.outputs.github_only != 'true'))) }}
391+
if: ${{ !github.event.pull_request.draft && (always() && needs.authz.result == 'success' && (needs.changes.result != 'success' || (needs.changes.outputs.docs_only != 'true' && (github.event_name != 'pull_request' || needs.changes.outputs.github_only != 'true')))) }}
388392
uses: ./.github/workflows/corpus-parity-subset.yml
389393

390394
# Advisory aggregate context covering every GitHub Actions lane. The merge

‎.github/workflows/native-live.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ jobs:
145145
- name: Install native build dependencies
146146
run: |
147147
sudo apt-get update
148-
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y cmake ninja-build libeigen3-dev tzdata-legacy libsqlite3-dev libssl-dev zlib1g-dev ccache git-lfs
148+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y cmake ninja-build libeigen3-dev tzdata-legacy libsqlite3-dev libssl-dev zlib1g-dev ccache git-lfs strace
149149
150150
- name: Restore ccache
151151
id: ccache-restore
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: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ jobs:
8989
# Org GitHub App token (no PAT — never expires). Authorizes the version
9090
# bump commit/tag push to protected main (the App is a bypass actor on the
9191
# org ruleset) AND the downstream hub dispatch. Scoped to this repo + the
92-
# hub. Minted first so checkout can push with it.
92+
# hub. Minted first so checkout can push with it. GitHub records this
93+
# authenticated pusher as pineforge-app[bot] on exact-main push runs;
94+
# ci_release_gate.py pins that login for the one-bump phase-1 exemption.
9395
- name: Mint org App token
9496
id: app
9597
uses: actions/create-github-app-token@v1
@@ -111,6 +113,14 @@ jobs:
111113
git config user.name "github-actions[bot]"
112114
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
113115
116+
# Phase 1 also accepts an App-pushed two-file bump on a gated PR merge.
117+
# No matching post-merge push run yet: refuse; retry after it exists.
118+
# The gate requires one active main pull_request ruleset whose own
119+
# bypass_actors is exactly Integration 4105147 with bypass_mode always.
120+
# Other rulesets' bypass lists do not supply or invalidate that barrier.
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.
114124
- name: Refuse unless pineforge/verify and pineforge/parity are green
115125
id: gate
116126
env:
@@ -194,7 +204,8 @@ jobs:
194204
# from now on (--check: the diff starts at the newest tag HEAD reaches)
195205
# must pass on the tagged commit before anything is pushed. The commit
196206
# and the tag go up in one atomic push: both land or neither does, so
197-
# main never holds a diff reset to a tag the remote lacks.
207+
# main never holds a diff reset to a tag the remote lacks. Keep these
208+
# exact two modified regular files: the release gate exempts no others.
198209
#
199210
# When a step fails after this push (gh release create, say), the tag
200211
# exists and re-running this run stops at "Compute next version" (tag

0 commit comments

Comments
 (0)