Skip to content

ci: add the required CI/gate check; declare the prover-only coverage exemption - #41

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/ci-gate-job
Nov 17, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
claude/ci-gate-job

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

The live Branch-Floor ruleset (25434034) requires a status check named exactly CI/gate, and no workflow reports it. That blocks #36 and #37. This PR adds the job. It does not touch #36, #37 or #96.

Changes

  • .github/workflows/proofs.yml: new job name: CI/gate, with needs: [proofs, lean-leg, rocq-leg, coverage-exemption] and if: always().
    • It runs scripts/ci-gate.sh, which fails on failure, cancelled, skipped, an empty needs, or malformed input.
    • Permissions are contents: read.
    • It lives in proofs.yml because needs: only reaches jobs in the same workflow, and those are the repo's real correctness legs. No reusable workflow for this exists in standards (checked: no CI/gate there, only required-contexts.yml and the coverage uploader for Rust), so none was reused.
  • .machine_readable/coverage-exemption.toml + scripts/check-coverage-exemption.sh + job coverage-exemption: the repo declares measurable-runtime-code = false, and CI checks that claim. It fails if runtime code appears under src/, outside a declared shrink-only pending list (src/interface, the Idris2/Zig scaffold that Port template fixes (rsr-template-repo #421 and earlier); remove the unused ABI/FFI scaffold #40 removes).
  • tests/workflows/ci_gate_test.sh: positive control, failure/cancelled/skipped/empty/malformed cases, a check that needs: lists every other job in proofs.yml, and a planted-runtime-code case.
  • CHANGELOG.adoc.

Testing

Run locally:

Check Result
tests/workflows/ci_gate_test.sh pass (10 cases)
check-lock-sync, check-required-contexts, check-root-shape, check-no-placeholders, check-action-pinning.js pass

Not run locally: shellcheck and asciidoctor are not installed in this environment. The real proof is the CI/gate check run on this PR (see the comment below once it reports).

Known limitations / owner-only items

  1. Pinning. The new uses: is actions/checkout@v7.0.1, the same ref proofs.yml already uses and actions.lock already lists. A raw SHA would desync actions.lock, and gh actions-lock is not available here, so I did not hand-edit the lock. Re-pinning to a SHA is a lock-tool run.
  2. Scope of the gate. It aggregates the proof legs and the exemption check. quality.yml, estate-rules.yml and the other PR workflows are not aggregated, because needs: cannot cross workflow files. Say if you want those folded in (reusable-workflow calls, or a check-run poller).
  3. The 80% code_coverage rule is in the live ruleset, not in any file here. An Agda repo uploads no Cobertura report, so the rule cannot pass, and uploading a fabricated report would be a lie. The honest fix is to remove the rule:
    gh api -X PUT repos/hyperpolymath/resource-algebra/rulesets/25434034 with the current body minus {"type":"code_coverage",…}. The canonical standards branch-floor.json has only deletion and non_fast_forward, and the estate already retired code_coverage from Base on 2026-10-02. Until then this PR's declared exemption is evidence for the change, not a bypass.
  4. The live ruleset has drifted from canon (it also carries linear history, signatures, a PR rule and CI/gate), so .github/rulesets/branch-floor.json no longer describes it.


Generated by Claude Code

The live Branch-Floor ruleset requires a status check named exactly
`CI/gate` but no workflow reported it. Add a gate job to proofs.yml that
aggregates the Agda, Lean and Rocq legs and the coverage-exemption check
with needs:, and fails on failure, cancellation, skipping or an empty set.

Declare the prover-only coverage exemption in
.machine_readable/coverage-exemption.toml and verify it in CI.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDf74BGYFzth9JRdGby
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 17, 2026 02:10
@hyperpolymath
hyperpolymath enabled auto-merge (squash) November 17, 2026 02:11
Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 17, 2026
Repository owner deleted a comment from chatgpt-codex-connector Bot Nov 17, 2026
@hyperpolymath
hyperpolymath merged commit dc5ac30 into main Nov 17, 2026
44 of 45 checks passed
@hyperpolymath
hyperpolymath deleted the claude/ci-gate-job branch November 17, 2026 02:12
hyperpolymath added a commit that referenced this pull request Nov 17, 2026
… in-workflow job to Proofs verdict (#43)

## Summary

Adds `.github/workflows/ci-gate.yml`, a thin caller of the reusable
`ci-gate.yml` in hyperpolymath/proven-cicd-and-workflows. It posts the
commit status `CI/gate` that the Branch-Floor ruleset (25434034)
requires and that nothing emitted. The suite publisher is now the only
producer of `CI/gate`.

**This is the bootstrap PR.** `CI/gate` cannot report on it:
`workflow_run` and `schedule` run only the workflow file on the default
branch, so the owner merges this PR past the gate once.

## Before merge

Pinned to the suite PR head 0862fe8 for review. Merge only after
proven-cicd-and-workflows#139 has merged, then re-pin to #139's merge
commit on the suite's main: the sweep triggers below are only complete
once the suite carries its sweep mode, and the lock record's `ref:
'main'` is only true after that. The re-pin touches `ci-gate.yml`, the
`actions.lock` key and record, and one row of
`tests/workflows/actions_lock_sha_refs_test.sh`.

After merge, every PR needs every check in
`profiles/ci-gate/hyperpolymath/resource-algebra.json` (schema v2,
workflow and job; re-read at 0862fe8, unchanged since 1d657fe):

- dogfood-gate.yml: 🔴 GATE: Empty-linter (invisible characters)
- empty-linter.yml: 🔴 GATE: Empty-linter (invisible characters)
- estate-rules.yml: estate-rules
- governance.yml: Estate Governance Policy
- lock-sync-gate.yml: actions.lock is in sync with the workflow YAML
- main-estate-audit.yml: Central Estate CI/CD Audit
- ossf-best-practices.yml: openssf-compliance
- proofs.yml: Core proofs and expected rejections
- proofs.yml: Lean recheck leg
- proofs.yml: Proofs verdict
- proofs.yml: Rocq recheck leg
- proven-tests.yml: Proven 3-outcome test & bench suite
- rust-ci.yml: Rust standalone tools and workspace gate
- secret-scanner.yml: scan / gitleaks
- secret-scanner.yml: scan / shell-secrets
- squabble.yml: Squabble CI chains & required-context gate

## Changes

- New `ci-gate.yml` caller: `workflow_run` with `types: [completed,
in_progress]`, job id `gate`, `with: context: "CI/gate"`.
- **Sweep triggers:** the caller also runs on `schedule` (`7,22,37,52 *
* * *`) and `workflow_dispatch`. Every 15 minutes it re-evaluates
`CI/gate` for open PR heads and the default branch. This bounds, but
does not eliminate, a stale status: statuses are last-writer-wins, and
GitHub may delay or skip scheduled runs. Permissions are `statuses:
write, actions: read, contents: read, pull-requests: read`
(`pull-requests: read` lists open PRs).
- **Typed status mapping in the squabble checker:**
`scripts/check-required-contexts.sh` accepts `<context> =>
status:<workflow file>`. For such a mapping it parses the workflow
in-process with `Bun.YAML`, the same as for plain mappings, and verifies
that:
  - the file exists;
  - it triggers on `workflow_run` with type `completed`;
- a job's `uses:` is
`hyperpolymath/proven-cicd-and-workflows/.github/workflows/ci-gate.yml@<40-hex>`
or the local `./.github/workflows/ci-gate.yml`;
  - that job passes `with.context` exactly equal to the context.

Any mismatch fails and names what is wrong. A plain mapping keeps its
meaning. It is in this PR because the checker must verify the publisher
this PR adds, and this PR is the one merged past the gate once. Same
change as rsr-template-repo (the source) and mathesis; tests are in
`tests/workflows/squabble_gate_test.sh`, section 5b. An earlier revision
spawned yq here, which tripped the benchmark regression gate (2.025x
against a 2.0x limit); in-process parsing brings it back to the main
baseline (12 ms median, the same as main).
- `.machine_readable/required-contexts-allow.txt` maps `CI/gate =>
status:.github/workflows/ci-gate.yml`, so the publisher is verified even
though no repo-local ruleset JSON lists the context.
- `tests/workflows/ci_gate_test.sh` (needs mikefarah yq v4, as
`actions_lock_sha_refs_test.sh` already does): the "no workflow job is
named `CI/gate`" negative reads parsed job names instead of a grep, so
plain, double-quoted and single-quoted spellings all count. Planted
controls for each spelling are detected, and an unrelated name is not
flagged.
- Reusable behaviour at 0862fe8: on an `in_progress` event it posts
pending as its first step, and it re-checks the runs before and after
every status write. Statuses stay last-writer-wins (the API has no
compare-and-swap), so a stale state can stand until a later evaluation;
the sweep mode that bounds this lands with the suite re-pin. The caller
therefore has no `concurrency:` block, which would only delay the
pending status.
- Onboarded in `actions.lock`: a workflow key plus a leaf dependency
record `hyperpolymath/proven-cicd-and-workflows@0862fe8…` with `ref:
'main'`, `commit`, `owner_id: 6759885`, `repo_id: 1326697643`, as the
suite README prescribes for consumers with a lock-sync gate.
- **Renamed the in-workflow job** `proofs.yml` `gate` from `name:
CI/gate` to `name: Proofs verdict`; the job id, `needs:` and verdict
logic are unchanged (from #41). `CI/gate` now belongs to the suite
publisher alone. Updated: workflow comments, `scripts/ci-gate.sh`
messages, `.machine_readable/coverage-exemption.toml` comment,
`.github/workflows/README.adoc`, and `CHANGELOG.adoc`. The CHANGELOG
entry was lost in the merge of main and is restored in ebd11ae.
- `tests/workflows/actions_lock_sha_refs_test.sh`: one row added to its
case table for the new SHA-keyed record. Nothing weakened.
- Drift, owner to decide: the repo-local `.github/rulesets/*.json` does
not list `CI/gate`, while the live ruleset requires it. The rulesets
JSON is not edited here.

## Testing

Compared against a worktree of origin/main, with actionlint and yq v4.

- `scripts/check-lock-sync.sh`, `bun scripts/check-action-pinning.js`,
`scripts/check-required-contexts.sh .`: pass. The checker reports 1
pull_request producer and 1 commit-status publisher verified.
- actionlint on `ci-gate.yml`: clean.
- Every `tests/workflows/*.sh`: no regressions against the baseline,
including `ci_gate_test.sh` and `squabble_gate_test.sh` (104 passed).

Not tested: no live run. End-to-end behaviour on GitHub, including the
schedule and the suite's sweep mode, is unproven until a caller is on a
default branch. Two known limits are left for the owner: third-party
checks are not counted by the gate, and anyone with write access can
post a `CI/gate` status by hand because the ruleset pins no integration.

## RSR Quality Checklist

### Required

- [x] Tests pass: the repo's fast checks (`scripts/check-lock-sync.sh`,
`bun scripts/check-action-pinning.js`,
`scripts/check-required-contexts.sh`, every `tests/workflows/*.sh`) were
run against an `origin/main` baseline, with no regressions. `just test`
itself was not run, because `just` and the prover toolchains are not
installed in this session.
- [x] Formatting: no formatter applies to the changed YAML, shell,
AsciiDoc and allow-file content. The changes follow the repo's existing
style.
- [x] Linter is clean: actionlint reports nothing on
`.github/workflows/ci-gate.yml`.
- [x] No banned language patterns: the diff has no Python, Go,
TypeScript, Deno or ReScript. The checker's embedded JavaScript runs on
Bun.
- [x] No `unsafe` blocks: not applicable (no Rust changes).
- [x] No banned functions: none are introduced.
- [x] SPDX headers: present on every new or modified source file,
including `ci-gate.yml` (`MPL-2.0`). `actions.lock` is machine-generated
and carries none, as before.
- [x] No secrets, credentials or `.env` files.

### As Applicable

- [ ] Repo deed `(status)` / `(maturity)`: not updated; project state is
unchanged.
- [ ] Repo deed `(ecosystem)`: not updated. The new suite dependency is
recorded in `actions.lock`.
- [ ] Repo deed `(meta)` / `docs/decisions/`: not updated.
- [ ] `docs/status/ROADMAP.adoc`: not updated.
- [x] Documentation: `.github/workflows/README.adoc` describes the
CI/gate publisher.
- [ ] `TOPOLOGY.md`: not applicable.
- [x] `CHANGELOG.adoc` updated.
- [x] New dependencies: the only one is the estate's own
`hyperpolymath/proven-cicd-and-workflows` reusable, pinned by full SHA.
No third-party licence change.
- [ ] ABI/FFI: not applicable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01J4QvDg8YzLVHtwwDfcY3J9

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* Added a `CI/gate` status check for pull requests from the same
repository, with scheduled, manual, and workflow-run updates.
* Added safeguards that require an owner-applied approval label for pull
requests changing protected CI gate files.
* **Changes**
* Renamed the workflow’s aggregate result to **Proofs verdict**; the
`CI/gate` status is published separately.
* Required-check configuration now supports commit-status checks
alongside pull-request workflow checks.
* **Documentation**
  * Added guidance on CI gate behavior, approval safeguards, and setup.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
hyperpolymath pushed a commit that referenced this pull request Nov 17, 2026
main moved six commits ahead (#36, #37, #41, #43, #44, #47). The branch's
proofs.yml predated #43's rename of the aggregating job to `Proofs verdict`,
so the CI/gate publisher reported "never reported: proofs.yml:Proofs
verdict" on this PR's head.

Conflicts: CHANGELOG.adoc keeps both sides' entries, newest first;
PROOF-STATUS takes main's revdate. The port's changelog line said the
gate's `-W noUnsupportedIndexedMatch` was unchanged; #37 removed it, so the
line now says the gate suppresses no warning and names the abbreviated and
split-pragma refusals.

coverage-exemption.toml: drop `pending-removal = ["src/interface"]`, whose
comment says to delete it when this PR merges; this PR removes the tree.
The exemption still holds, and a planted src/interface/*.zig is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDjDR2MdRwZH9b4rKJn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants