Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
154e3e3
ci: add CI gate caller emitting the CI/gate commit status (interim)
claude Nov 17, 2026
c32981d
ci: re-pin the CI gate caller to the suite PR head 1d657fe
claude Nov 17, 2026
4ba8bd9
ci: drop the concurrency block from the CI gate caller
claude Nov 17, 2026
bab5b42
ci: re-pin the CI gate caller to the suite PR head c77a66d
claude Nov 17, 2026
a1c0a17
ci: re-pin the CI gate caller to the suite PR head 0862fe8
claude Nov 17, 2026
b8bca3e
Merge branch 'main' into claude/sweet-edison-yp088x
hyperpolymath Nov 17, 2026
443bf0f
Merge branch 'main' into claude/sweet-edison-yp088x
hyperpolymath Nov 17, 2026
851050c
ci: scheduled CI/gate sweep and a typed status mapping in the squabbl…
claude Nov 17, 2026
0039844
perf(required-contexts): parse status publishers in-process with Bun.…
claude Nov 17, 2026
410c7df
Merge remote-tracking branch 'origin/main' into claude/sweet-edison-y…
claude Nov 17, 2026
6eccbb5
ci(ci-gate): start CI/gate on pull_request and add the gate tamper gu…
claude Nov 17, 2026
0fa4059
test(ci-gate): assert the caller shape and document the pull_request …
claude Nov 17, 2026
8e1f333
fix(required-contexts): check every job that calls the suite ci-gate …
claude Nov 17, 2026
f44c85b
fix(required-contexts): read local reusable targets, reject duplicate…
claude Nov 17, 2026
f7f520c
ci(ci-gate): pin the suite reusable at the #139 squash commit 4e9e680…
claude Nov 18, 2026
9e5ad99
Merge branch 'main' into claude/sweet-edison-yp088x
hyperpolymath Nov 18, 2026
5b52740
fix(required-contexts): require the local reusable to declare a strin…
claude Nov 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,52 @@ files the contract rejects. The hooks are now thin wrappers over the same
canonical tools, run from a standards checkout (`STANDARDS_DIR`), and skip
with a notice when none is present. k9iser is retired estate-wide: contracts
are authored to `1-formats/k9/spec/K9-CONTRACT-SPEC.adoc`, never generated.

== `ci-gate.yml` publishes the `CI/gate` status (interim)

`ci-gate.yml` is a thin caller of the reusable of the same name in
hyperpolymath/proven-cicd-and-workflows. It emits the commit status `CI/gate`,
which the Branch-Floor ruleset requires. It is a commit status, not a check run,
because a reusable's check-run name is `<caller job> / <job>` and can never equal
`CI/gate`.

* It starts on `pull_request` (job `gate-pr`, same-repository branches only: a
fork's or Dependabot's token cannot write statuses) so the pull request that
adds or changes the gate gets `CI/gate` itself and waits, within a bounded
budget, for the checks the profile names. `gate-pr` runs from the pull
request's own branch, so the tamper guard below is what makes an edit to the
gate visible.
* It also runs on `workflow_run` (`completed` and `in_progress`: a rerun flips the
status to pending, so a stale success never survives), on a 15-minute
`schedule` sweep and on `workflow_dispatch`. GitHub runs those from the copy on
the default branch: a pull request cannot alter that job, its pin or its list.
The job `gate` skips the `pull_request` event. There is no `concurrency:` block,
as in the suite's template: the reusable re-reads the runs before it writes.
* The required-check list is not in this repository. It lives in
`proven-cicd-and-workflows/profiles/ci-gate/<owner>/<repo>.json` at the pinned
SHA.
* It is onboarded in `actions.lock` (workflow key plus a leaf record for the suite
reusable, `ref: main`), because the lock-sync gate requires it. An A3 `estate-gate` replaces it by changing the pin and the
context.

=== `ci-gate-tamper-guard-caller.yml`: the gate tamper guard

