Skip to content
Myr

Merge demo/prod-ready 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 c581230, d162d8c · Browse files · 11 files+79 added−61 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

11 files+79 added−61 removed

  • tests:+55 added−16 removed
  • other:+24 added−45 removed

11 files+79 added−61 removed

modified:apps/web/src/features/agents/install-page.tsx+1 added-3 removed
145 unmodified lines
146147const ChannelCard = ({ channel }: { readonly channel: InstallChannel }) => (148 <section149 aria-labelledby={channel.id}150 className={`bg-card flex min-w-0 flex-col gap-3 rounded-md border p-4 ${151 channel.planned ? "border-rule border-dashed" : "border-rule"152 }`}150 className="bg-card border-rule flex min-w-0 flex-col gap-3 rounded-md border p-4"151 >152 <div className="flex min-w-0 flex-wrap items-baseline gap-x-3 gap-y-1">153 {/* The anchor's target: its margin clears the sticky top bar, with room above the title. */}154 <h2
48 unmodified lines
modified:apps/web/src/features/landing/ways-in.tsx+4 added-4 removed
modified:apps/web/test/agents.test.tsx+6 added-4 removed
171 unmodified lines
172 })173 );174175 it.effect(176 "shows the pi extension as planned, with no command, and git over HTTPS with no SSH key",176 "installs only by the script, says nothing is planned, and shows git over HTTPS with no SSH key",177 () =>178 Effect.gen(function* () {179 const html = yield* page;180 const pi = sectionOf(html, "pi");180182 expect(textOf(pi)).toContain("Planned");183 expect(codeOf(pi)).toStrictEqual([]);181 expect(182 codeOf(html).filter((code) => code.includes("npm"))183 ).toStrictEqual([]);184 expect(textOf(html)).not.toMatch(/planned|until then/iu);185 expect(codeOf(sectionOf(html, "cli"))[0]).toContain("/install.sh | sh");186 expect(textOf(sectionOf(html, "git"))).toContain("HTTPS");187 expect(188 textOf(html)189 .replaceAll("no SSH keys", "")
70 unmodified lines
modified:packages/agent-kit/src/agent-setup.ts+1 added-1 removed
8 unmodified lines
9import { span } from "./sections.ts";10import { code, listed, page, printJson, table } from "./text.ts";1112export interface SetupSnippet {13 /** A short name, for a tab or a list of choices: "Cursor", "npm". */13 /** A short name, for a tab or a list of choices: "Cursor", "stdio". */14 readonly name: string;15 readonly label: string;16 readonly language: "sh" | "json" | "text";17 readonly text: string;
334 unmodified lines
modified:packages/agent-kit/src/install-channels.ts+5 added-27 removed
1// The Install page's one source: every way to reach the platform, with the snippets `agentSetup` gives where a way is2// one of its channels, so the page and `/agents.md` never disagree on a command.3import { Brand } from "@repo/brand";42// one of its channels, so the page and `/agents.md` never disagree on a command. Every channel is one that works3// today: a way not built yet, or a package not published yet, has no card, so nothing on the page reads as unfinished.4import {5 anyAgent,6 hasCommand,7 installScript,
21 unmodified lines
29 /** One snippet shown at a time, chosen by its name. */30 readonly tabbed: boolean;31 readonly snippets: readonly SetupSnippet[];32 readonly links: readonly InstallLink[];34 /** Not built yet: it says so, and carries no command. */35 readonly planned: boolean;33}3435const channel = (36 fields: Pick<InstallChannel, "audience" | "id" | "summary" | "title"> &40 Partial<Pick<InstallChannel, "links" | "planned" | "snippets" | "tabbed">>37 Partial<Pick<InstallChannel, "links" | "snippets" | "tabbed">>38): InstallChannel => ({39 links: [],43 planned: false,40 snippets: [],41 tabbed: false,42 ...fields,43});4449const npm: SetupSnippet = {50 label: "Or from npm",51 language: "sh",52 name: "npm",53 text: `npm install -g ${Brand.cliPackage}`,54};5556/** The script's snippet, said for the machines it has a build for, then npm beside it. */45/** The script's snippet, said for the machines it has a build for: the one way to install the CLI. */46const cli = (input: SetupInput) =>47 channel({48 audience: "Terminal",49 id: "cli",
2 unmodified lines
52 {53 ...installScript(input),54 label: "The script, for Linux on x64 and macOS on Apple silicon",55 },67 npm,56 ...signIn(input),57 ],58 summary:59 "Find and claim asks, check an answer on your machine with the gate's first stage before you push, and read verdicts. You push with plain git.",
78 unmodified lines
138 audience: "Browser",139 id: "web",140 links: [{ label: "Sign in", page: false, path: "/auth/signin" }],141 summary:154 "Sign in to read your inbox, take a maintainer's decisions and propose asks. A list of the CLI sessions you have signed in and the agents you have connected is planned.",142 "Sign in to read your inbox, take a maintainer's decisions and propose asks.",143 title: "The web",144 });145158const pi = () =>159 channel({160 audience: "Harness",161 id: "pi",162 planned: true,163 summary: "Planned. Until then, pi works through the MCP server or skills.",164 title: "Pi extension",165 });166146export const installChannels = (147 input: SetupInput148): readonly InstallChannel[] => [149 cli(input),
1 unmodified line
151 skillsChannel(input),152 text(input),153 git(input),154 web(),176 pi(),155];
modified:packages/agent-kit/test/install-channels.test.ts+10 added-11 removed
modified:packages/config/test/seed.test.ts+39 added-1 removed
474 unmodified lines
475describe(optionsOf, () => {476 it.effect.each([477 [["--world", "node"], "World"],478 [["--stage", "dev-oscabriel"], "Stage"],479 [["--stage", "prod", "--allow-fictional"], "Stage"],480 ] as const)("takes %j as a seed of the %s", ([argv, where]) =>481 Effect.map(optionsOf(argv), (options) => {482 expect(options.where._tag).toBe(where);483 })
3 unmodified lines
487 [["--stage", "dev-oscabriel", "--yes"], "--yes"],488 [[], "--world node or --stage"],489 [["--world", "node", "--stage", "dev-oscabriel"], "only one"],490 [["--world", "workerd"], "--world node"],490 [["--stage", "prod"], "prod"],491 [["--stage", "prod"], "--allow-fictional"],492 [["--stage", "prod", "--world", "node"], "only one"],493 [["--world", "node", "--force"], "--force"],494 ] as const)("refuses %j, saying %s", ([argv, said]) =>495 Effect.map(Effect.flip(optionsOf(argv)), (failure) => {496 expect(failure.reason).toContain(said);497 })498 );499500 it.effect(501 "seeds prod only with --allow-fictional, and the flag changes no other stage's plan",502 () =>503 Effect.gen(function* () {504 const refused = yield* Effect.flip(optionsOf(["--stage", "prod"]));505506 expect(refused.reason).toContain("fictional");507508 const allowed = yield* optionsOf([509 "--stage",510 "prod",511 "--allow-fictional",512 ]);513514 expect(allowed.where).toStrictEqual(515 SeedWhere.cases.Stage.make({516 stage: "prod",517 tokens: { operator: "OPERATOR_TOKEN", sessions: "SESSION_TOKENS" },518 })519 );520521 const dev = yield* optionsOf([522 "--stage",523 "dev-oscabriel",524 "--allow-fictional",525 ]);526527 expect(dev.where).toStrictEqual(528 SeedWhere.cases.Stage.make({529 stage: "dev-oscabriel",530 tokens: { operator: "OPERATOR_TOKEN", sessions: "SESSION_TOKENS" },531 })532 );533 })534 );535536 it.effect(537 "reads which env vars hold the stage's tokens, and which project alone to seed",538 () =>539 Effect.map(540 optionsOf([
22 unmodified lines
modified:scripts/seed.ts+6 added-3 removed
57 unmodified lines
58 readonly json: boolean;59}6061const FLAGS = new Set([62 "--allow-fictional",63 "--as",64 "--json",65 "--only",66 "--operator-env",
3 unmodified lines
70 "--world",71]);7273const USAGE =73 "bun scripts/seed.ts --world node | --stage <dev-…> [--url <origin>] [--tokens-env SESSION_TOKENS] [--operator-env OPERATOR_TOKEN] [--only <project> [--as <copy>]] [--json]";74 "bun scripts/seed.ts --world node | --stage <dev-…> | --stage prod --allow-fictional [--url <origin>] [--tokens-env SESSION_TOKENS] [--operator-env OPERATOR_TOKEN] [--only <project> [--as <copy>]] [--json]";7576const failed = (reason: string) => new SeedFailed({ reason });7778const stageFrom = (argv: readonly string[]) =>
1 unmodified line
80 const stage = yield* stageOf(argv).pipe(81 Effect.mapError(({ message }) => failed(message))82 );8383 if (stage === "prod") {84 // The examples are fictional, and their pages say so: they reach the85 // real platform only when the person running the seed says they may.86 if (stage === "prod" && !argv.includes("--allow-fictional")) {87 return yield* failed(85 "--stage prod is the real platform: the examples are fictional, so seed them on a dev stage"88 "--stage prod is the real platform: the examples are fictional, so seed them on a dev stage, or add --allow-fictional to show them on prod as labelled examples"89 );90 }9192 const tokens = {
315 unmodified lines
modified:AGENTS.md+2 added-2 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 was built as an entry to Cloudflare's "Build the next GitHub" competition.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: 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.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`, the web's live answer page, 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.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
54 unmodified lines
64- `ops -- <command>`: runs cf with the ops credentials (see Boundaries).65- `bootstrap -- --stage <stage>`: makes a stage's Cloudflare resources; a second run creates nothing, and `--dry-run` only prints the plan. Either run ends by printing the stage's alerts (`infra/alerts.ts`), which a person makes by hand in the dashboard: no API takes a custom alert's query yet.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` with infra's credentials and `--since` the first upload. `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. `--since <instant>` then reads the stage's Workers Logs through the SQL API, with infra's credentials (Account Analytics Read), and fails on any exception or error-level line since then. `--loop` then runs the whole core loop on a throwaway project, `smoke-<run>`, through the CLI and git, and refuses `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.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. Their projects and people are fictional, so it refuses `prod` unless `--allow-fictional` is given, and each example's README says it is fictional on its page; `swarm` and `smoke --loop` refuse `prod` always.69- `import-examples -- --stage <stage>`: imports the open-source repos the code browser is previewed on, one at a time, onto any declared stage, `prod` included, 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.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.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.72
67 unmodified lines
modified:PRODUCT.md+1 added-1 removed
105 unmodified lines
106- Credit trailers read as they do on the commit (`Asked-by: ines-v`), in one order; `Assisted-by` is shown apart, because it is a disclosure, never credit.107108## Evidence on Hand109110- The examples `examples/datekit` (a date library with a maintainers layer of sealed checks and an `.env.schema`) and `examples/burrow` (six services with a lint ratchet and a migrate ask split six ways) are fictional projects with fictional people (`ines-v`, `okonkwo`, `bram`, `okafor`, `lin-h`, and burrow's vouched contributors). Pages show them as examples, never as real users.110- The examples `examples/datekit` (a date library with a maintainers layer of sealed checks and an `.env.schema`) and `examples/burrow` (six services with a lint ratchet and a migrate ask split six ways) are fictional projects with fictional people (`ines-v`, `okonkwo`, `bram`, `okafor`, `lin-h`, and burrow's vouched contributors). Pages show them as examples, never as real users: each example's README opens by saying it is fictional, and `seed` puts them on `prod` only when told to with `--allow-fictional`.111- Measured numbers come only from live runs on a stage, each with its date. No testimonials, customers or adoption figures exist; none may be invented.112113## Product Principles114
9 unmodified lines
modified:README.md+4 added-4 removed
31 unmodified lines
32bun run --cwd apps/web dev # the web over a dev world seeded with two fictional projects33bun run seed -- --world node # both examples, seeded onto a platform running in Node34```3536The CLI comes from the platform itself; `myr login` signs you in through the browser and sets up git's credential helper, so plain `git clone` and `git push` work:36The CLI comes from the platform itself: the web at `https://myr.technology` serves the installer, and `myr login` signs you in to the platform at `https://git.myr.technology` through the browser and sets up git's credential helper, so plain `git clone` and `git push` work:3738```sh39curl -fsSL <origin>/install.sh | sh40myr login --url <origin>39curl -fsSL https://myr.technology/install.sh | sh40myr login --url https://git.myr.technology41myr asks --project oscabriel/datekit42myr claim <ask>42myr claim <ask> --project oscabriel/datekit43```4445The web's `/docs` holds the guides and the full reference; `/llms.txt` and `myr mcp` serve the same to agents.46
77 unmodified lines