Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
dc316f2
Merge pull request #319 from UOR-Foundation/release/v0.4
afflom Oct 26, 2026
b979396
Merge pull request #324 from UOR-Foundation/release/v0.4
afflom Oct 26, 2026
e193494
docs: restyle the README and add the repository logo
humuhumu33 Oct 27, 2026
b884aa8
Merge pull request #329 from UOR-Foundation/docs/readme-refresh
humuhumu33 Oct 27, 2026
63880cf
docs: simplify the README and use an ASCII logo
humuhumu33 Oct 27, 2026
c3f1ba6
Merge pull request #330 from UOR-Foundation/docs/readme-refresh
humuhumu33 Oct 27, 2026
51484f6
docs: use the enclosed LexLean logo image and tighten the README
humuhumu33 Oct 27, 2026
71defb4
Merge pull request #331 from UOR-Foundation/docs/readme-refresh
humuhumu33 Oct 27, 2026
a415210
Land a cut on main only when the line contains main; dispatch the gat…
claude Nov 13, 2026
90caf0b
Merge main into release/v0.4 so the line contains main
claude Nov 13, 2026
8230ae5
Merge the reconciled line (release/v0.4 containing main) into this br…
claude Nov 13, 2026
eb6f1df
Land, tag, and release a cut once its gate passes, with no hand merge
claude Nov 13, 2026
9f42f7f
Merge the cut auto-landing into this branch
claude Nov 13, 2026
feac64a
Leave an empty ## Unreleased after a cut, so the next cut finds one
claude Nov 13, 2026
8287848
Bind both automatic merges to what was verified
claude Nov 13, 2026
cbaaa5c
Serialize and verify the merge of a line into main
claude Nov 13, 2026
d0d58d2
Give the main-forward job contents: write, which merging needs
claude Nov 13, 2026
7f69921
Name this repository case-insensitively in the Intel run identity
claude Nov 14, 2026
b1cb0a8
Merge release/v0.4 (the line's equivalent Intel identity fix, #533)
claude Nov 14, 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
63 changes: 63 additions & 0 deletions .github/scripts/await-gate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/env bash
# The wait of `cut.yml` for the gate of a cut (SPEC.md §9.4): polls the runs
# of `ci.yml` on HEAD_SHA, the regenerated head `regenerate.yml` delivered and
# dispatched the gate on, until the newest pull request or dispatched run of
# it completes or WAIT_MINUTES pass. A run that completed `success` counts
# only when `.github/release-gate.sh` accepts it as the whole gate with every
# job passed, the evidence `release.yml` will read for the tag; so a cut lands
# on exactly what would release.
#
# Writes `state` to GITHUB_OUTPUT: `passed`, `failed` (the newest run failed,
# was cancelled, or passed without being the whole gate; exit 1), or
# `pending` (no verdict in time; exit 0, or exit 1 when FINAL is `true`, the
# last wait of the cut). A run re-run after a failure is the newest run again,
# so re-running the cut's failed jobs waits for it afresh.
#
# Inputs, from the environment: REPO, HEAD_SHA, WAIT_MINUTES, FINAL. `gh`
# reads the runs and jobs (`actions: read`); the checkout is HEAD_SHA.
set -euo pipefail

repo=${REPO:?REPO names owner/name}
head=${HEAD_SHA:?HEAD_SHA names the commit the gate runs on}
wait=${WAIT_MINUTES:-340}
final=${FINAL:-false}
out=${GITHUB_OUTPUT:-/dev/null}
summary=${GITHUB_STEP_SUMMARY:-/dev/null}
say() { printf '%s\n' "$1" | tee -a "$summary"; }

deadline=$((SECONDS + wait * 60))
while :; do
state=$(gh api "repos/$repo/actions/workflows/ci.yml/runs?head_sha=$head&per_page=30" \
--jq "[.workflow_runs[] | select(.head_repository.full_name == \"$repo\") | select(.event == \"pull_request\" or .event == \"workflow_dispatch\")][0] // empty | \"\(.status) \(.conclusion) \(.html_url)\"" \
2>/dev/null || true)
case "$state" in
"completed success "*)
if SHA=$head OUT="${RUNNER_TEMP:-/tmp}/gate-evidence.txt" .github/release-gate.sh; then
say "The gate passed on \`$head\`: ${state##* }"
echo "state=passed" >> "$out"
exit 0
fi
say "The newest run of \`ci.yml\` on \`$head\` passed without being the whole gate: ${state##* }"
echo "state=failed" >> "$out"
exit 1
;;
completed*)
echo "::error::the gate of $head did not pass: $state"
say "The gate of \`$head\` did not pass (${state##* }). Re-run its failed jobs, then re-run this run's failed jobs to land the cut; or fix the cut branch and merge its pull request by hand."
echo "state=failed" >> "$out"
exit 1
;;
esac
if [ "$SECONDS" -ge "$deadline" ]; then
break
fi
sleep 60
done

