Merge docs/onboarding into main, keeping the Install page without the npm snippet the other branch dropped and naming the install script in the AGENTS.md block
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by oscabriel · committed by oscabriel · parents db02276, 41e1e04 · Browse files · 22 files·+338 added−89 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
22 files+338 added−89 removed
- tests:+139 added−21 removed
- other:+199 added−68 removed
Provenance
- Commit
59ed81f- Tree
23808c1- Author
oscabriel <oscarhernandeziv@gmail.com>- Committer
oscabriel <oscarhernandeziv@gmail.com>- Parent 1
db02276- Parent 2
41e1e04
22 files changed+338 added−89 removed
modified:apps/cli/src/local/login.ts+1 added-1 removed
242 unmodified lines243 return yield* originOf(current.value.url);244 }245 246 return yield* new LoginUsage({247- reason: `no platform to log in to for profile ${name}: run ${Brand.cli} login --url https://<platform host>${Option.isSome(profile) ? ` --profile ${name}` : ""}`,247+ reason: `no platform to log in to for profile ${name}: run ${Brand.cli} login --url https://git.${Brand.domain}${Option.isSome(profile) ? ` --profile ${name}` : ""}`,248 });249 });250 251 const tokenFromStdin = Effect.gen(function* () {393 unmodified linesmodified:apps/cli/test/local/login.test.ts+4 added-2 removed
462 unmodified lines463 30_000464 );465 466 it.live(467- "with no --url and no stored profile, asks for --url",467+ "with no --url and no stored profile, asks for --url, naming the platform's own host",468 () =>469 Effect.gen(function* () {470 const env = yield* home;471 const platform = yield* seams(signedInAs("alice"));4 unmodified lines476 stdin: `${given}\n`,477 });478 479 expect(Exit.isFailure(exit)).toBeTruthy();480- expect((yield* printed).stderr.join("\n")).toContain("--url");480+ expect((yield* printed).stderr.join("\n")).toContain(481+ `${Brand.cli} login --url https://git.${Brand.domain}`482+ );483 }).pipe(Effect.scoped, Effect.provide(testServices)),484 30_000485 );486 });286 unmodified linesmodified:apps/cli/test/commands-doc.test.ts+27 added-1 removed
15 unmodified lines16 const Takes = Schema.Struct({17 args: Schema.Array(18 Schema.Struct({ name: Schema.String, required: Schema.Boolean })19 ),20+ description: Schema.String,21 flags: Schema.Array(22 Schema.Struct({23 name: Schema.String,24 required: Schema.Boolean,10 unmodified lines35 36 const takesOf = (doc: HelpDoc.HelpDoc) =>37 encodeTakes({38 args: (doc.args ?? []).map(({ name, required }) => ({ name, required })),39+ description: doc.description,40 flags: doc.flags.map(({ name, required, type }) => ({41 name,42 required,43 type,132 unmodified lines176 const commands = yield* runnable;177 178 const differ = rows.flatMap((row) => {179 const { takes } = commands.get(words(row)) ?? {178- takes: { args: [], flags: [] },180+ takes: { args: [], description: "", flags: [] },181 };182 183 const flags = [...declared(row, takes)].toSorted();184 const real = takes.flags.map(({ name }) => name).toSorted();13 unmodified lines198 30_000199 );200 201 it.effect(202+ "say what each command does in the CLI's own words: a local command's exactly, a contract's as its help begins",203+ () =>204+ Effect.gen(function* () {205+ const commands = yield* runnable;206+207+ const differ = rows.flatMap((row) => {208+ const said = commands.get(words(row))?.takes.description ?? "";209+210+ const same =211+ row.source === "local"212+ ? said === row.summary213+ : said.startsWith(row.summary);214+215+ return same216+ ? []217+ : [{ command: words(row), said, summary: row.summary }];218+ });219+220+ expect(differ).toStrictEqual([]);221+ }),222+ 30_000223+ );224+225+ it.effect(226 "require a contract's required fields as flags, all but the --project the repo fills",227 () =>228 Effect.gen(function* () {229 const commands = yield* runnable;32 unmodified linesmodified:packages/agent-kit/src/docs/answer-an-ask.ts+13 added-3 removed
19 unmodified lines2021222324252627282930312632333435363738397 unmodified lines4748495043515253545556575859606162635464656667684 unmodified lines19 unmodified lines `[The open asks](/asks) list every open ask across projects, each saying what done means and whether you may take it. ${cli("front")} lists the same in a terminal, and ${cli("asks --project <owner>/<name>")} lists one project's. Some asks are held for newcomers, with a mentor named.`, "", `Read one in full before you claim it: ${cli("ask <ask> --project <owner>/<name>")}. Its brief says the want, the territory (the part of the code you may change), what is out of scope, and the check that fails on \`main\` today.`, "", "## Clone the project", "", "Work in a clone of the project, so your answer starts from its `main`:", "", ...shell(`git clone ${platformUrl}/<owner>/<name>.git`, "cd <name>"), "", "## Claim it", "", `${cli("claim <ask> --project <owner>/<name>")} gives you the ask alone, for a while: nobody else may answer it while your claim is live. It prints your fork's remote, ${code("<owner>/<name>--<ask>--<handle>")}. Each push keeps the claim alive; a claim with no push for too long lapses, and the ask is open again. Claiming it again returns the claim you hold. To let it go: ${cli("release <ask> --project <owner>/<name>")}.`, `In the clone, ${cli("claim <ask> --project <owner>/<name>")} gives you the ask alone, for a while: nobody else may answer it while your claim is live. It prints your fork's remote, ${code("<owner>/<name>--<ask>--<handle>")}. Each push keeps the claim alive; a claim with no push for too long lapses, and the ask is open again. Claiming it again returns the claim you hold. To let it go: ${cli("release <ask> --project <owner>/<name>")}.`, "", `Add the fork as a remote named ${code(Brand.slug)}, beside the clone's \`origin\`; you push your answer there:`, "", ...shell( `git remote add ${Brand.slug} <remote>`, `git fetch ${Brand.slug}` ),7 unmodified lines "## Push, and read the verdict", "", ...shell(pushCommand), "", `The cheap checks answer in git's own output, on its \`remote:\` lines. The rest run on the platform, on the tree your answer makes once merged onto \`main\`, and arrive later: ${cli("status --project <owner>/<name>")} shows your claims and answers and where each stands, and ${cli("verdict <ask> --project <owner>/<name>")} shows the verdict. The answer's page on the web follows it live, and the verdict is also a git note on your head:`, `The cheap checks answer in git's own output, on its \`remote:\` lines. The rest run on the platform, on the tree your answer makes once merged onto \`main\`, and the verdict arrives later: a push that git accepted is not yet a pass. ${cli("status --project <owner>/<name>")} shows your claims and answers and where each stands, and ${cli("verdict <ask> --project <owner>/<name>")} shows the verdict. Ask again until the answer's outcome is no longer \`Checking\`; with ${code("--json")}, that is its \`outcome._tag\`. It ends \`Landed\`, \`Refused\` or waiting on a maintainer. The answer's page on the web follows it live.`, "", "Once it is no longer checking, the verdict is also a git note on your head:", "", ...shell( `git fetch ${Brand.slug} ${notesRef}:${notesRef}`, `git notes --ref=${Brand.slug} show <head>` ), "", "## When it is refused", "", "Every refusal says whether trying again can help and names the command to run next. Run it, fix what it names, and push again. [Refusals](/docs/refusals) lists each one with what to do.", "", `When \`main\` moved under your answer and it no longer merges, the refusal is \`StaleBase\`. It names each conflicting path and, for each one the platform landed, the landing that last changed it. Rebase onto the new \`main\`, resolve, and push again: ${code(`git pull --rebase ${platformUrl}/<owner>/<name>.git main`)}.`, `When \`main\` moves under your answer, the platform merges your answer onto the new \`main\` on its own; you need do nothing. Only when that merge fails is the answer refused with \`StaleBase\`. It names each conflicting path and, for each one the platform landed, the landing that last changed it. Read what that landing changed, make your work fit it on those paths, and push to your fork again: each push is merged afresh onto the \`main\` of that moment. When it names no path, push the same work again as it is.`, "", "## Credit", "", "A landing is the platform's own commit, and it names every person involved in trailers: `Asked-by`, `Signed-off-by` for you, `Decided-by`, `Finished-by` and others. An agent you worked through is disclosed in `Assisted-by`, apart from the credit. Your page lists your landings across projects.",4 unmodified linesmodified:packages/agent-kit/src/docs/connect-an-agent.ts+1 added-1 removed
16 unmodified lines171819202121222324252 unmodified lines16 unmodified lines "## What holds for every agent", "", "- An agent holds no account and earns no credit. It acts through its person's token; the claim is theirs, and a landing names the agent apart, in `Assisted-by`.", "- Refusals come back typed: match on the `_tag`, and run its `next`.", `- Harness hooks (${cli("hook <event>")}) give an agent the gate's answer before it edits a file it may not touch, and check its work again when it stops.`, `- Harness hooks (${cli("hook <event>")}) give an agent the gate's answer before it edits a file it may not touch, and check its work again when it stops. [Install](/install) has them as a Claude Code \`settings.json\` block, under the CLI.`, "", "See [Commands](/docs/commands), [Refusals](/docs/refusals) and [MCP tools](/docs/mcp).", "", ],2 unmodified linesmodified:packages/agent-kit/src/docs/run-a-project.ts+32 added-6 removed
43 unmodified lines44 "```",45 "",46 `The project's Policy page shows what the folder evaluated to at the landed commit, and ${cli("policy --project <owner>/<name>")} prints the same.`,47 "",48+ "### The run block",49+ "",50+ `The project's own commands, under ${code("run")}. The platform runs them exactly as written, on the tree an answer makes once merged onto \`main\`, in the checker's image; ${cli("check")} runs them on your machine.`,51+ "",52+ `- ${code("setup")}: run once, before the network closes, to install what the checks need, as ${code("bun install")} does.`,53+ `- ${code("setupEgress")}: hosts setup may reach beyond the defaults; setup only, never the checks, which reach no network.`,54+ `- ${code("doctor")}: a command that says whether a machine can run the checks; it judges nothing.`,55+ `- ${code("test")}: the one command that runs a single check file, with ${code("{path}")} standing for the file, as in ${code("bun test {path}")}. The red-first check that opens an ask runs it, and so does each ask's check on every answer.`,56+ `- ${code("checks")}: the lanes, by name, each a command every answer must keep green, as in ${code('{ unit: "bun test" }')}.`,57+ `- ${code("image")}: the image the checks run in; ${code("checker:default")} when absent.`,58+ "",59+ `An open ask's check fails on \`main\` until the ask is answered: that is what opening it proves. A lane that runs the whole suite would then fail on every answer to every other ask, so keep the asks' checks out of the lanes, as datekit does with ${code("bun test --path-ignore-patterns='test/asks/**'")}. ${cli("init")} writes the unit lane that way.`,60+ "",61+ "### What init leaves to the defaults",62+ "",63+ `${cli("init")} writes the run block it found and ${code('vouch: "bansOnly"')}, and leaves every other key out, so each takes its default:`,64+ "",65+ `- ${code("deciders")}: with none named, the project's owners decide every path, as ${code('{ "**": "owners" }')} would say.`,66+ `- ${code("kinds")}: ${code("[kinds.fix]")}, one kind of ask: a check that fails on \`main\` and passes with the answer.`,67+ `- ${code("vouch")}: with ${code('"bansOnly"')}, nobody needs a vouch, but a denounced person still may not claim, push or propose. Left out, it is ${code('"forCode"')}: only people vouched for may claim or offer a sealed answer. ${code('"all"')} gates proposals too.`,68+ `- ${code("budget")}, ${code("caps")} and ${code("claims")}: 5 decisions a day, each taking its default after 14 days; 3 claims and 2 proposals per person; a claim warned after 2 hours without a push, and lapsed after 24.`,69+ "",70 "## Open an ask",71 "",50- `An ask is a file in ${code(`${dir}/asks/`)} with its check beside it: the want, the territory, what is out of scope, and a test that fails on \`main\` today. Some kinds also name a mentor, or hold the ask for newcomers.`,72+ `An ask is a file and a check: the want, the territory, what is out of scope, and a test that fails on \`main\` today. The file is ${code(`${dir}/asks/<ask>.ask.ts`)}, and its stem is the ask's id: ${code(`${dir}/asks/format-ordinal.ask.ts`)} opens the ask ${code("format-ordinal")}. The check lives at the ${code("path")} the ask names; keep every ask's check at ${code("test/asks/<ask>.test.ts")}, so one pattern keeps them all out of the lanes. Some kinds also name a mentor, or hold the ask for newcomers.`,73 "",74 "```ts",75 `import { kinds, territory } from "${Brand.cliPackage}/rules";`,76 "",4 unmodified lines81 ' reserve: "newcomers",',82 "});",83 "```",84 "",63- `${cli("ask open <ask> --project <owner>/<name>")} lands the ask, but only once its check fails on \`main\` twice the same way, by an assertion: a check that cannot fail, or fails by not loading, opens nothing. ${cli("schema ask open")} prints what it takes.`,85+ `Write both in your clone, then run ${cli("ask open <ask> --project <owner>/<name>")}. It reads the ask file and the check at its ${code("path")} from your working tree, and lands the ask, but only once its check fails on \`main\` twice the same way, by an assertion: a check that cannot fail, or fails by not loading, opens nothing. ${code("--files")} sends other files in their place, as JSON, ${code('[{"path": "…", "content": "…"}]')}; ${cli("schema ask open")} prints what it takes.`,86 "",87 "## Proposals and drafts",88 "",89 `Anyone not denounced may propose an ask: ${cli('propose --project <owner>/<name> --want "<what should be true>"')}. A proposal expires unless a maintainer accepts it. With ${code("--draft")}, the platform's agent drafts the ask file and its failing check, runs them red first, and puts the draft to a maintainer with its evidence; ${cli("proposal <proposal> --project <owner>/<name>")} follows it, and ${cli("ask draft <proposal> --project <owner>/<name>")} asks for another round. Nothing lands until a maintainer accepts, and the landing discloses the agent in \`Assisted-by\`.`,3 unmodified lines93 `A maintainer's day is a short list of decisions, each with its evidence and a safe default taken if nobody decides before it expires, held to the project's budget. Read it on the web in [your inbox](/inbox), or with ${cli("today")}, and take one with ${cli("decide --project <owner>/<name> --decision <decision> --choice accept")} (or \`decline\`, \`adopt\`, \`revert\`).`,94 "",95 "## Finish an answer, or land your own change",96 "",75- `When an ask's kind requires a finish, a passing answer waits for a maintainer's own commits on top: ${cli("finish <ask> --project <owner>/<name> --base <base> --head <head>")}. They are checked again, and the landing credits you with \`Finished-by\`.`,97+ `When an ask's kind requires a finish, a passing answer waits for a maintainer's own commits on top: ${cli("finish <ask> --project <owner>/<name> --base <base> --head <head> --requestId <id>")}. They are checked again, and the landing credits you with \`Finished-by\`.`,98 "",77- `A maintainer's own change goes through the same gate. Make your working fork, push to it, and land it:`,99+ `A maintainer's own change goes through the same gate. ${cli("fork --project <owner>/<name>")} makes your working fork, or returns the one you have, and prints its name and its git remote. Add the remote, push your change to it, and land it:`,100 "",101 ...shell(102 `${Brand.cli} fork --project <owner>/<name>`,81- `git push <fork remote> HEAD:main`,82- `${Brand.cli} land --project <owner>/<name> --base <base> --head <head>`103+ `git remote add fork <remote>`,104+ `git push fork HEAD:main`,105+ `git fetch ${Brand.slug}`,106+ `${Brand.cli} land --project <owner>/<name> --base $(git rev-parse ${Brand.slug}/main) --head $(git rev-parse HEAD) --message "<what it does>" --requestId <id>`107 ),108 "",109+ `${code("--base")} is \`main\` as the platform last landed it: ${code(`git rev-parse ${Brand.slug}/main`)} after ${code(`git fetch ${Brand.slug}`)}, where ${code(Brand.slug)} is the remote ${cli("init")} added for the project. ${code("--head")} is the commit you pushed to the fork. ${code("--requestId")} is any 8 to 64 letters, digits, \`-\` or \`_\` you choose: sending the same one again returns the same receipt, and checks nothing twice. ${cli("finish")} takes the same three. If \`main\` moves past your base before the change lands, the platform merges it onto the new \`main\` itself, and refuses with \`StaleBase\` only when that merge conflicts.`,110+ "",111 "## Vouch",112 "",113 `${cli("vouch --project <owner>/<name> --handle <handle> --verdict vouch")} admits a person to claim, by landing a line in the vouch file; \`--verdict denounce\` bars them from proposing.`,114 "",3 unmodified linesmodified:packages/agent-kit/src/agents-block.ts+2 added
45 unmodified lines46 `## Contributing to ${project}`,47 "",48 `This project takes changes through ${Brand.name}: an answer to one of its asks lands only by passing the gate. This block is generated from the config folder, and the gate decides what lands. The full guide is the ${code(contributeSkillName(project))} skill (${code(agentsPath)}).`,49 "",50+ `It needs the ${Brand.name} CLI (the install script on the platform's ${code("/install")} page) signed in with ${code(`${Brand.cli} login --url <platform>`)}, and runs in a clone of the project, ${code(`git clone <platform>/${project}.git`)}, where ${code("<platform>")} is the host this project lives on: in such a clone, ${code("git remote get-url origin")} names it.`,51+ "",52 ...loopSteps(),53 "",54 ...rules(policy),55 "",59 unmodified linesmodified:packages/agent-kit/src/command-doc.ts+5 added-4 removed
2 unmodified lines3 Description,4 NeedsApproval,5 ReadOnly,6 Surfaces,7+ TodayOf,8 } from "@repo/protocol/contracts";9 import type { Contracts } from "@repo/protocol/contracts";10 import { Array as Arr, Context, Order, Schema, SchemaAST } from "effect";11 33 unmodified lines45 path: ["logout"],46 positional: [],47 readOnly: false,48 source: "local",48- summary: "Forget a platform's stored token.",49+ summary:50+ "Forget a profile's token, and stop git asking for a platform no profile is on.",51 },52 {53 contract: "initProject",54 flags: [89 unmodified lines144 path: ["schema"],145 positional: ["command"],146 readOnly: true,147 source: "local",146- summary: "Print the JSON Schema of a command's payload.",148+ summary: "Print the JSON Schema of the payload a command sends.",149 },150 {151 contract: "today",152 flags: ["--project", "--tui", "--json"],1 unmodified line154 path: ["today"],155 positional: [],156 readOnly: true,157 source: "local",156- summary:157- "Show your Today: the decisions to take, each with its evidence and a safe default; --tui opens it full-screen at a terminal.",158+ summary: `${Context.get(TodayOf.annotations, Description)} It only reads, unless --tui opens it full-screen to take decisions at a terminal.`,159 },160 ];161 162 const standIns = new Set(60 unmodified linesmodified:packages/agent-kit/src/hook-events.ts+23 added
1+import { Brand } from "@repo/brand";2 import { Schema } from "effect";3 4 export const HookEvent = Schema.Literals([5 "session-start",14 unmodified lines20 "Write",21 "MultiEdit",22 "NotebookEdit",23 ] as const;24+25+const hookCommand = (event: HookEvent) => ({26+ hooks: [{ command: `${Brand.cli} hook ${event} --json`, type: "command" }],27+});28+29+/**30+ * Claude Code's `hooks`, as its plugin's `hooks/hooks.json` and a31+ * `settings.json` both hold them. Each hook fails open: hooks are early32+ * feedback, and the gateway decides.33+ */34+export const claudeHooks = () => ({35+ hooks: Object.fromEntries(36+ HookEvent.literals.map((event) => [37+ claudeEventOf[event],38+ [39+ event === "pre-tool-use"40+ ? { ...hookCommand(event), matcher: guardedTools.join("|") }41+ : hookCommand(event),42+ ],43+ ])44+ ),45+});modified:packages/agent-kit/src/install-channels.ts+12 added-1 removed
9 unmodified lines10 skills,11 stdioMcp,12 } from "./agent-setup.ts";13 import type { SetupInput, SetupSnippet } from "./agent-setup.ts";14+import { claudeHooks } from "./hook-events.ts";15+import { printJson } from "./text.ts";16 17 /** A page of the web (`page`), or a file it serves, such as `/llms.txt`. */18 export interface InstallLink {19 readonly label: string;23 unmodified lines43 tabbed: false,44 ...fields,45 });46 47+const hooks: SetupSnippet = {48+ label:49+ "Claude Code's hooks, in .claude/settings.json: the gate's scope guard before an edit, the claimed ask's brief at the start, and its verdict before you stop",50+ language: "json",51+ name: "Hooks",52+ text: printJson(claudeHooks()).trimEnd(),53+};54+45-/** The script's snippet, said for the machines it has a build for: the one way to install the CLI. */55+/** The script's snippet, said for the machines it has a build for: the one way to install the CLI, then sign-in and the harness hooks. */56 const cli = (input: SetupInput) =>57 channel({58 audience: "Terminal",59 id: "cli",3 unmodified lines63 ...installScript(input),64 label: "The script, for Linux on x64 and macOS on Apple silicon",65 },66 ...signIn(input),67+ ...(hasCommand(input.commands, "hook") ? [hooks] : []),68 ],69 summary:70 "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.",71 title: "The CLI",95 unmodified linesmodified:packages/agent-kit/src/platform.ts+2 added-19 removed
5 unmodified lines6 7 import type { CommandDoc } from "./command-doc.ts";8 import { frontmatter } from "./generated-file.ts";9 import type { GeneratedFile } from "./generated-file.ts";10-import { claudeEventOf, guardedTools, HookEvent } from "./hook-events.ts";10+import { claudeHooks } from "./hook-events.ts";11 import { refusalSection } from "./refusals.ts";12 import { loopSteps, unfencedSection } from "./sections.ts";13 import { code, page, printJson, table } from "./text.ts";14 113 unmodified lines128 ? servers[flavour].stdio129 : servers[flavour].remote(`${platformUrl}/mcp`),130 });131 132-const hookCommand = (event: HookEvent) => ({133- hooks: [{ command: `${Brand.cli} hook ${event} --json`, type: "command" }],134-});132+const hooksJson = () => printJson(claudeHooks());133 136-// Each hook fails open: hooks are early feedback, and the gateway decides.137-const hooksJson = () =>138- printJson({139- hooks: Object.fromEntries(140- HookEvent.literals.map((event) => [141- claudeEventOf[event],142- [143- event === "pre-tool-use"144- ? { ...hookCommand(event), matcher: guardedTools.join("|") }145- : hookCommand(event),146- ],147- ])148- ),149- });150-134 const pluginDescription = `The ${Brand.name} CLI's skill, MCP server and hooks: the gate's scope guard before an edit, the claimed ask's brief at the start, and its verdict before you stop.`;135 136 const homepage = (platformUrl: string | undefined) =>137 platformUrl === undefined ? {} : { homepage: platformUrl };51 unmodified linesmodified:packages/agent-kit/src/sections.ts+2 added-2 removed
17 unmodified lines18 export const loopSteps = () => [19 `1. Read the ask, then claim it: ${cli("ask", "<ask>")}, then ${cli("claim", "<ask>")}. The claim prints your fork's remote; add it with ${code(`git remote add ${remote} <remote>`)}.`,20 "2. Work inside the ask's territory until its check passes.",21 `3. Run ${cli("check")}. It gives the refusals a push would get, then runs the ask's check and the project's lanes; fix everything it reports.`,22- `4. Push your answer to your fork: ${code(pushCommand)}. The push itself can be refused; follow the answer with ${cli("status")}.`,23- `5. Read the verdict on your head: ${code(`git fetch ${remote} ${notesRef}:${notesRef}`)}, then ${code(`git notes --ref=${Brand.slug} show HEAD`)}. It is JSON: match on its \`_tag\`, and run a refusal's \`next\`.`,22+ `4. Push your answer to your fork: ${code(pushCommand)}. The push itself can be refused, on git's \`remote:\` lines.`,23+ `5. Wait for the verdict: the rest of the checks run on the platform after git returns. Run ${cli("status", "--json")} until your answer's \`outcome._tag\` is no longer \`Checking\`, then read the verdict on your head: ${code(`git fetch ${remote} ${notesRef}:${notesRef}`)}, then ${code(`git notes --ref=${Brand.slug} show HEAD`)}. It is JSON: match on its \`_tag\`, and run a refusal's \`next\`.`,24 ];25 26 const unitsOfTime = [27 { ms: 86_400_000 * 7, one: "week" },213 unmodified linesmodified:packages/agent-kit/test/golden/agent-plugins-stdio.txt+2 added-2 removed
22 unmodified lines23 24 1. Read the ask, then claim it: `__CLI__ ask <ask>`, then `__CLI__ claim <ask>`. The claim prints your fork's remote; add it with `git remote add __SLUG__ <remote>`.25 2. Work inside the ask's territory until its check passes.26 3. Run `__CLI__ check`. It gives the refusals a push would get, then runs the ask's check and the project's lanes; fix everything it reports.27-4. Push your answer to your fork: `git push __SLUG__ HEAD:main`. The push itself can be refused; follow the answer with `__CLI__ status`.28-5. Read the verdict on your head: `git fetch __SLUG__ refs/notes/__SLUG__:refs/notes/__SLUG__`, then `git notes --ref=__SLUG__ show HEAD`. It is JSON: match on its `_tag`, and run a refusal's `next`.27+4. Push your answer to your fork: `git push __SLUG__ HEAD:main`. The push itself can be refused, on git's `remote:` lines.28+5. Wait for the verdict: the rest of the checks run on the platform after git returns. Run `__CLI__ status --json` until your answer's `outcome._tag` is no longer `Checking`, then read the verdict on your head: `git fetch __SLUG__ refs/notes/__SLUG__:refs/notes/__SLUG__`, then `git notes --ref=__SLUG__ show HEAD`. It is JSON: match on its `_tag`, and run a refusal's `next`.29 30 A project's own `<key>-contribute` skill (its key: the name with each `/` as `__`, as in `oscabriel__foo-contribute`, or for a project made before owners its old one-word key, as in `datekit-contribute`) and the block in its AGENTS.md give its territories, its run block and its ask kinds.31 32 ## Output65 unmodified linesmodified:packages/agent-kit/test/golden/agent-plugins.txt+2 added-2 removed
23 unmodified lines24 25 1. Read the ask, then claim it: `__CLI__ ask <ask>`, then `__CLI__ claim <ask>`. The claim prints your fork's remote; add it with `git remote add __SLUG__ <remote>`.26 2. Work inside the ask's territory until its check passes.27 3. Run `__CLI__ check`. It gives the refusals a push would get, then runs the ask's check and the project's lanes; fix everything it reports.28-4. Push your answer to your fork: `git push __SLUG__ HEAD:main`. The push itself can be refused; follow the answer with `__CLI__ status`.29-5. Read the verdict on your head: `git fetch __SLUG__ refs/notes/__SLUG__:refs/notes/__SLUG__`, then `git notes --ref=__SLUG__ show HEAD`. It is JSON: match on its `_tag`, and run a refusal's `next`.28+4. Push your answer to your fork: `git push __SLUG__ HEAD:main`. The push itself can be refused, on git's `remote:` lines.29+5. Wait for the verdict: the rest of the checks run on the platform after git returns. Run `__CLI__ status --json` until your answer's `outcome._tag` is no longer `Checking`, then read the verdict on your head: `git fetch __SLUG__ refs/notes/__SLUG__:refs/notes/__SLUG__`, then `git notes --ref=__SLUG__ show HEAD`. It is JSON: match on its `_tag`, and run a refusal's `next`.30 31 A project's own `<key>-contribute` skill (its key: the name with each `/` as `__`, as in `oscabriel__foo-contribute`, or for a project made before owners its old one-word key, as in `datekit-contribute`) and the block in its AGENTS.md give its territories, its run block and its ask kinds.32 33 ## Output62 unmodified linesmodified:packages/agent-kit/test/golden/agents-block.txt+4 added-2 removed
2 unmodified lines3 ## Contributing to oscabriel/datekit4 5 This project takes changes through __NAME__: an answer to one of its asks lands only by passing the gate. This block is generated from the config folder, and the gate decides what lands. The full guide is the `datekit-contribute` skill (`.agents/skills/datekit-contribute/SKILL.md`).6 7+It needs the __NAME__ CLI (the install script on the platform's `/install` page) signed in with `__CLI__ login --url <platform>`, and runs in a clone of the project, `git clone <platform>/oscabriel/datekit.git`, where `<platform>` is the host this project lives on: in such a clone, `git remote get-url origin` names it.8+9 1. Read the ask, then claim it: `__CLI__ ask <ask>`, then `__CLI__ claim <ask>`. The claim prints your fork's remote; add it with `git remote add __SLUG__ <remote>`.10 2. Work inside the ask's territory until its check passes.11 3. Run `__CLI__ check`. It gives the refusals a push would get, then runs the ask's check and the project's lanes; fix everything it reports.10-4. Push your answer to your fork: `git push __SLUG__ HEAD:main`. The push itself can be refused; follow the answer with `__CLI__ status`.11-5. Read the verdict on your head: `git fetch __SLUG__ refs/notes/__SLUG__:refs/notes/__SLUG__`, then `git notes --ref=__SLUG__ show HEAD`. It is JSON: match on its `_tag`, and run a refusal's `next`.12+4. Push your answer to your fork: `git push __SLUG__ HEAD:main`. The push itself can be refused, on git's `remote:` lines.13+5. Wait for the verdict: the rest of the checks run on the platform after git returns. Run `__CLI__ status --json` until your answer's `outcome._tag` is no longer `Checking`, then read the verdict on your head: `git fetch __SLUG__ refs/notes/__SLUG__:refs/notes/__SLUG__`, then `git notes --ref=__SLUG__ show HEAD`. It is JSON: match on its `_tag`, and run a refusal's `next`.14 15 - Change only files in the ask's territory; a push that changes anything else is refused with `OutOfScope`.16 - Never change the judge closure (`.__SLUG__/**`, `bunfig.toml`, `tsconfig.json`, `package.json#/scripts`); a push that does is refused with `TouchedJudge`.17 - Never add a marker that turns a check off (`.skip(`, `.only(`, `@ts-ignore`); one without a reason is refused with `Weakened`.8 unmodified linesmodified:packages/agent-kit/test/golden/claude-plugin-stdio.txt+2 added-2 removed
21 unmodified lines22 23 1. Read the ask, then claim it: `__CLI__ ask <ask>`, then `__CLI__ claim <ask>`. The claim prints your fork's remote; add it with `git remote add __SLUG__ <remote>`.24 2. Work inside the ask's territory until its check passes.25 3. Run `__CLI__ check`. It gives the refusals a push would get, then runs the ask's check and the project's lanes; fix everything it reports.26-4. Push your answer to your fork: `git push __SLUG__ HEAD:main`. The push itself can be refused; follow the answer with `__CLI__ status`.27-5. Read the verdict on your head: `git fetch __SLUG__ refs/notes/__SLUG__:refs/notes/__SLUG__`, then `git notes --ref=__SLUG__ show HEAD`. It is JSON: match on its `_tag`, and run a refusal's `next`.26+4. Push your answer to your fork: `git push __SLUG__ HEAD:main`. The push itself can be refused, on git's `remote:` lines.27+5. Wait for the verdict: the rest of the checks run on the platform after git returns. Run `__CLI__ status --json` until your answer's `outcome._tag` is no longer `Checking`, then read the verdict on your head: `git fetch __SLUG__ refs/notes/__SLUG__:refs/notes/__SLUG__`, then `git notes --ref=__SLUG__ show HEAD`. It is JSON: match on its `_tag`, and run a refusal's `next`.28 29 A project's own `<key>-contribute` skill (its key: the name with each `/` as `__`, as in `oscabriel__foo-contribute`, or for a project made before owners its old one-word key, as in `datekit-contribute`) and the block in its AGENTS.md give its territories, its run block and its ask kinds.30 31 ## Output100 unmodified linesmodified:packages/agent-kit/test/golden/claude-plugin.txt+2 added-2 removed
22 unmodified lines23 24 1. Read the ask, then claim it: `__CLI__ ask <ask>`, then `__CLI__ claim <ask>`. The claim prints your fork's remote; add it with `git remote add __SLUG__ <remote>`.25 2. Work inside the ask's territory until its check passes.26 3. Run `__CLI__ check`. It gives the refusals a push would get, then runs the ask's check and the project's lanes; fix everything it reports.27-4. Push your answer to your fork: `git push __SLUG__ HEAD:main`. The push itself can be refused; follow the answer with `__CLI__ status`.28-5. Read the verdict on your head: `git fetch __SLUG__ refs/notes/__SLUG__:refs/notes/__SLUG__`, then `git notes --ref=__SLUG__ show HEAD`. It is JSON: match on its `_tag`, and run a refusal's `next`.27+4. Push your answer to your fork: `git push __SLUG__ HEAD:main`. The push itself can be refused, on git's `remote:` lines.28+5. Wait for the verdict: the rest of the checks run on the platform after git returns. Run `__CLI__ status --json` until your answer's `outcome._tag` is no longer `Checking`, then read the verdict on your head: `git fetch __SLUG__ refs/notes/__SLUG__:refs/notes/__SLUG__`, then `git notes --ref=__SLUG__ show HEAD`. It is JSON: match on its `_tag`, and run a refusal's `next`.29 30 A project's own `<key>-contribute` skill (its key: the name with each `/` as `__`, as in `oscabriel__foo-contribute`, or for a project made before owners its old one-word key, as in `datekit-contribute`) and the block in its AGENTS.md give its territories, its run block and its ask kinds.31 32 ## Output98 unmodified linesmodified:packages/agent-kit/test/golden/platform-skill.txt+2 added-2 removed
15 unmodified lines16 17 1. Read the ask, then claim it: `__CLI__ ask <ask>`, then `__CLI__ claim <ask>`. The claim prints your fork's remote; add it with `git remote add __SLUG__ <remote>`.18 2. Work inside the ask's territory until its check passes.19 3. Run `__CLI__ check`. It gives the refusals a push would get, then runs the ask's check and the project's lanes; fix everything it reports.20-4. Push your answer to your fork: `git push __SLUG__ HEAD:main`. The push itself can be refused; follow the answer with `__CLI__ status`.21-5. Read the verdict on your head: `git fetch __SLUG__ refs/notes/__SLUG__:refs/notes/__SLUG__`, then `git notes --ref=__SLUG__ show HEAD`. It is JSON: match on its `_tag`, and run a refusal's `next`.20+4. Push your answer to your fork: `git push __SLUG__ HEAD:main`. The push itself can be refused, on git's `remote:` lines.21+5. Wait for the verdict: the rest of the checks run on the platform after git returns. Run `__CLI__ status --json` until your answer's `outcome._tag` is no longer `Checking`, then read the verdict on your head: `git fetch __SLUG__ refs/notes/__SLUG__:refs/notes/__SLUG__`, then `git notes --ref=__SLUG__ show HEAD`. It is JSON: match on its `_tag`, and run a refusal's `next`.22 23 A project's own `<key>-contribute` skill (its key: the name with each `/` as `__`, as in `oscabriel__foo-contribute`, or for a project made before owners its old one-word key, as in `datekit-contribute`) and the block in its AGENTS.md give its territories, its run block and its ask kinds.24 25 ## Output51 unmodified linesmodified:packages/agent-kit/test/golden/project-skill.txt+4 added-4 removed
14 unmodified lines15 16 1. Read the ask, then claim it: `__CLI__ ask <ask>`, then `__CLI__ claim <ask>`. The claim prints your fork's remote; add it with `git remote add __SLUG__ <remote>`.17 2. Work inside the ask's territory until its check passes.18 3. Run `__CLI__ check`. It gives the refusals a push would get, then runs the ask's check and the project's lanes; fix everything it reports.19-4. Push your answer to your fork: `git push __SLUG__ HEAD:main`. The push itself can be refused; follow the answer with `__CLI__ status`.20-5. Read the verdict on your head: `git fetch __SLUG__ refs/notes/__SLUG__:refs/notes/__SLUG__`, then `git notes --ref=__SLUG__ show HEAD`. It is JSON: match on its `_tag`, and run a refusal's `next`.19+4. Push your answer to your fork: `git push __SLUG__ HEAD:main`. The push itself can be refused, on git's `remote:` lines.20+5. Wait for the verdict: the rest of the checks run on the platform after git returns. Run `__CLI__ status --json` until your answer's `outcome._tag` is no longer `Checking`, then read the verdict on your head: `git fetch __SLUG__ refs/notes/__SLUG__:refs/notes/__SLUG__`, then `git notes --ref=__SLUG__ show HEAD`. It is JSON: match on its `_tag`, and run a refusal's `next`.21 22 A claim stays alive only while you push to it: after 2 hours without a push it is warned, and after 1 day it lapses. You may hold 3 claims at once in this project.23 24 List the open asks with `__CLI__ asks`. Add `--json` to any command for one JSON envelope instead of Markdown.101 unmodified lines126 127 1. Read the ask, then claim it: `__CLI__ ask <ask>`, then `__CLI__ claim <ask>`. The claim prints your fork's remote; add it with `git remote add __SLUG__ <remote>`.128 2. Work inside the ask's territory until its check passes.129 3. Run `__CLI__ check`. It gives the refusals a push would get, then runs the ask's check and the project's lanes; fix everything it reports.130-4. Push your answer to your fork: `git push __SLUG__ HEAD:main`. The push itself can be refused; follow the answer with `__CLI__ status`.131-5. Read the verdict on your head: `git fetch __SLUG__ refs/notes/__SLUG__:refs/notes/__SLUG__`, then `git notes --ref=__SLUG__ show HEAD`. It is JSON: match on its `_tag`, and run a refusal's `next`.130+4. Push your answer to your fork: `git push __SLUG__ HEAD:main`. The push itself can be refused, on git's `remote:` lines.131+5. Wait for the verdict: the rest of the checks run on the platform after git returns. Run `__CLI__ status --json` until your answer's `outcome._tag` is no longer `Checking`, then read the verdict on your head: `git fetch __SLUG__ refs/notes/__SLUG__:refs/notes/__SLUG__`, then `git notes --ref=__SLUG__ show HEAD`. It is JSON: match on its `_tag`, and run a refusal's `next`.132 133 A claim stays alive only while you push to it: after 2 hours without a push it is warned, and after 1 day it lapses. You may hold 3 claims at once in this project.134 135 List the open asks with `__CLI__ asks`. Add `--json` to any command for one JSON envelope instead of Markdown.86 unmodified linesmodified:packages/agent-kit/test/install-channels.test.ts+51 added-2 removed
22 unmodified lines23 });24 25 const commands: readonly CommandDoc[] = [26 ...someCommands,27+ local("hook", "Answer a harness hook."),28 local("login", "Sign in to a platform."),29 local("mcp", "Serve the platform's tools over MCP on stdio."),30 ];31 22 unmodified lines54 );55 }56 });57 57- it("install the CLI by the script alone, then sign in to the platform", () => {58- expect(textsOf(channel("cli"))).toStrictEqual([58+ it("install the CLI by the script alone, then sign in to the platform, then the hooks", () => {59+ expect(textsOf(channel("cli")).slice(0, 2)).toStrictEqual([60 `curl -fsSL ${webUrl}/install.sh | sh`,61 `${Brand.cli} login --url ${platformUrl}`,62 ]);63 expect(64 channels.flatMap(textsOf).filter((each) => /\bnpm install\b/u.test(each))65 ).toStrictEqual([]);66 });67 68+ it("give Claude Code's settings.json a hook for each event the CLI answers, the edit tools guarded", () => {69+ const hooks = channel("cli").snippets.find(({ name }) => name === "Hooks");70+71+ expect(hooks?.language).toBe("json");72+ expect(JSON.parse(hooks?.text ?? "{}")).toStrictEqual({73+ hooks: {74+ PreToolUse: [75+ {76+ hooks: [77+ {78+ command: `${Brand.cli} hook pre-tool-use --json`,79+ type: "command",80+ },81+ ],82+ matcher: "Edit|Write|MultiEdit|NotebookEdit",83+ },84+ ],85+ SessionStart: [86+ {87+ hooks: [88+ {89+ command: `${Brand.cli} hook session-start --json`,90+ type: "command",91+ },92+ ],93+ },94+ ],95+ Stop: [96+ {97+ hooks: [98+ { command: `${Brand.cli} hook stop --json`, type: "command" },99+ ],100+ },101+ ],102+ },103+ });104+ expect(105+ channel(106+ "cli",107+ installChannels({108+ commands: commands.filter(({ path }) => path.join(" ") !== "hook"),109+ platformUrl,110+ webUrl,111+ })112+ ).snippets113+ ).toHaveLength(2);114+ });115+116 it("give MCP one tab per client and stdio, with the snippets agentSetup gives", () => {117 const mcp = channel("mcp");118 119 const setup = agentSetup({ commands, platformUrl, webUrl }).filter(63 unmodified linesmodified:packages/protocol/src/contracts.ts+106 added-31 removed
160 unmodified lines161 // An empty `Schema.Struct` has no object root in JSON Schema, which an MCP162 // tool's input needs; this is the form `Tool.EmptyParams` takes.163 const NoPayload = Schema.Record(Schema.String, Schema.Never);164 165+// What a flag takes, said once: `--help` and each MCP tool's input schema read it.166+const described = <S extends Schema.Top>(schema: S, description: string) =>167+ schema.annotate({ description });168+169+const baseField = described(170+ CommitSha,171+ "The commit your change is built on: main as the platform last landed it"172+);173+174+const headField = described(175+ CommitSha,176+ "The commit to check: the one you pushed to your fork"177+);178+179+const requestIdField = described(180+ RequestId,181+ "Any 8 to 64 letters, digits, - or _ you choose; sending the same one again returns the same receipt"182+);183+184 export class ListProjects extends Rpc.make("listProjects", {185 payload: NoPayload,186 success: Schema.Struct({ projects: Schema.Array(ProjectListing) }),187 })27 unmodified lines215 .annotate(Surfaces, servedOn.recentLandings) {}216 217 export class FrontPage extends Rpc.make("frontPage", {218 payload: {200- kind: Schema.optionalKey(KindName),201- reserved: Schema.optionalKey(Reserve),219+ kind: Schema.optionalKey(220+ described(KindName, "Only asks of this kind, such as fix")221+ ),222+ reserved: Schema.optionalKey(223+ described(Reserve, "Only asks held for newcomers, or for people")224+ ),225 },226 success: Schema.Struct({ entries: Schema.Array(FrontPageEntry) }),227 })228 .annotate(46 unmodified lines275 .annotate(Surfaces, servedOn.showAsk) {}276 277 export class Status extends Rpc.make("status", {278 error: UnknownProject,256- payload: { project: Schema.optionalKey(ProjectName) },279+ payload: {280+ project: Schema.optionalKey(281+ described(ProjectName, "The project to show; every project when absent")282+ ),283+ },284 success: Schema.Struct({285 answers: Schema.Array(AnswerView),286 claims: Schema.Array(ClaimView),287 handle: Handle,15 unmodified lines303 export class VerdictOf extends Rpc.make("verdict", {304 error: Schema.Union([UnknownProject, UnknownAsk]),305 payload: {306 ask: AskId,280- /** The answer's head; its latest when absent. */281- head: Schema.optionalKey(CommitSha),307+ head: Schema.optionalKey(308+ described(CommitSha, "The answer's head to show; its latest when absent")309+ ),310 project: ProjectName,311 },312 success: Schema.Struct({ verdict: Schema.optionalKey(Verdict) }),313 })28 unmodified lines342 .annotate(Cli, { name: "landing" })343 .annotate(Surfaces, servedOn.landing) {}344 345 export class Credits extends Rpc.make("credits", {318- payload: { handle: Handle },346+ payload: { handle: described(Handle, "The person whose credits to count") },347 success: Schema.Struct({ credits: Schema.Array(CreditSummary) }),348 })349 .annotate(350 Description,313 unmodified lines664 StaleBase,665 ]),666 payload: {667 ask: AskId,668+ files: described(640- files: Schema.NonEmptyArray(ConfigFile),669+ Schema.NonEmptyArray(ConfigFile),670+ "The ask file and its check, as JSON [{path, content}]; the CLI reads both from your working tree when it is left out"671+ ),672 project: ProjectName,673 },674 success: Schema.Struct({ ask: Ask, landed: LandedSha }),675 })24 unmodified lines700 701 export class ProposeAsk extends Rpc.make("proposeAsk", {702 error: Schema.Union([UnknownProject, Denounced, CapReached, NotVouched]),703 payload: Schema.Struct({673- draft: Schema.optionalKey(Schema.Literal(true)),674- files: Schema.optionalKey(Schema.NonEmptyArray(ConfigFile)),704+ draft: Schema.optionalKey(705+ described(706+ Schema.Literal(true),707+ "Have the platform's agent draft the ask file and its failing check"708+ )709+ ),710+ files: Schema.optionalKey(711+ described(712+ Schema.NonEmptyArray(ConfigFile),713+ "Your own ask file and check, as JSON [{path, content}]"714+ )715+ ),716 project: ProjectName,676- sealed: Schema.optionalKey(Schema.Struct({ head: CommitSha })),677- territory: Schema.optionalKey(Schema.NonEmptyString),678- want: Schema.NonEmptyString,717+ sealed: Schema.optionalKey(718+ described(719+ Schema.Struct({ head: CommitSha }),720+ "An answer you already have, sealed until the ask opens, as JSON {head}"721+ )722+ ),723+ territory: Schema.optionalKey(724+ described(725+ Schema.NonEmptyString,726+ "The paths an answer may change, in your words"727+ )728+ ),729+ want: described(730+ Schema.NonEmptyString,731+ "What should be true once the ask is answered"732+ ),733 }).check(draftsAlone),734 success: Schema.Struct({ proposal: Proposal }),735 })736 .annotate(18 unmodified lines755 DraftInProgress,756 CapReached,757 ]),758 payload: {705- note: Schema.optionalKey(DraftNote),759+ note: Schema.optionalKey(760+ described(DraftNote, "What the next round should change, for the agent")761+ ),762 project: ProjectName,763 proposal: ProposalId,764 },765 success: Schema.Struct({ proposal: Proposal }),15 unmodified lines781 error: Schema.Union([UnknownProject, UnknownAsk, Denounced, CapReached]),782 payload: {783 ask: AskId,784 project: ProjectName,785+ reason: described(729- reason: Schema.NonEmptyString,786+ Schema.NonEmptyString,787+ "What is wrong with the ask, for its maintainers"788+ ),789 },790 success: Schema.Struct({ proposal: Proposal }),791 })792 .annotate(18 unmodified lines811 VerifierBlocked,812 StaleBase,813 ]),814 payload: {756- choice: Choice,757- decision: DecisionId,758- note: Schema.optionalKey(Schema.String),815+ choice: described(816+ Choice,817+ "accept or decline it; for a stray push, adopt or revert it"818+ ),819+ decision: described(DecisionId, "The decision's id, as Today lists it"),820+ note: Schema.optionalKey(821+ described(Schema.String, "Why, kept with the decision")822+ ),823 project: ProjectName,824 },825 success: Schema.Struct({ decision: Decision }),826 })68 unmodified lines895 PrivatePathInPublicTree,896 ]),897 payload: {898 ask: AskId,835- base: CommitSha,836- head: CommitSha,899+ base: baseField,900+ head: headField,901 project: ProjectName,838- requestId: RequestId,902+ requestId: requestIdField,903 },904 success: AnswerReceipt,905 })906 .annotate(18 unmodified lines925 TouchedJudge,926 ]),927 payload: {928 ask: AskId,865- base: CommitSha,866- head: CommitSha,929+ base: baseField,930+ head: headField,931 project: ProjectName,868- requestId: RequestId,932+ requestId: requestIdField,933 },934 success: AnswerReceipt,935 })936 .annotate(11 unmodified lines948 949 export class Land extends Rpc.make("land", {950 error: Schema.Union([UnknownProject, NotDecider, StaleBase, RepoBusy]),951 payload: {888- base: CommitSha,889- head: CommitSha,890- message: Schema.NonEmptyString,952+ base: baseField,953+ head: headField,954+ message: described(955+ Schema.NonEmptyString,956+ "The landing's commit message: what the change does"957+ ),958 project: ProjectName,892- requestId: RequestId,959+ requestId: requestIdField,960 },961 success: LandReceipt,962 })963 .annotate(32 unmodified lines996 997 export class Vouch extends Rpc.make("vouch", {998 error: Schema.Union([UnknownProject, NotDecider, StaleBase]),999 payload: {933- handle: Handle,934- note: Schema.optionalKey(Schema.String),1000+ handle: described(Handle, "The person's handle"),1001+ note: Schema.optionalKey(1002+ described(Schema.String, "Why, kept beside the line in the vouch file")1003+ ),1004 project: ProjectName,1005+ verdict: described(936- verdict: Schema.Literals(["vouch", "denounce"]),1006+ Schema.Literals(["vouch", "denounce"]),1007+ "vouch admits them to claim; denounce bars them from claiming and proposing"1008+ ),1009 },1010 success: Schema.Struct({ landed: LandedSha }),1011 })1012 .annotate(12 unmodified lines1025 export class EvidenceOf extends Rpc.make("evidence", {1026 error: Schema.Union([UnknownProject, NotDecider]),1027 payload: {1028 project: ProjectName,1029+ ref: described(957- ref: Schema.NonEmptyString,1030+ Schema.NonEmptyString,1031+ "The logRef a failing lane's verdict names"1032+ ),1033 },1034 success: Schema.Struct({1035 lane: LaneName,1036 /** The log's tail: its last 256 KiB, where a failure prints. */139 unmodified linesadded:packages/protocol/test/field-descriptions.test.ts+39 added
1+import { describe, expect, it } from "@effect/vitest";2+import { Context, Predicate, SchemaAST } from "effect";3+4+import { Cli, Contracts } from "../src/contracts.ts";5+6+// A field named for what it holds needs no more words: its name is the help.7+const selfNamed = new Set([8+ "acknowledgeShort",9+ "ask",10+ "import",11+ "key",12+ "project",13+ "proposal",14+ "sha",15+ "value",16+]);17+18+const undescribed = [...Contracts.requests.values()].flatMap((rpc) => {19+ const { name } = Context.get(rpc.annotations, Cli);20+ const { ast } = rpc.payloadSchema;21+22+ if (name === undefined || !SchemaAST.isObjects(ast)) {23+ return [];24+ }25+26+ return ast.propertySignatures.flatMap((field) =>27+ Predicate.isString(field.name) &&28+ !selfNamed.has(field.name) &&29+ SchemaAST.resolveDescription(field.type) === undefined30+ ? [`${name} --${field.name}`]31+ : []32+ );33+});34+35+describe("a command's flags", () => {36+ it("each say what they take, in --help and in the MCP tool's input schema", () => {37+ expect(undescribed).toStrictEqual([]);38+ });39+});