Skip to content

Design chain land holds nothing

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

A bootstrap chain land holds no other push: merge the chain at the tip, cross-build re-prove, retract by pinned tag

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

The issue: maxon-lang/maxon#230. The ruling it implements: maxon-lang/maxon#223, "A chain land holds nothing" and "The job that holds the push credential never runs a compiler built from the branch". The ordinary door it builds on: Design-one-landing-door (#229).

1. The problem

A chain land requires main to stand still from its plan to its push, about 27 minutes: the plan refuses a chain whose base is not main's tip, and chain, prove, publish, land and every chain-walk step re-check require_base_unmoved. /land §7 and §9 make every other author wait on scripts/land.sh in-flight --wait meanwhile, so one chain holds every land.

Program (a branch pushed, or dispatched) Actual Expected
a bootstrap chain whose base is behind main's tip, touching files main did not plan fails: "lands only on origin/main's tip — rebase onto it and push again" freeze, prove and publish run on the chain as pushed; S (on the chain's merge-base) is merged onto the tip as S', the pin is written on S'
main moves while a chain runs the next guarded step fails "moved past … — nothing published"; the author rebases and runs the 27 minutes again the run carries on; the land step merges at the tip it finds
any other land while a chain runs /land waits on land.sh in-flight --wait lands at once
a chain whose merge onto the tip changed a seed input (unreachable) the merged tree is built with the new seed for every native target, cross-built on one runner; a refusal retracts the seed and bounces
retract after a chain land keeps the seed only when main holds this run's pin commit keeps it when main pins the tag, whatever commit carries the pin

2a. SOURCE facts