echo "state=pending" >> "$out"
if [ "$final" = true ]; then
echo "::error::the gate of $head did not finish in time: ${state:-no run yet}"
say "The gate of \`$head\` gave no verdict in time (${state:-no run yet}). Re-run this run's failed jobs to wait again, or merge the pull request by hand once it passes."
exit 1
fi
say "The gate of \`$head\` gave no verdict in $wait minutes (${state:-no run yet}); the next job waits on."
12 changes: 11 additions & 1 deletion .github/scripts/deliver-regenerated.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@
#
# Inputs, from the environment: REPO, COMMIT, BRANCH (may be empty), RUN_URL,
# REGENERATED (the downloaded `regenerated-<commit>` artifact), GITHUB_REF,
# GITHUB_STEP_SUMMARY. The checkout is COMMIT with the workflow token.
# GITHUB_STEP_SUMMARY. The checkout is COMMIT with the workflow token. Output,
# to GITHUB_OUTPUT: `head`, the commit the gate was dispatched on, when it was
# (`cut.yml` waits for that run and lands the cut on it); nothing otherwise.
set -euo pipefail

repo=${REPO:?REPO names owner/name}
commit=${COMMIT:?COMMIT names the regenerated commit}
branch=${BRANCH:-}
dir=${REGENERATED:?REGENERATED names the artifact directory}
summary=${GITHUB_STEP_SUMMARY:-/dev/null}
output=${GITHUB_OUTPUT:-/dev/null}
say() { printf '%s\n' "$1" | tee -a "$summary"; }

