Skip to content

Design one landing door

Eric Stern edited this page Nov 17, 2026 · 3 revisions

land.yml is the one landing door: merge at main's tip, prove the seed, mint the scale row, consume the branch

STATUS: LANDED 3168004b7a37 (2026-11-17) REV: 1 BASE: 4bc653cd853f, tree clean, 2026-11-17

The issue: maxon-lang/maxon#229. The ruling it implements: maxon-lang/maxon#223, decisions 1–10 and "the job that holds the push credential never runs a compiler built from the branch". The ruling's chain part ("A chain land holds nothing") is maxon-lang/maxon#230 and is not this change: the chain path keeps working as it does at BASE.

1. The problem

Main has three doors, git push origin main, fleet.mjs land and land.yml. Each requires the candidate to descend from main's tip when the push happens. When main moves, the author rebases, rebuilds, re-gates and re-mints the scale row, although the commits it rebased over usually touch other files.

Today, on land.yml:

Program (a branch pushed, or dispatched) Actual Expected
one commit, Land: main, its base one commit behind main, touching a file main did not plan fails: "does not fast-forward origin/main — rebase onto it and push again" merged at main's tip and pushed
a commit whose Land: main line sits in the body, not the final paragraph plan prints "carries no Land: trailer — nothing to land", run green plan fails: "move it into the final paragraph"
a compiler change whose author read the ladder the author mints the row by hand, on a rebased tree, at their own path the door mints it on the merged tree, carried as a Scale-Note: trailer
a commit that adds a scale row by hand accepted refused, naming the trailer
two land runs pushed close together one shared concurrency group: a pending run is replaced and does not land both run; the compare-and-swap push serialises
a run that ends (landed or bounced) on a trailer-pushed branch the branch stays; the author deletes it by hand before re-pushing under the same name the run deletes it if it still points at the run's head
the land job checks out the branch and runs its land.sh with the App token (builds nothing today, but nothing keeps the merge and build out of it) the credentialed job runs git alone; merge, build and row are made in a job without the credential

2a. SOURCE facts

