Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .github/bdd-parts.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,8 @@
"preservation-std": [
"SP-29"
]
},
"targets": {
"honesty": ["bdd"]
}
}
26 changes: 15 additions & 11 deletions .github/ci-plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# What a run of ci.yml is (SPEC.md §9.4), decided from the event and the
# repository alone, before any job that costs a runner starts.
#
# pull request, draft the `rest` leg only: a development signal
# pull request, ready, base the `rest` leg only, the same signal: only a pull
# pull request, draft honesty then the `rest` leg only: a development signal
# pull request, ready, base honesty then the `rest` leg only, the same signal: only a pull
# not main or release/* request into a line can land on it
# pull request, ready, base the whole gate
# main or release/*
Expand Down Expand Up @@ -40,7 +40,9 @@ out=${GITHUB_OUTPUT:-/dev/stdout}
summary=${GITHUB_STEP_SUMMARY:-/dev/null}

emit() {
printf 'full=%s\nrows=%s\n' "$1" "$2" >> "$out"
printf 'full=%s\nrows=%s\nhonesty=%s\nfanout=%s\n' "$1" "$2" \
"$(jq -c '[.[] | select(.part == "honesty")]' <<< "$2")" \
"$(jq -c '[.[] | select(.part != "honesty")]' <<< "$2")" >> "$out"
}