(cd "$dir" && sha256sum --check --quiet SHA256SUMS)
Expand Down Expand Up @@ -54,6 +57,12 @@ if [ -s "$dir/regenerated.patch" ]; then
fi
if git diff --cached --quiet; then
say "The regenerated tree of \`$commit\` is the committed tree: nothing to deliver."
# A caller's branch was pushed with the workflow token, which started no
# run: the gate is dispatched for it all the same.
if [ -n "${BRANCH:-}" ]; then
gh workflow run ci.yml --repo "$repo" --ref "$branch"
echo "head=$commit" >> "$output"
fi
else
paths=$(git diff --cached --name-only | wc -l)
{
Expand All @@ -71,6 +80,7 @@ else
# A plain push is a fast-forward or nothing.
git push origin "HEAD:refs/heads/$branch"
gh workflow run ci.yml --repo "$repo" --ref "$branch"
echo "head=$(git rev-parse HEAD)" >> "$output"
say "Delivered $paths regenerated paths to \`$branch\` as \`$(git rev-parse HEAD)\` and dispatched \`ci.yml\` there."
fi

Expand Down
159 changes: 153 additions & 6 deletions .github/workflows/cut.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# A release cut in one push (SPEC.md §9.4): the version commit, its
# regeneration, and the pull request that lands it on its line.
# regeneration, its gate, and its landing, tag, and release, with no hand step.
#
# git push origin release/vX.Y:refs/heads/cut/vX.Y.Z
#
Expand All @@ -8,10 +8,20 @@
# `## X.Y.Z`, commits that on the pushed commit, and opens the pull request
# from `cut/vX.Y.Z` into `release/vX.Y`. `regenerate.yml` then writes what the
# version moves (every build oracle names the compiler's version), delivers
# that to the branch, and dispatches the gate there. Merging the pull request
# is the decision to release: `tag.yml` tags the merge once its gate passes
# and `release.yml` publishes it. The pushed commit must be on the line, and
# the version must follow the line's and have no tag.
# that to the branch, and dispatches the gate there. `gate` and `gate-more`
# wait for that run (the gate takes hours, and a job may run six), `land`
# merges the pull request at the head the gate passed on, and `tag.yml`,
# called here because a merge made with the workflow token starts no run,
# tags the merge, dispatches `release.yml`, and carries the line to `main`.
# The pushed commit must be on the line, and the version must follow the
# line's and have no tag.
#
# What stops the landing leaves the pull request open, and a person's merge
# of it releases as before (`tag.yml` on the push): a gate that failed (re-run
# its failed jobs, then this run's failed jobs, and the cut lands), a gate
# with no verdict after two waits (re-run this run's failed jobs to wait
# again), no pull request, a line that moved since the cut, or a head pushed
# since the gate ran.
name: cut

on:
Expand Down Expand Up @@ -83,7 +93,7 @@ jobs:
-m "cargo xtask bump-version $VERSION: the workspace version, SPEC.md §2.3, RP-01, Cargo.lock, and the changelog's unreleased entries."
git push origin "HEAD:refs/heads/$GITHUB_REF_NAME"
echo "commit=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
body="Cuts LexLean $VERSION on \`$LINE\` (\`cut.yml\`). \`regenerate.yml\` writes what the version moves and dispatches the gate here. Merging releases: \`tag.yml\` tags the merge as \`v$VERSION\` once its gate passes, and \`release.yml\` publishes it. Edit the \`## $VERSION\` changelog section before merging if it needs a summary."
body="Cuts LexLean $VERSION on \`$LINE\` (\`cut.yml\`). \`regenerate.yml\` writes what the version moves and dispatches the gate here. Once that gate passes, \`cut.yml\` merges this pull request at the head it verified, tags the merge as \`v$VERSION\`, and \`release.yml\` publishes it; nobody needs to merge it. A push to this branch before then stops the automatic landing, and merging by hand releases as before."
if url=$(gh pr create --repo "$GITHUB_REPOSITORY" --base "$LINE" --head "$GITHUB_REF_NAME" \
--title "Release $VERSION" --body "$body" 2>&1); then
echo "Opened $url" >> "$GITHUB_STEP_SUMMARY"
Expand All @@ -106,3 +116,140 @@ jobs:
with:
ref: ${{ needs.version.outputs.commit }}
branch: ${{ needs.version.outputs.branch }}

# The gate of the delivered head: the run `regenerate.yml` dispatched,
# planned as the pull request's, which must be the whole gate and pass every
# job. Two waits, because the gate runs for hours and a job for at most six.
gate:
name: wait for the gate
needs: regenerate
if: needs.regenerate.outputs.head != ''
runs-on: ubuntu-24.04
timeout-minutes: 360
permissions:
contents: read
actions: read
outputs:
state: ${{ steps.wait.outputs.state }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ needs.regenerate.outputs.head }}
persist-credentials: false
- name: Wait for the gate of the delivered head
id: wait
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
HEAD_SHA: ${{ needs.regenerate.outputs.head }}
WAIT_MINUTES: "340"
run: .github/scripts/await-gate.sh

gate-more:
name: wait for the gate (continued)
needs: [regenerate, gate]
if: needs.gate.outputs.state == 'pending'
runs-on: ubuntu-24.04
timeout-minutes: 360
permissions:
contents: read
actions: read
outputs:
state: ${{ steps.wait.outputs.state }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ needs.regenerate.outputs.head }}
persist-credentials: false
- name: Wait for the gate of the delivered head
id: wait
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
HEAD_SHA: ${{ needs.regenerate.outputs.head }}
WAIT_MINUTES: "340"
FINAL: "true"
run: .github/scripts/await-gate.sh

