Skip to content
Myr

AGENTS.md

This file

Path

AGENTS.md

139 lines · 29.2 KiB · Markdown

Last changed by

Merge redesign into mainoscabrielbefore adoptioncaedd21

History of this file

Take it

The walk stopped after 200 commits: lines older than f9bd621 point at it.

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

lines 1–2why, one step back
1# Myr
2

Merge build/root-docs-tidy into mainoscabrielbefore adoption378d320

line 3why, one step back
3Myr 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 was built as an entry to Cloudflare's "Build the next GitHub" competition.

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

line 4why, one step back
4

Merge build/readme-cut into mainoscabrielbefore adoption5792317

line 5why, one step back
5The 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 and deploy it; `GLOSSARY.md` defines the words.

Merge branch 'build/707-adr-glossary-agents-fold-ins'oscabrielbefore adoption2b1fd3c

line 6why, one step back
6

Prune the repo's agent scaffolding: verify guards the product, and ported files carry their own licence noticeoscabrielbefore adoption0e95d48

line 7why, one step back
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.

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

lines 8–10why, one step back
8
9## Principles10

Prune the repo's agent scaffolding: verify guards the product, and ported files carry their own licence noticeoscabrielbefore adoption0e95d48

line 11why, one step back
11A check wins over prose: if this file and a check disagree, fix this file.

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

lines 12–14why, one step back
12
13| # | Principle | Held by |14| --- | --- | --- |

Prune the repo's agent scaffolding: verify guards the product, and ported files carry their own licence noticeoscabrielbefore adoption0e95d48

line 15why, one step back
15| 1 | **Encode lessons in structure; prose is the last rung.** When a mistake repeats, make it unrepresentable, then a lint or a test. | No fence |

Merge redesign into mainoscabrielbefore adoptioncaedd21

