{"version":267,"agent":"approvals-page","message":"Pipelines: uses: agent replaces uses: review (abso issue 688, Agent VCS's shape). One general step: a model reads the version's diff and acts as the run's own seat. instructions: names a file in the project to follow (the server's built-in review when none); model: names a model as the AI binding does (anthropic/claude-sonnet-5, @cf/...); may: lists what the seat may do, and slice 1 knows only note. A path outside the project, a model name that isn't one, and an unknown may are refused. Tests: src/pipeline/test, 32 pass.","time":1792099016371,"timeIso":"2026-10-15T21:16:56.371Z","changes":2,"change":4064,"files":["src/pipeline/pipeline.ts","src/pipeline/test/pipeline.test.ts"],"draft":null,"diff":[{"path":"src/pipeline/pipeline.ts","added":32,"removed":3,"diff":"--- a/src/pipeline/pipeline.ts\n+++ b/src/pipeline/pipeline.ts\n@@ -74,7 +74,7 @@\n \t| { readonly ok: true; readonly file: PipelineFile }\n \t| { readonly ok: false; readonly problems: readonly Problem[] };\n \n-export const BUILT_INS = [\"deploy\", \"preview\", \"notify\", \"npm-publish\", \"review\"] as const;\n+export const BUILT_INS = [\"deploy\", \"preview\", \"notify\", \"npm-publish\", \"agent\"] as const;\n export type BuiltIn = (typeof BUILT_INS)[number];\n \n /** Each built-in step's own settings, beside the keys every job has. */\n@@ -84,10 +84,16 @@\n \tnotify: [\"to\"],\n \t// The npm packages it may publish, from the .tgz files its from: job kept, and the dist-tag (latest if none).\n \t\"npm-publish\": [\"packages\", \"tag\"],\n-\t// A model reads the version's diff and leaves notes on it (abso issue 688). The server picks the model and the caps.\n-\treview: [],\n+\t// A model reads the version's diff and acts on it as the run's own seat (abso issue 688): the instructions file it\n+\t// follows (a built-in review when none), the model, and what the seat may do (note: notes on the changed lines).\n+\tagent: [\"instructions\", \"model\", \"may\"],\n };\n \n+/** What an agent step's seat may do (688). Slice 1: leave notes on the version's changed lines. */\n+export const AGENT_MAY = [\"note\"] as const;\n+/** A model as the server's AI binding names it: provider/model or Workers AI's @cf/author/model. */\n+const MODEL_NAME = /^(@cf\\/)?[a-z0-9][a-z0-9_.-]*\\/[a-z0-9][a-z0-9_.:-]*$/i;\n+\n /** An npm dist-tag: npm refuses one that reads as a version, so it starts with a letter. */\n const DIST_TAG = /^[a-z][a-z0-9_-]{0,31}$/;\n \n@@ -337,6 +343,29 @@\n \tfor (const k of settings) if (j[k] !== undefined) withs[k] = j[k];\n \tif (uses === \"deploy\" && typeof j.worker !== \"string\")\n \t\tsay(`${at}.worker`, \"names the Worker deploy ships, and is missing\");\n+\tif (uses === \"agent\") {\n+\t\tconst instructions = j.instructions;\n+\t\tif (\n+\t\t\tinstructions !== undefined &&\n+\t\t\t(typeof instructions !== \"string\" ||\n+\t\t\t\tinstructions === \"\" ||\n+\t\t\t\tinstructions.startsWith(\"/\") ||\n+\t\t\t\tinstructions.split(\"/\").includes(\"..\"))\n+\t\t)\n+\t\t\tsay(`${at}.instructions`, `names a file in the project, such as .abso/review.md, not ${q(instructions)}`);\n+\t\tif (j.model !== undefined && (typeof j.model !== \"string\" || !MODEL_NAME.test(j.model)))\n+\t\t\tsay(`${at}.model`, `names a model such as anthropic/claude-sonnet-5, not ${q(j.model)}`);\n+\t\tif (j.may !== undefined) {\n+\t\t\tconst may = typeof j.may === \"string\" ? [j.may] : j.may;\n+\t\t\tif (!Array.isArray(may) || may.length === 0)\n+\t\t\t\tsay(`${at}.may`, `lists what the seat may do: ${AGENT_MAY.join(\", \")}`);\n+\t\t\telse\n+\t\t\t\tmay.forEach((m, i) => {\n+\t\t\t\t\tif (!(AGENT_MAY as readonly unknown[]).includes(m))\n+\t\t\t\t\t\tsay(`${at}.may[${i}]`, `${q(m)} isn't something an agent step may do yet (${AGENT_MAY.join(\", \")})`);\n+\t\t\t\t});\n+\t\t}\n+\t}\n \tif (uses === \"npm-publish\") {\n \t\tif (j.from === undefined)\n \t\t\tsay(`${at}.from`, \"names the job whose kept .tgz files npm-publish pushes, and is missing\");"},{"path":"src/pipeline/test/pipeline.test.ts","added":40,"removed":6,"diff":"--- a/src/pipeline/test/pipeline.test.ts\n+++ b/src/pipeline/test/pipeline.test.ts\n@@ -252,16 +252,50 @@\n \t\thas(ps, \"pipelines.p.jobs.c.packages[2]\", /isn't an npm package name/);\n \t});\n \n-\tit(\"review: a step with no settings of its own; the server picks the model (abso issue 688)\", () => {\n-\t\tconst read = checkPipelines(one({ review: { uses: \"review\" } }, { only: [\"shared\"] }));\n+\tit(\"agent: instructions, a model and what its seat may do; all optional (abso issue 688)\", () => {\n+\t\tok(checkPipelines(one({ review: { uses: \"agent\" } }, { only: [\"shared\"] })));\n+\t\tconst read = checkPipelines(\n+\t\t\tone(\n+\t\t\t\t{\n+\t\t\t\t\treview: {\n+\t\t\t\t\t\tuses: \"agent\",\n+\t\t\t\t\t\tinstructions: \".abso/review.md\",\n+\t\t\t\t\t\tmodel: \"anthropic/claude-sonnet-5\",\n+\t\t\t\t\t\tmay: [\"note\"],\n+\t\t\t\t\t},\n+\t\t\t\t\ttidy: { uses: \"agent\", model: \"@cf/meta/llama-3.3-70b-instruct-fp8-fast\", may: \"note\" },\n+\t\t\t\t},\n+\t\t\t\t{ only: [\"shared\"] },\n+\t\t\t),\n+\t\t);\n \t\tok(read);\n \t\tconst job = read.ok ? read.file.pipelines[0]!.jobs.find((j) => j.name === \"review\") : undefined;\n-\t\tassert.equal(job?.uses, \"review\");\n-\t\tassert.deepEqual(job?.with, {});\n+\t\tassert.equal(job?.uses, \"agent\");\n+\t\tassert.deepEqual(job?.with, {\n+\t\t\tinstructions: \".abso/review.md\",\n+\t\t\tmodel: \"anthropic/claude-sonnet-5\",\n+\t\t\tmay: [\"note\"],\n+\t\t});\n+\t\tconst bad = problems(\n+\t\t\tcheckPipelines(\n+\t\t\t\tone({\n+\t\t\t\t\ta: { uses: \"agent\", instructions: \"../outside.md\" },\n+\t\t\t\t\tb: { uses: \"agent\", model: \"sonnet please\" },\n+\t\t\t\t\tc: { uses: \"agent\", may: [\"note\", \"land\"] },\n+\t\t\t\t\td: { uses: \"agent\", may: [] },\n+\t\t\t\t\te: { uses: \"agent\", instructions: \"/etc/passwd\" },\n+\t\t\t\t}),\n+\t\t\t),\n+\t\t);\n+\t\thas(bad, \"pipelines.p.jobs.a.instructions\", /names a file in the project/);\n+\t\thas(bad, \"pipelines.p.jobs.b.model\", /names a model/);\n+\t\thas(bad, \"pipelines.p.jobs.c.may[1]\", /isn't something an agent step may do yet/);\n+\t\thas(bad, \"pipelines.p.jobs.d.may\", /lists what the seat may do/);\n+\t\thas(bad, \"pipelines.p.jobs.e.instructions\", /names a file in the project/);\n \t\tconst ps = problems(\n-\t\t\tcheckPipelines(one({ a: { uses: \"review\", model: \"x\" }, b: { uses: \"review\", abso: \"writer\" } })),\n+\t\t\tcheckPipelines(one({ a: { uses: \"agent\", worker: \"x\" }, b: { uses: \"agent\", abso: \"writer\" } })),\n \t\t);\n-\t\thas(ps, \"pipelines.p.jobs.a.model\", /./);\n+\t\thas(ps, \"pipelines.p.jobs.a.worker\", /isn't a key here/);\n \t\thas(ps, \"pipelines.p.jobs.b.abso\", /a uses step runs on the server/);\n \t});\n "}],"ci":null}