Full survey: kept by the planner (not in the repository). Paths relative to the repository root.

  • scripts/land.sh (677 lines). Subcommands submit [--rehearsal], chain, in-flight [--wait], plan, freeze, prove, publish, land, retract (usage :7-16, dispatcher :663-677).
    • Trailers: land_trailers() :102-105 uses git interpret-trailers --parse, case-insensitive key. A Land: line outside the final paragraph is not seen; landing_mode returns empty (:289) and command_plan writes kind none and returns 0 (:304-308). landed_message() :186-201 strips Land: lines from the final paragraph.
    • plan :297-364: base is origin/main (fetch_branch :98-100); the fast-forward refusal is :317; merge commits refused :320-321; a commit touching scripts/seed-tag refused :322-323; builds the head with the seed pinned at base via ./scripts/build-from-seed.sh in a worktree at temp/land-branch/tree (prepare_tree :128-151, build_prepared_tree :153-155); classify() :266-279: accepted+1 commit ordinary, accepted+>1 fail (squash), refused+1 fail, refused+>1 chain.
    • land :475-494: require_base_unmoved (:444-450, compares ls-remote tip with LAND_BASE), then a plain git push origin <tip>:refs/heads/main. Ordinary pushes the author's commit itself.
    • submit :630-661: pushes land/<12 hex of HEAD> (a fresh name per attempt), dispatches, polls the run, then deletes the branch itself (:653).
    • Nothing in land.sh touches the scale log.
  • .github/workflows/land.yml (196 lines). Push on **, !main and workflow_dispatch with input mode (rehearsal|main). Concurrency :17-19: group land-main for every real land, cancel-in-progress: false (a pending run is replaced). Workflow permissions contents: read. Jobs: plan (builds a compiler) · credential (App token probe, main mode) · chain · prove (matrix) · publish (contents: write) · land (:159-177: mints the App token, checks out the branch with it, runs land.sh land) · retract. The start test is contains(message, "\nLand:") (:18, :30), cruder than land.sh's parsed trailer — the mismatch behind the green "nothing to land".
  • Scale rows. scale-test is a compiler subcommand (maxon-bin/Main.maxon:48, Testing/ScaleTestRunner.maxon, ScaleHistory.maxon, ScaleDigest.maxon). --note records only into the tree the measuring compiler was built in place in (treeToRecord, ScaleDigest.maxon:114-130), with a staleness refusal on source mtimes. The tree digest covers the .maxon files of maxon-bin/, stdlib/, runtime/ (ScaleDigest.maxon:63-96). The corpus is generated into .scale-tmp/ under the cwd. --check-row digests the cwd tree against the last row (ScaleHistory.maxon:216-246).
  • scripts/check-scale-rows.sh fix texts: :45 RowFix ("re-run maxon scale-test --note=… on this tree; a row is minted last, after the rebase"), :46 EditFix. It runs in ci.yml:406-415 (--range … --compiler) and scale-rows.yml (--history-only); merge commits are skipped (:474-476).
  • docs/optimization-log.md header "How rows get here" :30-86 (rows appended by the tool, minted after the rebase), minted at/corpus semantics :88-110 (deltas print only when both match the previous row), CPU noise band :195 (measured locally). Last rows were minted at /home/user/maxon/..., older ones at Windows paths.
  • .gitattributes: docs/optimization-log.md merge=union is the only union file.
  • Build inputs. build-from-seed.sh (seed path build, then maxon run build in place); fetch-seed.sh, scripts/lib/{seed,host-binaries}.sh, scripts/seed-tag. ci.yml:11-12,59-63 counts maxon-bin/, stdlib/, runtime/, vendor/, project.maxon and scripts/{fetch-seed.sh,seed-tag,build-from-seed.sh,fetch-vendor.sh,lib/**} as build inputs.
  • Docs that describe the door: docs/RELEASING.md:67-138 ("Landing a branch — land.yml", the concurrency paragraph :103-111, "How a commit reaches main" :124-133), :459-464 (the landing App). /land §4 :213-228, §7 :259-271 (in-flight wait, pull --rebase), §8 :273-301 (the row gate :289), §9 :303-335 (git push origin main, rejected push = re-gate and re-mint, "the push ends the change"). situations.md:227-234 ("A rejected push"). compiler-workflow "Landing a commit with its own seed" :208-251.
  • Host: this machine's git is 2.36 (no merge-tree --write-tree, which needs 2.38). The door's merge runs on the runner only.

2b. SPEC-SURFACE facts

  • Which specs files own this behaviour: none. The door is a workflow and a shell script; no spec, tests/ corpus or self-test exercises land.sh, land.yml or check-scale-rows.sh.
  • Existing cases that touch it: the tests/cli/scale-test-*.maxtest cases (15) pin scale-test --note / --check-row behaviour, which this change does not alter; ScaleHistorySelfTest.maxon likewise. Nothing pins the door.
  • Neighbouring cases: none. The issue's acceptance is runner rehearsals (§6), which is the only place this behaviour runs.

3. The approach

One git-only merge procedure in land.sh, called by an uncredentialed job that also builds and mints, and again by the credentialed job that only re-merges and pushes.

  1. Trailers — one predicate. A commit's Land: and Scale-Note: are read by one function over interpret-trailers --parse. If the message holds a line with either key that the parse did not return, the plan fails: "the Land: line is not in the commit's final paragraph — move it into the final paragraph" (and the same for Scale-Note:). The workflow's crude start test stays crude, so the run starts and fails.
  2. Base is merge-base(origin/main, head); the fast-forward refusal goes for ordinary lands. A chain still requires base == origin/main (its path is #230's), with a fix naming the rebase.
  3. Refuse a hand row. If base..head changes any row of the three history tables, the plan fails, naming the Scale-Note: trailer. The table is read by the one reader check-scale-rows.sh already has (open choice 2).
  4. Classify as today (build the head with the seed pinned at its base). Ordinary only from here; the chain path is untouched.
  5. Merge at the tip (merge_onto <tip> <base> <commit>): the overlap set is (files changed base..commit) ∩ (files changed base..tip) minus files whose merge attribute is union (read with git check-attr against the tip's tree). Non-empty: bounce, naming the files and "rebase by hand and submit again". Empty: git merge-tree --write-tree (with the attribute source pinned to the tip, so union is honoured whatever the checkout holds) and commit-tree onto the tip with the author's identity and date, the message less its Land: line, the committer the bot. Main always receives this commit, so every land has one shape.
  6. Prove the seed (decision 4): seed_inputs_differ <treeA> <treeB> compares, by git tree/blob id, maxon-bin/, stdlib/, runtime/, vendor/, project.maxon, maxon.maxtasks, scripts/seed-tag, scripts/build-from-seed.sh, scripts/fetch-seed.sh, scripts/fetch-vendor.sh, scripts/lib/ (open choice 3). Same as the built head: skip. Different: check out the merged tree in the same worktree and build-from-seed.sh with the seed pinned at the tip; a refusal bounces.
  7. Mint the row (decision 5): with a Scale-Note:, run maxon scale-test --note=<note> in temp/land-branch/tree holding the merged tree, with the compiler built there (the head's build when step 6 skipped — the seed inputs, and so the files' mtimes, are unchanged by the checkout). The log blob joins the merged tree; the landed commit is written with it. A refused note bounces. Every row is minted at one runner path with one corpus.
  8. Hand-off. The plan job (contents: read, no secret) uploads the landed commit as a git bundle artifact and outputs the tip it merged onto (T1) and the landed sha.
  9. The push job (land) holds the App token and runs git alone — no build, no maxon. It fetches the bundle and main (T2). T2 == T1: push with --force-with-lease=refs/heads/main:T1. T2 != T1: if seed_inputs_differ T1 T2 is false, re-merge with merge_onto T2 T1 <landed> (the overlap check runs again; a concurrent row in the union log merges, ours last) and push with the lease on T2; a rejected lease repeats this, bounded (3). If main moved by a seed input, the job re-dispatches the run (workflow_dispatch with an attempt input, actions: write, bounded at 3), or bounces when the bound is spent. It records the sha main received as a ::notice title=landed::<sha> annotation.
  10. No concurrency group (decision 7). Chain runs stay guarded by require_base_unmoved as today.
  11. Consume the branch (decision 6): a final consume job (if: always(), contents: write, GITHUB_TOKEN, no build) deletes the run's branch with a compare-and-swap push (--force-with-lease=refs/heads/<b>:<head> :refs/heads/<b>), so a branch re-pushed meanwhile is kept. It skips a run that re-dispatched itself. submit stops deleting, and pushes to one name per local branch (land/<local branch>), so a rewritten commit goes up under the same name with a plain push; a push rejected because the name still exists means a run of it is still going.
  12. The verdict ends the change (decision 9): land.sh await <branch> <head> (split out of submit, used by it) waits for the run and prints the sha main received, read from the annotation. It serves the Land: main trailer route too.
  13. Rehearsal reaches every path. A rehearsal runs every ordinary step and never pushes; the land job runs without a token and stops before the push, printing the commit it would push. Rehearsal-only dispatch inputs tip and moved stand in for main's tip at plan time and at push time, so the re-merge, the union merge, the overlap bounce and the seed-input re-dispatch decision are rehearsable without touching main. They are refused in main mode.
  14. Docs: docs/RELEASING.md "Landing a branch" and "How a commit reaches main" rewritten for one door (decisions 1–10), the landing-App paragraph for the job split; docs/optimization-log.md header (rows minted by land.yml on the runner from a Scale-Note:; the CPU noise band re-measured for the runner from the rehearsals); check-scale-rows.sh RowFix/EditFix name the trailer; /land §4 (settle the note as the trailer), §7 (no rebase for the door; the in-flight chain wait stays until #230), §8 (the row gate goes), §9 (submit or Land: main, the run's verdict and the sha main received end the change; a bounce is rebase by hand + re-take only what moved + submit under the same name); compiler-workflow chain section (no fast-forward, branch consumed by the run).

Rejected:

  • Push the author's commit unchanged when it is already a fast-forward with no note — two shapes on main for one door; the landed commit is always the door's.
  • Pass the merged tree to the push job as a workflow output — a tree is not an output; a bundle carries the objects and is verified by git bundle verify.
  • Hold the merge, build and push in one job with the App token — the ruling forbids it.
  • Plan job pushes the candidate to a scratch ref for the push job — it would need contents: write in the job that runs the branch's compiler.
  • Delete the branch with gh api after reading its sha — a race deletes a branch re-pushed between the read and the delete; the lease does not.
  • A fresh branch name per submit (today's land/<sha>) — ruled out by #223.
  • Rehearse the union and re-merge paths with real main lands — lands throwaway commits on main.

4. Blast radius

One implementer (one partition), with the docs pass after:

  • scripts/land.sh — trailers, base, hand-row refusal, merge_onto, seed_inputs_differ, minting, bundle, push/re-merge/re-dispatch, consume, submit/await.
  • .github/workflows/land.yml — concurrency removed, tip/moved/attempt inputs, plan uploads the bundle, land runs git alone in both modes, consume job.
  • scripts/check-scale-rows.sh — fix texts (and, open choice 2, the table reader made sourceable).
  • docs/RELEASING.md, the header prose of docs/optimization-log.md, .claude/skills/land/SKILL.md §4 §7–§9, .claude/skills/compiler-workflow/SKILL.md chain section; open choice 4: .claude/skills/land/situations.md "A rejected push".

5. Obligations

  • No compiler, runtime or stdlib source changes; no self-compile, no seed chain, no error code, no cross-target arm.
  • No RELEASE_NOTES.md entry (a workflow and tooling change, per the issue).
  • docs/ source: docs/RELEASING.md owns the door; regenerate the site (node website/scripts/sync-docs.mjs) if it is a synced source.
  • Lint: bash -n and shellcheck on land.sh and check-scale-rows.sh; actionlint on land.yml if available.
  • Nothing about any agent fleet in a commit, the docs or this page.

6. Candidate acceptance — runner rehearsals on throwaway branches of maxon-lang/maxon

# Rehearsal Asserts Red today because
R1–R3 three dispatches of one tree with a Scale-Note:, started together, mode=rehearsal all three run to completion (none cancelled); identical Allocations and Bytes rows; their CPU rows give the runner's noise band the shared group replaces pending runs; nothing mints a row
R4 tip = main, moved = a commit on main's tip that appends a row to all three tables the land job re-merges with git alone; the union log holds both rows, ours last; check-scale-rows.sh --range passes on the result the plan refuses a non-fast-forward; the land job does not merge
R5 a branch based one commit behind main, touching a file the newer commit did not merged at the tip; seed proof skipped or run per the predicate "does not fast-forward"
R6 a commit with its Land: rehearsal line in the body the plan fails naming "move it into the final paragraph" green "nothing to land"
R7 a branch changing a file tip also changed → bounce; the run deletes the branch; a fixed commit pushed under the same name with a plain push bounce names the file; branch gone without a hand delete; second run proceeds non-fast-forward refusal; the branch is never deleted on the trailer route
R8 a commit adding a row by hand refused naming Scale-Note: accepted
R9 moved changes a seed input the land job chooses re-dispatch (rehearsal: one re-dispatched rehearsal run, bounded) no such path
— structural: the land job's steps no build step, no maxon invocation; merge/build/row only in plan (contents: read) land checks out with the App token today
— the change lands itself: its own commit carries Land: main and goes through the new door main receives the door's commit; the annotation names its sha —

7. Staging

ONE /land.

8. Open questions

  1. Rehearsal-only tip/moved inputs (step 13) — workflow surface whose only purpose is rehearsing paths that otherwise need main to move. Recommended: add them, refused in main mode.
  2. The hand-row check's table reader. Recommended: make check-scale-rows.sh's table extraction a sourced function (scripts/lib/) that land.sh also calls, rather than a second awk parser — this widens check-scale-rows.sh beyond "fix text only".
  3. The seed-input predicate includes vendor/, project.maxon, maxon.maxtasks and scripts/fetch-vendor.sh beyond the ruling's list, because ci.yml counts them as build inputs. Recommended: include them.
  4. .claude/skills/land/situations.md "A rejected push" becomes false under the door. Recommended: rewrite it in this commit (outside the listed area).
  5. Out of area, left alone: fleet.mjs land and .claude/agents/orchestrator.md (the fleet's fast-forward door), .claude/skills/assign-task, .claude/skills/fannkuch-iterate ("a push rejected …"). Recommended: a follow-up issue, not this commit.
  6. Rehearsal also consumes the branch (decision 6 does not distinguish modes). Recommended: yes.
  7. Landing this change through its own door (Land: main on its branch). Recommended: yes — it is the only proof of the main-mode path.
  8. #224 (/land: re-take only results whose inputs changed) also edits /land SKILL.md; whichever lands second takes the other's text.

9. Amendments

  • 2026-11-17: on the runner (git 2.56.1) git merge-tree --write-tree honours merge=union only from the worktree's attributes or an attribute source: with neither (a bare clone, or the file removed) the two appended rows conflict; git --attr-source=<tip> merges them, the first-named side's row first. merge_onto pins the attribute source to the tip and names the tip first, so the landed row is last.
  • 2026-11-17: rulings on section 8: 1 yes; 2 yes (the table reader moves to scripts/lib/); 3 yes; 4 yes; 5 not in this change; 6 yes; 7 yes.