line 16why, one step back
16| 2 | **Parse at the boundary, trust inside.** Decode every external input (HTTP, git, DO RPC, WebSocket, rule facts, env) with Effect Schema; inside, use branded types (`AskId`, `LandedSha`, `PatchId`). Decode the Worker `env` once, in one Layer. | The Effect diagnostics at error in `tsconfig.base.json`; `anti-slop/no-unknown-parameters`, `anti-slop/no-widen-then-assert` and `anti-slop/require-safety-comment-for-type-assertion`; `apps/platform/test/platform.test.ts` (a bad env fails at start, decoded once in `apps/platform/src/platform.ts`); `apps/platform/test/bindings.test.ts` (the decoded bindings, vars and secrets equal each wrangler.jsonc block's, the `AI` binding, `DRAFT_LIMIT`, `DRAFT_MODEL`, `PUBLIC_WEB_URL` and the code store's `CODE_CACHE` among them, and each port's factory takes its binding as the generated Env types it, without a cast); `packages/project/test/code-history.test.ts` (a kept code-history value is decoded with Schema when read, and one that no longer decodes is computed again); `packages/project/test/code.test.ts` (a kept commit that no longer decodes is computed again); `apps/web/test/dev-fixtures.test.ts` (the dev world's fixture record is decoded through the protocol's schemas when the world is built, so every case reads only a record that decodes); `apps/web/test/server-params.test.ts` (a project route's server handler is handed the project's full name once, as Start's params parse it, never parsed again); `apps/web/test/theme.test.ts` (the theme preference is decoded with Schema when read from `localStorage`, and a value it never wrote, or storage the browser refuses, reads as the system's own) |

Merge build/1499-w14-integration into mainoscabrielbefore adoptioncb4fcca

line 17why, one step back
17| 3 | **Refusals are a closed `Schema.TaggedError` union and a public contract.** Handle them with `Match.exhaustive` or `catchTags`. Each carries a `retryable` and a `next` command fixed per tag, an optional `at`, and no `message` field. A `_tag` is renamed only with an alias. `protocol/render` is the one renderer for git `remote:`, CLI and MCP text. Stage-1 refusals accumulate. | `packages/protocol/test/refusal.test.ts` and `packages/protocol/test/render.test.ts` (every tag, the code reads' and drafting's `UnknownPath`, `UnknownRevision`, `UnknownProposal`, `ProposalClosed` and `DraftInProgress` included; a limit's refusal names its kind and its wait, and a ref outside `refs/heads/` reads as one the platform writes); `packages/agent-kit/test/full-llms.test.ts` (every tag in the union has a row in `/llms-full.txt`); `packages/protocol/test/mcp.test.ts` (a refusal from tools/call keeps its tag); `anti-slop-effect/prefer-effect-match` and `anti-slop-effect/no-manual-tag-comparison`; `packages/gate/test/shape.test.ts` (one push hears every stage-1 refusal at once); `apps/platform/test/mcp.test.ts` (each refusing MCP contract comes back as its exact refusal, `draftAsk`, `showProposal` and a code read's `UnknownPath` included); `apps/platform/test/workflows/draft.test.ts` (past the draft limit, `CapReached`); `apps/cli/test/policy.test.ts`; `apps/cli/test/local/check.test.ts` (the local check gives the gateway's stage-1 refusals for the same commit); `packages/protocol/test/exit-code.test.ts` (each tag's CLI exit code is pinned, 75 exactly when it is retryable); `packages/config/test/legacy-projects.test.ts` (the same alias rule for a project's address: the forty projects made before owners keep their keys as aliases of their full names, the two examples and the import plan's, each key and each name once) |

Merge redesign into mainoscabrielbefore adoptioncaedd21

lines 18–22why, one step back
18| 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, `policy`, `ask draft` and `proposal` included); `packages/protocol/test/mcp.test.ts` (every MCP tool's schemas, with no JSON Schema leak, the policy and drafting contracts included; the five capped code reads are tools, `showCommit` and `listPaths` are not); `packages/agent-kit/test/install-channels.test.ts` and `apps/web/test/agents.test.tsx` (every snippet, command and link on the Install page is `@repo/agent-kit`'s, and the old `/agents` answers a 301 to `/install`); `packages/agent-kit/test/docs.test.ts` and `apps/web/test/docs.test.tsx` (the `/docs` pages name only the CLI's commands with flags each takes and link only to pages that exist, the reference lists every command, refusal, event, MCP tool, limit, endpoint and imported project from its source, and the web draws each page and its Markdown from that one text); `apps/web/test/llms.test.ts` (`/` and `/<project>` asked for Markdown answer with the `llms.txt` texts, and their HTML names that Markdown as an alternate); `packages/agent-kit/test/full-llms.test.ts` (one `ProjectEvent` line per tag); `apps/platform/test/home.test.ts` (the platform's `/` in Markdown is the web's `llms.txt`, one text from `@repo/agent-kit`); `packages/protocol/test/project-name.test.ts` (`ProjectName` is the one parser of a project's name for every surface: lowercase, a legacy key read as its full name, encoded only in the full form, and a key that reads back to its name); 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`); `apps/web/test/shell.test.tsx` (the footer's wordmark is `Brand.domain`, read from `@repo/brand`, never typed) |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/platform/test/router-build.test.ts` (both handlers are built when the Worker module loads, with no binding touched, and a layer that awaits a promise while it is built is refused there); `apps/web/test/production-bundle.test.ts` (no dev-world module in the web's production build, and no chunk every page preloads holds the Markdown renderer, under a gzip ceiling); `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); `packages/drafting/test/memory.test.ts` (the `Drafter` port's `/memory` adapter, `packages/drafting/src/drafter/memory.ts`) and `packages/drafting/test/binding.test.ts` (its Workers AI adapter over the `AI` binding); `apps/platform/test/mailer.test.ts` (sign-in's `Mailer` port, its `/memory` adapter and its Email Service adapter over the `EMAIL` binding); `packages/project/test/code-store.test.ts` (the `CodeStore` port's `/memory` adapter, `packages/project/src/code-store/memory.ts`, and its R2 adapter over `CODE_CACHE`, whose failures are misses, never the read's); `apps/platform/test/code-reads.test.ts` and `apps/web/test/dev-backend.test.ts` (the platform and the web's dev world answer the code reads and raw files alike, both through `@repo/project/code`); `packages/project/test/standing-posture.test.ts` (one helper, `withStandingPosture`, gives a listing each project's own posture, for the platform and the web's dev world alike, through the `StandingPostures` port whose default keeps nothing; its D1 adapter is the platform's); `packages/project/test/description.test.ts` and `packages/project/test/description-d1.test.ts` (the `ProjectDescriptions` port's `/memory` adapter, `packages/project/src/description/memory.ts`, and its D1 adapter, whose unreadable rows and missing table are misses); `apps/web/test/seeded.test.tsx` (a loader's read seeds a registry of its own page and leaves the registry every request shares as it was); `apps/web/test/shell.test.tsx` (no plain anchor between the web's pages: every link is the router's). 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, Artifacts or `CODE_CACHE` binding) and `apps/platform/test/env.test-d.ts` (only the platform's has both); `packages/project/test/code-raw.test.ts` and `apps/platform/test/raw.test.ts` (raw bytes under `nosniff` and the sandboxing CSP, refusals included); `apps/platform/test/code-reads.test.ts` (no code read's payload names a repo); `packages/project/test/code-history.test.ts` (the code store is keyed under the project's canonical repo alone and holds no landing); `apps/platform/test/w9-contracts.test.ts` (`projectPolicy` answers without the policy's layers or asks, and `packages/config/test/cartridge.test.ts` keeps the cartridge removable); `packages/drafting/test/prompt.test.ts` (a draft's prompt never carries a layer's name, repo, reason or paths); `apps/web/test/markdown.test.tsx` (a README's script, handlers, unsafe URLs, iframes, styles and forms never reach the page); `apps/platform/test/gateway.test.ts` and `packages/gate/test/parse.test.ts` (a fork takes branches only: its notes, tags and the platform's refs are refused); `packages/protocol/test/fork-address.test.ts` (a fork's address is a closed parse that never joins text into a ref path), with `packages/project/test/code.test.ts` and `apps/platform/test/code-reads.test.ts` (a fork is read only at the address of a claim fork the project lists, and a layer's repo, an unlisted fork or a repo's name is `UnknownRevision`); `packages/protocol/test/recent-landing.test.ts` and `packages/project/test/recent-landings-d1.test.ts` (a kept refusal is its tag and area alone); `apps/platform/test/visibility/posture-listing.test.ts` and `apps/platform/test/home.test.ts` (the project list and the platform's `/` show the posture the project's ledger shows); `apps/web/test/landing.test.tsx` (the landing's latest landings name each by its project, and a refused answer by its tag and its area alone, never a check's name, suite, lane, path or log) and `apps/web/test/explore.test.tsx` (each project's card shows the posture its listing gives); `apps/web/test/ledger.test.tsx` (the Visibility tab's ledger adds no path, check name or file name, and the tab's views import nothing from the visibility cartridge) and `apps/web/test/env.test.tsx` (its Environment shows no value and no control to set or read one, and the old `/env` and `/ledger` answer a 301 to the tab); `apps/web/test/home.test.tsx`, `apps/web/test/today.test.tsx` and `apps/web/test/edge-cache.test.ts` (`/inbox` is read with the reader's own session and kept by no cache, and the old `/home` and `/today` answer a 301 to it); `apps/web/test/theme.test.ts` and `apps/web/test/settings.test.tsx` (the theme preference lives in `localStorage` and never in a cookie, so it makes no page personal); `apps/platform/test/pages.test.ts` (the sign-in page, as an MCP client's consent, escapes every value a client supplies, and every sign-in form shown again escapes what the person typed); `apps/platform/test/oauth.test.ts` (no account is written, and no grant given, until its email is proved by a mailed code, and a password reset reads the same for an address no account has); `apps/platform/test/gateway-owner.test.ts` (the gateway reads a full name, a source path, a legacy key or a fork's address to the repo its project's key names, and an owner alone or a name under a page's word to none) |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`; `apps/platform/test/workflows/draft.test.ts` (a replayed draft round asks the model nothing more, and each round is its own instance); `packages/project/test/code.test.ts` (code reads cached by object id, only once finished, while `main` resolves every time, and a commit's diff kept by its SHA without its landing); `packages/project/test/drafting.model.test.ts` (a settle of a stale round changes nothing); `packages/project/test/import.test.ts` (a retried import adopts the repo it made, and a retried import keeps its source); `packages/project/test/code-history.test.ts` (a why and a path's history are kept by commit, path hash and algorithm version, and the store, a step from a kept ancestor and a whole walk agree); `packages/config/test/smoke-loop.test.ts` (smoke's throwaway project is in the ledger before init makes it, and a taken name stops before anything is made); `apps/web/test/events.test.ts` (the web's fold of a project's events gives the same map when an event is heard twice or out of order, and a replay that already holds a landing stamps nothing); `packages/project/test/standing-posture.test.ts` (a kept posture is read again only for the project whose event the projection applied, or once its instant has come); `packages/project/test/recent-landings-d1.test.ts` (the same rows heard again change nothing, and at most `RECENT_LANDINGS_CAP` rows are kept); `packages/project/test/description.test.ts` (a landed project is read once while its last landing stands). No fence: one push deduped by (repo, sha) across the gateway's record and OnPush's |

Prune the repo's agent scaffolding: verify guards the product, and ported files carry their own licence noticeoscabrielbefore adoption0e95d48

lines 23–24why, one step back
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 |

Add the live-run tooling: smoke --loop, seed --as, a recording lock for deploys, and a Playwright check of the deployed weboscabrielbefore adoption030c4d6

line 25why, one step back
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`), and refuses every deploy while `infra/.recording` is there (`packages/config/test/recording.test.ts`) |

