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
Provenance
- Commit
080e1fc- Tree
5c7a64a- Author
oscabriel <oscarhernandeziv@gmail.com>- Committer
oscabriel <oscarhernandeziv@gmail.com>- Parent 1
c581230- Parent 2
d162d8c
11 files changed+79 added−61 removed
modified:apps/web/src/features/agents/install-page.tsx+1 added-3 removed
145 unmodified lines146 147 const 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 <h248 unmodified linesmodified:apps/web/src/features/landing/ways-in.tsx+4 added-4 removed
11 unmodified lines1213141516171816171819202113 unmodified lines35363738403940414211 unmodified lines readonly platformUrl: string; readonly webUrl: string;}) => ( <ul className="tablet:grid-cols-2 columns:grid-cols-3 grid gap-x-8 gap-y-6"> {installChannels({ commands, platformUrl, webUrl }) .filter(({ planned }) => !planned) .map(({ audience, id, summary, title }) => ( {installChannels({ commands, platformUrl, webUrl }).map( ({ audience, id, summary, title }) => ( <li className="border-rule flex min-w-0 flex-col gap-1.5 border-t pt-4" data-way={id} key={id}13 unmodified lines </p> </div> <p className="text-ui text-muted-foreground">{summary}</p> </li> ))} ) )} </ul>);modified:apps/web/test/agents.test.tsx+6 added-4 removed
171 unmodified lines172 })173 );174 175 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");180 182- 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 linesmodified:packages/agent-kit/src/agent-setup.ts+1 added-1 removed
8 unmodified lines9 import { span } from "./sections.ts";10 import { code, listed, page, printJson, table } from "./text.ts";11 12 export 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 linesmodified: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.3-import { Brand } from "@repo/brand";4-2+// 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.4 import {5 anyAgent,6 hasCommand,7 installScript,21 unmodified lines29 /** 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 }34 35 const 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 });44 49-const npm: SetupSnippet = {50- label: "Or from npm",51- language: "sh",52- name: "npm",53- text: `npm install -g ${Brand.cliPackage}`,54-};55-56-/** 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. */46 const cli = (input: SetupInput) =>47 channel({48 audience: "Terminal",49 id: "cli",2 unmodified lines52 {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 lines138 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 });145 158-const 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- });166-146 export const installChannels = (147 input: SetupInput148 ): readonly InstallChannel[] => [149 cli(input),1 unmodified line151 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
43 unmodified lines4445464748484950515253545556585758596160616263646566676852 unmodified lines12112212312412412512612512612712812913013113212812913013113213343 unmodified lines "skills", "text", "git", "web", "pi", ]);
for (const each of channels) { expect([each.id, each.title, each.audience, each.summary]).not.toContain( "" ); } });
it("install the CLI by script or from npm, then sign in to the platform", () => { it("install the CLI by the script alone, then sign in to the platform", () => { expect(textsOf(channel("cli"))).toStrictEqual([ `curl -fsSL ${webUrl}/install.sh | sh`, `npm install -g ${Brand.cliPackage}`, `${Brand.cli} login --url ${platformUrl}`, ]); expect( channels.flatMap(textsOf).filter((each) => /\bnpm install\b/u.test(each)) ).toStrictEqual([]); });
it("give MCP one tab per client and stdio, with the snippets agentSetup gives", () => { const mcp = channel("mcp");52 unmodified lines channels.flatMap(textsOf).filter((each) => /ssh:|git@|ssh-/iu.test(each)) ).toStrictEqual([]); });
it("show the web and the pi extension with no command, the extension as planned", () => { const pi = channel("pi");
it("show the web with no command, and no channel says it is planned", () => { expect(channel("web").snippets).toStrictEqual([]); expect( channels.filter(({ planned }) => planned).map(({ id }) => id) ).toStrictEqual(["pi"]); expect([pi.snippets, channel("web").snippets]).toStrictEqual([[], []]); expect(pi.summary).toContain("MCP"); expect(pi.summary).toContain("skills"); channels .flatMap(({ summary, title }) => [summary, title]) .filter((each) => /\bplanned\b|\bnot yet\b|\buntil then\b/iu.test(each)) ).toStrictEqual([]); });});modified:packages/config/test/seed.test.ts+39 added-1 removed
474 unmodified lines475 describe(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 lines487 [["--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 );499 500 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"]));505+506+ expect(refused.reason).toContain("fictional");507+508+ const allowed = yield* optionsOf([509+ "--stage",510+ "prod",511+ "--allow-fictional",512+ ]);513+514+ expect(allowed.where).toStrictEqual(515+ SeedWhere.cases.Stage.make({516+ stage: "prod",517+ tokens: { operator: "OPERATOR_TOKEN", sessions: "SESSION_TOKENS" },518+ })519+ );520+521+ const dev = yield* optionsOf([522+ "--stage",523+ "dev-oscabriel",524+ "--allow-fictional",525+ ]);526+527+ 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+ );535+536+ 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 linesmodified:scripts/seed.ts+6 added-3 removed
57 unmodified lines58 readonly json: boolean;59 }60 61 const FLAGS = new Set([62+ "--allow-fictional",63 "--as",64 "--json",65 "--only",66 "--operator-env",3 unmodified lines70 "--world",71 ]);72 73 const 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]";75 76 const failed = (reason: string) => new SeedFailed({ reason });77 78 const stageFrom = (argv: readonly string[]) =>1 unmodified line80 const stage = yield* stageOf(argv).pipe(81 Effect.mapError(({ message }) => failed(message))82 );83 83- 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 }91 92 const tokens = {315 unmodified linesmodified:AGENTS.md+2 added-2 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 was built as an entry to Cloudflare's "Build the next GitHub" competition.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: 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.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`, 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.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 ## Principles54 unmodified lines64 - `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 linesmodified:PRODUCT.md+1 added-1 removed
105 unmodified lines106 - 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.107 108 ## Evidence on Hand109 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.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.112 113 ## Product Principles114 9 unmodified linesmodified:README.md+4 added-4 removed
31 unmodified lines32 bun run --cwd apps/web dev # the web over a dev world seeded with two fictional projects33 bun run seed -- --world node # both examples, seeded onto a platform running in Node34 ```35 36-The 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:36+The 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:37 38 ```sh39-curl -fsSL <origin>/install.sh | sh40-myr login --url <origin>39+curl -fsSL https://myr.technology/install.sh | sh40+myr login --url https://git.myr.technology41 myr asks --project oscabriel/datekit42-myr claim <ask>42+myr claim <ask> --project oscabriel/datekit43 ```44 45 The web's `/docs` holds the guides and the full reference; `/llms.txt` and `myr mcp` serve the same to agents.46 77 unmodified lines