# The merge of the pull request at the head the gate passed on, as a merge
# commit made here on the line's head B and pushed with a lease on B: B is
# an ancestor of the head, so the merge's tree is the head's, the evidence
# `ci.yml`'s plan and `release-gate.sh` accept for it (the push, made with
# the workflow token, starts no run of its own), and a line that moved after
# the check refuses the push instead of taking a tree nobody verified.
land:
name: land the cut
needs: [version, regenerate, gate, gate-more]
if: >-
!cancelled() && needs.regenerate.result == 'success'
&& (needs.gate.outputs.state == 'passed' || needs.gate-more.outputs.state == 'passed')
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: write
pull-requests: write
outputs:
merge: ${{ steps.merge.outputs.merge }}
line: ${{ steps.merge.outputs.line }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Merge the pull request at the verified head
id: merge
shell: bash
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
BRANCH: ${{ needs.version.outputs.branch }}
HEAD_SHA: ${{ needs.regenerate.outputs.head }}
REPO_OWNER: ${{ github.repository_owner }}
run: |
set -euo pipefail
pr=$(gh pr list --repo "$REPO" --head "$BRANCH" --state open --json number,baseRefName,headRefOid \
--jq '.[] | "\(.number) \(.baseRefName) \(.headRefOid)"')
if [ -z "$pr" ] || [ "$(printf '%s\n' "$pr" | wc -l)" -ne 1 ]; then
echo "::error::no single open pull request from $BRANCH; open it and merge it by hand"
exit 1
fi
read -r number line head <<< "$pr"
if [ "$head" != "$HEAD_SHA" ]; then
echo "::error::$BRANCH is at $head, not $HEAD_SHA where the gate passed; merge it by hand once its gate passes"
exit 1
fi
git fetch --quiet origin "+refs/heads/$line:refs/remotes/origin/$line"
base=$(git rev-parse "refs/remotes/origin/$line")
if ! git merge-base --is-ancestor "$base" "$HEAD_SHA"; then
echo "::error::$line moved to $base since the cut, so the merge would land a tree the gate did not verify; merge it by hand"
exit 1
fi
git checkout --quiet --detach "$base"
git -c user.name='github-actions[bot]' \
-c user.email='41898282+github-actions[bot]@users.noreply.github.com' \
merge --quiet --no-ff --no-edit \
-m "Merge pull request #$number from $REPO_OWNER/$BRANCH" -m "Release ${BRANCH#cut/v}, landed by cut.yml at the head its gate verified." "$HEAD_SHA"
if [ "$(git rev-parse 'HEAD^{tree}')" != "$(git rev-parse "$HEAD_SHA^{tree}")" ]; then
echo "::error::the merge's tree is not the tree the gate verified"
exit 1
fi
# The lease makes the push land only on the B checked above.
git push --force-with-lease="refs/heads/$line:$base" origin "HEAD:refs/heads/$line"
merge=$(git rev-parse HEAD)
echo "merge=$merge" >> "$GITHUB_OUTPUT"
echo "line=$line" >> "$GITHUB_OUTPUT"
echo "Merged #$number into \`$line\` as \`$merge\` at the verified head \`$HEAD_SHA\`." >> "$GITHUB_STEP_SUMMARY"

tag:
name: tag
needs: land
uses: ./.github/workflows/tag.yml
# A reusable workflow is validated against what its caller grants: `tag`
# pushes the tag, dispatches, and opens and merges the pull request into
# `main`.
permissions:
contents: write
actions: write
pull-requests: write
with:
commit: ${{ needs.land.outputs.merge }}
line: ${{ needs.land.outputs.line }}
10 changes: 9 additions & 1 deletion .github/workflows/regenerate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
#
# A push to `regenerate/**` starts it from any commit, because GitHub
# dispatches only a workflow its default branch carries. `cut.yml` calls it on
# the version commit of a release cut, naming the branch to deliver to.
# the version commit of a release cut, naming the branch to deliver to, and
# lands the cut once the gate passes on the head this returns (`head`).
name: regenerate

on:
Expand All @@ -41,6 +42,10 @@ on:
atlas:
type: boolean
default: false
outputs:
head:
description: The commit of `branch` the gate was dispatched on (the delivered head), or empty when nothing was delivered or dispatched
value: ${{ jobs.deliver.outputs.head }}

permissions:
contents: read
Expand Down Expand Up @@ -350,6 +355,8 @@ jobs:
contents: write
actions: write
pull-requests: read
outputs:
head: ${{ steps.deliver.outputs.head }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -359,6 +366,7 @@ jobs:
name: regenerated-${{ inputs.ref || github.sha }}
path: ${{ runner.temp }}/regenerated
- name: Commit the regenerated tree to the pull request and run the gate there
id: deliver
shell: bash
env:
GH_TOKEN: ${{ github.token }}
Expand Down
Loading
Loading