Close the wave: openings are heard as landings, and the code store is written downoscabrielbefore adoption2587726

line 26why, one step back
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); `packages/project/test/drafting.model.test.ts` (a proposal's `DraftCommand.DraftStarted` and `DraftSettled` over generated histories; a Ready round's files survive a later failed round); `apps/platform/test/project-do.test.ts`. No fence: `Effect.sleep` and `Effect.delay` in `packages/project/src` |

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

line 27why, one step back
27

Prune the repo's agent scaffolding: verify guards the product, and ported files carry their own licence noticeoscabrielbefore adoption0e95d48

line 28why, one step back
28## Verify

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

line 29why, one step back
29

Merge build/root-docs-tidy into mainoscabrielbefore adoption378d320

line 30why, one step back
30`bun run verify` runs `lockfile:check`, `check`, `typecheck`, `test`, `brand:check` and `bytes:check`, and stops at the first failure. Run `bun run fix`, then `bun run verify`, before you stop. When a check fails, fix the cause. Loosening, skipping or disabling a check needs the maintainer's sign-off.

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

lines 31–36why, one step back
31
32**Safe by default:**3334- new or tightened tests;35- tightening a rule;36- changing a lint rule that fights an idiom Effect's own docs use, with the reason beside it in `oxlint.config.ts` (lint fits Effect, not the other way around);

