Close the code browser and drafting wave: its decisions in two ADRs, every rule it added held, and its leftovers folded in
Before adoption: this commit came in with the history the project adopted, so no landing records it.
- Merges confirmed: 901 and 902 alone on main (fc4691d, 254268a), group A (903-909) and group B (910-913) --no-ff in the index's order (bbe1442, a4543f6), 914 and 915 live on main (353b924, f4a1424); no worktree or build branch is left. - docs/adr/0018: asks are drafted by the platform's agent as Draft rounds of the Answer Workflow, through the AI binding, fields rendered by code, run red first and put to a decider; considered a container harness with a provider secret, drafting inside the Project DO's call, and the agents SDK. docs/adr/0019: the web reads code only through public contracts the platform serves over RepoHost, canonical repos only, client-only Pierre with a server fallback, raw bytes under a sandboxing CSP, object-id caching of finished reads, tags peeled by the port, and the operator's tag backfill as the one write that skips the gateway (tags only, never main); considered an Artifacts binding on the web, server highlighting and fork browsing. - GLOSSARY.md: Draft, Tag and Why. README.md: what the code browser, why, drafting, the people page and the platform's / do; the eight imports on the dev stage; Keep-or-cut rows for drafting, why, README rendering and the people page with the files each cut removes; drafting in the tree, AI in the platform's bindings; Pierre and unified in Credits. - AGENTS.md "Held by": principles 2, 3, 4, 6, 7, 8 and 12 name the W9 checks (bindings' AI/DRAFT_LIMIT/DRAFT_MODEL/PUBLIC_WEB_URL, the five new refusals, draftAsk and showProposal over MCP, the policy and drafting commands, the Drafter's memory and binding adapters, code reads on both hosts, the raw route's headers, repo-free payloads, projectPolicy without layers, the prompt digest, the draft run's replay, the object-id cache, the drafting model test, a retried import). Commands: what import-examples does now. Rejected dependencies: shadcn's command (cmdk), sidebar and resizable, and DOMPurify, each with its reason. - docs-public.test.ts now also refuses a wave's decision (W9-D14) or section (W9 §14) in committable text, red first on 15 files; those comments cite ADR 0018 or 0019 or say the reason, and issue numbers left the comments and temp-folder prefixes. - Fold-ins, each red first by assertion: - session-slot's sign-in return drops the #fragment (hereOf), so a page opened at #L3 no longer renders a different link in the browser than on the server (session.test.ts); - the README sanitizer strips a <style> with its CSS, which showed as text (markdown.test.tsx); - admissionId keeps the pushed head whole and tags a cut project and layer name with a hash, as draftId does, so two heads under long names never share an Admission instance (answer-runs.test.ts; one instanceId rule for both); - the people page says what a layer discloses in the ledger's own words, one map in features/shared/disclosure.ts (project-people.test.tsx). - Deleted features/shared/not-built.tsx (no route uses it); forward.ts's comment names the raw route. - Byte limits tightened to about 15% above the bundles measured on this commit (web-wiring.test.ts red first): platform entry 1,667,814 stays under its 1,900,000 ceiling (14% above), JavaScript 1,918,000 (was 2,500,000); sandbox 570,424 -> 656,000 (was 1,665,000 and 2,500,000); web entry 710,962 -> 818,000 (was 1,665,000), JavaScript 3,543,318 -> 4,075,000 (was 4,500,000). - verify green: project 533, platform 466, web 444, protocol 418, cli 318, config 290, drafting 23.
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
40 files+273 added−152 removed
- tests:+95 added−19 removed
- other:+178 added−133 removed
Provenance
- Commit
009640c- Tree
8766d44- Author
oscabriel <oscarhernandeziv@gmail.com>- Committer
oscabriel <oscarhernandeziv@gmail.com>- Parent
f4a1424
40 files changed+273 added−152 removed
modified:apps/platform/src/workflows/answer.ts+1 added-1 removed
13 unmodified lines14151617181819202122126 unmodified linesExpand all13 unmodified lines * tagged `Admission` run `admissionSteps`, so typed visibility adds no * Workflow binding. An admission's output is `null`. * * So does a round of a proposal's draft: params tagged `Draft` run * `draftSteps` (W9-D14), over the Worker's ports and the drafter * `draftSteps` (ADR 0018), over the Worker's ports and the drafter * (`draftPorts`), with each step's timeout handed to the engine. A draft's * output is `null` too. */import type { RepoHost } from "@repo/artifacts/repo-host";126 unmodified linesExpand allmodified:apps/platform/src/workflows/draft-steps.ts+1 added-1 removed
1 /**2 * One round of a proposal's draft, as steps of the `Answer` Workflow3- * (W9-D14): the program is `@repo/drafting/run`'s `runDraft`, shared with3+ * (ADR 0018): the program is `@repo/drafting/run`'s `runDraft`, shared with4 * the in-process run, over the Workflow's `StepRunner`. Its steps are5 * `context`, then `draft-<n>` and `rehearse-<n>` per attempt, then6 * `settle`, inside the instance `draft-<project>-<proposal>-r<round>`.7 *46 unmodified linesmodified:apps/platform/src/answer-runs.ts+22 added-16 removed
10 unmodified lines11 * `admissionId`, so a push admitted twice runs once.12 *13 * For one round of a proposal's draft: the run (`@repo/drafting/run`) is14 * steps of the same Workflow under params tagged `Draft`, so drafting adds15- * no Workflow binding (W9-D14). Its instance id is `draftId`, one per15+ * no Workflow binding (ADR 0018). Its instance id is `draftId`, one per16 * project, proposal and round, so a round started twice runs once.17 */18 import { DraftParams as DraftRun } from "@repo/project/draft-runs";19 import {39 unmodified lines59 60 /** How long a Workflow instance id may be. */61 const ID_LENGTH = 100;62 63-/** The instance an admission runs as: one per project, layer and pushed head. */64-export const admissionId = (params: AdmissionParams) =>65- `admit-${params.project}-${params.layer}-${params.head}`.slice(0, ID_LENGTH);66-63 /** A modulus for `tagOf`: the Mersenne prime 2^31 - 1, so every step stays a safe integer. */64 const TAG_MODULUS = 2_147_483_647;65 66 /** A polynomial hash of `text`'s code points, in base 36: a short, stable tag for a name cut short. */7 unmodified lines74 return hash.toString(36);75 };76 77 /**82- * The instance a draft's round runs as: one per project, proposal and83- * round. The proposal and round are kept whole: a project name too long for84- * the engine's id is cut, and tagged with a hash of the whole name, so no85- * two rounds share an instance (a complete one is never run again).78+ * An instance id of `named` then `suffix`, within the engine's length. The79+ * suffix is kept whole; a name too long is cut and tagged with a hash of the80+ * whole name, so two runs with different suffixes or names never share an81+ * instance (one that exists is never started again).82 */87-export const draftId = (88- params: Pick<DraftParams, "project" | "proposal" | "round">89-) => {90- const suffix = `-${params.proposal}-r${params.round}`;91- const whole = `draft-${params.project}${suffix}`;83+const instanceId = (named: string, suffix: string) => {84+ const whole = `${named}${suffix}`;85 86 if (whole.length <= ID_LENGTH) {87 return whole;88 }89 97- const tag = `-${tagOf(params.project)}`;90+ const tag = `-${tagOf(named)}`;91 99- return `${whole.slice(0, ID_LENGTH - tag.length - suffix.length)}${tag}${suffix}`;92+ return `${named.slice(0, ID_LENGTH - tag.length - suffix.length)}${tag}${suffix}`;93 };94+95+/** The instance an admission runs as: one per project, layer and pushed head. */96+export const admissionId = (params: AdmissionParams) =>97+ instanceId(`admit-${params.project}-${params.layer}`, `-${params.head}`);98+99+/**100+ * The instance a draft's round runs as: one per project, proposal and101+ * round, the proposal and round kept whole.102+ */103+export const draftId = (104+ params: Pick<DraftParams, "project" | "proposal" | "round">105+) =>106+ instanceId(`draft-${params.project}`, `-${params.proposal}-r${params.round}`);modified:apps/platform/src/home.ts+1 added-1 removed
8 unmodified lines9 * the platform is also the git remote, the MCP base and the CLI's URL, so10 * the page names them as the reader will type them. The projects are the11 * front page's, and nothing else: no layer and no fork is listed. Every12 * value that reaches the HTML is escaped. Not a redirect: the web app is a13- * link (W9-D11).13+ * link, so the host stays discoverable at its own address.14 */15 import { commandDocs } from "@repo/agent-kit/command-doc";16 import { frontLlms, MCP_PROTOCOL } from "@repo/agent-kit/host-doc";17 import { Brand } from "@repo/brand";186 unmodified linesmodified:apps/platform/test/workflows/draft.test.ts+1 added-1 removed
1 /**2- * A draft's run as the `Answer` Workflow takes it (W9-D14): the program's2+ * A draft's run as the `Answer` Workflow takes it (ADR 0018): the program's3 * steps over memory steps that record and replay as the engine does4 * (`memoSteps`), the memory drafter scripted per attempt, and a project in5 * memory whose rehearsals run on the scripted Checker. The Workflow's own6 * start (`DraftRunsWorkflow`) is held to create-or-restart over a fake676 unmodified linesadded:apps/platform/test/answer-runs.test.ts+46 added
12345678910111213141516171819202122232425262728293031323334353637383940414243444546/** * The instance ids the `Answer` Workflow's runs take. The engine refuses an * id past 100 characters, and starting an id that exists changes nothing, so * two runs that must both happen need two ids however long their names are. */import { describe, expect, it } from "@effect/vitest";import { CommitSha, LayerName, ProjectName } from "@repo/protocol/ids";
import { AdmissionParams, admissionId } from "../src/answer-runs.ts";
/** What the engine takes as an instance id. */const INSTANCE_ID = /^[a-zA-Z0-9_][a-zA-Z0-9-_]*$/u;
describe("an admission's instance", () => { it("is the project, layer and head, whole, when they fit", () => { expect( admissionId( AdmissionParams.make({ head: CommitSha.make("a".repeat(40)), layer: LayerName.make("maintainers"), project: ProjectName.make("datekit"), }) ) ).toBe(`admit-datekit-maintainers-${"a".repeat(40)}`); });
it("keeps each pushed head its own instance under a long project and layer name, within the engine's 100 characters", () => { const project = ProjectName.make(`${"a-long-project-name".repeat(3)}x`); const layer = LayerName.make("maintainers-of-the-sealed-suites");
const heads = [ CommitSha.make(`${"1".repeat(39)}a`), CommitSha.make(`${"1".repeat(39)}b`), ];
const ids = heads.map((head) => admissionId(AdmissionParams.make({ head, layer, project })) );
expect({ distinct: new Set(ids).size, fit: ids.every((id) => id.length <= 100 && INSTANCE_ID.test(id)), named: heads.every((head, at) => (ids[at] ?? "").endsWith(`-${head}`)), }).toStrictEqual({ distinct: 2, fit: true, named: true }); });});modified:apps/web/src/features/agents/forward.ts+3 added-2 removed
123434567899 unmodified lines/** * The paths the platform serves and the web host only passes on: * the CLI's install script and releases and the projects' * skills (`/.well-known/agent-skills/*`). The request goes to the backend * the CLI's install script and releases, the projects' * skills (`/.well-known/agent-skills/*`) and a project's raw files * (`/<project>/raw/<rev>/<path>`, under the platform's sandboxing headers). The request goes to the backend * as it came, for GET and for HEAD only: the platform only reads on these * paths (it answers any other method 405), so the web passes no other * method on. */9 unmodified linesmodified:apps/web/src/features/auth/session-slot.tsx+11 added-1 removed
14 unmodified lines15 16 import { HandleLink } from "../shared/handle.tsx";17 import { whoAtom } from "./who.ts";18 19+/**20+ * Where sign-in comes back to: the page the reader is on, without its21+ * `#fragment`. The server never sees a fragment, so a link that carried one22+ * would differ between the server's render and the browser's (`#L3`).23+ */24+export const hereOf = (location: {25+ readonly pathname: string;26+ readonly searchStr: string;27+}) => `${location.pathname}${location.searchStr}`;28+29 /** Sign-in, coming back to `here` afterwards. */30 const signInHref = (here: string) =>31 `/auth/signin?${new URLSearchParams({ return: here }).toString()}`;32 40 unmodified lines73 ),74 });75 76 export const SessionSlot = () => {67- const here = useLocation({ select: (location) => location.href });77+ const here = useLocation({ select: hereOf });78 const who = useAtomValue(whoAtom);79 80 return (81 <SessionView5 unmodified linesmodified:apps/web/src/features/code/paths.ts+1 added-1 removed
28 unmodified lines29 /** A file's bytes at `rev`, as the platform serves them. */30 export const rawHref = (project: ProjectName, rev: string, path: string) =>31 under(`/${project}/raw/${revSegment(rev)}`, path);32 33-/** Why each line of a file at `rev` is there (912's page). */33+/** Why each line of a file at `rev` is there (the why page). */34 export const whyHref = (project: ProjectName, rev: string, path: string) =>35 under(`/${project}/why/${revSegment(rev)}`, path);36 37 /** The log from `rev`: only the commits that changed `path` when given, from the `from`th. */69 unmodified linesmodified:apps/web/src/features/ledger/ledger-page.tsx+3 added-18 removed
10 unmodified lines11 * and never reaches the public ledger.12 */13 import { Brand } from "@repo/brand";14 import { LedgerEntry } from "@repo/protocol/domain/visibility";15-import type {16- Disclosure,17- Layer,18- Ledger,19-} from "@repo/protocol/domain/visibility";15+import type { Layer, Ledger } from "@repo/protocol/domain/visibility";16 import type { AreaName, SuiteRoot } from "@repo/protocol/ids";17 import { DateTime, Option } from "effect";18 import type { ReactNode } from "react";19 20 import { CODE, Field, Fields, LINK, Region } from "../ask/fields.tsx";21 import { postureLabel } from "../project/posture-label.ts";22 import { ProjectNav } from "../project/project-nav.tsx";23 import { CommandLine } from "../shared/command.tsx";24+import { disclosureWords } from "../shared/disclosure.ts";25 import { EmptyState } from "../shared/empty.tsx";26 import { HandleLink } from "../shared/handle.tsx";27 import { PageShell } from "../shared/layout.tsx";28 import { PostureBadge } from "../shared/posture.tsx";121 unmodified lines150 root,151 }));152 };153 157-/** What people outside a layer's audience learn about what it holds. */158-const disclosures = {159- counted: "counted: how many it holds, and when they open",160- declared: "declared: that it exists, with its kinds and reason",161- hidden: "hidden: nothing beyond its name",162- public: "public: everything",163- sealed:164- "sealed: counts, authors and a salted root; never names, paths or contents",165- writeOnly:166- "write-only: names, and who set each value and when; never a value",167-} as const satisfies Record<Disclosure, string>;168-154 const plural = (count: number, one: string, many: string) =>155 `${count} ${count === 1 ? one : many}`;156 157 /** A day as a reader skims it: "Oct 11", in UTC. */28 unmodified lines186 <h3 className={`${CODE} text-sealed font-medium`}>{layer.name}</h3>187 <Fields label={`Layer ${layer.name}`}>188 <Field label="Audience">{layer.audience}</Field>189 <Field label="Holds">{layer.holds.join(", ")}</Field>205- <Field label="Disclosure">{disclosures[layer.disclose]}</Field>190+ <Field label="Disclosure">{disclosureWords[layer.disclose]}</Field>191 <Field label="Reason">{layer.reason}</Field>192 {layer.sunsetDays === undefined ? null : (193 <Field label="Sunset">{`after ${plural(layer.sunsetDays, "day", "days")}`}</Field>194 )}196 unmodified linesmodified:apps/web/src/features/markdown/pipeline.ts+5 added-2 removed
1 /**2 * The plugin chain that turns a project's Markdown into a safe tree, in3- * the one order that makes it safe (W9-D5). It is the security property3+ * the one order that makes it safe (ADR 0019). It is the security property4 * of the README renderer, so it lives here alone and is tested whole5 * (`test/markdown.test.tsx`):6 *7 * 1. `remarkGfm`: tables, task lists, strikethrough, autolinks, footnotes;30 unmodified lines38 export type MarkdownAt = Omit<RepoUrlContext, "kind">;39 40 /**41 * GitHub's allow-list (`hast-util-sanitize`'s `defaultSchema`), with a42- * code block's `language-…` class kept on `code`, and nothing else added.42+ * code block's `language-…` class kept on `code`, and a `style` element43+ * dropped with its CSS (the default drops only a `script` whole, so a44+ * style's rules would show as text).45 */46 export const schema: Schema = {47 ...defaultSchema,48+ strip: [...(defaultSchema.strip ?? []), "style"],49 attributes: {50 ...defaultSchema.attributes,51 code: [52 ...(defaultSchema.attributes?.code ?? []),70 unmodified linesmodified:apps/web/src/features/markdown/resolve.ts+1 added-1 removed
1 unmodified line2 * Where a link or an image in a project's Markdown file points, inside the3 * web: the file was read at one commit, in one directory, so a relative4 * URL names a path in that commit's tree, as GitHub resolves a README's5 * links. The result always names the SHA, never `main`, so it reads the6- * same tree forever (and a raw image caches forever, W9-D6).6+ * same tree forever (and a raw image caches forever, ADR 0019).7 *8 * Pure, so the rules are table-tested on their own; `pipeline.ts` runs it9 * over the rendered tree before the sanitizer sees it.10 */69 unmodified linesmodified:apps/web/src/features/project-people/people-view.tsx+3 added-17 removed
11 unmodified lines12 * config folder, and it says so with the commands.13 */14 import { Brand } from "@repo/brand";15 import type { PublicPolicy } from "@repo/protocol/domain/policy";16-import type {17- Disclosure,18- Layer,19- Ledger,20- Members,21-} from "@repo/protocol/domain/visibility";16+import type { Layer, Ledger, Members } from "@repo/protocol/domain/visibility";17 import type { Handle, ProjectName } from "@repo/protocol/ids";18 import { Option } from "effect";19 import { Fragment } from "react";20 import type { ReactNode } from "react";10 unmodified lines31 import { CODE, Field, Fields, LINK, Region } from "../ask/fields.tsx";32 import { ledgerPath } from "../ledger/path.ts";33 import { ProjectNav } from "../project/project-nav.tsx";34 import { CommandLine } from "../shared/command.tsx";35+import { disclosureWords } from "../shared/disclosure.ts";36 import { EmptyState } from "../shared/empty.tsx";37 import { HandleLink } from "../shared/handle.tsx";38 import { PageShell } from "../shared/layout.tsx";39 35 unmodified lines75 forCode:76 "For code: claiming an ask or offering a sealed answer needs a vouch; anyone not denounced may propose an ask.",77 } as const satisfies Record<PublicPolicy["vouch"]["mode"], string>;78 83-/** What people outside a layer's audience learn about what it holds. */84-const disclosures = {85- counted: "counted: how many it holds, and when they open",86- declared: "declared: that it exists, with its kinds and reason",87- hidden: "hidden: nothing beyond its name",88- public: "public: everything",89- sealed: "sealed: counts, authors and a salted root, never contents",90- writeOnly: "write-only: who set each value and when, never a value",91-} as const satisfies Record<Disclosure, string>;92-79 const Code = ({ children }: { readonly children: ReactNode }) => (80 <code className={CODE}>{children}</code>81 );82 126 unmodified lines209 </Field>210 <Field label="Writers">211 <MembersOf members={layer.writers} />212 </Field>227- <Field label="Disclosure">{disclosures[layer.disclose]}</Field>213+ <Field label="Disclosure">{disclosureWords[layer.disclose]}</Field>214 <Field label="Reason">{layer.reason}</Field>215 {layer.sunsetDays === undefined ? null : (216 <Field label="Sunset">{`released after ${plural(layer.sunsetDays, "day", "days")}`}</Field>217 )}175 unmodified linesadded:apps/web/src/features/shared/disclosure.ts+17 added
1+/**2+ * What people outside a layer's audience learn about what it holds, in3+ * one set of words for every page that shows a layer (the ledger, the4+ * people page).5+ */6+import type { Disclosure } from "@repo/protocol/domain/visibility";7+8+export const disclosureWords = {9+ counted: "counted: how many it holds, and when they open",10+ declared: "declared: that it exists, with its kinds and reason",11+ hidden: "hidden: nothing beyond its name",12+ public: "public: everything",13+ sealed:14+ "sealed: counts, authors and a salted root; never names, paths or contents",15+ writeOnly:16+ "write-only: names, and who set each value and when; never a value",17+} as const satisfies Record<Disclosure, string>;deleted:apps/web/src/features/shared/not-built.tsx-42 removed
1-/**2- * A project page whose route exists but whose view does not yet: the3- * project's nav and one line naming the build step that fills it. Every4- * W9 route renders this until its issue replaces the route's body, so5- * every typed link to it resolves meanwhile. Delete this file once no6- * route imports it.7- */8-import { ProjectName } from "@repo/protocol/ids";9-import { Option, Schema } from "effect";10-11-import { ProjectNav } from "../project/project-nav.tsx";12-import type { ProjectTab } from "../project/project-nav.tsx";13-import { UnknownProjectView } from "../project/unknown-project.tsx";14-import { EmptyState } from "./empty.tsx";15-import { PageShell } from "./layout.tsx";16-17-const decodeProject = Schema.decodeUnknownOption(ProjectName);18-19-export const NotBuilt = ({20- current,21- issue,22- project,23- title,24-}: {25- readonly current?: ProjectTab | undefined;26- /** The build issue that builds the page, e.g. `"904"`. */27- readonly issue: string;28- /** The route's `$project`, as the address spells it. */29- readonly project: string;30- readonly title: string;31-}) =>32- Option.match(decodeProject(project), {33- onNone: () => <UnknownProjectView name={project} />,34- onSome: (name) => (35- <PageShell title={title}>36- <ProjectNav current={current} project={name} />37- <div data-not-built={issue}>38- <EmptyState title={`This page is not built yet (${issue}).`} />39- </div>40- </PageShell>41- ),42- });modified:apps/web/src/features/why/why-view.tsx+1 added-1 removed
1 /**2- * Why each line of a file is there (spec W9-D9). The server sends a table2+ * Why each line of a file is there (ADR 0019). The server sends a table3 * of ranges (lines a–b → the landing or the commit that brought them)4 * beside the file's numbered lines; the browser then draws the file with5 * one row above each range (`code`, from `client-why.tsx`), where clicking6 * a line number opens that line's landing. A file the walk cannot read as145 unmodified linesmodified:apps/web/test/markdown.test.tsx+7 added
84 unmodified lines85 expect(markup).not.toContain(word);86 expect(markup).toContain("<p>after</p>");87 });88 89+ it("drops a style's CSS with the element, so no stray rules show as text", () => {90+ const markup = rendered("<style>body{display:none}</style>\n\nafter");91+92+ expect(markup).not.toContain("display:none");93+ expect(markup).toContain("<p>after</p>");94+ });95+96 it("prefixes a name the README sets, so it cannot clobber the page's own", () => {97 const markup = rendered('<a name="top">Top</a>');98 99 expect(markup).toMatch(/(?:id|name)="user-content-top"/u);143 unmodified linesmodified:apps/web/test/project-people.test.tsx+10 added
214 unmodified lines215 ])216 ).toBeTruthy();217 });218 219+ it("says what a layer discloses in the ledger page's own words", () => {220+ const layers = plainText(221+ between(markupOf(page), 'id="layers"', 'id="limits"')222+ );223+224+ expect(layers).toContain(225+ "sealed: counts, authors and a salted root; never names, paths or contents"226+ );227+ });228+229 it("shows the caps, budget, claim timing and record window", () => {230 const limits = plainText(231 between(markupOf(page), 'id="limits"', 'id="agents"')232 );314 unmodified linesmodified:apps/web/test/session.test.ts+12 added-1 removed
12 unmodified lines13 import { Effect, Option, Schema } from "effect";14 import { createElement } from "react";15 import { renderToStaticMarkup } from "react-dom/server";16 17-import { SessionView } from "../src/features/auth/session-slot.tsx";17+import { hereOf, SessionView } from "../src/features/auth/session-slot.tsx";18 import { devSignIn } from "../src/routes/auth/-dev.ts";19 import { backend } from "../src/server/backend.ts";20 import { serverClientOver } from "../src/server/client.ts";21 import {801 unmodified lines823 expect(markup).toContain('href="/auth/signin?return=%2Ftoday"');824 expect(markup).toContain(">Sign in<");825 expect(markup).not.toContain("/auth/signout");826 });827+828+ it("comes back to the page without its #fragment, which the server never sees, so the link it renders matches in the browser", () => {829+ const location = {830+ hash: "L3",831+ href: "/datekit/blob/main/src/add.ts?plain=1#L3",832+ pathname: "/datekit/blob/main/src/add.ts",833+ searchStr: "?plain=1",834+ };835+836+ expect(hereOf(location)).toBe("/datekit/blob/main/src/add.ts?plain=1");837+ });838 });added:docs/adr/0018-asks-are-drafted-in-a-workflow-and-put-to-a-decider.md+22 added
1+---2+status: accepted3+---4+5+# Asks are drafted by the platform's agent in a Workflow, run red first, and put to a decider6+7+A member who can say what a project wants, but not write its ask, proposes the want with a draft. The platform's agent then writes the ask for them. A draft round is one run of the existing `Answer` Workflow under params tagged `Draft`. Its steps are a context step, which picks files from the canonical tree at the landed commit within a byte budget and never reads a layer, then up to three attempts, then a settle. Each attempt makes one model call through Workers AI's `AI` binding, recorded as a step, and one rehearsal: red first on the Checker, the same preparation `accept` runs, which lands nothing. The model is the `DRAFT_MODEL` var, and no key or secret is involved. A refused rehearsal feeds its rendered refusal and the last 4 KB of its output into the next attempt. The model returns fields only (the ask's id, want, context, territory, the test's path and source, a rationale). Code renders the `.ask.ts` file from those fields, so only the test file is the model's own text, and that test may not sit in the config folder. A settled draft reaches a decider as an `OpenProposal` decision. Its evidence is the drafted files, the red-first signature, the model, the attempt and the rationale. Accepting it runs the unchanged `accept`, red first again on the then-current `main`. The landing credits the proposer (`Asked-by`) and the decider (`Decided-by`), and discloses the agent with `Assisted-by: <cli>-drafter:<model> (verified)`.8+9+## Considered Options10+11+- **A container harness with a provider secret** (a coding agent in a Checker-like container, calling a model provider with a key). It could edit and run code freely, but it adds a secret to set per stage, a second container image, and a harness that writes code into the ask file. That stays a later step, which could reach the same binding through an intercepted host.12+- **Drafting inside the Project Durable Object's call.** A model call takes 30 to 60 s and a rehearsal minutes; a DO call that long blocks the project, and a retried call would ask the model again. A Workflow step records the model's answer, so a replay asks nothing more.13+- **The `agents` SDK.** It brings 17 peer dependencies and a deprecated MCP agent, and it adds nothing a recorded step and a binding call do not already do.14+15+## Consequences16+17+- Nothing a draft writes lands without a decider: the draft's own rehearsal only reports, and `accept` is the one path to `main`.18+- A draft round's instance is one per project, proposal and round, so a round started twice runs once. A complete round is never started again, since that would ask the model again. A round that errored is.19+- Workers AI does not hold a model to the JSON Schema it is asked for. The reply is decoded with Effect Schema whatever the model claims, and a reply that does not decode is a spent attempt.20+- The prompt's policy digest is built from the public policy only, so a layer's name, readers and paths never reach a model.21+- Drafts are `fix` asks only for now. A project with no `fix` kind settles its draft as failed at once.22+- Drafting has its own rate limit (`DRAFT_LIMIT`), and each draft costs at most three model calls and six Checker runs, plus two on accept.added:docs/adr/0019-the-web-reads-repos-through-public-contracts.md+23 added
1+---2+status: accepted3+---4+5+# The web reads a project's code through public contracts the platform serves6+7+The web's code browser (tree, file, raw bytes, log, commit, refs, and why each line is there) reads only through public, read-only contracts on `/rpc`. The platform Worker serves them over its existing `RepoHost` on the public Artifacts namespace. The logic lives in one host-free module, `@repo/project/code`, which the platform's handlers and the web's offline dev world both call. No payload names a repo. Each names a project, and the module reads that project's canonical repo only, never a fork or a layer. A revision is `main` (the project's landed SHA, from its record and never from a ref), a full commit SHA in the canonical repo, or a tag name matched exactly against the port's tag list, never joined into a ref path. Every answer names the commit it resolved, so any page becomes a permalink.8+9+## Considered Options10+11+- **An Artifacts binding on the web Worker.** It would save a hop, but the web would then hold storage. Today it holds a service binding and public vars only, and a type test keeps it that way. A second Worker reading repos would also put a second place in front of the visibility rule.12+- **Highlighting on the server.** A cold highlight costs about 800 ms and some 730 bytes a line, and the grammars would add about 11 MB to the Worker. Pierre draws code in the browser instead, and the server sends a plain fallback: a table for a folder, and numbered lines with `#L<n>` anchors for a file.13+- **Browsing forks.** Forks would need their own auth paths, and a layer repo must never be nameable. Claim forks are listed and link to their answer's page instead.14+15+## Consequences16+17+- Raw bytes (`GET /<project>/raw/<rev>/<path>`) carry `x-content-type-options: nosniff` and a sandboxing CSP (`default-src 'none'; img-src 'self' data:; style-src 'unsafe-inline'; sandbox`) on every answer, refusals included. HTML and XML are served as plain text, and SVG as an image, which the sandbox keeps from running script. A read by commit SHA is cached as immutable. The web passes the route on untouched.18+- Reads addressed by object id (trees, blobs, commits, a commit's changes, a file's why) are cached per isolate, keyed by the object's id. Only finished reads are kept, never one still under way, because Workers cancels a request whose client left without interrupting its fibers. `main` is resolved on every call.19+- A README renders as GitHub-flavoured Markdown in one fixed plugin order, its relative links and images pointing into the repo at the SHA, then sanitized with GitHub's allow-list. The order is the security property, so it lives in one tested module.20+- Why each line is there is a first-parent blame from the revision, up to 200 commits. A line whose commit is a platform landing names its ask, answer, people and verdict from the project's own record, so a trailer forged on an imported commit never reads as a landing.21+- The port lists tags already peeled to their commits, since an annotated tag names a tag object a commit read cannot open.22+- Artifacts' import brings no tags. An operator may backfill an imported repo's `refs/tags/*` from its source, through a short-lived write token minted over REST. This is the one write that skips the gateway, and it writes tags only, never `main`.23+- Each read is an Artifacts operation, billed past a monthly allowance and limited to 2,000 a repo every 10 s. Every walk is capped: 50,000 paths, 200 commits scanned for a path's log or for why, 300 files and 2 MiB of text in a commit's diff, and 1 MiB per file.modified:infra/smoke.ts+1 added-1 removed
171 unmodified lines172 * A server error, or a 404 from a hostname that is not serving yet: a173 * Worker's first deploy to workers.dev answers 404 for its first seconds174 * (once, smoke ran 4 s after the web's first deploy and got 404 twice), and175 * a deploy that adds a route can still be answered by the version before it176- * (demo's W9 deploy: `/` answered 404 once as the upload finished). The176+ * (a demo deploy that added `/`: it answered 404 once as the upload finished). The177 * web's probes and `platform-root` read a 404 so; the platform's178 * `missing-repo-404` expects one.179 */180 const notServingYet = (status: number) => status >= 500 || status === 404;407 unmodified linesmodified:packages/config/test/docs-public.test.ts+6 added-3 removed
25 unmodified lines26 ] as const;27 28 /**29 * What a reference into the build's private plan looks like, which a reader30- * with only the repo cannot follow: a section of its spec (`spec §8`), one of31- * its decisions (`spec D6`), one of its issues by wave (`W3 313`), or the32- * research synthesis it was drawn from (`SYN`).30+ * with only the repo cannot follow: a section of its spec (`spec §8`, or a31+ * wave's `W9 §14`), one of its decisions (`spec D6`, or a wave's `W9-D14`),32+ * one of its issues by wave (`W3 313`), or the research synthesis it was33+ * drawn from (`SYN`).34 */35 const PLAN_REFERENCES = [36 /\bspec §/u,37 /\bspec D\d/u,38+ /\bW\d+ §/u,39+ /\bW\d+-D\d/u,40 /\bW\d \d{3}\b/u,41 /\bSYN\b/u,42 ] as const;43 204 unmodified linesmodified:packages/config/test/import-examples.test.ts+2 added-4 removed
197 unmodified lines198 ) =>199 Effect.gen(function* () {200 const fs = yield* FileSystem.FileSystem;201 const path = yield* Path.Path;202- const dir = yield* fs.makeTempDirectoryScoped({ prefix: "import-913-" });202+ const dir = yield* fs.makeTempDirectoryScoped({ prefix: "importing-" });203 const ledgerFile = path.join(dir, "created.jsonl");204 const printed: string[] = [];205 206 const captured: Console.Console = {179 unmodified lines386 Effect.gen(function* () {387 const fs = yield* FileSystem.FileSystem;388 const path = yield* Path.Path;389 390- const dir = yield* fs.makeTempDirectoryScoped({391- prefix: "import-913-",392- });390+ const dir = yield* fs.makeTempDirectoryScoped({ prefix: "importing-" });391 392 const ledgerFile = path.join(dir, "created.jsonl");393 const platform = yield* fakePlatform(["anyhow", "ky"]);394 95 unmodified linesmodified:packages/config/test/smoke-loop.test.ts+1 added-1 removed
268 unmodified lines269 () =>270 Effect.gen(function* () {271 const fs = yield* FileSystem.FileSystem;272 const path = yield* Path.Path;273- const dir = yield* fs.makeTempDirectoryScoped({ prefix: "smoke-910-" });273+ const dir = yield* fs.makeTempDirectoryScoped({ prefix: "drafting-" });274 275 const report = yield* Effect.scoped(276 Effect.gen(function* () {277 const origin = yield* servedWorld(77 unmodified linesmodified:packages/config/test/smoke.test.ts+2 added-2 removed
231 unmodified lines232 it.live(233 "asks / again while the version before a deploy still answers it with 404, and passes once it settles",234 () =>235 Effect.gen(function* () {236- // demo's W9 deploy (914): smoke ran as the upload finished, and the237- // W8 version, which has no `/`, answered it once more with 404.236+ // a demo deploy that added `/`: smoke ran as the upload finished, and the237+ // version before, which has no `/`, answered it once more with 404.238 const asked = { root: 0 };239 240 const origin = yield* fakePlatform((seen) => {241 if (seen.path === "/") {316 unmodified linesmodified:packages/config/test/web-wiring.test.ts+7 added-6 removed
218 unmodified lines219 it("measures the web Worker", () => {220 expect(workers.map(({ dir }) => dir)).toContain("apps/web");221 });222 223- // Each Worker grows on its own, so each has limits of its own: the224- // platform's and the web's JavaScript at the ceilings the code browser225- // and drafting land under.223+ // Each Worker grows on its own, so each has limits of its own, about224+ // 15% above its bundle as measured once the code browser and drafting225+ // landed (the platform's entry stays at the ceiling they landed under,226+ // 14% above it).227 it("holds each Worker it measures to limits of its own", () => {228 expect(budgets).toStrictEqual({228- "apps/platform": { entry: 1_900_000, javascript: 2_500_000 },229- "apps/sandbox": { entry: 1_665_000, javascript: 2_500_000 },230- "apps/web": { entry: 1_665_000, javascript: 4_500_000 },229+ "apps/platform": { entry: 1_900_000, javascript: 1_918_000 },230+ "apps/sandbox": { entry: 656_000, javascript: 656_000 },231+ "apps/web": { entry: 818_000, javascript: 4_075_000 },232 });233 expect(Object.keys(budgets).toSorted()).toStrictEqual(234 workers.map(({ dir }) => dir).toSorted()235 );23 unmodified linesmodified:packages/drafting/src/drafter/binding.ts+1 added-1 removed
1 /**2 * The `Drafter` over Workers AI, through the platform's `AI` binding3- * (W9-D12): one chat call that asks for JSON matching `DraftedAsk`'s JSON3+ * (ADR 0018): one chat call that asks for JSON matching `DraftedAsk`'s JSON4 * Schema. Workers AI can't promise the model keeps to the schema, so the5 * reply is decoded with Effect Schema whatever the model claims6 * (principle 2). Nothing here logs: a prompt carries the project's files.7 */162 unmodified linesmodified:packages/drafting/src/context.ts+1 added-1 removed
1 /**2 * What the drafter reads: files picked from the project's canonical tree at3- * the landed commit, deterministically, within a byte budget (W9 §14.7).3+ * the landed commit, deterministically, within a byte budget (ADR 0018).4 * The caller hands the tree and a reader over the canonical repo only, so5 * no layer's repo can be read here; a path that looks like a layer's or a6 * held-back check's is refused anyway, as is an env file.7 *317 unmodified linesmodified:packages/drafting/src/drafted.ts+1 added-1 removed
69 unmodified lines70 /**71 * Sentences as a model may send them: a list, or one sentence alone, which72 * decodes as a list of one. Workers AI does not hold a model to the JSON73 * Schema it is asked for: kimi-k2.7-code sent `context` and `outOfScope` as74- * strings on every attempt (914, live on dev-oscabriel).74+ * strings on every attempt, live on dev-oscabriel.75 */76 const Sentences = Schema.Union([77 Schema.Array(Text),78 Text.pipe(71 unmodified linesmodified:packages/drafting/src/render.ts+2 added-2 removed
1 /**2- * The ask file, written by code from a draft's fields (W9-D13): the model2+ * The ask file, written by code from a draft's fields (ADR 0018): the model3 * never writes the `.ask.ts` source, so it cannot put code there. Every4 * string it gave enters the file through `JSON.stringify`, as a string5 * literal, and a field it left out (or gave empty) is left out. Only the6 * test file is the model's own text.7 unmodified lines14 const text = (value: string) => JSON.stringify(value);15 16 const list = (values: readonly string[]) => `[${values.map(text).join(", ")}]`;17 18-/** Each drafted kind's handle in the rules package: W9 drafts `fix` only. */18+/** Each drafted kind's handle in the rules package: drafts are `fix` asks only, for now. */19 const kindHandle = { fix: "kinds.fix" } as const satisfies Record<20 DraftedAsk["kind"],21 string22 >;53 unmodified linesmodified:packages/drafting/src/run.ts+2 added-2 removed
1 /**2- * One draft run, as a program over named steps (W9-D14): the platform's2+ * One draft run, as a program over named steps (ADR 0018): the platform's3 * `Answer` Workflow runs it with durable steps (`apps/platform`'s4 * `workflows/draft-steps.ts`), and `draft-runs/inline.ts` runs it in5 * process, so both reach the same end.6 *99 unmodified lines106 });107 108 type Attempted = typeof Attempted.Type;109 110-/** The kind a draft is: W9 drafts `fix` asks only (W9-D13). */110+/** The kind a draft is: drafts are `fix` asks only, for now (ADR 0018). */111 const draftedKind = "fix";112 113 /** A proposal's territory as the paths whose files the drafter reads. */114 const territoryPaths = (territory: string | undefined) =>255 unmodified linesmodified:packages/drafting/test/binding.test.ts+1 added-1 removed
159 unmodified lines160 it.effect(161 "takes one sentence where the schema asks for a list of them, as a list of one",162 () =>163 Effect.gen(function* () {164- // kimi-k2.7-code on dev-oscabriel (914) answered every attempt with164+ // kimi-k2.7-code on dev-oscabriel answered every attempt with165 // `context` and `outOfScope` as strings, whatever the JSON Schema said.166 const reply = JSON.stringify({167 ...encoded,168 context: "An ordinal date is YYYY-DDD.",75 unmodified linesmodified:packages/project/src/code/raw.ts+2 added-2 removed
1 /**2- * A project's raw bytes, `GET /<project>/raw/<rev>/<path…>` (spec W9-D6),2+ * A project's raw bytes, `GET /<project>/raw/<rev>/<path…>` (ADR 0019),3 * as one pure response both the platform (`apps/platform/src/raw.ts`) and4 * the web's dev world serve. Both origins hold a session cookie, so no file5 * may run as script there: every answer carries `nosniff` and a sandboxing6 * CSP, images come back as themselves (an SVG too: an `<img>` never runs32 unmodified lines39 ]);40 41 const TEXT = "text/plain; charset=utf-8";42 43-/** What every raw answer carries, a refusal too (spec W9-D6). */43+/** What every raw answer carries, a refusal too (ADR 0019). */44 const SAFE = {45 "content-security-policy": SANDBOX,46 "x-content-type-options": "nosniff",47 } as const;147 unmodified linesmodified:packages/project/src/code/revision.ts+1 added-1 removed
1 /**2 * A revision as a reader names it, resolved to the commit it means in the3- * project's canonical repo (spec W9-D3): absent or `main` is main's landed3+ * project's canonical repo (ADR 0019): absent or `main` is main's landed4 * commit, from the project's record and never from a ref; 40 hex digits are5 * that commit, if the repo holds it; anything else is a tag's exact name,6 * found among the repo's tags and never joined into a ref path, so7 * `../heads/x` or a ref of the platform's own names nothing.92 unmodified linesmodified:packages/project/src/code/why.ts+1 added-1 removed
1 /**2- * Why each line of a file is there (spec W9-D9): a first-parent blame from2+ * Why each line of a file is there (ADR 0019): a first-parent blame from3 * a revision. The walk takes at most `WHY_SCAN` first-parent commits from4 * the log and the path's blob at each (trees kept by id through5 * `CodeCache`, `READS_AT_ONCE` commits read together), keeps the commits6 * where the blob changed, then reads those blobs newest first, a batch at229 unmodified linesmodified:scripts/startup-budget.ts+10 added-7 removed
24 unmodified lines25 * Each Worker has limits of its own, so one Worker's growth never hides26 * in another's headroom. Code that is added before anything imports it27 * adds no bytes, so a limit is raised to its ceiling when a wave of work28 * starts, and tightened to about 15% above the measured bundle when the29- * wave ends: the platform's entry was 1,605,405 bytes before the code30- * browser and drafting, and its ceiling is 1,900,000 while they land; the31- * web's JavaScript was 2,364,955 bytes before the code browser and README32- * rendering, and its ceiling is 4,500,000 while they land. The web's29+ * wave ends. Before the code browser, README rendering and drafting the30+ * platform's entry was 1,605,405 bytes and the web's JavaScript 2,364,955;31+ * they landed under ceilings of 1,900,000 and 4,500,000. Measured once32+ * they had landed: the platform's entry (its only module) 1,667,814 bytes,33+ * held to 1,900,000 (the ceiling, 14% above) and 1,918,000 of JavaScript;34+ * the sandbox's 570,424, held to 656,000; the web's entry 710,962, held to35+ * 818,000, and its JavaScript 3,543,318, held to 4,075,000. The web's36 * JavaScript counts the Worker's server modules only: chunks the browser37 * alone loads (Pierre's) are assets.38 */39 import { BunRuntime, BunServices } from "@effect/platform-bun";7 unmodified lines47 }48 49 /** Each Worker's limits, by its folder. */50 export const budgets = {48- "apps/platform": { entry: 1_900_000, javascript: 2_500_000 },49- "apps/sandbox": { entry: 1_665_000, javascript: 2_500_000 },50- "apps/web": { entry: 1_665_000, javascript: 4_500_000 },51+ "apps/platform": { entry: 1_900_000, javascript: 1_918_000 },52+ "apps/sandbox": { entry: 656_000, javascript: 656_000 },53+ "apps/web": { entry: 818_000, javascript: 4_075_000 },54 } as const satisfies Record<string, Budget>;55 56 /**57 * Each Worker, the file its `main` bundles to, and the build a dry run needs131 unmodified linesmodified:AGENTS.md+10 added-8 removed
11 unmodified lines12 13 | # | Principle | Held by |14 | --- | --- | --- |15 | 1 | **Encode lessons in structure; prose is the last rung.** When a mistake repeats, make it unrepresentable, then a lint or a test. | No fence |16-| 2 | **Parse at the boundary, trust inside.** Decode every external input (HTTP, git, DO RPC, WebSocket, rule facts, env) with Effect Schema; inside, use branded types (`AskId`, `LandedSha`, `PatchId`). Decode the Worker `env` once, in one Layer. | The Effect diagnostics at error in `tsconfig.base.json`; `anti-slop/no-unknown-parameters`, `anti-slop/no-widen-then-assert` and `anti-slop/require-safety-comment-for-type-assertion`; `apps/platform/test/platform.test.ts` (a bad env fails at start, decoded once in `apps/platform/src/platform.ts`); `apps/platform/test/bindings.test.ts` (the decoded bindings, vars and secrets equal each wrangler.jsonc block's, and each port's factory takes its binding as the generated Env types it, without a cast) |17-| 3 | **Refusals are a closed `Schema.TaggedError` union and a public contract.** Handle them with `Match.exhaustive` or `catchTags`. Each carries a `retryable` and a `next` command fixed per tag, an optional `at`, and no `message` field. A `_tag` is renamed only with an alias. `protocol/render` is the one renderer for git `remote:`, CLI and MCP text. Stage-1 refusals accumulate. | `packages/protocol/test/refusal.test.ts`; `packages/protocol/test/render.test.ts`; `packages/protocol/test/mcp.test.ts` (a refusal from tools/call keeps its tag); `anti-slop-effect/prefer-effect-match` and `anti-slop-effect/no-manual-tag-comparison`; `packages/gate/test/shape.test.ts` (one push hears every stage-1 refusal at once); `apps/platform/test/mcp.test.ts` (each refusing MCP contract comes back as its exact refusal); `apps/cli/test/policy.test.ts`; `apps/cli/test/local/check.test.ts` (the local check gives the gateway's stage-1 refusals for the same commit) |18-| 4 | **One schema, many surfaces.** Change `packages/protocol`; every surface derives from it. Projections live only in `apps/*/src/surfaces.ts`. The CLI's command list is `commandDocs` in `@repo/agent-kit`, which the platform's skill, the CLI's MCP prompt and the web's `llms.txt` all read. | `apps/cli/test/commands-doc.test.ts` (the command list against the real CLI's commands, flags and positionals); `packages/protocol/test/mcp.test.ts` (every MCP tool's schemas, with no JSON Schema leak); per-package `allowedUnstableApis` with `unstableApiUsage` at error |16+| 2 | **Parse at the boundary, trust inside.** Decode every external input (HTTP, git, DO RPC, WebSocket, rule facts, env) with Effect Schema; inside, use branded types (`AskId`, `LandedSha`, `PatchId`). Decode the Worker `env` once, in one Layer. | The Effect diagnostics at error in `tsconfig.base.json`; `anti-slop/no-unknown-parameters`, `anti-slop/no-widen-then-assert` and `anti-slop/require-safety-comment-for-type-assertion`; `apps/platform/test/platform.test.ts` (a bad env fails at start, decoded once in `apps/platform/src/platform.ts`); `apps/platform/test/bindings.test.ts` (the decoded bindings, vars and secrets equal each wrangler.jsonc block's, the `AI` binding, `DRAFT_LIMIT`, `DRAFT_MODEL` and `PUBLIC_WEB_URL` among them, and each port's factory takes its binding as the generated Env types it, without a cast) |17+| 3 | **Refusals are a closed `Schema.TaggedError` union and a public contract.** Handle them with `Match.exhaustive` or `catchTags`. Each carries a `retryable` and a `next` command fixed per tag, an optional `at`, and no `message` field. A `_tag` is renamed only with an alias. `protocol/render` is the one renderer for git `remote:`, CLI and MCP text. Stage-1 refusals accumulate. | `packages/protocol/test/refusal.test.ts` and `packages/protocol/test/render.test.ts` (every tag, the code reads' and drafting's `UnknownPath`, `UnknownRevision`, `UnknownProposal`, `ProposalClosed` and `DraftInProgress` included); `packages/protocol/test/mcp.test.ts` (a refusal from tools/call keeps its tag); `anti-slop-effect/prefer-effect-match` and `anti-slop-effect/no-manual-tag-comparison`; `packages/gate/test/shape.test.ts` (one push hears every stage-1 refusal at once); `apps/platform/test/mcp.test.ts` (each refusing MCP contract comes back as its exact refusal, `draftAsk` and `showProposal` included); `apps/platform/test/workflows/draft.test.ts` (past the draft limit, `CapReached`); `apps/cli/test/policy.test.ts`; `apps/cli/test/local/check.test.ts` (the local check gives the gateway's stage-1 refusals for the same commit) |18+| 4 | **One schema, many surfaces.** Change `packages/protocol`; every surface derives from it. Projections live only in `apps/*/src/surfaces.ts`. The CLI's command list is `commandDocs` in `@repo/agent-kit`, which the platform's skill, the CLI's MCP prompt and the web's `llms.txt` all read. | `apps/cli/test/commands-doc.test.ts` (the command list against the real CLI's commands, flags and positionals, `policy`, `ask draft` and `proposal` included); `packages/protocol/test/mcp.test.ts` (every MCP tool's schemas, with no JSON Schema leak, the policy and drafting contracts included); `apps/platform/test/home.test.ts` (the platform's `/` in Markdown is the web's `llms.txt`, one text from `@repo/agent-kit`); per-package `allowedUnstableApis` with `unstableApiUsage` at error |19 | 5 | **The name lives only in `packages/brand`.** Internal packages use `@repo/*`. DO classes, Workflows, queues and databases carry job names. | `brand:check` (`scripts/brand.ts`, tested by `packages/brand/test/leaks.test.ts`) |20-| 6 | **Pure core, thin hosts.** Only `@repo/artifacts` calls Artifacts. Each beta dependency sits behind one job-named port with a `/memory` adapter in the owning package. Apps import packages only. Worker code stays free of `node:child_process`, `@effect/platform-bun` and OpenTUI. `rules` and `gate` run in both Workers and Bun. `alchemy/*` stays in `infra/`. No module-level mutable state in a package's `src/`. | Scoped `allowedUnstableApis`; `packages/artifacts/test/repo-host-contract.ts` (one RepoHost contract every adapter passes); `apps/platform/test/bindings.test.ts` and `apps/platform/test/worker-init.test.ts` (the Worker starts on its real adapters, composed in `apps/platform/src/ports.ts`); `apps/web/test/production-bundle.test.ts` (no dev-world module in the web's production build); `packages/config/test/cartridge.test.ts` (the visibility cartridge is plugged in by one marked line and reached by nothing else, so removing it is a deletion). No fence: import direction and module-level state |21-| 7 | **Deny by default for visibility.** Land the answer's tree, never the composed tree. Nothing from a layer enters a public tree. Snapshot before held-back files are written. Public-serving Workers have no private-namespace binding. Public commits, trailers, notes and errors name public paths only. | `PrivatePathInPublicTree`, one rule for the gate's stage 1 and the landing guard (`packages/gate/test/shape.test.ts`, `packages/visibility/test/guards.test.ts`); `apps/platform/test/visibility/layer-gateway.test.ts` (only a layer's readers clone it, every read is logged, a fork push cannot carry its paths); `apps/sandbox/test/held-back.test.ts` (egress off and the snapshot taken before any sealed file is written; one bit per area, no output); `apps/platform/test/visibility/held-back.test.ts` (the `Held-back:` trailer, the landing guards, no stored value in a note or a kept log); `apps/platform/test/bindings.test.ts`; `apps/sandbox/test/checker.test.ts` (no snapshot once the held-back slot is reached); `apps/web/test/env.test-d.ts` (the web's Env has no private-namespace or Artifacts binding) and `apps/platform/test/env.test-d.ts` (only the platform's has both) |22-| 8 | **Deterministic and idempotent.** Rule evaluation sees frozen time and randomness and only injected facts. Re-running an operation converges. Check results are keyed by (tree SHA, check version), push events deduped by (repo, sha), and land requests carry a `requestId`. | `globalDate`, `globalRandom`, `globalTimers` and `cryptoRandomUUID` at error, with their in-Effect twins; `packages/rules/test/replay.test.ts`; `packages/project/test/project-store.contract.ts`; `packages/project/test/claim.model.test.ts` and `packages/project/test/landing.model.test.ts`; `apps/platform/test/workflows/answer.test.ts`; `apps/platform/test/workflows/on-push.test.ts`; `apps/platform/test/core-loop.test.ts`. No fence: one push deduped by (repo, sha) across the gateway's record and OnPush's |20+| 6 | **Pure core, thin hosts.** Only `@repo/artifacts` calls Artifacts. Each beta dependency sits behind one job-named port with a `/memory` adapter in the owning package. Apps import packages only. Worker code stays free of `node:child_process`, `@effect/platform-bun` and OpenTUI. `rules` and `gate` run in both Workers and Bun. `alchemy/*` stays in `infra/`. No module-level mutable state in a package's `src/`. | Scoped `allowedUnstableApis`; `packages/artifacts/test/repo-host-contract.ts` (one RepoHost contract every adapter passes); `apps/platform/test/bindings.test.ts` and `apps/platform/test/worker-init.test.ts` (the Worker starts on its real adapters, composed in `apps/platform/src/ports.ts`); `apps/web/test/production-bundle.test.ts` (no dev-world module in the web's production build); `packages/config/test/cartridge.test.ts` (the visibility cartridge is plugged in by one marked line and reached by nothing else, so removing it is a deletion); `packages/drafting/test/memory.test.ts` (the `Drafter` port's `/memory` adapter, `packages/drafting/src/drafter/memory.ts`) and `packages/drafting/test/binding.test.ts` (its Workers AI adapter over the `AI` binding); `apps/platform/test/code-reads.test.ts` and `apps/web/test/dev-backend.test.ts` (the platform and the web's dev world answer the code reads and raw files alike, both through `@repo/project/code`). No fence: import direction and module-level state |21+| 7 | **Deny by default for visibility.** Land the answer's tree, never the composed tree. Nothing from a layer enters a public tree. Snapshot before held-back files are written. Public-serving Workers have no private-namespace binding. Public commits, trailers, notes and errors name public paths only. | `PrivatePathInPublicTree`, one rule for the gate's stage 1 and the landing guard (`packages/gate/test/shape.test.ts`, `packages/visibility/test/guards.test.ts`); `apps/platform/test/visibility/layer-gateway.test.ts` (only a layer's readers clone it, every read is logged, a fork push cannot carry its paths); `apps/sandbox/test/held-back.test.ts` (egress off and the snapshot taken before any sealed file is written; one bit per area, no output); `apps/platform/test/visibility/held-back.test.ts` (the `Held-back:` trailer, the landing guards, no stored value in a note or a kept log); `apps/platform/test/bindings.test.ts`; `apps/sandbox/test/checker.test.ts` (no snapshot once the held-back slot is reached); `apps/web/test/env.test-d.ts` (the web's Env has no private-namespace or Artifacts binding) and `apps/platform/test/env.test-d.ts` (only the platform's has both); `packages/project/test/code-raw.test.ts` and `apps/platform/test/raw.test.ts` (raw bytes under `nosniff` and the sandboxing CSP, refusals included); `apps/platform/test/code-reads.test.ts` (no code read's payload names a repo); `apps/platform/test/w9-contracts.test.ts` (`projectPolicy` answers without the policy's layers or asks, and `packages/config/test/cartridge.test.ts` keeps the cartridge removable); `packages/drafting/test/prompt.test.ts` (a draft's prompt never carries a layer's name, repo, reason or paths); `apps/web/test/markdown.test.tsx` (a README's script, handlers, unsafe URLs, iframes, styles and forms never reach the page) |22+| 8 | **Deterministic and idempotent.** Rule evaluation sees frozen time and randomness and only injected facts. Re-running an operation converges. Check results are keyed by (tree SHA, check version), push events deduped by (repo, sha), and land requests carry a `requestId`. | `globalDate`, `globalRandom`, `globalTimers` and `cryptoRandomUUID` at error, with their in-Effect twins; `packages/rules/test/replay.test.ts`; `packages/project/test/project-store.contract.ts`; `packages/project/test/claim.model.test.ts` and `packages/project/test/landing.model.test.ts`; `apps/platform/test/workflows/answer.test.ts`; `apps/platform/test/workflows/on-push.test.ts`; `apps/platform/test/core-loop.test.ts`; `apps/platform/test/workflows/draft.test.ts` (a replayed draft round asks the model nothing more, and each round is its own instance); `packages/project/test/code.test.ts` (code reads cached by object id, only once finished, while `main` resolves every time); `packages/project/test/drafting.model.test.ts` (a settle of a stale round changes nothing); `packages/project/test/import.test.ts` (a retried import adopts the repo it made). No fence: one push deduped by (repo, sha) across the gateway's record and OnPush's |23 | 9 | **Effect v4 only.** Read `node_modules/effect/src` as API truth. Off limits: `effect/unstable/*`, v3 `@effect/platform` and `@effect/cli`, and `effect/workflow` or `effect/cluster` on Workers. | `outdatedApi`; `no-restricted-imports` |24 | 10 | **Escapes need a reason.** Every `oxlint-disable`, `@effect-diagnostics` or `@ts-expect-error` carries its reason after `--`, and is added only where no idiomatic code does the job. | `check` fails on an unused directive. No fence: the reason |25 | 11 | **`bun run verify` is the authority.** Deploy only to an explicit stage, after `verify`, with smoke after. A red gate is fixed, never deployed around. | `packages/config/test/verify.test.ts` (verify's steps); `infra/deploy.ts` refuses without a known stage, runs `verify` first and `scripts/smoke.ts` after (`packages/config/test/deploy.test.ts`, `packages/config/test/smoke.test.ts`), and refuses every deploy while `infra/.recording` is there (`packages/config/test/recording.test.ts`) |26-| 12 | **Lifecycles are pure transitions.** `transition(state, command, now)`. Per DO call: hydrate, transition, persist, settle. Deadlines run on DO alarms. Call them lifecycles. | `globalTimers` and `globalTimersInEffect`; `packages/project/test/claim.model.test.ts` and `packages/project/test/landing.model.test.ts` (model tests over effect/Arbitrary histories, each seen catching its planted bug); `apps/platform/test/project-do.test.ts`. No fence: `Effect.sleep` and `Effect.delay` in `packages/project/src` |26+| 12 | **Lifecycles are pure transitions.** `transition(state, command, now)`. Per DO call: hydrate, transition, persist, settle. Deadlines run on DO alarms. Call them lifecycles. | `globalTimers` and `globalTimersInEffect`; `packages/project/test/claim.model.test.ts` and `packages/project/test/landing.model.test.ts` (model tests over effect/Arbitrary histories, each seen catching its planted bug); `packages/project/test/drafting.model.test.ts` (a proposal's `DraftCommand.DraftStarted` and `DraftSettled` over generated histories); `apps/platform/test/project-do.test.ts`. No fence: `Effect.sleep` and `Effect.delay` in `packages/project/src` |27 28 ## Verify29 30 `bun run verify` runs `lockfile:check`, `check`, `typecheck`, `test`, `brand:check` and `bytes:check`, and stops at the first failure. Run `bun run fix`, then `bun run verify`, before you stop. When a check fails, fix the cause. Loosening, skipping or disabling a check needs the user's sign-off.34 unmodified lines65 - `bootstrap -- --stage <stage>`: makes a stage's Cloudflare resources; a second run creates nothing, and `--dry-run` only prints the plan.66 - `deploy -- --stage <stage>`: the one way to deploy. It runs `verify`, deploys the three Workers with Wrangler, reads the push trigger back, then runs `smoke`.67 - `smoke -- --stage <stage>`: read-only probes against a live stage. `--loop` then runs the whole core loop on a throwaway project, `smoke-<run>`, through the CLI and git, and refuses `demo`.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.69-- `import-examples -- --stage <stage>`: imports the open-source repos the code browser is previewed on, one at a time, onto a stage other than `demo`, each recorded in the ledger as kept. Until its body lands it says so and exits 1.69+- `import-examples -- --stage <stage>`: imports the open-source repos the code browser is previewed on, one at a time, onto a stage other than `demo`, 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 73 ## Nouns43 unmodified lines117 - varlock's runtime (`@varlock/cloudflare-integration/init`, `varlock/env`, `varlock/auto-load`) in any Worker: it wraps the global `Response`, and the gateway streams git packs. `varlockCloudflareVitePlugin()` in `apps/web`: web has no secrets.118 - `@cloudflare/forge`, its SDK transformer, `fern-api` and cf's generator: they aren't on npm, Fern rejects our `_tag` unions, and the output carries Cloudflare branding. No HttpApi, OpenAPI or `openapi.json` surface in the window, and no "generated by Forge" claim.119 - From Rat Stack: `packages/capability` as the schema source (fallback only), `toHttpApi`, code mode, the subprocess sandbox, devtools, the 1,534-line oxlint boundaries plugin, and any fork or template of the repo.120 - XState in the window; the `no-comments` rule; Alchemy PR preview packages; `herdr-ts-sdk`.121+- shadcn's `command` (it brings `cmdk`, built on Radix), `sidebar` (its source calls `Math.random()`, which typecheck refuses, and its `use-mobile` hook fails lint) and `resizable` (it adds `react-resizable-panels`, and a fixed grid does the job) in `apps/web`.122+- DOMPurify for a README's HTML: it needs a DOM, which the Worker has not got. `rehype-sanitize` runs the same on the server and in the browser.123 - Any inbound or two-way GitHub sync. It would be a second way onto `main` that skips the gate.124 125 ## Agent skills126 22 unmodified linesmodified:GLOSSARY.md+12 added
53 unmodified lines54 **Proposal**:55 A request to open an ask, or to flag an existing one, from anyone not denounced; it expires unless a decider accepts it.56 _Avoid_: feature request, suggestion57 58+**Draft**:59+An ask file and its check that the platform's agent wrote for a proposal, run red first before it is put to a decider. It lands only when a decider accepts it.60+_Avoid_: AI suggestion, auto-ask61+62 **Sealed answer**:63 An answer recorded with a proposal and judged after the ask opens, without the decider reading its diff.64 65 **Finish**:32 unmodified lines98 **Verdict**:99 The record of one check run: base, head, patch id, level and the platform as verifier, kept with the landing.100 _Avoid_: approval, review101 102+**Why**:103+A line's landing: the ask, the answer, the people and the verdict that put that line on main.104+_Avoid_: blame105+106 **Patch id**:107 The platform's own fingerprint of an answer's change set: a hash over each path the answer changes, with its content before and after, so the same change gives the same id however its commits were made.108 _Avoid_: git patch-id, diff hash109 92 unmodified lines202 **Policy**:203 A project's rules as the platform evaluated them from the config folder at one landed SHA, or the defaults when the project has no config folder.204 _Avoid_: settings, config (when meaning the evaluated result)205 206+**Tag**:207+A git tag on main naming one commit, as the project's history has it.208+_Avoid_: release (a GitHub Release's notes and assets are not git data)209+210 **Run block**:211 The config folder's declaration of the project's own commands: setup, doctor, test, checks.212 213 **Gateway**:6 unmodified linesmodified:README.md+19 added-2 removed
42 unmodified lines43 4. The gateway checks the push against the claim, the territory and the judge closure, and refuses in `git push`'s output.44 5. The platform merges onto `main` and runs the ask's check, the project's checks and the held-back checks on that exact tree.45 6. It lands the checked tree on `main` as its own commit crediting every person, or answers with a refusal.46 47+Around the loop:48+49+- **A code browser on the web.** A project's page shows its clone line, its files and its README, rendered as GitHub-flavoured Markdown with links and images pointing into the repo at the commit. Beside it are a file tree, highlighted files with `#L` line links, raw bytes served under a sandboxing CSP, the history, each commit's diff, and one refs page (main, tags and claim forks). Every page names the commit it shows, so any page is a permalink.50+- **Why each line is there.** A file's why page attributes each line to the landing that put it on `main`, naming its ask, answer, people and verdict. Imported history reads "before adoption".51+- **Asks drafted for a want.** A member proposes a want with `--draft` (or the web's propose form). The platform's agent, a Workers AI model, drafts the ask file and its failing test, runs them red first on the Checker, and puts the draft to a decider with its evidence. Nothing lands until a decider accepts, and the landing discloses the agent with `Assisted-by` ([ADR 0018](docs/adr/0018-asks-are-drafted-in-a-workflow-and-put-to-a-decider.md)).52+- **A people page.** Who decides which paths, who is vouched for or denounced, each layer's readers, writers and disclosure, and the caps, budget and claim timing, all read from the config folder at the landed commit. It has no edit control: these change by landing a change to the config folder.53+- **The platform's own front page.** The platform's `/` says what the host serves (clone URLs, MCP, agent skills, sign-in, the CLI and the web app), in HTML for a browser and as Markdown for an agent.54+55+The web reads code only through public contracts the platform serves ([ADR 0019](docs/adr/0019-the-web-reads-repos-through-public-contracts.md)). On the dev stage, eight open-source repos are imported and kept for previewing it: anyhow, ky, gum, click, awesome, changesets, stb and fuzzel.56+57 ## Run it58 59 ### What you need60 188 unmodified lines249 A cartridge is a cut line removed by deletion. Visibility is the one plugged in by a marked line in `apps/platform/src/cartridges.ts`, and the one whose cut has been rehearsed: the visibility build's own integration deleted it in a scratch worktree, 103 files changed and 18,364 lines deleted, and `bun run verify` stayed green. The other rows list the files a cut deletes and the callers it edits, and none of those cuts has been rehearsed.250 251 | Cut line | What goes | What removes it |252 | --- | --- | --- |253+| 1 | Asks drafted by the platform's agent (`propose --draft`, `ask draft`, `proposal`; a proposal without a draft still goes to a decider) | `packages/drafting/`, `packages/project/src/draft-runs.ts`, `packages/project/test/{drafting.model,draft-settle,rehearse}.test.ts`, `apps/platform/src/workflows/draft-steps.ts`, `apps/platform/src/adapters/draft-runs-workflow.ts`, `apps/platform/test/workflows/draft.test.ts`; the `ai` binding, `DRAFT_MODEL` and `DRAFT_LIMIT` lines in `apps/platform/wrangler.jsonc` (then `bun run --cwd apps/platform types`) and their decode in `apps/platform/src/platform.ts`; the web's `apps/web/src/routes/$project/proposals/`, `apps/web/src/features/{propose,proposal}/`, `apps/web/src/client/{propose,proposal}.ts` and their tests; the `draftAsk` and `showProposal` handlers in `apps/platform/src/handlers.ts` and `apps/web/src/dev/handlers.ts`, and `proposeAsk`'s `draft` branch |254 | 1 | Today full-screen at a terminal, `myr today --tui` (`myr today` goes back to the contract's projected command, which prints the same) | `apps/cli/src/tui/`, `apps/cli/test/tui/`, the `@opentui/*` lines in `apps/cli/package.json`; `today` in `wrapped`, `entries` and `Every` in `apps/cli/src/surfaces.ts`, its row in `packages/agent-kit/src/command-doc.ts` and its word in `packages/agent-kit/test/command-doc.test.ts` |255 | 1 | Agent extras: the Markdown ask page, per-project well-known skills, and `myr schema` | `apps/web/src/features/ask/markdown.ts`, `apps/web/test/ask-markdown.test.ts`; `packages/agent-kit/src/well-known.ts`, `apps/platform/src/well-known.ts`, `apps/platform/test/well-known.test.ts`, `apps/web/src/routes/[.]well-known/agent-skills/$.ts`; `apps/cli/test/schema.test.ts` and the `schema` command in `apps/cli/src/surfaces.ts` |256 | 1 | The pi adapter | `apps/cli/src/pi.ts`, `apps/cli/test/pi.test.ts`, its entry and its `neverBundle` line in `apps/cli/tsdown.config.ts`, the pi dev dependency in `apps/cli/package.json`, and the adapter's line in the package manifest's `pi` key in `scripts/lib/release.ts` |257+| 2 | Why each line is there, on the web (the file toolbar's Why link goes) | `packages/git/src/blame.ts`, `packages/git/src/line-diff.ts` (with `tree-diff.ts` keeping its own diff), `packages/git/test/{blame,line-diff}.test.ts`, `packages/project/src/code/why.ts`, `packages/project/test/code-why.test.ts`, `whyOf` in `packages/project/src/code.ts`, the `why` contract's handlers, `apps/web/src/routes/$project/why/`, `apps/web/src/features/why/`, `apps/web/src/client/why.ts`, `apps/web/test/why.test.tsx`, `apps/web/e2e/why.e2e.ts` |258+| 2 | A README rendered as Markdown (it shows as plain text instead) | `apps/web/src/features/markdown/`, `apps/web/test/markdown.test.tsx`, `apps/web/test/markdown-resolve.test.ts`, and the `react-markdown`, `remark-gfm`, `rehype-*` and `@tailwindcss/typography` lines in `apps/web/package.json` |259+| 3 | The people page | `apps/web/src/routes/$project/people.tsx`, `apps/web/src/features/project-people/`, `apps/web/src/client/policy.ts`, `apps/web/test/project-people.test.tsx`, `apps/web/e2e/people.e2e.ts`, and its tab in the project nav |260 | 2 | `myr why`, verdicts as git notes, and the `ReachedInternals` stage | `apps/cli/src/local/why.ts`, `apps/cli/test/local/why.test.ts`; `packages/git/src/notes.ts`, `apps/platform/src/workflows/notes.ts`, `packages/git/test/notes.test.ts`, `apps/platform/test/notes.test.ts` (verdicts still reach `status`, `verdict` and MCP); `packages/gate/src/imports.ts`, `packages/gate/test/imports.test.ts` and its branch in `packages/gate/src/stages/shape.ts` |261 | 2 | The null-answer codemod: a check that passes against an answer whose exports do nothing is `WeakCheck` (built and tested; no ask runs it yet, since it needs a third check run and a step in the Checker's image) | `packages/checks/src/null-answer.ts`, `packages/checks/test/null-answer.test.ts`, `packages/checks/test/fixtures/null-answer/`, and its `./null-answer` export and `ts-morph` line in `packages/checks/package.json` |262 | 3 | Garden's Promote: a finish repeated across answers becomes a proposed `lintToZero` ask behind one decision (built and tested; no landing calls it yet, since no finish carries the rule it names) | `packages/project/src/attention/promote.ts`, `packages/project/test/attention/promote.test.ts` |263 | 3 | Admission runs and env injection | `packages/project/src/visibility/admission.ts`, `apps/platform/src/workflows/admission-steps.ts`, `packages/project/test/visibility/admission.test.ts`, `apps/platform/test/visibility/admission.test.ts`; `apps/sandbox/src/env-gateway.ts`, `apps/sandbox/src/checker/env.ts`, `apps/sandbox/test/env-injection.test.ts` |21 unmodified lines285 project/ the claim and landing lifecycles, the project store, Today, credit, the Lander port, the D1 projection286 git/ the gateway, smart HTTP, trailers, notes, tree diffs, patch ids287 artifacts/ the RepoHost port, the only caller of Artifacts288 visibility/ the cartridge: layers, posture, ledger, guards, env shape, write-only values275- agent-kit/ generated agent files: the project skill, the AGENTS.md block, hooks, the command list289+ agent-kit/ generated agent files: the project skill, the AGENTS.md block, hooks, the command list, the host's front page290+ drafting/ the platform's agent: drafts an ask from a want through Workers AI, the ask file rendered by code291 testkit/ scenario builders, golden git transcripts, process fakes292 brand/ the name, and every identifier made from it293 config/ the vitest preset and the repo's own tests294 infra/ bootstrap, deploy, the recording lock, the stage table, smoke's probes, teardown8 unmodified lines303 ### Three Workers, and who holds what304 305 | Worker | Holds | Reached by |306 | --- | --- | --- |292-| `platform` | `ARTIFACTS` (the public namespace) and `ARTIFACTS_PRIVATE` (layer repos), the `PROJECT` Durable Object, the `ANSWER` and `ON_PUSH` Workflows, the `FRONT_PAGE` database, `OAUTH_KV`, the `EVIDENCE` and `RELEASES` buckets, `LOADER` (a Worker Loader for config code), the `SANDBOX` service, rate limits, the push-event trigger and every secret | git, the CLI, MCP clients and the web |307+| `platform` | `ARTIFACTS` (the public namespace) and `ARTIFACTS_PRIVATE` (layer repos), the `PROJECT` Durable Object, the `ANSWER` and `ON_PUSH` Workflows, the `FRONT_PAGE` database, `OAUTH_KV`, the `EVIDENCE` and `RELEASES` buckets, `LOADER` (a Worker Loader for config code), `AI` (Workers AI, for drafting asks), the `SANDBOX` service, rate limits, the push-event trigger and every secret | git, the CLI, MCP clients and the web |308 | `sandbox` | the `CHECKER` and `LANDER` Durable Objects and their containers; no Artifacts binding: each job carries a short-lived token for one repo | only the platform's `SANDBOX` binding; it has no public URL |309 | `web` | `PLATFORM` (a service binding) and public vars; no storage and no secret | browsers, and agents reading Markdown |310 311 Bindings are declared per stage in each app's `wrangler.jsonc`, and the platform decodes its whole env once, at start (`apps/platform/src/platform.ts`).43 unmodified lines355 - **Rat Stack** ([joelhooks/rat-stack](https://github.com/joelhooks/rat-stack) at `fba26d8`, MIT). The projection of one Effect `RpcGroup` into CLI commands and MCP tools (`packages/protocol/src/{cli,mcp}.ts`), the shape of the Effect diagnostics map in `tsconfig.base.json`, and burrow's `no-module-level-mutable-state` rule.356 - **anti-slop** ([dmmulroy/anti-slop](https://github.com/dmmulroy/anti-slop) at `c44ef22`, MIT). The oxlint plugins, generic and Effect, that lint this repo, vendored in `tools/oxlint/anti-slop/`.357 - **shadcn/ui** (MIT). The web's base components, in `apps/web/src/components/ui/`.358 - **Public Sans** and **JetBrains Mono** (SIL Open Font License). The web's two typefaces, self-hosted in `apps/web/src/assets/fonts/`.359+- **Pierre** (`@pierre/diffs` and `@pierre/trees`, Apache-2.0). The web's highlighted files, diffs and file tree, drawn in the browser.360+- **unified** (`react-markdown`, `remark-gfm`, `rehype-raw`, `rehype-sanitize`, `rehype-slug`, MIT). A README rendered as GitHub-flavoured Markdown, sanitized with GitHub's allow-list.361 - **Effect**. The product is written in Effect v4: its schemas, the one `RpcGroup`, the CLI, the MCP servers and the platform's HTTP.362 - **isomorphic-git**. git inside a Worker: the in-memory repo host, the smart-HTTP pushes of the Artifacts binding adapter, and the `/isogit` Lander.363 - **Cloudflare's cf** (ideas, no code). One merged command catalog for every surface (`commandDocs` in `packages/agent-kit/src/command-doc.ts`), and the rule that wire schemas use whole or finite numbers and optional keys, so the JSON Schema an MCP client reads holds no `"Infinity"` and no `null`.364 - **Ghostty's `VOUCHED.td` format**. A project's vouch file: one handle per line, and a leading `-` to denounce.9 unmodified lines