`ci-gate-tamper-guard-caller.yml` is a thin caller of the suite's reusable
`ci-gate-tamper-guard.yml`, pinned to the same commit as the gate. It runs on
`pull_request_target`, so GitHub uses the default-branch copy and a pull request
cannot edit the guard that judges it; it never checks out or runs pull request
code. A pull request that touches a gate file (`.github/workflows/ci-gate*.yml`,
and `scripts/check-required-contexts.sh`, among the suite's gate files) fails
`guard / check` until the owner applies the label `gate-change-approved`
after the newest commit, and only a repository admin's label counts.

* Only the owner applies `gate-change-approved`. An agent must never apply it.
It is tamper-evident, not tamper-proof; the suite's `docs/CI-GATE.adoc`,
"Tamper guard", states the limit.
* The guard has a fixed set of protected paths in the suite's script; the caller
takes no `paths` input. In this repository
`.machine_readable/required-contexts-allow.txt` (the `CI/gate => status:` mapping)
is not in that set, so a change to it is not flagged by the guard.
* It is onboarded in `actions.lock` like `ci-gate.yml` (its own workflow key, the
same leaf record for the suite). It is not yet a required context; listing
`guard / check` in the suite's profile is a later round, once the guard is on the default branch.
9 changes: 9 additions & 0 deletions .github/workflows/actions.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ workflows:
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
'.github/workflows/build-notification.yml':
- 'actions/checkout@v7.0.1'
'.github/workflows/ci-gate-tamper-guard-caller.yml':
- 'hyperpolymath/proven-cicd-and-workflows@4e9e680b0dfd842a457cf23271f9e005a88f766c'
'.github/workflows/ci-gate.yml':
- 'hyperpolymath/proven-cicd-and-workflows@4e9e680b0dfd842a457cf23271f9e005a88f766c'
'.github/workflows/codeql.yml':
- 'actions/checkout@v7.0.1'
- 'github/codeql-action@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee'
Expand Down Expand Up @@ -175,6 +179,11 @@ dependencies:
commit: 'sha1-0f8e8c99d88aeb3fbfd523f1ef2c6f762d10d64d'
owner_id: 75048950
repo_id: 623796603
'hyperpolymath/proven-cicd-and-workflows@4e9e680b0dfd842a457cf23271f9e005a88f766c':
ref: 'main'
commit: 'sha1-4e9e680b0dfd842a457cf23271f9e005a88f766c'
owner_id: 6759885
repo_id: 1326697643
'hyperpolymath/smtp-notify-action@v0.5.1':
ref: 'v0.5.1'
commit: 'sha1-e384daf6167a7a7567642d6a62060106244d2413'
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/ci-gate-tamper-guard-caller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-License-Identifier: MPL-2.0
# Gate tamper guard - thin caller of the suite's reusable guard; installed as .github/workflows/ci-gate-tamper-guard-caller.yml. pull_request_target runs this file from the
# DEFAULT branch, so a pull request cannot edit it; the job never checks out or runs pull request code
# (it reads the changed-file list through the API). The pin is a full SHA, never @main or a tag.
# A pull request that touches gate files fails this check until the OWNER applies the label
# `gate-change-approved` after the newest commit. AGENTS MUST NEVER APPLY THAT LABEL.
# No `secrets:` line, minimal permissions. See docs/CI-GATE.adoc, "Tamper guard".
name: Gate tamper guard

on:
pull_request_target:
types: [opened, reopened, synchronize, edited, labeled, unlabeled]

permissions:
pull-requests: read
contents: read

jobs:
guard:
uses: hyperpolymath/proven-cicd-and-workflows/.github/workflows/ci-gate-tamper-guard.yml@4e9e680b0dfd842a457cf23271f9e005a88f766c # cicd-suite tamper guard
88 changes: 88 additions & 0 deletions .github/workflows/ci-gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# SPDX-License-Identifier: MPL-2.0
# CI gate — thin caller of the estate's interim gate, which lives in
# hyperpolymath/proven-cicd-and-workflows as a reusable workflow. Do not copy
# its jobs in here: a copy freezes at one cicd-suite commit and never receives
# a fix.
#
# It emits the commit status `CI/gate`, which the Branch-Floor ruleset
# requires. It is a COMMIT STATUS, not a check run, because a job inside a
# reusable workflow gets the check-run name `<caller job> / <called job>`
# (see rust-ci-caller.yml: `rust-ci / Cargo test`), which always contains
# " / " and can never equal `CI/gate`.
#
# It triggers on workflow_run, schedule and workflow_dispatch, all of which GitHub runs from the
# DEFAULT branch: a pull request cannot alter this file, its pin or its list. The consequence:
# the pull request that adds this caller can never receive `CI/gate` itself, and
# would be merged past the gate once (owner action) without the gate-pr job at the end. There is no
# pull_request start here except the gate-pr job at the end (docs/CI-GATE.adoc, "The pull_request start"),
# whose shape tests/ci-gate.sh asserts.
#
# `schedule` and `workflow_dispatch` run a SWEEP: the reusable lists the open pull requests and the
# default branch head and re-evaluates each distinct head SHA with the same guarded publisher. A stale state
# then normally lasts until the next sweep. It is still last-writer-wins, a sweep is itself an evaluator,
# and GitHub may delay or skip scheduled runs (docs/CI-GATE.adoc, "Residual limit"). The cron below runs at minutes
# 7, 22, 37 and 52 of every hour; keep the minutes off :00 and :30, where scheduled load is highest.
# The sweep reads open pull requests, so the caller must grant `pull-requests: read`.
#
# It also fires when a workflow run STARTS (`in_progress`, which GitHub also sends for a rerun):
# any active run makes the verdict pending, so a rerun replaces a stale success with pending,
# approximating a native required check. `completed` then re-evaluates it (last-writer-wins; see docs/CI-GATE.adoc, "Residual limit").
#
# The required-check list is NOT in this repository: it lives in
# proven-cicd-and-workflows/profiles/ci-gate/<owner>/<repo>.json at the pinned
# SHA below, selected by github.repository. A repository with no profile there
# fails the gate closed until one is added to the suite.
#
# The job id MUST stay `gate`. The pin is a full SHA, never `@main` or a tag:
# the account enforces sha_pinning_required. An A3 `estate-gate` replaces this
# interim gate by changing ONE pin and ONE context (`with: context`) here.
#
# ONBOARDED in actions.lock (workflow key plus a leaf dependency record for the
# suite reusable) because this repository's lock-sync gate requires every
# job-level reusable ref to be keyed there; see the suite README, "Consumers
# with a lock-sync gate". The record's ref is the symbolic `main`, never the SHA.
#
# There is deliberately NO `concurrency:` block: serialising per SHA would delay the
# in_progress caller behind a running evaluation that then writes a stale success. Instead the
# reusable re-reads the runs just before it writes and re-evaluates when they moved
# (scripts/ci-gate-publish.sh; tests/ci-gate.sh asserts the template has no concurrency).
#
# No `secrets:` line: the reusable consumes none.
name: CI gate

on:
pull_request:
workflow_run:
workflows: ["**", "!CI gate"]
types: [completed, in_progress]
schedule:
- cron: "7,22,37,52 * * * *"
workflow_dispatch: {}

permissions:
statuses: write
actions: read
contents: read
pull-requests: read

jobs:
gate:
if: github.event_name != 'pull_request' && (github.event_name != 'workflow_run' || github.event.workflow_run.name != 'CI gate')
uses: hyperpolymath/proven-cicd-and-workflows/.github/workflows/ci-gate.yml@4e9e680b0dfd842a457cf23271f9e005a88f766c # cicd-suite ci-gate
with:
context: "CI/gate"
# timeout_minutes: 180 # how long a missing check keeps the gate pending

# The pull_request start. workflow_run, schedule and workflow_dispatch run only from the default
# branch, so without this job the pull request that adds or changes the gate never gets the status
# and a ruleset requiring it blocks that very pull request. This job runs from the pull request's own
# branch and posts the same verdict, waiting (bounded) for the checks named in the profile to report.
# Same-repository branches only: a fork's or Dependabot's pull_request token cannot write statuses,
# and those are covered by the workflow_run job. No trust decision uses github.actor.
# Because a pull request can edit this file, the Gate tamper guard (ci-gate-tamper-guard.yml, run from
# the default branch) fails a pull request that touches gate files unless the owner has approved it.
gate-pr:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: hyperpolymath/proven-cicd-and-workflows/.github/workflows/ci-gate.yml@4e9e680b0dfd842a457cf23271f9e005a88f766c # cicd-suite ci-gate
with:
context: "CI/gate"
15 changes: 8 additions & 7 deletions .github/workflows/proven-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,15 @@ jobs:
STANDARDS_DIR="$RUNNER_TEMP/standards" bash scripts/run-proven-suite.sh --require-zig --bench

# ==========================================================================
# Required status check "CI/gate" (Branch-Floor ruleset).
# The check context is this job's name. It waits for every other job in this
# workflow and runs even when one fails, is cancelled or is skipped; it exits
# In-workflow verdict job "Proven suite verdict" (NOT the required context).
# The context `CI/gate` is NOT this job: it is a commit status published by
# ci-gate.yml (the suite reusable), the only producer of it. This job waits for every
# other job in this workflow and runs even when one fails, is cancelled or is skipped; it exits
# 0 only when every required job succeeded (or was skipped by design behind a
# detector job that itself succeeded). Pattern: hyperpolymath/hypatia ci.yml.
# ==========================================================================
ci-gate:
name: CI/gate
name: Proven suite verdict
Comment thread
hyperpolymath marked this conversation as resolved.
Resolved
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions: {}
Expand All @@ -183,7 +184,7 @@ jobs:
}
row() { printf '| %s | %s | %s | %s |\n' "$@" | tee -a "$summary"; }
{
echo "### CI/gate"
echo "### Proven suite verdict"
echo
echo "| job | result | role | verdict |"
echo "|---|---|---|---|"
Expand Down Expand Up @@ -222,7 +223,7 @@ jobs:
msg="required jobs: $total; satisfied: $passed; advisory: $(wc -w <<< "$ADVISORY_JOBS")"
echo "$msg" | tee -a "$summary"
if [ "$fail" -ne 0 ]; then
echo "::error::CI/gate failed ($msg)"
echo "::error::Proven suite verdict failed ($msg)"
exit 1
fi
echo "CI/gate passed ($msg)"
echo "Proven suite verdict passed ($msg)"
8 changes: 7 additions & 1 deletion .machine_readable/required-contexts-allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
# workflow files in `.github/workflows/` that produce them on `pull_request`.
#
# Format: <exact check context> => <.github/workflows/file.yml>
# or: <exact commit-status context> => status:<.github/workflows/file.yml>
#
# A `status:` mapping names a workflow_run publisher of a commit status (the
# estate's CI gate caller). The checker verifies that the file exists, triggers on
# workflow_run with a `completed` type, calls the suite's ci-gate reusable at a
# 40-hex pin (or the local copy) and passes `with.context` equal to the context.
#
# Verified by `scripts/check-required-contexts.sh` (3-outcome 0/1/2) so a
# renamed or path-filtered workflow can never silently strand pull requests
# behind an unsatisfiable ruleset check (issue #219 class).
scan / gitleaks => .github/workflows/secret-scanner.yml
CI/gate => .github/workflows/proven-tests.yml
CI/gate => status:.github/workflows/ci-gate.yml
22 changes: 22 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,28 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning].