Prune the repo's agent scaffolding: verify guards the product, and ported files carry their own licence noticeoscabrielbefore adoption0e95d48

line 37why, one step back
37- an escape with its reason, where no idiomatic code does the job;

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

line 38why, one step back
38- docs;

Merge build/readme-cut into mainoscabrielbefore adoption5792317

line 39why, one step back
39- a cut that removes a cartridge by deletion (see Nouns).

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

line 40why, one step back
40

Merge build/root-docs-tidy into mainoscabrielbefore adoption378d320

line 41why, one step back
41**Needs the maintainer's sign-off:**

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

line 42why, one step back
42

Merge branch 'build/707-adr-glossary-agents-fold-ins'oscabrielbefore adoption2b1fd3c

line 43why, one step back
43- a dependency that no `package.json` in the repo has yet;

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

line 44why, one step back
44- any version change to effect, wrangler or pi;

Prune the repo's agent scaffolding: verify guards the product, and ported files carry their own licence noticeoscabrielbefore adoption0e95d48

line 45why, one step back
45- loosening `oxlint.config.ts`, `tsconfig.base.json` (map, overrides, allow-lists), `bunfig.toml`, `turbo.json` or `package.json` scripts;

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

lines 46–47why, one step back
46- renaming or removing a DO class;
47- deleting any Cloudflare resource;

Prune the repo's agent scaffolding: verify guards the product, and ported files carry their own licence noticeoscabrielbefore adoption0e95d48

line 48why, one step back
48- any deploy during a recording.

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

lines 49–51why, one step back
49
50## Commands51

Merge branch 'build/707-adr-glossary-agents-fold-ins'oscabrielbefore adoption2b1fd3c

line 52why, one step back
52Run each as `bun run <name>` from the repo root; `--` passes flags to the script.

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

line 53why, one step back
53

Prune the repo's agent scaffolding: verify guards the product, and ported files carry their own licence noticeoscabrielbefore adoption0e95d48

line 54why, one step back
54- `verify`: the gate (see Verify).

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

