Skip to content
Myr

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.

authored by oscabriel · committed by oscabriel · parent cbc19ce · Browse files · 6 files+21 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

6 files+21 added−11 removed

  • tests:+13 added−3 removed
  • other:+8 added−8 removed

6 files+21 added−11 removed

modified:docs/adr/0006-landing-is-a-parse.md+1 added-1 removed
modified:docs/adr/0008-claims-are-exclusive-by-default.md+1 added-1 removed
modified:docs/adr/0014-landing-is-a-cas-push-of-main-then-bookkeeping-refs.md+1 added-1 removed
modified:packages/config/test/docs-public.test.ts+13 added-3 removed
22 unmodified lines
23 "plans.gneiss.run",24 ".scratch/build",25] as const;2627/**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 */32const PLAN_REFERENCES = [/\bspec §/u, /\bW\d \d{3}\b/u] as const;3334/** Terms the code uses in public names, each of which GLOSSARY.md defines. */35const TERMS = [36 "Claim fork",37 "Decision",
80 unmodified lines
118 const docs = yield* publicDocs;119120 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 lines
modified:AGENTS.md+4 added-4 removed
1# Myr23Myr 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.45The 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.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, check it and cut it; `docs/adr/` records each decision and why; `GLOSSARY.md` defines the words.67`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.89## Principles
8 unmodified lines
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); `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 lines
65- `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.7172## Nouns7374Each code noun has one home:
71 unmodified lines
modified:GLOSSARY.md+1 added-1 removed
38 unmodified lines
39**Check kind**:40The shape of an ask's check: redThenGreen, lintToZero, ratchet, migrate, or symbolAbsent (a family's delete child).4142**Family**:43A 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.43A 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, batch4546**Territory**:47The module (by default a workspace package) an answer may change.
160 unmodified lines