run-a-project.ts
This file
Path
packages/agent-kit/src/docs/run-a-project.ts
91 lines · 6.2 KiB · TypeScript
Last changed by
Merge redesign into mainoscabrielbefore adoptioncaedd21
History of this fileTake it
Merge build/1313-docs into mainoscabrielbefore adoption9000f4e
line 1why, one step back1import { Brand } from "@repo/brand";Merge build/1413-docs-and-texts into mainoscabrielbefore adoptionf10338e
line 2why, one step back2import { sourceHosts } from "@repo/protocol/ids";Merge build/1313-docs into mainoscabrielbefore adoption9000f4e
lines 3–13why, one step back34import { code } from "../text.ts";5import type { DocSource } from "./page.ts";6import { cli, shell } from "./page.ts";78const dir = Brand.configDir;910export const runAProject: DocSource = {11 body: () => [12 "## Make a project",13 "",Merge build/maintainer-wording into mainoscabrielbefore adoption4c1a571
line 14why, one step back14 `In a repo of your own, ${cli("init --project <owner>/<name>")} makes it a project: it finds the repo's checks (its test and lint commands, and its CI), writes the config folder, ${code(`${dir}/`)}, and pushes. You are the project's first maintainer.`,Merge build/1313-docs into mainoscabrielbefore adoption9000f4e
line 15why, one step back15 "",Merge build/1413-docs-and-texts into mainoscabrielbefore adoptionf10338e
lines 16–21why, one step back16 "## How a project is named",17 "",18 `A project's name is its owner, then a short name: ${code("<owner>/<name>")}, as in ${code("oscabriel/datekit")}. The name is the project's address everywhere: ${code("--project")} takes it, the web shows the project at ${code("/<owner>/<name>")}, and git clones it from ${code("<platform>/<owner>/<name>.git")}. You make projects under your own handle; a bare word, as in ${cli("init --project datekit")}, is taken as yours, under the handle ${cli("login")} kept. Owning a namespace is the right to make projects in it and nothing more: who decides stays with the config folder.`,19 "",20 "## Import a repo",21 "",Merge build/maintainer-wording into mainoscabrielbefore adoption4c1a571
line 22why, one step back22 `To bring a public repo over HTTPS: ${cli("init --import <url>")}, with ${code("--branch")} when its default branch is not the one you want. A repo from ${sourceHosts.map((host) => code(host)).join(", ")} is named after its source namespace, ${code("<host>/<account>/<name>")}, so ${code("https://github.com/pallets/click")} becomes ${code("github.com/pallets/click")}; a repo from any other host is named under your handle, after the URL's last segment. ${code("--project")} names it otherwise, a bare word again under your handle. On the web, [Import a repo](/import) does the same, and the web address of such a name nobody has imported yet, such as ${code("/github.com/pallets/click")}, offers the import. You are an import's first maintainer, as of any project.`,Merge build/1413-docs-and-texts into mainoscabrielbefore adoptionf10338e
line 23why, one step back23 "",Merge build/1313-docs into mainoscabrielbefore adoption9000f4e
lines 24–45why, one step back24 "## The config folder",25 "",26 `How the project takes changes is TypeScript on \`main\`, in ${code(`${dir}/`)}. The platform reads it only from the commit it last landed, in a sandbox with no network and frozen time, so it changes the way everything else does: by a landing.`,27 "",28 `- ${code(`${dir}/project.ts`)}: who decides which paths, the kinds of ask the project takes, the daily budget of decisions, caps on claims and proposals, the commands the checks run, and who must be vouched for to claim.`,29 `- ${code(`${dir}/asks/`)}: one file per ask.`,30 `- ${code(`${dir}/vouched.td`)}: who is vouched for, and who is denounced.`,31 `- ${code(`${dir}/visibility.ts`)}: layers and held-back checks, if any (see [Held-back checks and layers](/docs/held-back-checks)).`,32 "",33 "```ts",34 `import { kinds, project } from "${Brand.cliPackage}/rules";`,35 "",36 "export default project({",37 ' budget: { decisionsPerDay: 5, expire: "14 days" },',38 " caps: { claimsPerPerson: 3, proposalsPerPerson: 2 },",39 ' deciders: { "**": ["ines-v"], "src/tz.ts": ["okonkwo"] },',40 " kinds: [kinds.fix],",41 ' run: { checks: { unit: "bun test" }, test: "bun test {path}" },',42 ' vouch: "forCode",',43 "});",44 "```",45 "",Merge build/1413-docs-and-texts into mainoscabrielbefore adoptionf10338e
line 46why, one step back46 `The project's Policy page shows what the folder evaluated to at the landed commit, and ${cli("policy --project <owner>/<name>")} prints the same.`,Merge build/1313-docs into mainoscabrielbefore adoption9000f4e
lines 47–62why, one step back47 "",48 "## Open an ask",49 "",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.`,51 "",52 "```ts",53 `import { kinds, territory } from "${Brand.cliPackage}/rules";`,54 "",55 "export default kinds.fix.ask({",56 ' want: "The Do token of format prints the day of the month as an English ordinal.",',57 ' path: "test/asks/format-ordinal.test.ts",',58 ' territory: territory.paths("src/format.ts", "test/format.test.ts"),',59 ' reserve: "newcomers",',60 "});",61 "```",62 "",Merge build/1413-docs-and-texts into mainoscabrielbefore adoptionf10338e
line 63why, one step back63 `${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.`,Merge build/1313-docs into mainoscabrielbefore adoption9000f4e
lines 64–66why, one step back64 "",65 "## Proposals and drafts",66 "",Merge build/maintainer-wording into mainoscabrielbefore adoption4c1a571
line 67why, one step back67 `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\`.`,Merge build/1313-docs into mainoscabrielbefore adoption9000f4e
lines 68–70why, one step back68 "",69 "## Today",70 "",Merge redesign into mainoscabrielbefore adoptioncaedd21
line 71why, one step back71 `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\`).`,Merge build/1313-docs into mainoscabrielbefore adoption9000f4e
lines 72–74why, one step back72 "",73 "## Finish an answer, or land your own change",74 "",Merge build/maintainer-wording into mainoscabrielbefore adoption4c1a571
line 75why, one step back75 `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\`.`,Merge build/1313-docs into mainoscabrielbefore adoption9000f4e
line 76why, one step back76 "",Merge build/maintainer-wording into mainoscabrielbefore adoption4c1a571
line 77why, one step back77 `A maintainer's own change goes through the same gate. Make your working fork, push to it, and land it:`,Merge build/1313-docs into mainoscabrielbefore adoption9000f4e
lines 78–79why, one step back78 "",79 ...shell(Merge build/1413-docs-and-texts into mainoscabrielbefore adoptionf10338e
line 80why, one step back80 `${Brand.cli} fork --project <owner>/<name>`,Merge build/1313-docs into mainoscabrielbefore adoption9000f4e
line 81why, one step back81 `git push <fork remote> HEAD:main`,Merge build/1413-docs-and-texts into mainoscabrielbefore adoptionf10338e
line 82why, one step back82 `${Brand.cli} land --project <owner>/<name> --base <base> --head <head>`Merge build/1313-docs into mainoscabrielbefore adoption9000f4e
lines 83–86why, one step back83 ),84 "",85 "## Vouch",86 "",Merge build/1413-docs-and-texts into mainoscabrielbefore adoptionf10338e
line 87why, one step back87 `${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.`,Merge build/1313-docs into mainoscabrielbefore adoption9000f4e
lines 88–91why, one step back88 "",89 ],90 slug: "run-a-project",91};