==== Changed

* `CI/gate` now also starts on `pull_request`, and a tamper guard is added.
`.github/workflows/ci-gate.yml` is rewritten from the suite's
`templates/ci-gate-caller.yml`: a same-repository `gate-pr` job on
`pull_request` posts `CI/gate` on the pull request that adds or changes the
gate, beside the existing `workflow_run`, `schedule` and `workflow_dispatch`
job `gate` (which skips `pull_request`). The new
`.github/workflows/ci-gate-tamper-guard-caller.yml` calls the suite's guard on
`pull_request_target`: a pull request that touches a gate file fails
`guard / check` until the owner applies the label `gate-change-approved`. The
guard is not a required context yet. Both callers pin
hyperpolymath/proven-cicd-and-workflows at `4e9e680b0dfd842a457cf23271f9e005a88f766c`,
the squash commit of hyperpolymath/proven-cicd-and-workflows#139 on its `main`;
`actions.lock` is edited by hand to match (`gh actions-lock` v0.2.0 cannot lock
cross-repository reusable workflows) and `scripts/check-lock-sync.sh` is the
authority. `tests/workflows/squabble_gate_test.sh` section 5b asserts the new
triggers, the jobs and their pins, and the guard caller's shape.
* The in-workflow aggregate job in `proven-tests.yml` is renamed from `CI/gate` to
`Proven suite verdict` (job id, `needs:` and verdict logic unchanged). The
context `CI/gate` is now a commit status published by `ci-gate.yml`, a thin
caller of the reusable in proven-cicd-and-workflows, which is its only
producer. `ci-gate.yml` is keyed in `actions.lock` as the lock-sync gate
requires.
* KYAML, step 5 of standards YAML-POLICY §5 (standards#1024): the three
estate-owned YAML files that no third-party bot rewrites are now KYAML
content: `build/container/compose.yaml`, `compose.example.yaml` and
Expand Down
Loading
Loading