line 55why, one step back
55- `check`: lints and checks formatting; an unused escape directive fails it.

Prune the repo's agent scaffolding: verify guards the product, and ported files carry their own licence noticeoscabrielbefore adoption0e95d48

line 56why, one step back
56- `fix`: applies lint fixes and formatting.

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

lines 57–61why, one step back
57- `typecheck`: type-checks every workspace and the root's scripts, Effect diagnostics included.
58- `test`: runs every workspace's tests.59- `brand:check`: fails when the name appears outside `packages/brand` and prose.60- `bytes:check`: fails when a Worker's bundle grows past its byte budget.61- `lockfile:check`: fails when `bun.lock` is out of date with the manifests.

Merge branch 'build/707-adr-glossary-agents-fold-ins'oscabrielbefore adoption2b1fd3c

line 62why, one step back
62- `prepare`: runs on `bun install` and patches TypeScript with the Effect language service.

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

lines 63–64why, one step back
63- `env:check`: shows the env with its values redacted.
64- `ops -- <command>`: runs cf with the ops credentials (see Boundaries).

Merge branch 'build/707-adr-glossary-agents-fold-ins'oscabrielbefore adoption2b1fd3c

line 65why, one step back
65- `bootstrap -- --stage <stage>`: makes a stage's Cloudflare resources; a second run creates nothing, and `--dry-run` only prints the plan.

Add a prod stage served on the brand's own domainoscabrielbefore adoption78a5062

