Repository navigation
Design landing from a branch
A commit the pinned seed refuses lands from a branch: CI freezes, proves and publishes its seed before main moves
STATUS: APPROVED 2026-11-16 (REV 2 folds in the ruling's amendments A1–A12) REV: 2 BASE: 997636dfb662, tree clean, 2026-11-16
The issue and its ruling: maxon-lang/maxon#80.
Today a commit the pinned seed refuses (E2015, E3004, a new language form, E3092) reaches main only through scripts/pin-seed.sh. That script runs on a machine that can create a GitHub release, push a tag, push main, and reach WSL and the shared Mac to prove lanes. A session that can push only its own branch can do none of this, so it cannot land such a commit at all. The script also freezes the local slot, which was built through intermediate trees that no commit records, so nothing on main can rebuild that seed.
What proves it fixed: a seed-pinning change, pushed to a branch, lands on main with a new seed-* pre-release pinned in scripts/seed-tag, and every step runs in GitHub Actions. The chain that built the seed stays reachable from a published ref. A run that fails or is cancelled leaves none of its objects behind and does not move main.
-
scripts/pin-seed.sh(565 lines) does these steps in order: preconditions,freeze-seed.sh, local or WSL/Mac proofs, push the tag, create the release, fetch it back, commit the pin, pushmain. A retract trap covers failure. About 250 of its lines reach WSL and the shared Mac. -
scripts/freeze-seed.shcross-builds all four native targets with the slot compiler and writes the archives,SHA256SUMSandNOTES.mdtotemp/seed/dist/. It refuses an uncommitted compiler source and a stale slot. The tag isseed-<date>-<first 12 of HEAD>. -
scripts/lib/seed.sh: the release helpers, all REST throughgh api. -
scripts/fetch-seed.sh TAG LANE --from=DIRinstalls a frozen seed from local archives, checked againstSHA256SUMS. -
scripts/build-from-seed.sh:.bootstrap/maxonbuildsC1, thenC1buildsC2into the slot. -
.github/workflows/ci.ymlruns onpush: main,pull_requestandworkflow_dispatch. It reads its lanes frommaxon-bin/targets.tsvthroughscripts/targets/matrix.sh.tests/targetsfails any workflow line that spells a target name. - Repository rules:
mainis unprotected. The one ruleset coversrefs/tags/v*. - A push or release made with
GITHUB_TOKENstarts no other workflow. Five workflows run onpush: main, and four run onrelease: published.
No spec or test reads the scripts or the workflow, except that tests/targets checks that no workflow spells a target. The acceptance is runs of the workflow (§6).
The new workflow is .github/workflows/land.yml. Its logic is in scripts/land.sh, one subcommand per job, so the YAML holds no logic. scripts/pin-seed.sh is deleted.
Trigger (A3).
-
Push: a push to any branch other than
main. Tags never trigger. The run proceeds only when the head commit carries aLand:git trailer.- A cheap first condition skips runs whose message cannot hold the trailer.
-
land.sh planthen parses the trailers exactly. An unknown value, or more than oneLand:trailer, is an error.
-
Dispatch: a
workflow_dispatchwith the inputsbranchandmode, wheremodeismainorrehearsal. - Starting a run needs write access either way.
Classification (A2) comes from the pinned seed's verdict on the head tree (build-from-seed.sh) and the number of commits since origin/main:
| Commits | Seed verdict | Result |
|---|---|---|
| 0 | — | "nothing to land" |
any, not a fast-forward of main
|
— | "rebase onto origin/main" |
| 1 | accepted | ordinary: fast-forward main to the head commit, unchanged |
| more than 1 | accepted | error: an ordinary land is one commit |
| 1 | refused | error: prints the seed's diagnostic and names the fix (commit the intermediate tree before it) |
| more than 1 | refused | chain |
The chain (A1).
- The pinned seed builds the first commit. Each later commit is built by its predecessor's compiler, using
build-from-seed.sh's two stages. A failed step names the commit. - The landed commit
Shas the head's tree andorigin/mainas its parent. Its message is the head's message, without theLand:trailer, plus oneBootstrap-Chain: <sha>trailer per chain commit, in order. It keeps the head's author and author date. - The committer is
github-actions[bot], with the time the plan job recorded. Every job therefore recomputes the sameS, and the pin commitP, from the plan's outputs and checks the sha, with no bundles passed between jobs. - The seed's
NOTES.mdlists the chain. - The never-moved ref
refs/tags/<seed-tag>-chain, on the head commit, is published with the seed and retracted with it. - The intermediate commits never reach
main, andmainstays linear. -
docs/RELEASING.mdsays how to rebuild: fetch the chain ref, then runscripts/land.sh chain <S>^ <seed-tag>-chain, the same walk the workflow runs, with the parent's pinned seed.
Jobs.
| Job | Runs on | Permissions |
|---|---|---|
| plan | ubuntu-latest |
contents: read, no secret |
| credential | — | only main mode |
| chain | ubuntu-latest | chain only, contents: read
|
| prove | native matrix from matrix.sh
|
chain only, contents: read
|
| publish | — | chain only, contents: write, GITHUB_TOKEN
|
| land | — |
main mode only |
| retract | — | chain only, contents: write
|
-
plan. Mode and trailer, fast-forward check, commit count, the seed's verdict, classification. Records the tag
seed-<UTC date>-<first 12 of S>and the committer time, and refuses a tag or release that already exists. -
credential. Mints the GitHub App token, requesting
contents: writeandworkflows: write, and drops it. A missing or under-permissioned App fails here, before anything is published. -
chain. Walks the chain, checks out
S, runsfreeze-seed.sh, appends the chain toNOTES.md, and uploadstemp/seed/dist/. -
prove. On every lane:
fetch-seed.sh <tag> <lane> --from=<dist>, then one self-compile with the frozen seed. "Which lanes to prove" is deleted. -
publish.
- Re-checks that
origin/mainis stillS's parent (A4). - Pushes the tag on
Sand the chain ref on the head commit. - Creates the pre-release, which starts none of the
release: publishedworkflows. - Fetches every target back against
SHA256SUMS. - Records
P's sha.
- Re-checks that
-
land. Mints the App token just before the push (A6). Pushes
SandPtomain, or the ordinary head, in one non-force push. Never runs inrehearsalmode. -
retract (A5),
if: always(). Runs after a failure, after a cancellation, and always in a rehearsal.- It deletes only objects whose names carry this run's
S: the release, the seed tag and the chain ref, each checked againstSor the head commit before it goes. - It retracts nothing when
mainholdsP. - It retracts nothing, and fails, when
maincannot be read. - It is idempotent, so re-running the job is safe.
- It deletes only objects whose names carry this run's
Concurrency (A4).
- Every land run shares one
land-maingroup, with no cancellation. A run skipped for having no trailer joins a group of its own, so it never displaces a pending land. - A run replaced while pending is reported as "not landed, push again".
- The workflow never rebases.
Credentials (A6).
-
GITHUB_TOKENcreates the tag, the chain ref and the release. - The push to
mainuses an installation token of a GitHub App installed on this repository alone, withcontents: writeandworkflows: write. The secrets areLAND_APP_IDandLAND_APP_PRIVATE_KEY, referenced only by the credential and land jobs. Jobs that build branch compilers hold neither. - A personal token is ruled out.
docs/RELEASING.md's secrets table gains both rows.
Rehearsal (A3, A10). Land: rehearsal as a trailer, or mode=rehearsal on a dispatch, runs everything, publish and fetch-back included. It never mints the token that pushes main, and it always retracts. It is permanent and usable by any pusher.
Local entry point (A7). scripts/land.sh submit [--rehearsal] pushes HEAD to land/<first 12 of HEAD> and dispatches land.yml on it. It follows the run to its end, reports the outcome and deletes that branch. It refuses a HEAD that carries a Land: trailer, because the push alone would also start a run.
/land's push step (A8).
- An ordinary commit from a session that can push
main:git push origin main, unchanged. - A seed-refused commit from any session: only through
land.yml, either by pushing a chain branch whose head carriesLand: mainor withland.sh submit. - An ordinary commit from a session that can push only its branch: one commit with
Land: main. - The outcome is read from the head commit's check runs (A9). A chain's
Sis found by itsBootstrap-Chain:trailer.
Alternatives rejected:
- An uploaded slot binary: there is no upload path, and it cannot be rebuilt.
- The chain's commits on
main:mainwould hold commits its own seed refuses. - A separate bootstrap ref: a session can push only its own branch.
- A chain inferred from commit count.
- Landing on every branch push.
- A personal token.
- A rehearsal that can push
main. - Passing
Sbetween jobs as a bundle: a deterministicSneeds no artifact. - Keeping
pin-seed.shin any form.
-
New:
.github/workflows/land.yml,scripts/land.sh. -
Deleted:
scripts/pin-seed.sh. -
Edited:
scripts/lib/seed.sh, the headers ofscripts/freeze-seed.sh,scripts/fetch-seed.shandscripts/build-from-seed.sh, anddocs/RELEASING.md. -
Mentions rewritten:
/land§8–§9,/plan-and-landStaging,compiler-workflow, thereleaseskill,maxon-bin/AGENTS.md. - One implementer.
- No compiler, runtime, target or error code changes.
- The documentation source is
docs/RELEASING.md, thennode website/scripts/sync-docs.mjs --check. - Gates:
tests/targets(no workflow spells a target),shellcheck-clean scripts, andcheck-ignored-files.py.
- Rehearsals of every refusal in the classification table.
- A toy chain rehearsal: all four proofs green, the pre-release and both refs published, fetched back, and gone at the end. It publishes and deletes one pre-release, so it runs only with a go-ahead.
- This change lands itself as an ordinary one-commit land touching a workflow, after the two in-flight
pin-seed.shlands. - The first real chain land.
- A moved-
mainrun that fails with nothing published.
ONE /land (A12).
None. The App and its two secrets are created by the user.
- 2026-11-16, REV 2: the ruling's A1–A12 are folded in.
- The chain ref and the
Bootstrap-Chain:trailer. - Classification by the seed's verdict.
-
Land:as a trailer, withrehearsal. - The re-check before publishing.
- Retraction on cancellation.
- The GitHub App credential.
-
pin-seed.shdeleted. -
/land's push rules. - Deterministic
SandPreplace the bundle artifact.
- The chain ref and the
The ruling on maxon-lang/maxon#80 adds two amendments:
-
A13:
mainis re-checked at the start of every job and between chain-walk steps, and the publish check stays authoritative. -
A14: an in-progress, non-rehearsal chain run of
land.ymlis the hold.scripts/land.shreports it, and/landchecks it before its rebase and beforegit push origin main. No stored marker exists.