Paths relative to the repository root, at BASE.

  • scripts/land.sh (1282 lines).
    • The hold: require_base_unmoved :807-813 (compares ls-remote main with LAND_BASE), fail_base_moved :803-805; called by walk_chain per step through WalkGuarded (:290-294), command_freeze :758, command_prove :776, command_publish :819, land_chain :963 (whose push is a plain non-force push, :967). command_chain walks WalkUnguarded (:735).
    • in-flight: command_in_flight :1081-1104, landing_chain_runs :1063-1079, run_is_landing_chain :1047-1061; constants RunStatusesInFlight, JobChain, JobCredential, InFlightPollSeconds, InFlightNone :53-59. JobPlan and run_jobs are also used by await (newest_planned_run :1106, run_annotations :1127) and stay.
    • Chain plan :674-686: refuses a Scale-Note:; require_no_stand_ins (rehearsal tip/moved refused for a chain); [ "$base" = "$tip" ] || fail … (:677); S = commit_from(head, chain, head^{tree}, base); tag seed-<date>-<S12>; require_tag_free; pin = make_pin(S, tag).
    • make_pin :377-385: one commit on landed setting scripts/seed-tag, message "The tree is built with , frozen from ". recreate_landed / recreate_pin :388-402 recompute S and the pin from the plan's outputs (deterministic: bot committer at LAND_COMMITTED).
    • The ordinary machinery this change reuses: merge_onto <tip> <base> <commit> :479-492 (overlap check less merge=union, git --attr-source=<tip> merge-tree --write-tree, commit_from onto the tip); seed_inputs_differ :417-427 over SeedInputs :128-140; standing_tip <mode> <moment> :597-629 (plan moment: tip > main; push moment: moved > plan's tip > main; main mode refuses stand-ins); redispatch / dispatch_land :855-883 (bounded by attempt, MaxLandAttempts=3); the compare-and-swap push loop in land_ordinary :919-960 (MaxPushAttempts=3); record_landed annotations read by await.
    • commit_from <source> <chain> <tree> <parent> :356-363 → landed_message :312-344 strips Land: and appends one Bootstrap-Chain: trailer per chain commit.
    • command_retract :1020-1040: keeps the seed when LAND_PIN is an ancestor of origin/main; otherwise deletes the release (after checking the tag is on LAND_LANDED), the tag and the -chain ref, each checked against this run's commits.
  • .github/workflows/land.yml (276 lines). Jobs plan → credential (main mode) / chain (freeze) → prove (native matrix, checks out the head) → publish (contents: write) → land (App token; runs for a chain only in main mode, :205) → retract (if: … chain && (rehearsal || land != success), :247-249) → consume. Plan outputs include pin; *plan-env passes LAND_PIN to every chain job. Inputs mode, head, tip, moved, attempt.
  • scripts/freeze-seed.sh already cross-builds on one Linux runner: maxon run build --target=<t> --output=… for every target in $MaxonTargets. prove builds with the seed alone: <seed> build maxon-bin --output=… (land.sh:783). fetch-seed.sh <tag> <lane> fetches a published seed and checks SHA256SUMS.
  • Nothing else reads the tag's commit as being on main: no script, workflow or tool checks that a seed tag's commit is an ancestor of main (grep over scripts/, .github/, .claude/). scripts/land.sh chain <S>^ <tag>-chain reaches S through the tag.
  • The last real chain: 52f9df01b (S, on base ee3b938dc, chain bdf254c10ce4 → 19d6260bb881), pinned by 01f5f4553 with seed-2026-11-17-52f9df01bc4e. The seed pinned at ee3b938dc, seed-2026-11-16-c8112863d746, refuses 19d6260.
  • Docs that describe the hold: docs/RELEASING.md :117-120 (chain lands only on the tip), :144-146 (land pushes after checking main is S's parent), :147-150 (retract keyed on the pin), :155-161 (every job re-checks), :163-168 (the in-flight hold), :203-204 (S is the commit on main with the trailers). .claude/skills/compiler-workflow/SKILL.md :238-245 (moved-main retracts; "a chain needs main's tip as its base"; the in-flight paragraph). .claude/skills/land/SKILL.md :42 (the step table's row 7), :258-265 (§7 "Wait out a chain land"), :312-313 (§9 "then in-flight"). Outside the area: .claude/agents/orchestrator.md:163 (workers hold pushes while a chain is in flight).
  • Host: git 2.36 here (no merge-tree --write-tree); every merge is checked 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 or land.yml.
  • Existing cases that touch it: none.
  • Neighbouring cases: none. Acceptance is runner rehearsals (§6), as for #229.

3. The approach

The chain's seed is frozen, proved and published on S exactly as pushed; a new uncredentialed pin job merges S at the tip with the ordinary door's merge_onto, re-proves by cross-building when the merge changed a seed input, and writes the pin; the credentialed land job shares one compare-and-swap push loop with the ordinary land.

  1. Plan. The chain's base is merge-base(tip, head), as for an ordinary land; the "lands only on the tip" refusal goes, and so does require_no_stand_ins for a chain (main mode still refuses stand-ins through standing_tip). S and the tag are computed as today. The pin is no longer a plan output. The plan runs merge_onto of S onto the tip it read and discards the result, so a chain that overlaps main bounces in minutes, not after the freeze (open choice 3).
  2. Freeze, prove, publish lose every require_base_unmoved; walk_chain loses its guard parameter. The tag stays on S, the -chain ref on the head.
  3. pin job (new; contents: read, no secret; after publish). It reads the tip at the plan moment (standing_tip … plan: main, or the rehearsal tip). T == base: S' = S. Otherwise S' = merge_onto(T, base, S) with one more trailer naming S (open choice 1); commit_from gains a trailers argument in place of its chain argument so both callers go through it. If seed_inputs_differ(S, S'): fetch the published seed for the runner's lane and build the merged tree's maxon-bin once per native target with --target=<t>, the seed alone, as prove builds (open choice 8); a refusal fails the job, and retract deletes the seed. Then P = make_pin(S', tag), its message still naming S ("frozen from"). Outputs: the tip, S', P, whether it built.
  4. land job runs for a chain in both modes (rehearsal without a token, as for ordinary). It runs git alone: it recomputes S, S' and P from the outputs (deterministic, so no bundle) and checks require_still_published. The push loop of land_ordinary becomes one loop for both kinds, parameterised by how a kind re-merges: tip unchanged → push the candidate; moved by no seed input → ordinary re-merges the landed commit, a chain re-merges S' onto the new tip and writes a new pin, both with git alone; moved by a seed input → re-dispatch, bounded. Push with --force-with-lease on the tip, bounded, as today.
  5. A chain's re-dispatch reuses its seed. It passes the published tag as a new dispatch input seed (open choice 2). A plan given seed reads S from the tag, checks that it is S recomputed for this head and base at S's committer time, checks the -chain ref is on the head, and skips classification, freeze, prove and publish; pin re-proves against the new tip. Re-freezing on a main move stays ruled out.
  6. retract keys on "main pins this tag": a commit on origin/main whose change to scripts/seed-tag adds or removes the tag (git log -S<tag> origin/main -- scripts/seed-tag), so a later chain that moved the pin on does not make a landed seed look unpinned (open choice 4). It runs for every chain run that did not re-dispatch, in both modes, and decides by the pin; a re-dispatched attempt leaves the seed to the attempt that ends. It still deletes nothing when main cannot be read and checks each object against this run's commits.
  7. Deleted: require_base_unmoved, fail_base_moved, WalkGuarded/WalkUnguarded, command_in_flight and its helpers and constants, the in-flight subcommand and usage line, recreate_pin's plan-time pin, the plan's pin output.
  8. Docs: docs/RELEASING.md (plan, chain, publish, the new pin step, land, retract, the hold paragraph deleted, "a chain's S" redefined, the seed input), then node website/scripts/sync-docs.mjs; compiler-workflow's chain section (no rebase onto the tip; a bounce is the overlap or the seed refusing the merged tree; the in-flight paragraph deleted); /land's step table row 7, §7 and §9's in-flight step (open choice 7).

Rejected:

  • Merge and re-prove inside the land job — it holds the credential and would run the new seed, a compiler built from the branch.
  • Re-freeze on every main move, or move the seed tag to S' — ruled out by #223.
  • Re-prove on the four native runners after the merge — the ruling says cross-built on one runner; four runners add queue time to the push window.
  • Re-prove with the chain's own two-stage build — a seed has to build the tree, one stage, as prove does.
  • Pass S' and P to the land job as a bundle — they are git-only and deterministic; the land job recomputes them, as the chain path already does for S.
  • Find a re-dispatched chain's seed by searching tags for a -chain ref on the head — a search where an input states it.
  • Keep in-flight as an informational command — nothing waits on it any more; the ruling deletes it.

4. Blast radius

One implementer; then the docs pass.

  • scripts/land.sh — plan (chain base, early overlap, seed reuse), commit_from trailers, pin subcommand, the shared push loop, chain re-merge and re-dispatch, retract by pin, deletions.
  • .github/workflows/land.yml — seed input, pin job, land for a chain in both modes, retract's condition, plan outputs (no pin; whether the seed is reused), job needs/if.
  • docs/RELEASING.md, the site page it generates, .claude/skills/compiler-workflow/SKILL.md chain section, .claude/skills/land/SKILL.md row 7, §7, §9.
  • Open choice 6: .claude/agents/orchestrator.md:163.

5. Obligations

  • No compiler, runtime or stdlib source; no self-compile, seed chain, error code or cross-target arm.
  • No RELEASE_NOTES.md entry: tooling, not Maxon source.
  • docs/RELEASING.md owns the surface; regenerate the site.
  • bash -n, shellcheck on land.sh; actionlint (or a YAML parse) on land.yml; check-ignored-files.py.
  • Nothing about any agent fleet in a commit, the docs or this page.

6. Candidate acceptance — runner rehearsals on throwaway branches

The rehearsal chain. The last real chain replayed on its own base: bdf254c then 19d6260 with the change's scripts/land.sh, scripts/lib/scale-tables.sh, scripts/check-scale-rows.sh and land.yml laid over the head (the workflow runs from the branch). Its base ee3b938dc pins seed-2026-11-16-c8112863d746, which refuses the head, so the plan classifies it a chain. Every "main" is a stand-in branch off ee3b938dc: T-doc (a docs-only commit), T-seed (a seed-input change the new seed builds), T-bad (a maxon-bin change no compiler builds), each disjoint from the chain's files. Real main is never pushed and pins nothing new. Each rehearsal publishes a seed-* pre-release and its two refs, and its retract deletes them; whatever survives is deleted by hand at the end.

# Rehearsal Asserts Red today because
C0 the chain with today's door, no stand-ins plan fails "lands only on origin/main's tip" (the red)
C1 tip=T-doc freeze/prove/publish run; tag on S; S' on T-doc carries S's message, its Bootstrap-Chain: trailers and the trailer naming S; P on S'; the re-prove skipped; would-push holds P→S'→T-doc; retract deletes the release, tag and ref the plan refuses a chain not on the tip, and refuses stand-ins
O1 an ordinary rehearsal started while C1 runs it lands (would receive) before C1 ends /land waits on in-flight
C2 tip=T-seed the pin job cross-builds every native target with the new seed, green; then as C1 no such job
C3 tip=T-bad the cross-build refuses; land does not run; retract deletes the seed; the run fails naming the refusal no such job
C4 tip=T-doc, moved=T-doc+a docs commit land re-merges S' and writes a new pin with git alone the land job pushes only onto S's base
C5 tip=T-doc, moved=T-doc+a seed input land re-dispatches attempt 2 with seed; attempt 1 retracts nothing; attempt 2 skips freeze/prove/publish, pin cross-builds on the moved tip; attempt 2's retract deletes the seed no such path
P1 land.sh retract run locally with the real pinned tag seed-2026-11-17-52f9df01bc4e, its S and head, GH_TOKEN set to an invalid value so nothing can be deleted "main pins … — stays published", exit 0; with a tag main never pinned it reaches the release check (and fails on the invalid token) retract keys on the pin commit's sha
— structural: the land job no build and no maxon; the merge, cross-build and pin made in pin (contents: read) —
— this change lands through the door main receives the door's commit —

7. Staging

ONE /land.

8. Open questions

  1. The trailer naming S on S'. Recommended: Frozen-From: <full sha of S>, added only when S' ≠ S.
  2. A chain's re-dispatch carries the seed as a new workflow_dispatch input seed (refused unless the head is a chain whose -chain ref is on it and S recomputes). Recommended: yes.
  3. The plan merges a chain at its tip and discards the result so an overlap bounces before the 27-minute freeze. Recommended: yes.
  4. "Main pins this tag" read as "some commit on main set or cleared that tag in scripts/seed-tag" (git log -S), not "the tip's pin equals the tag". Recommended: the history reading, since a later chain may move the pin on before retract runs.
  5. Rehearsal moments for a chain: the pin job reads tip, the land job reads moved, the same plan/push moments the ordinary path has. Recommended: yes (no new input).
  6. .claude/agents/orchestrator.md:163 tells workers to hold pushes during a chain land, which this change makes false; outside the area. Recommended: rewrite that sentence in this commit.
  7. /land §7 keeps its number and becomes the remaining sentence ("you do not rebase for the door"), so no §-reference elsewhere shifts. Recommended: yes.
  8. The cross-build re-prove is one stage per target (<seed> build maxon-bin --target=<t>), as prove builds. Recommended: yes.
  9. The rehearsals publish and retract about six seed-* pre-releases (never pinned, never on main). Recommended: proceed.

9. Amendments

  • 2026-11-17: approved as written, one /land; open choices 1–9 accepted as recommended (choice 6 adds .claude/agents/orchestrator.md to the area).
  • 2026-11-17: rehearsed C0–C6, O1, P1 as section 6 lists (C6 added: a seeded attempt whose plan fails runs retract's fallback). Implementation choices: a chain re-merges S onto a moved tip (not S'), so the Frozen-From: trailer is present whenever the commit differs from S; retract also runs for a re-dispatched attempt whose plan did not succeed, binding the seed to the head by recomputing S; prove passes --target=<its lane> through the helper it shares with the cross-build.

Clone this wiki locally