Explications › Décisions › 002. Changes land through a merge gate; main stays green

Explications › Décisions

Cette page n’est pas encore traduite : voici la version anglaise.

002. Changes land through a merge gate; main stays green

Nothing lands on main unless the full test suites pass on the merged result. Each session works on its own branch, in its own worktree.

  • Status: Accepted, implemented on 2026-11-23.
  • Date: 2026-11-23.
  • Supersedes: none.
  • Superseded by: none.

Context#

arche-lang and the server repository have no remote and no CI. Several sessions, people and agents, commit to both mains at the same time.

The architecture review of 2026-11-23 found main red: three tests failed because of the Polarion work, and the playground tests had failed before. The shared checkout was on another session's branch, with edits not committed. main moved twice during one merge.

When main is red, every branch inherits failures it did not cause. Each agent has to prove that its failures were already there, which takes hours. Real regressions hide among the known ones.

Decision#

  • Every session works on its own branch, in its own git worktree. No one works in the shared checkout.
  • A branch lands through a local merge gate (make land BRANCH=x). It merges the branch into a temporary worktree made from main, runs the full test suites of both repositories there, and moves main forward only when they pass.
  • A failing test on main is fixed first. Until it is, nothing else lands.
  • Since ADR 010, the gate also checks archec's own generated modules before the tests. It builds main's tip once per commit in .git/land/stage0/. With that archec it checks that model/ generates the branch's files (tools/selfgen.mjs --check). Then it builds the branch and checks again with the branch's own archec, the fixed point. A generated file edited by hand fails the first check, which names its model file. The fix is to change the model and run npm run gen:self. selfgen --unmove <module> makes a file hand-written again. When main has no model/ yet, the stage-0 check is skipped.

Consequences#

  • main is always a state that passed every test, so a failure on a branch is that branch's own.
  • Landing takes as long as the full suites, and branches land one at a time.
  • A flaky test blocks everyone. Tests have to be made sturdy, and long ones faster.
  • Work in progress stays on its branch until it passes, never on main.