whole_gate() {
Expand All @@ -50,11 +52,11 @@ whole_gate() {

# The id of a pull request run of this workflow on the second parent of HEAD
# that ran every job of the gate and passed every one, when HEAD is a merge of
# that parent with the same tree. A draft run has only the `rest` leg, so it is
# that parent with the same tree. A draft run has honesty and the `rest` leg, so it is
# never one: the run must hold the join of Atlas, every host of the matrix, and
# every leg of the rows file, and no job that did not conclude `success`.
verified_parent_run() {
local parent head_tree hosts runs id names part
local parent head_tree hosts runs id names part job
parent=$(git rev-parse --verify --quiet 'HEAD^2') || return 1
head_tree=$(git rev-parse 'HEAD^{tree}')
[ "$head_tree" = "$(git rev-parse "$parent^{tree}")" ] || return 1
Expand All @@ -65,10 +67,12 @@ verified_parent_run() {
names=$(gh api "repos/$repo/actions/runs/$id/jobs?per_page=100" --paginate \
--jq '.jobs[] | "\(.name)\t\(.conclusion)"') || continue
if printf '%s\n' "$names" | awk -F'\t' '$2 != "success" { bad = 1 } END { exit bad }' \
&& printf '%s\n' "$names" | grep -qxF $'atlas (join)\tsuccess' \
&& printf '%s\n' "$names" | grep -xF $'atlas (join)\tsuccess' >/dev/null \
&& [ "$(printf '%s\n' "$names" | grep -c '^build and non-Lean tests (')" -eq "$hosts" ]; then
for part in $(jq -r '.[].part' "$rows_file"); do
printf '%s\n' "$names" | grep -qxF "just vv ($part)"$'\tsuccess' || continue 2
job="just vv ($part)"
[ "$part" != honesty ] || job=honesty
printf '%s\n' "$names" | grep -xF "$job"$'\tsuccess' >/dev/null || continue 2
done
printf '%s\n' "$id"
return 0
Expand All @@ -80,17 +84,17 @@ verified_parent_run() {
case "$event" in
pull_request)
if [ "$draft" = true ]; then
emit false "$(jq -c '[.[] | select(.part == "rest")]' "$rows_file")"
printf '%s\n' 'Draft pull request: the `rest` leg only. This run is not the gate; marking the pull request ready runs the whole gate.' >> "$summary"
emit false "$(jq -c '[.[] | select(.part == "honesty" or .part == "rest")]' "$rows_file")"
printf '%s\n' 'Draft pull request: honesty then the `rest` leg only. This run is not the gate; marking the pull request ready runs the whole gate.' >> "$summary"
else
case "$base" in
# An unknown base is not known to be stacked: the whole gate.
main | release/* | '')
whole_gate 'Pull request ready for review: the whole gate.'
;;
*)
emit false "$(jq -c '[.[] | select(.part == "rest")]' "$rows_file")"
printf 'Pull request into `%s`, which is neither `main` nor a release line: the `rest` leg only. A stacked pull request cannot land on a line; the pull request into `main` or a release line runs the whole gate.\n' "$base" >> "$summary"
emit false "$(jq -c '[.[] | select(.part == "honesty" or .part == "rest")]' "$rows_file")"
printf 'Pull request into `%s`, which is neither `main` nor a release line: honesty then the `rest` leg only. A stacked pull request cannot land on a line; the pull request into `main` or a release line runs the whole gate.\n' "$base" >> "$summary"
;;
esac
fi
Expand Down
8 changes: 5 additions & 3 deletions .github/release-gate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# tree is the tree of its second parent, a run on that parent. A run counts
# when every job of it concluded `success` and it holds the join of Atlas,
# every host of the matrix, and every leg of `.github/vv-rows.json`; a
# draft run, which has only the `rest` leg, never does. A tag on a commit no
# draft run, which has only honesty and the `rest` leg, never does. A tag on a commit no
# such run verified is refused, naming what was looked for.
#
# Inputs, all from the environment: REPO (owner/name), SHA (the tagged
Expand Down Expand Up @@ -42,14 +42,16 @@ jobs_of() {

# Whether a jobs listing is the whole gate, passed.
whole_gate_passed() {
local jobs=$1 part
local jobs=$1 part job
[ -n "$jobs" ] || return 1
printf '%s\n' "$jobs" | awk -F'\t' '$2 != "success" { bad = 1 } END { exit bad }' || return 1
# Quiet grep can close the pipe early and make printf fail under pipefail.
printf '%s\n' "$jobs" | grep -xP 'atlas \(join\)\tsuccess\t.*' >/dev/null || return 1
[ "$(printf '%s\n' "$jobs" | grep -c '^build and non-Lean tests (')" -eq "$hosts" ] || return 1
for part in $parts; do
printf '%s\n' "$jobs" | grep -P "^just vv \(\Q$part\E\)\tsuccess\t" >/dev/null || return 1
job="just vv ($part)"
[ "$part" != honesty ] || job=honesty
printf '%s\n' "$jobs" | grep -P "^\Q$job\E\tsuccess\t" >/dev/null || return 1
done
}

Expand Down
11 changes: 10 additions & 1 deletion .github/vv-rows.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[
{
"part": "honesty",
"recipes": "fmt-check model spec-links bdd",
"examples_part": "",
"bdd_part": "honesty",
"width": "",
"memory_kib": "",
"hints": ""
},
{
"part": "examples",
"recipes": "examples",
Expand All @@ -10,7 +19,7 @@
},
{
"part": "rest",
"recipes": "fmt-check model spec-links lint test features bdd inventory golden repro deny",
"recipes": "lint test features bdd inventory golden repro deny",
"examples_part": "",
"bdd_part": "rest",
"width": "",
Expand Down
59 changes: 50 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
# checkout", and a restored target directory is not one. CI runs its twelve
# recipes as the legs of `.github/vv-rows.json` at once, each its own clean
# checkout: `examples`, which here verifies every example but UOR Atlas, and
# `rest`, the other eleven in the order of `vv`, with the `bdd` rows below.
# `honesty`, format/model/spec-links and the BDD meta target first, then
# `rest`, the remaining recipes in order, with the `bdd` rows below.
# Together they run every recipe of `vv` exactly once, so the gate is the same
# and the wall time is the longest leg rather than the sum.
# and its wall time includes honesty followed by the downstream critical path.
#
# `bdd`, the conformance suite, was most of the `rest` leg's time, and it runs
# as the parts of `.github/bdd-parts.json` (§9.4): each `bdd-<part>` row runs
Expand All @@ -34,8 +35,8 @@
# from broken code.
#
# Which runs are the gate (§9.4): the `plan` job decides from the event alone.
# A pull request that is a draft runs the `rest` leg and nothing else, because
# a head pushed again before it is final should cost one job and not the whole
# A pull request that is a draft runs honesty then the `rest` leg, because
# a head pushed again before it is final should cost two jobs and not the whole
# gate; it is a development signal and the pull request is not mergeable on it.
# So does a ready pull request whose base is neither `main` nor `release/*`: a
# stacked pull request cannot land on a line, and the pull request that carries
Expand Down Expand Up @@ -109,6 +110,8 @@ jobs:
outputs:
full: ${{ steps.plan.outputs.full }}
rows: ${{ steps.plan.outputs.rows }}
honesty: ${{ steps.plan.outputs.honesty }}
fanout: ${{ steps.plan.outputs.fanout }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -124,17 +127,55 @@ jobs:
REPO: ${{ github.repository }}
run: .github/ci-plan.sh

# The existing model/spec-link recipes and complete BDD meta target own
# this row. Claim drift fails before expensive proof and supported-host jobs.
honesty:
name: ${{ matrix.part }}
needs: [plan]
if: ${{ needs.plan.outputs.honesty != '[]' }}
strategy:
matrix:
include: ${{ fromJSON(needs.plan.outputs.honesty) }}
runs-on: ubuntu-24.04
timeout-minutes: 30
env:
LEXLEAN_BDD_PART: ${{ matrix.bdd_part }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install the pinned Rust toolchain
run: rustup toolchain install
- uses: taiki-e/install-action@b6b84cf49ebfe0176417bdce007c624f0db37f20 # v2.86.2
with:
tool: just
- name: Run the honesty part of the acceptance gate
shell: bash
run: |
set -euo pipefail
mkdir -p ci-evidence
just --timestamp --timestamp-format '%s%.3f' ${{ matrix.recipes }} 2>&1 | tee ci-evidence/vv.txt
printf '[%s] %s\n' "$(date +%s.%3N)" 'vv part: every recipe passed' >> ci-evidence/vv.txt
- name: Summarize the run's timing and memory
if: ${{ !cancelled() }}
run: cargo xtask ci-summary --evidence ci-evidence
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ !cancelled() }}
with:
name: acceptance-gate-evidence-${{ matrix.part }}
path: ci-evidence
if-no-files-found: error
retention-days: 14

vv:
name: just vv (${{ matrix.part }})
needs: [plan]
if: ${{ needs.plan.outputs.rows != '[]' }}
needs: [plan, honesty]
if: ${{ needs.plan.outputs.fanout != '[]' }}
# A failing leg does not cancel the others: each leg's evidence is complete.
# The legs are the rows of `.github/vv-rows.json`, or only its `rest` row
# while the pull request is a draft.
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.plan.outputs.rows) }}
include: ${{ fromJSON(needs.plan.outputs.fanout) }}
runs-on: ubuntu-24.04
# Complete proof coverage is intentionally the long pole. GitHub-hosted
# jobs permit six hours; a shorter local-style timeout would turn complete
Expand Down Expand Up @@ -257,7 +298,7 @@ jobs:
atlas-prefix:
name: atlas (prefix)
if: ${{ needs.plan.outputs.full == 'true' }}
needs: [plan]
needs: [plan, honesty]
runs-on: ubuntu-24.04
timeout-minutes: 360
env:
Expand Down Expand Up @@ -806,7 +847,7 @@ jobs:
# own `xtask` and `repo-conformance`, which no host in this job runs.
host-matrix:
name: build and non-Lean tests (${{ matrix.target }})
needs: [plan]
needs: [plan, honesty]
if: ${{ needs.plan.outputs.full == 'true' }}
strategy:
fail-fast: false
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/honesty.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CONFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ the error registry does not sanction (R5, `ERRORS.md`).
| `RP-11` | `build` | Every public README capability claim is tied to a registered model ID and honesty level. |
| `RP-12` | `build` | A release is refused unless the complete release criterion and all required artifacts are satisfied. |
| `RP-13` | `build` | The ordinary workspace test phase excludes repo-conformance, the bdd phase alone runs its complete suite, and a test inventory proves that the two phases together equal the whole workspace test set with no test lost and none run twice, and that the parts of the committed bdd plan together equal the bdd phase with every test in exactly one part. |
| `RP-14` | `build` | The normative CI job runs every recipe of just vv in parallel legs that each start from a clean checkout on the standard ubuntu-24.04 runner, each recipe exactly once but bdd, which runs once per part of its committed plan on the row that names the part, the examples leg at the verification resource profile its matrix row names and without UOR Atlas, which the Atlas jobs of the same run verify as the shards of the committed plan and a join at that profile, every process once and nothing across runs, and the other legs at the default, with no cache, path filter, or skipped recipe, and each job uploads its CI evidence; a plan job decides what a run is from the event alone: a draft pull request, and a ready pull request whose base is neither main nor a release line, run the rest leg and no other job, a ready pull request into main or a release line, a request, and a push to main or to a release line run every job, and a push to main or to a release line that merges a head whose tree it equals runs none when the whole gate passed on that head, and runs the whole gate when any job of that run did not pass, was skipped, or is missing. |
| `RP-14` | `build` | The normative CI job runs every recipe of just vv in parallel legs that each start from a clean checkout on the standard ubuntu-24.04 runner, each recipe exactly once but bdd, which runs once per part of its committed plan on the row that names the part, the examples leg at the verification resource profile its matrix row names and without UOR Atlas, which the Atlas jobs of the same run verify as the shards of the committed plan and a join at that profile, every process once and nothing across runs, and the other legs at the default, with no cache, path filter, or skipped recipe, and each job uploads its CI evidence; a plan job decides what a run is from the event alone: a draft pull request, and a ready pull request whose base is neither main nor a release line, run honesty then the rest leg and no other gate job, a ready pull request into main or a release line, a request, and a push to main or to a release line run every job, and a push to main or to a release line that merges a head whose tree it equals runs none when the whole gate passed on that head, and runs the whole gate when any job of that run did not pass, was skipped, or is missing. |
| `RP-15` | `build` | Every match over a closed semantic enum (the IR, the production realization calculus, and its Rust AST) that names at least five of the enum's variants names all of them, with no wildcard or binding catch-all arm, so that a variant added to the enum is a compile error in each Lean, LaTeX, validation, charge, and calculus consumer and never a silent fallback; the audit rejects a catch-all planted in each consumer group and fails when a consumer it must read has no such match left. |
| `RP-16` | `build` | The development container installs, at image build, exactly the Rust toolchain that rust-toolchain.toml pins and exactly the Lean toolchain that lean-toolchain pins and selects no other default, so that nothing is fetched when a session starts, and a Dockerfile that names another version of either, installs a second toolchain, or selects an unpinned default is refused. |
| `RP-18` | `build` | The release workflow packages the lexlean crate twice to the same bytes, runs cargo publish --dry-run, and refuses a crate whose SHA-256 differs from the one release/checksums.txt lists for it or from the bytes cargo would upload, or whose archive lacks the metadata and size crates.io requires, and uploads to crates.io only when a CARGO_REGISTRY_TOKEN secret or trusted publishing authorises it; a commit of a release line release/vX.Y is published as the pre-release X.Y.0-dev.N, N being its number of first-parent commits, and a plant in each of these checks is refused. |
Expand Down
2 changes: 1 addition & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ features:
# target with one test per registered ID. `test` leaves all of it to this
# recipe, and `inventory` proves that between them nothing was lost or run
# twice. The meta-gate target alone, which needs no Lean, is what the
# honesty workflow runs (`cargo test -p repo-conformance --test bdd`).
# initial same-run honesty part owns (by the complete Cargo test target).
# `cargo xtask bdd` runs `cargo test -p repo-conformance --all-features`; in
# CI, `LEXLEAN_BDD_PART` names the part of `.github/bdd-parts.json` a job runs
# (§9.4), and unset, as here, the recipe runs the whole suite.
Expand Down
Loading
Loading