Correct the ADRs and AGENTS.md where they disagreed with the code, and refuse build-plan references in the public docs
Before adoption: this commit came in with the history the project adopted, so no landing records it.
707 review fixes: - ADR 0014: the `--force-with-lease` option said a wrong expected value rewrites history. A lease refuses a wrong value; the risk is a matching one moving `main` to a commit that does not descend from it. It now says so, and that the Lander leases only its compose refs (apps/sandbox/src/lander/script.ts). - AGENTS.md: principle 8 cited the build plan's issue ("W3 313 #2"), which a reader of the repo cannot open; removed. The opening said refusals arrive in git's own output; only the cheap stages do, the rest through status, watch, MCP and the verdict note (ADR 0015). `swarm` and `release` were described as working, but both are stubs that exit 1 today; their lines now say so. - ADR 0008: "every repo name splits back into its parts" holds for claim and working forks only; a layer name follows the config folder's grammar, which does not refuse `--`. - ADR 0006: a held-back result carries over only when the patch id and the pinned suite are both unchanged (held-back.ts). - GLOSSARY.md: a Family forms only when the old name is used in two or more modules (packages/project/src/migrate.ts). - docs-public.test.ts: also refuses build-plan references (`spec §`, a wave and issue number such as `W3 313`). Red first by assertion on AGENTS.md's principle 8 line, green after its removal.
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+21 added−11 removed
- tests:+13 added−3 removed
- other:+8 added−8 removed
Provenance
- Commit
f8985b9- Tree
7b724ba- Author
oscabriel <oscarhernandeziv@gmail.com>- Committer
oscabriel <oscarhernandeziv@gmail.com>- Parent
cbc19ce
6 files changed+21 added−11 removed
modified:docs/adr/0006-landing-is-a-parse.md+1 added-1 removed
19 unmodified lines202122232424252619 unmodified lines- `Flake` and `VerifierBlocked` never count against the answerer.
## Amended (2026-10-08)
- **`PatchId` is the platform's own**, not `git patch-id`: SHA-256 over the answer's change set as sorted `path`, blob-before, blob-after lines (an absent blob as empty), computed with WebCrypto in a Worker that has no diff engine (`packages/git/src/patch-id.ts`). It ignores commit order and moves only when a blob the answer touches moves, which is when a held-back lane must run again; a verdict records it, and only held-back results may carry over on an unchanged one. Open: the change set is taken against the answer's own base, so a re-merge onto a `main` that changed one of those files keeps the same id.- **`PatchId` is the platform's own**, not `git patch-id`: SHA-256 over the answer's change set as sorted `path`, blob-before, blob-after lines (an absent blob as empty), computed with WebCrypto in a Worker that has no diff engine (`packages/git/src/patch-id.ts`). It ignores commit order and moves only when a blob the answer touches moves, which is when a held-back lane must run again; a verdict records it, and only held-back results may carry over, when both it and the pinned held-back suite are unchanged. Open: the change set is taken against the answer's own base, so a re-merge onto a `main` that changed one of those files keeps the same id.- **Waiting is not refusing.** An answer's `Outcome` is `Checking`, `Landed`, `WaitingOnParent`, `AwaitingFinish`, `AwaitingDecision` or `Refused`. The three waiting states carry no refusal: nothing failed, and the answer needs no new push. Only `Refused` carries refusals, all from the cheapest failing stage.- Stages 0 and 1 answer inside the push; the merge, the project's commands, held-back checks and the human stage answer afterwards (ADR 0015).modified:docs/adr/0008-claims-are-exclusive-by-default.md+1 added-1 removed
14 unmodified lines1516171819192014 unmodified linesThe front page shows an ask as either claimed or open.
## Amended (2026-10-08)
- **Fork names carry their parts.** A claim's fork is `<project>--<ask>--<handle>` and a person's working fork `<project>--me--<handle>`, the handle in lowercase; a layer's repo is `<project>--<layer>`. A project name or an ask id is lowercase words joined by single hyphens, so neither can hold `--`, and every repo name splits back into its parts. `me` and `layer` are reserved ask ids, as are `open` and `flag`, which the CLI's `ask` subcommands take.- **Fork names carry their parts.** A claim's fork is `<project>--<ask>--<handle>` and a person's working fork `<project>--me--<handle>`, the handle in lowercase; a layer's repo is `<project>--<layer>`. A project name or an ask id is lowercase words joined by single hyphens, so neither can hold `--`, and a claim fork's or a working fork's name splits back into its parts. A layer's name follows the config folder's looser grammar, which does not refuse `--`. `me` and `layer` are reserved ask ids, as are `open` and `flag`, which the CLI's `ask` subcommands take.- **Making a claim's fork is safe to retry, and converges on one repo.** Ten claims at once against live Artifacts (Oct 7) were all ready within 9.9 s, so no pool of pre-made forks is needed. Under that load 4 of 10 fork calls first answered HTTP 500, then 409 "repo already exists" when retried under the same name, and each still ended as exactly one repo. So a 500 is read as "maybe made" and tried once more, and an already-exists on the claim's own name counts as made once that repo holds `main`. The name comes from the claim, so claiming again finds the same fork.modified:docs/adr/0014-landing-is-a-cas-push-of-main-then-bookkeeping-refs.md+1 added-1 removed
7 unmodified lines8910111212131415165 unmodified lines7 unmodified lines
## Considered Options
- **One atomic push of `main`, the mirror ref and the note.** This was the earlier design. Artifacts refuses `--atomic` (spike, Oct 6), and its receive-pack advertises no `atomic` capability.- **`--force-with-lease` on `main`.** It is a compare-and-swap too, but it is a forced push: a wrong expected value rewrites history instead of failing. A plain push of a commit whose parent is the old tip can only move `main` forward.- **`--force-with-lease` on `main`.** It is a compare-and-swap too, but it is a forced push: once the expected value matches, any commit replaces `main`, even one that does not descend from it, so a landing built on the wrong parent would rewrite history instead of failing. A plain push of a commit whose parent is the old tip can only move `main` forward. The Lander uses a lease only for its own compose refs, never for `main`.- **Bookkeeping first, `main` last.** A mirror or a note naming a commit that never landed would mislead its readers, and Artifacts accepts a notes ref naming a commit the repo lacks, then fails the fetch of that commit.
## Consequences
5 unmodified linesmodified:packages/config/test/docs-public.test.ts+13 added-3 removed
22 unmodified lines23 "plans.gneiss.run",24 ".scratch/build",25 ] as const;26 27+/**28+ * What a reference into the build's private plan looks like, which a reader29+ * with only the repo cannot follow: a section of its spec (`spec §8`) or one30+ * of its issues by wave (`W3 313`).31+ */32+const PLAN_REFERENCES = [/\bspec §/u, /\bW\d \d{3}\b/u] as const;33+34 /** Terms the code uses in public names, each of which GLOSSARY.md defines. */35 const TERMS = [36 "Claim fork",37 "Decision",80 unmodified lines118 const docs = yield* publicDocs;119 120 expect(121 docs.flatMap(({ path, text }) =>115- PRIVATE.flatMap((pointer) =>116- text.includes(pointer) ? [`${path}: ${pointer}`] : []117- )122+ [123+ ...PRIVATE.filter((pointer) => text.includes(pointer)),124+ ...PLAN_REFERENCES.flatMap((reference) =>125+ reference.test(text) ? [reference.source] : []126+ ),127+ ].map((found) => `${path}: ${found}`)128 )129 ).toStrictEqual([]);130 }).pipe(Effect.provide(NodeServices.layer))131 );71 unmodified linesmodified:AGENTS.md+4 added-4 removed
1 # Myr2 3 Myr is a Git platform on Cloudflare. Everything a project ships is public, its contribution process is typed code on main, and a push lands only by passing a typed gate. It is our entry to Cloudflare's "Build the next GitHub" competition, which closes Wed Oct 14, 11:59 PM PDT.4 5-The core loop runs on Cloudflare today: a person claims an ask, pushes an answer through the platform's git gateway, and the platform checks it and lands it, or refuses it in git's own output. The CLI, MCP and the web all serve the same contracts, and typed visibility (layers, held-back checks, posture, the ledger and write-only env values) plugs in as one cartridge. `README.md` says how to run it, check it and cut it; `docs/adr/` records each decision and why; `GLOSSARY.md` defines the words.5+The core loop runs on Cloudflare today: a person claims an ask, pushes an answer through the platform's git gateway, and the platform checks it and lands it, or refuses it: the cheap stages answer in git's own output, and the rest arrive later in `status`, `watch`, MCP and the verdict note. The CLI, MCP and the web all serve the same contracts, and typed visibility (layers, held-back checks, posture, the ledger and write-only env values) plugs in as one cartridge. `README.md` says how to run it, check it and cut it; `docs/adr/` records each decision and why; `GLOSSARY.md` defines the words.6 7 `bun run verify` is the gate. The principles table names the check that holds each rule; a rule marked "No fence" is held by review.8 9 ## Principles8 unmodified lines18 | 4 | **One schema, many surfaces.** Change `packages/protocol`; every surface derives from it. Projections live only in `apps/*/src/surfaces.ts`. The CLI's command list is `commandDocs` in `@repo/agent-kit`, which the platform's skill, the CLI's MCP prompt and the web's `llms.txt` all read. | `apps/cli/test/commands-doc.test.ts` (the command list against the real CLI's commands, flags and positionals); `packages/protocol/test/mcp.test.ts` (every MCP tool's schemas, with no JSON Schema leak); per-package `allowedUnstableApis` with `unstableApiUsage` at error |19 | 5 | **The name lives only in `packages/brand`.** Internal packages use `@repo/*`. DO classes, Workflows, queues and databases carry job names. | `brand:check` (`scripts/brand.ts`, tested by `packages/brand/test/leaks.test.ts`) |20 | 6 | **Pure core, thin hosts.** Only `@repo/artifacts` calls Artifacts. Each beta dependency sits behind one job-named port with a `/memory` adapter in the owning package. Apps import packages only. Worker code stays free of `node:child_process`, `@effect/platform-bun` and OpenTUI. `rules` and `gate` run in both Workers and Bun. `alchemy/*` stays in `infra/`. No module-level mutable state in a package's `src/`. | Scoped `allowedUnstableApis`; `packages/artifacts/test/repo-host-contract.ts` (one RepoHost contract every adapter passes); `apps/platform/test/bindings.test.ts` and `apps/platform/test/worker-init.test.ts` (the Worker starts on its real adapters, composed in `apps/platform/src/ports.ts`); `apps/web/test/production-bundle.test.ts` (no dev-world module in the web's production build); `packages/config/test/cartridge.test.ts` (the visibility cartridge is plugged in by one marked line and reached by nothing else, so removing it is a deletion). No fence: import direction and module-level state |21 | 7 | **Deny by default for visibility.** Land the answer's tree, never the composed tree. Nothing from a layer enters a public tree. Snapshot before held-back files are written. Public-serving Workers have no private-namespace binding. Public commits, trailers, notes and errors name public paths only. | `PrivatePathInPublicTree`, one rule for the gate's stage 1 and the landing guard (`packages/gate/test/shape.test.ts`, `packages/visibility/test/guards.test.ts`); `apps/platform/test/visibility/layer-gateway.test.ts` (only a layer's readers clone it, every read is logged, a fork push cannot carry its paths); `apps/sandbox/test/held-back.test.ts` (egress off and the snapshot taken before any sealed file is written; one bit per area, no output); `apps/platform/test/visibility/held-back.test.ts` (the `Held-back:` trailer, the landing guards, no stored value in a note or a kept log); `apps/platform/test/bindings.test.ts`; `apps/sandbox/test/checker.test.ts` (no snapshot once the held-back slot is reached); `apps/web/test/env.test-d.ts` (the web's Env has no private-namespace or Artifacts binding) and `apps/platform/test/env.test-d.ts` (only the platform's has both) |22-| 8 | **Deterministic and idempotent.** Rule evaluation sees frozen time and randomness and only injected facts. Re-running an operation converges. Check results are keyed by (tree SHA, check version), push events deduped by (repo, sha), and land requests carry a `requestId`. | `globalDate`, `globalRandom`, `globalTimers` and `cryptoRandomUUID` at error, with their in-Effect twins; `packages/rules/test/replay.test.ts`; `packages/project/test/project-store.contract.ts`; `packages/project/test/claim.model.test.ts` and `packages/project/test/landing.model.test.ts`; `apps/platform/test/workflows/answer.test.ts`; `apps/platform/test/workflows/on-push.test.ts`; `apps/platform/test/core-loop.test.ts`. No fence: one push deduped by (repo, sha) across the gateway's record and OnPush's (W3 313 #2) |22+| 8 | **Deterministic and idempotent.** Rule evaluation sees frozen time and randomness and only injected facts. Re-running an operation converges. Check results are keyed by (tree SHA, check version), push events deduped by (repo, sha), and land requests carry a `requestId`. | `globalDate`, `globalRandom`, `globalTimers` and `cryptoRandomUUID` at error, with their in-Effect twins; `packages/rules/test/replay.test.ts`; `packages/project/test/project-store.contract.ts`; `packages/project/test/claim.model.test.ts` and `packages/project/test/landing.model.test.ts`; `apps/platform/test/workflows/answer.test.ts`; `apps/platform/test/workflows/on-push.test.ts`; `apps/platform/test/core-loop.test.ts`. No fence: one push deduped by (repo, sha) across the gateway's record and OnPush's |23 | 9 | **Effect v4 only.** Read `node_modules/effect/src` as API truth. Off limits: `effect/unstable/*`, v3 `@effect/platform` and `@effect/cli`, and `effect/workflow` or `effect/cluster` on Workers. | `outdatedApi`; `no-restricted-imports` |24 | 10 | **Escapes need a reason.** Every `oxlint-disable`, `@effect-diagnostics` or `@ts-expect-error` carries its reason after `--`, and is added only where no idiomatic code does the job. | `check` fails on an unused directive. No fence: the reason |25 | 11 | **`bun run verify` is the authority.** Deploy only to an explicit stage, after `verify`, with smoke after. A red gate is fixed, never deployed around. | `packages/config/test/verify.test.ts` (verify's steps); `infra/deploy.ts` refuses without a known stage, runs `verify` first and `scripts/smoke.ts` after (`packages/config/test/deploy.test.ts`, `packages/config/test/smoke.test.ts`) |26 | 12 | **Lifecycles are pure transitions.** `transition(state, command, now)`. Per DO call: hydrate, transition, persist, settle. Deadlines run on DO alarms. Call them lifecycles. | `globalTimers` and `globalTimersInEffect`; `packages/project/test/claim.model.test.ts` and `packages/project/test/landing.model.test.ts` (model tests over effect/Arbitrary histories, each seen catching its planted bug); `apps/platform/test/project-do.test.ts`. No fence: `Effect.sleep` and `Effect.delay` in `packages/project/src` |38 unmodified lines65 - `bootstrap -- --stage <stage>`: makes a stage's Cloudflare resources; a second run creates nothing, and `--dry-run` only prints the plan.66 - `deploy -- --stage <stage>`: the one way to deploy. It runs `verify`, deploys the three Workers with Wrangler, reads the push trigger back, then runs `smoke`.67 - `smoke -- --stage <stage>`: read-only probes against a live stage.68 - `seed`: puts the two example projects on a platform (`--world node` on this machine, or `--stage <stage>`); a second run changes nothing.69-- `swarm`: runs fictional contributors, on several harnesses, against one split family on a stage.70-- `release`: builds the CLI's package and binaries, which the platform serves from its own bucket. Only a person publishes.69+- `swarm`: not built yet, so it says so and exits 1. Once built, it runs fictional contributors, on several harnesses, against one split family on a stage.70+- `release`: not built yet, so it says so and exits 1. Once built, it builds the CLI's package and binaries, which the platform serves from its own bucket. Only a person publishes.71 72 ## Nouns73 74 Each code noun has one home:71 unmodified linesmodified:GLOSSARY.md+1 added-1 removed
38 unmodified lines39 **Check kind**:40 The shape of an ask's check: redThenGreen, lintToZero, ratchet, migrate, or symbolAbsent (a family's delete child).41 42 **Family**:43-A migrate ask opened as one child ask per module that still uses the old name, 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.43+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.44 _Avoid_: epic, subtasks, batch45 46 **Territory**:47 The module (by default a workspace package) an answer may change.160 unmodified lines