lines 66–68why, one step back
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`. `prod` is served on the brand's own domain (the web at the apex, the platform at `git.`), which `infra/stages.ts` names and the deploy passes to Wrangler, so the name stays out of `wrangler.jsonc`.
67- `smoke -- --stage <stage>`: read-only probes against a live stage. `--loop` then runs the whole core loop on a throwaway project, `smoke-<run>`, through the CLI and git, and refuses `demo` and `prod`.68- `seed`: puts the two example projects on a platform (`--world node` on this machine, or `--stage <stage>`); a second run changes nothing. `--only <example> --as <name>` seeds a fresh copy under another name, and refuses a taken one. It refuses `prod`, as `swarm` does: their projects and people are fictional.

Merge build/agents-private into mainoscabrielbefore adoptionb1f69d8

line 69why, one step back
69- `import-examples -- --stage <stage>`: imports the open-source repos the code browser is previewed on, one at a time, onto a stage (`demo` included, with its reason in the stage's record), each recorded in the ledger as kept; `--tags` backfills the tags Artifacts' import leaves out, `--only <name>` imports one, and `--world node` imports onto this machine.

Close W7: cross-compile the release again, guard pi's edits, and keep the swarm out of this checkoutoscabrielbefore adoption842f042

line 70why, one step back
70- `swarm -- --stage <stage> --project <name>`: plans six fictional contributors, on four harnesses, against one split family on a stage, claims each one's ask, prepares a workspace with a clone of its fork outside the checkout, starts each harness headless on the brief and sends every refusal back into the same session, at most three times, then writes the run's summary; `--view herdr` runs them in herdr panes beside a counter, and `--dry-run` only prints the plan.

Say what swarm and release do now that both are built, and name the pi adapter's files in its cut rowoscabrielbefore adoption5060ac3

line 71why, one step back
71- `release -- --build | --upload --stage <stage> | --publish`: builds the CLI's npm package and two binaries, uploads a release to the stage's own bucket, which the platform serves, and leaves `npm publish` to a person: under an agent it prints the command instead.

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

lines 72–89why, one step back
72
73## Nouns7475Each code noun has one home:7677- **Contract:** one Rpc in `protocol/src/contracts.ts`.78- **Projection:** `protocol/{cli,mcp}` and `apps/*/src/surfaces.ts`.79- **Port:** the owning package's `src/<port>.ts`.80- **Adapter:** `<package>/src/<port>/{memory,binding,rest,sqlite,local,isogit,worker,bun,json}.ts`.81- **Lifecycle:** `project/src/{claim,landing}.ts`.82- **Stage:** `gate/src/stages/*.ts`.83- **Cartridge:** a cut line removable by deletion.8485Contributors meet four domain nouns: ask, answer, check and refusal. They are vocabulary, not the brand. `GLOSSARY.md` defines them.8687## Boundaries8889- **Competition rules apply to repo text.** Describe rival projects by mechanism, neutrally. All of this repo's code is public; no part of the submission lives in a private layer.

Merge build/root-docs-tidy into mainoscabrielbefore adoption378d320

lines 90–92why, one step back
90- **Git.** Commit on branches and merge locally. Pushing and adding a remote are the maintainer's to do.
91- **Env.** To see the env, run `bun run env:check` (`varlock load --agent`, values redacted). That is the only way to read it: `.env`, `.env.local` and `.env.*.local` stay closed. To add a variable, edit the `.env.schema` that owns it (`infra/` for tool credentials, an app's for its Worker) and ask the maintainer to set the value. Product code reads a project's `.env.schema` only through `@repo/visibility`'s parser, and never resolves it.92- **Deploy and ops.** Deploy with Wrangler, through `infra/deploy.ts`. `cf` handles read-mostly API operations, run as `bun run ops -- <command>`. Find a command with `bun run ops -- cli search "…"` and `bun run ops -- schema <command>`, and try it with `--dry-run` before a real call. Leave cf's project commands (`dev`, `build`, `deploy`, `init`, `migrate`, `previews`) and the global `cf` alone. Ask the maintainer before any cf `delete` or `revoke`, and keep `apps/platform` undeployed while a recording runs: `bun infra/recording.ts on` makes every deploy refuse until a person runs `off`. `wrangler delete` auto-confirms in a non-interactive shell, so never run it without the maintainer's OK; cf deletes need `--force` when non-interactive. Throwaways leave through `bun infra/teardown.ts`, which prints its plan from the ledger (`infra/created.jsonl`); its `--apply` deletes, so it is the maintainer's to run, as a cf `delete` is.

Prune the repo's agent scaffolding: verify guards the product, and ported files carry their own licence noticeoscabrielbefore adoption0e95d48

line 93why, one step back
93- **Ported code is ours.** A ported file carries its upstream licence notice in its header; a vendored folder or a font keeps its licence file beside it. Change ported files freely; upstream `main` is never synced in. Borrowed code stays under 15% of the codebase (aim for about 5%).

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

lines 94–96why, one step back
94
95## Effect traps96

Prune the repo's agent scaffolding: verify guards the product, and ported files carry their own licence noticeoscabrielbefore adoption0e95d48

line 97why, one step back
97- Wire schemas in `protocol` use `Schema.Int` or `Schema.Finite` in place of bare `Schema.Number`, and `Schema.optionalKey` in place of `Schema.optional`. The bare forms put `"Infinity"` strings and `null` into JSON Schema and MCP tool schemas, which `packages/protocol/test/mcp.test.ts` refuses.

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

lines 98–108why, one step back
98- The Effect language service reads an `@effect-diagnostics` directive anywhere in the source, string literals included, and a directive there fails `typecheck` (TS377000, "has no effect"). A test that needs the directive as data joins the string at run time.
99- Promises and web streams enter Effect through `Effect.tryPromise` and `Stream.fromReadableStream`/`toReadableStream`; the `asyncFunction` diagnostic bans `async`.100- Tests that spawn processes or open sockets use `it.live`; `it.effect` runs on the TestClock.101- `McpServer.layerStdio` interrupts the fiber that started it when stdin ends; in tests, fork the server and await it.102- The RPC HTTP client carries Rpc headers inside the body, so send a credential as a plain HTTP header.103104## Rejected dependencies105106Each was weighed and turned down; re-adding one needs sign-off.107108- `agents`: McpAgent is deprecated, it brings 17 peer dependencies, and it pins the MCP SDK at 2.0.0.

Merge build/root-docs-tidy into mainoscabrielbefore adoption378d320

lines 109–110why, one step back
109- `alchemy`: released Alchemy can't declare DO-managed containers, so it would be a two-tool hybrid, with beta churn.
110- cf's project commands, `cloudflare.config.ts` and `@cloudflare/config`: the config can't declare `triggers.events`, the deploy refuses the sandbox's container self-binding, and it would be a second deploy tool.

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

lines 111–112why, one step back
111- `@cloudflare/vite-plugin@beta`: a sha-tagged beta. Web stays on the stable plugin.
112- `@cloudflare/containers`: the pre-1.0 model.

Merge build/root-docs-tidy into mainoscabrielbefore adoption378d320

line 113why, one step back
113- `vite-plus`: not yet.

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

lines 114–117why, one step back
114- v3 `@effect/platform` and `@effect/cli`; `effect/workflow`; `effect/cluster`.
115- `@effect/language-service` as a package: on TypeScript 7, `@effect/tsgo` serves the plugin.116- nx, moon, biome, ink, commander, citty, @clack/prompts, rwsdk, react-router, foldkit, Terraform, Pulumi, SST, node-diff3, pnpm.117- varlock's runtime (`@varlock/cloudflare-integration/init`, `varlock/env`, `varlock/auto-load`) in any Worker: it wraps the global `Response`, and the gateway streams git packs. `varlockCloudflareVitePlugin()` in `apps/web`: web has no secrets.

Merge build/root-docs-tidy into mainoscabrielbefore adoption378d320

line 118why, one step back
118- `@cloudflare/forge`, its SDK transformer, `fern-api` and cf's generator: they aren't on npm, Fern rejects our `_tag` unions, and the output carries Cloudflare branding. No HttpApi, OpenAPI or `openapi.json` surface, and no "generated by Forge" claim.

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

line 119why, one step back
119- From Rat Stack: `packages/capability` as the schema source (fallback only), `toHttpApi`, code mode, the subprocess sandbox, devtools, the 1,534-line oxlint boundaries plugin, and any fork or template of the repo.

Merge build/root-docs-tidy into mainoscabrielbefore adoption378d320

line 120why, one step back
120- XState; the `no-comments` rule; Alchemy PR preview packages; `herdr-ts-sdk`.

Close the code browser and drafting wave: its decisions in two ADRs, every rule it added held, and its leftovers folded inoscabrielbefore adoption009640c

lines 121–122why, one step back
121- shadcn's `command` (it brings `cmdk`, built on Radix), `sidebar` (its source calls `Math.random()`, which typecheck refuses, and its `use-mobile` hook fails lint) and `resizable` (it adds `react-resizable-panels`, and a fixed grid does the job) in `apps/web`.
122- DOMPurify for a README's HTML: it needs a DOM, which the Worker has not got. `rehype-sanitize` runs the same on the server and in the browser.

Merge build/root-docs-tidy into mainoscabrielbefore adoption378d320

lines 123–124why, one step back
123- Any inbound or two-way sync with another code host. It would be a second way onto `main` that skips the gate.
124- A decentralised-identity client (an atproto OAuth client, a DID resolver) behind the handle: a sign-in redesign and a third party's account as identity. A second identity, if ever, is a key the person holds.

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

line 125why, one step back
125

Merge build/agents-private into mainoscabrielbefore adoptionb1f69d8

line 126why, one step back
126## Working docs

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

line 127why, one step back
127

Merge build/root-docs-tidy into mainoscabrielbefore adoption378d320

line 128why, one step back
128The maintainer's working notes (decision records, the stage record and the issue tracker) are not in this repo, and nothing committed depends on them; a clone has `README.md`, `GLOSSARY.md` and this file.

Integrate W5 group A: the dev world opens burrow's migrate as its family, reads the session cookie, and lists when each project last landedoscabrielbefore adoptionf9bd621

lines 129–139why, one step back
129
130<!-- BEGIN:turborepo-agent-rules -->131132# This is NOT the Turborepo you know133134Turborepo configuration, task behavior, and CLI commands can vary between installed versions and may differ from your training data. Resolve the `turbo` package from this file's directory or relevant workspace; in monorepos, it may not be visible from the repository root. For example, run `node -p "require.resolve('turbo/package.json')"` from a workspace that depends on `turbo`.135136Read `docs/README.md` inside that installed package first, then read the relevant pages from its `docs/` directory before changing Turborepo configuration or commands. Heed deprecation notices. These bundled docs match the installed package version and are available without network access.137138This block is written and re-added by `turbo` before repository-scoped commands when an AI agent is detected. In the Turborepo source repository, its template is defined in `crates/turborepo-cli/src/cli/agent_guidance.rs`. Removing the managed block while updates are enabled means a later qualifying invocation will add it again. Set `"agentGuidance": false` in the root `turbo.json` or `turbo.jsonc` to opt out; this does not remove an existing block. Keep the block committed with your work to avoid an uncommitted change on the next agent invocation.139<!-- END:turborepo-agent-rules -->