Merge docs/concurrency-story into main
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by oscabriel · committed by oscabriel · parents 080e1fc, 7988526 · Browse files · 8 files·+136 added−11 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
8 files+136 added−11 removed
- tests:+18 added−0 removed
- other:+118 added−11 removed
Provenance
- Commit
3c2c19c- Tree
ba6bf07- Author
oscabriel <oscarhernandeziv@gmail.com>- Committer
oscabriel <oscarhernandeziv@gmail.com>- Parent 1
080e1fc- Parent 2
7988526
8 files changed+136 added−11 removed
modified:apps/web/src/features/landing/landing-page.tsx+11 added-5 removed
10 unmodified lines11 import { LandingNowList } from "./landing-now-list.tsx";12 import type { LandingNow } from "./landing-now.ts";13 import { MusicBox } from "./music-box/music-box.tsx";14 import { WaysIn } from "./ways-in.tsx";15-import { HEADLINE, HERO_LEDE } from "./words.ts";15+import { CONCURRENCY, HEADLINE, HERO_LEDE } from "./words.ts";16 17 /** The page's one main action, a size up from a toolbar's button. */18 const PRIMARY = buttonVariants({19 className: "text-want h-11 px-6 no-underline",17 unmodified lines37 </>38 );39 };40 41-/** The lede, with `main` set as the ref it is, in mono at the lede's own size. */42-const Lede = () => {43- const [before, after] = HERO_LEDE.split(MAIN);41+/** A sentence with `main` set as the ref it is, in mono at the sentence's own size. */42+const WithMain = ({ text }: { readonly text: string }) => {43+ const [before, after] = text.split(MAIN);44 45 return (46 <>47 {before}115 unmodified lines163 <h1 className="text-display text-balance">164 <Headline />165 </h1>166 <p className="text-lede text-muted-foreground max-w-(--measure-lede) text-pretty">167- <Lede />167+ <WithMain text={HERO_LEDE} />168 </p>169+ <p170+ className="text-ui text-muted-foreground max-w-(--measure-lede) text-pretty"171+ data-concurrency=""172+ >173+ <WithMain text={CONCURRENCY} />174+ </p>175 </div>176 <div className="flex max-w-full flex-col items-center gap-4">177 <AppLink className={PRIMARY} data-action="asks" to={ASKS_PATH}>178 Browse open asks35 unmodified linesmodified:apps/web/src/features/landing/words.ts+4 added
7 unmodified lines891011121314151617187 unmodified lines/** The hero's lede: what the gate does, in three sentences. */export const HERO_LEDE = "A project writes the changes it wants as asks, each with a check that fails on main today. Anyone, person or agent, can claim one and push an answer. The gate lands it, or tells git exactly why not.";
/** The hero's line on many agents at once, under the lede. */export const CONCURRENCY = "Many agents answer at once, each in a fork of its own, and main moves by one landing at a time.";
/** The README's lede, the page's description where it unfurls. */export const LEDE = "Everything a project ships is public, its contribution process is typed code on main, and a push lands only by passing a typed gate.";modified:apps/web/src/features/shared/status-line.tsx+5 added-1 removed
47 unmodified lines48 Match.when(49 "shape",50 () => "What the change touches, read from its paths and added lines."51 ),52- Match.when("merge", () => "The answer merged onto the landed main."),52 Match.when(53+ "merge",54+ () =>55+ "The answer merged onto the landed main, and merged again when main moves."56+ ),57+ Match.when(58 "cheap",59 () => "Counts on the merged tree: the project's ratchets."60 ),61 Match.when(548 unmodified linesmodified:apps/web/test/landing.test.tsx+18 added
165 unmodified lines166 ).toBeTruthy();167 })168 );169 170+ it.effect(171+ "says under the lede that many agents answer at once while main moves one landing at a time, and that the merge stage merges again when main moves",172+ () =>173+ Effect.gen(function* () {174+ const main = mainOf(yield* pageWith(landed));175+ const hero = main.slice(0, main.indexOf('data-figure="music-box"'));176+ const gate = main.slice(main.indexOf('aria-labelledby="gate"'));177+178+ const merge =179+ /<li\b[^>]*data-stage="merge"[\s\S]*?<\/li>/u.exec(gate)?.[0] ?? "";180+181+ expect(textIn(hero)).toContain(182+ "Many agents answer at once, each in a fork of its own, and main moves by one landing at a time."183+ );184+ expect(textIn(merge)).toContain("merged again when main moves");185+ })186+ );187+188 it.effect("names the four words as GLOSSARY.md defines them", () =>189 Effect.gen(function* () {190 const markup = yield* pageWith(landed);191 const words = ["Ask", "Answer", "Check", "Refusal"];288 unmodified linesadded:examples/swarm-run-2026-10-08.md+79 added
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879# Swarm and core-loop runs, 2026-10-08
The record of the live runs the README's "Many agents at once" numbers come from. Every number here was measured on the `dev-oscabriel` stage on 2026-10-08 (UTC), on the Workers deployed from commit `c7b68ff` (every Answer instance in the runs carries the same Worker version). The runs started from commits `25a727e` and `6730a0e`, which change only the swarm's own scripts. Nothing here is rounded or estimated; a number that missed its bar says so.
## The swarm
Each run seeded a fresh copy of burrow, the fictional six-service example, with `bun run seed -- --stage dev-oscabriel --as burrow-swarm-<n>`, then ran `bun run swarm -- --stage dev-oscabriel --project burrow-swarm-<n> --scenario video` headless. Six fictional contributors on four harnesses each claimed one child of burrow's `drop-legacy-fetch` family (a migrate ask split into one child per module that calls `legacyFetch`, plus a delete child that waits on them all) and answered it at the same time. Time is from the contributor's claim to the end of its run. Refusals counts what the contributor's `status` shows: a push refused in git's own output is not an answer there, so it is not counted.
### Run 1
Commit `25a727e`, project `burrow-swarm-1` (seeded 16:29 to 16:31 UTC, main `2c89373`). Started at 16:31:32; the last landing came at 16:35:14, 3 min 42 s later. 4 of 6 landed.
| Contributor | Harness | Model | Outcome | Attempts | Refusals | Time | Landed SHA || --- | --- | --- | --- | --- | --- | --- | --- || wren | Claude Code | claude-opus-5-5 | landed | 1 | none | 93 s | `8949928` || tamsin | OpenCode | openai/gpt-5.5 | failed | 1 | none | 5 s | none || ivo | Amp | medium | failed | 0 | none | 6 s | none || marisol | pi | opencode-go/kimi-k3 | landed | 1 | none | 198 s | `a4f1cd0` || dagny | pi | opencode-go/glm-5.3 | landed | 1 | none | 234 s | `c5e1de8` || pell | pi, with the adapter | opencode-go/qwen3.8-flash | landed | 1 | none | 228 s | `5c697db` |
The two failures, and their causes:
- **tamsin**: the model provider refused every call, `provider.quota: The usage limit has been reached`, on the ChatGPT account OpenCode signs in with, which earlier runs that day had also used. Run 2 moved tamsin to `opencode-go/gpt-6-luna`.- **ivo**: `git clone` of its claim fork failed with `remote: no repo`, one second after its claim; 20 s later the same token read the fork. A claim answers before its outbox has made the fork. Commit `6730a0e` made the swarm's workspace clone again every 2 s, up to 30 tries, while git says the repo is not found.
### Run 2
Commit `6730a0e`, project `burrow-swarm-2` (seeded 16:39 UTC, main `68ba265`). Started at 16:40:30; the last landing came at 16:48:11, 7 min 41 s later. 6 of 6 landed.
| Contributor | Harness | Model | Outcome | Attempts | Refusals | Time | Landed SHA || --- | --- | --- | --- | --- | --- | --- | --- || wren | Claude Code | claude-opus-5-5 | landed | 1 | none | 86 s | `ea9a199` || tamsin | OpenCode | opencode-go/gpt-6-luna | landed | 2 | `StaleBase` ×1 | 466 s | `13ef502` || ivo | Amp | medium | landed | 1 | `ChecksFailed` ×1 | 154 s | `7fa1b47` || marisol | pi | opencode-go/kimi-k3 | landed | 1 | none | 209 s | `492a68d` || dagny | pi | opencode-go/glm-5.3 | landed | 1 | none | 257 s | `f1e3b5b` || pell | pi, with the adapter | opencode-go/qwen3.8-flash | landed | 1 | none | 307 s | `8799664` |
- **ivo**: its first answer was refused `ChecksFailed` by burrow's lint lane. It fixed the answer and pushed again in the same session, and that answer landed.- **tamsin**: its first answer was refused `StaleBase`, since its siblings had landed first. It rebased onto the new main and force-pushed; the gate refused that push in git's output with `OutOfScope`, naming the files the siblings had landed, because a push's diff starts at the claim's base, not at the main the answer was rebased onto. It then submitted the rebased head with `submit --base <new main>`, and that answer landed as `13ef502`. In a family, the rebase that git suggests after `StaleBase` was refused, and only the contract's `--base` path worked.- Every landing but tamsin's carries an `Assisted-by` trailer naming its harness; OpenCode's has none.
### Re-merges
Six of the ten swarm landings across both runs met a moved main (`MainMoved`) at their first land, and were merged onto the new main and checked again before they landed; dagny's landing in run 2 did so twice.
## The Lander's land step
The final land step of each swarm landing, read from the Answer workflow's steps (`wrangler workflows instances describe`), in whole seconds:
| Run | wren | tamsin | ivo | marisol | dagny | pell || --- | --- | --- | --- | --- | --- | --- || 1 | 8 | none | none | 4 | 5 | 6 || 2 | 5 | 12 | 7 | 5 | 5 | 12 |
Median 5.5 s, worst 12 s. In the same steps, `cheap` took 9 to 24 s and `checks` 4 to 9 s, and recording a landing after each land took 7 to 11 s.
## The core loop
Five runs of `bun scripts/smoke.ts --stage dev-oscabriel --loop`, at commit `6730a0e`, one after another from 16:48:58 to 16:59 UTC. All five passed. Each run makes a throwaway project, opens an ask red first, claims it, pushes outside the ask's territory and is refused `OutOfScope` in git's output, then pushes the fixed answer, waits for it to land and reads its verdict note. Each landing came from the fictional `bram` and carried `Asked-by`, `Signed-off-by`, `Assisted-by`, `Ask` and `Verdict` trailers. Steps in ms:
| Run | people | init | open-ask | claim | out-of-scope | answer | landing | verdict-note | total || --- | --- | --- | --- | --- | --- | --- | --- | --- | --- || `smoke-20261008-164858` | 2,888 | 24,515 | 23,384 | 3,664 | 6,594 | 5,285 | 30,911 | 1,963 | 99,204 || `smoke-20261008-165040` | 2,472 | 23,357 | 21,650 | 3,701 | 5,094 | 5,088 | 34,090 | 2,114 | 97,566 || `smoke-20261008-165218` | 2,559 | 24,307 | 21,903 | 4,441 | 6,085 | 4,804 | 32,882 | 2,602 | 99,583 || `smoke-20261008-165400` | 2,523 | 22,341 | 23,501 | 4,597 | 10,623 | 4,745 | 91,869 | 2,386 | 162,585 || `smoke-20261008-165645` | 2,586 | 23,180 | 21,592 | 9,921 | 7,225 | 5,524 | 28,659 | 1,894 | 100,581 || **median** | 2,559 | 23,357 | 21,903 | 4,441 | 6,594 | 5,088 | 32,882 | 2,114 | 99,583 || **worst** | 2,888 | 24,515 | 23,501 | 9,921 | 10,623 | 5,524 | 91,869 | 2,602 | 162,585 |
The `landing` step is the whole asynchronous verdict, from the push taken to main moved. The Answer workflow's merge, checks and land steps for each loop landing, in seconds: 11/3/6, 14/3/7, 12/2/6, -/3/9 and 7/4/4; the land step's median is 6 s and its worst 9 s. In the run that took 91.9 s, the push was taken at 16:55:09 and its Answer workflow began 66 s later, at the Project's alarm; the platform's logs for that window hold nothing above info level, and the cause was not traced.
The ask's check, red twice on main in `open-ask`, took 21.6 to 23.5 s, under the 60 s bar for a small check; the loop's `checks` step took 2 to 4 s.
## Not met
The 5 s landing bar was missed: the Lander's land step took over 5 s in 5 of the 10 swarm landings and in 4 of the 5 core-loop landings.modified:GLOSSARY.md+3 added-3 removed
15 unmodified lines16 A commit in a claimant's fork offered to satisfy one ask.17 _Avoid_: pull request, PR, patch, attempt, submission18 19 **Round**:20-One push of an answer that the gate checked: its head commit, the gate's verdict on it, and when. The next push starts the next round, numbered from 1, and a verdict is never read against a later round.20+One push of an answer that the gate checked: its head commit, the gate's verdict on it, and when. The next push starts the next round, numbered from 1, and a verdict is never read against a later round. The rounds are the record an agent works from when it pushes again, so nothing it learned lives only in its own context.21 _Avoid_: revision, iteration, attempt, submission22 23 **Claim**:24-One person's exclusive, expiring right to answer an ask, made of a fork and a scoped token; kept alive only by pushes.24+One person's exclusive, expiring right to answer an ask, made of a fork and a scoped token; kept alive only by pushes. While it lives, a second claimant is refused, so agents working at once never answer the same ask unless its kind allows a race.25 _Avoid_: lease, lock, assignment26 27 **Claim fork**:28 The fork a claim is made of, at `<owner>/<name>--<ask>--<handle>`, to which the claimant pushes answers.14 unmodified lines43 **Check kind**:44 The shape of an ask's check: redThenGreen, lintToZero, ratchet, migrate, or symbolAbsent (a family's delete child).45 46 **Family**:47-A migrate ask whose old name is used in two or more modules, opened as one child ask per module that uses it, each with that module as its territory, plus a delete child that waits on every child and checks the name is gone; the parent closes when its last child lands.47+A migrate ask whose old name is used in two or more modules, opened as one child ask per module that uses it, each with that module as its territory, plus a delete child that waits on every child and checks the name is gone; the parent closes when its last child lands. Each child is claimed on its own, so one change is answered by several people at once.48 _Avoid_: epic, subtasks, batch, stack49 50 **Territory**:51 The module (by default a workspace package) an answer may change.204 unmodified linesmodified:PRODUCT.md+1 added
42 unmodified lines43444546474849505173 unmodified lines42 unmodified lines
The mechanism is the claim, not the feature count. What it promises:
- **main moves only by a landing.** A landing is the platform's commit of a checked tree; a direct push to main is refused. Maintainers' own changes go through the same gate.- **Many agents at once.** A claim is exclusive unless its ask's kind allows a race, and answers to different asks are merged and checked in parallel, each in its own Workflow; only the final write to main waits, in a landing slot that holds one answer at a time. When main moves first, the platform merges the answer onto the new main and checks it again, up to three times, and otherwise refuses `StaleBase`, naming each conflicting path and who moved it.- **An answer cannot change what judges it.** The judge is read from the last landing, and its closure (check files, test and lint config, CI and hook configs, scripts, the config folder, `.env.schema`) is out of every answer's reach. An answer that edits them, or adds a disable comment with no reason, is refused; a reasoned one counts against the territory's escapes, and waits for a maintainer when it would raise them.- **Every refusal is a typed value**, from a closed union: a tag, a reason, where it points, the command to run next, and whether retrying can help. It reads the same in `git push` output, the CLI, MCP and the web, and accumulates at the cheap stages, so one push hears every independent problem.- **Credit is git trailers on the landing commit** (`Asked-by`, `Signed-off-by`, `Decided-by`, `Mentored-by`, `Finished-by`, `Advised-by`). Agents are disclosed, never credited. Trust is a vouch: a public line on main that may carry the member's reason and the landing it followed, read as a line and never as a number.- **Held-back checks disclose one bit per area.** A layer's files never enter a public tree; a contributor learns which area failed, never a check's name or output, with a few attempts a week. A landing judged by them says "checked against N sealed checks" in its `Held-back:` trailer.73 unmodified linesmodified:README.md+15 added-2 removed
1 # Myr2 3 A Git platform for the boundary between a project and everyone else. Everything a project ships is public, its contribution process is typed code on `main`, and a push lands only by passing a typed gate.4 5-Anyone's agent can now offer a change at any hour, and projects answer by closing the door or hand-building a vouch gate in front of it. Myr puts that boundary in the platform, so it is held at the push rather than in a maintainer's evening. It runs live at <https://myr.technology>.5+Anyone's agent can now offer a change at any hour, and projects answer by closing the door or hand-building a vouch gate in front of it. Myr puts that boundary in the platform, so it is held at the push rather than in a maintainer's evening. Many agents offering changes to one project at once is the reason it is held there: each answer is judged on its own merged tree, and `main` moves by one landing at a time. It runs live at <https://myr.technology>.6 7 A platform can do what a setting on a code host cannot:8 9 - **Judge with checks the answer cannot touch.** A push that edits test config, scripts or CI, or skips a test without a reason, is refused.11 unmodified lines21 remote: retryable: no22 ! [remote rejected] HEAD -> main (OutOfScope)23 ```24 25+## Many agents at once26+27+A claim is exclusive unless the ask's kind allows a race, so a second claimant hears `AskFull`, and a claim lives only while its claimant pushes: by default it is warned after 2 hours and lapses after 24 without a push. Each project is one Durable Object and each pushed answer runs in a Workflow of its own, so answers to different asks are merged and checked in parallel; only the final write to `main` waits, in a landing slot that holds one answer at a time. The platform never rebases an answer: when `main` moved while it waited, it merges the answer three ways onto the new `main` and checks the merged tree again, up to three times (`maxRemerges` in `packages/project/src/landing.ts`). When that merge conflicts, or `main` keeps moving, the answer is refused `StaleBase`, and a conflict's refusal names each conflicting path with the landing, ask and person that moved it. A migrate ask whose old name is used in several modules opens as a family: one child ask per module, each claimed on its own, plus a delete child that waits until every other child has landed. What an agent carries from one push to the next is kept by the platform, not in its context: each push is a numbered round with its own verdict, each refusal is a typed value with the command to run next, and `myr evidence` returns a failing lane's log to the answer's claimant.28+29+Measured live on the `dev-oscabriel` stage on 2026-10-08, from commits `25a727e` (swarm run 1) and `6730a0e` (the rest), with [`scripts/swarm.ts`](scripts/swarm.ts) and `smoke --loop`; the whole record, failures included, is in [examples/swarm-run-2026-10-08.md](examples/swarm-run-2026-10-08.md).30+31+| Run | Measured |32+| --- | --- |33+| Swarm run 2: six contributors on four harnesses (Claude Code, OpenCode, Amp, pi), one family child each | 6 of 6 landed in 7 min 41 s; one `StaleBase` landed on its second attempt, one `ChecksFailed` landed after a fix |34+| Both swarm runs' ten landings | 6 of 10 met a moved `main` and were merged and checked again before landing |35+| The core loop, five runs | 5 of 5 passed, each refused `OutOfScope` in git's output before it landed |36+| The Lander's land step, ten swarm landings | median 5.5 s, worst 12 s: over the 5 s bar in 5 of 10 |37+38 ## Quick start39 40 You need Bun 1.4.2 and git 2.5x. Nothing here needs an account:41 74 unmodified lines116 apps/ the platform, sandbox and web Workers, and the CLI117 packages/ the protocol (one schema for every surface), gate, rules, checks, lifecycles, git and the rest118 infra/ bootstrap, deploy, the stage table, teardown119 scripts/ brand and byte checks, seed, smoke, swarm, release107-examples/ datekit and burrow, fictional projects seeded on dev stages120+examples/ datekit and burrow, fictional projects seeded on dev stages, and the swarm's run record121 tools/ the vendored lint plugins122 ```123 124 ## Credits12 unmodified lines