{"version":94,"agent":"infra-pipeline","message":"Pipeline files: a run job may ask for an abso key on its own project for the length of the job (abso: reader or writer). A writer key follows the same rule as secrets: no pipeline a draft can start. A uses step can't ask for one, since it runs on the server.","time":1791629526123,"timeIso":"2026-10-10T10:52:06.123Z","changes":2,"change":1059,"files":["src/pipeline/pipeline.ts","src/pipeline/test/pipeline.test.ts"],"draft":null,"diff":[{"path":"src/pipeline/pipeline.ts","added":21,"removed":8,"diff":"--- a/src/pipeline/pipeline.ts\n+++ b/src/pipeline/pipeline.ts\n@@ -8,7 +8,8 @@\n // (`on`), optionally which spaces it runs for (`only`), its `jobs`, and which\n // jobs make a version green (`required`). A job runs a command (`run`) or a\n // built-in step (`uses`), after the jobs it `needs`, and may take another\n-// job's kept files (`from`) and named `secrets`.\n+// job's kept files (`from`) and named `secrets`, and a run job may ask for an\n+// abso key on its own project (`abso: reader` or `writer`) for the length of the job.\n //\n // What the check refuses: a cycle in needs; needs, required or from naming a\n // job that doesn't exist; secrets in a pipeline a draft can start, since a\n@@ -39,6 +40,8 @@\n \treadonly keep: readonly string[];\n \treadonly cache: readonly string[];\n \treadonly secrets: readonly string[];\n+\t/** An abso key on the project for the job's length (abso 343): none unless asked. */\n+\treadonly abso?: \"reader\" | \"writer\";\n \t/** The built-in step's own settings (deploy's worker, staging, live; notify's to), as written. */\n \treadonly with: Readonly<Record<string, unknown>>;\n }\n@@ -89,7 +92,7 @@\n const TRIGGERS = [\"publish\", \"draft\", \"green\", \"land\", \"hand\"] as const;\n const SIZES: readonly Size[] = [\"small\", \"standard\", \"large\"];\n const MACHINE_KEYS = [\"image\", \"dockerfile\", \"size\"] as const;\n-const JOB_KEYS = [\"needs\", \"run\", \"uses\", \"from\", \"keep\", \"cache\", \"secrets\", ...MACHINE_KEYS] as const;\n+const JOB_KEYS = [\"needs\", \"run\", \"uses\", \"from\", \"keep\", \"cache\", \"secrets\", \"abso\", ...MACHINE_KEYS] as const;\n const PIPELINE_KEYS = [\"on\", \"only\", \"jobs\", \"required\"] as const;\n /** avcs.json's keys for today's CI (worker/src/ci.ts) and the merge queue: read elsewhere, left alone here. */\n const AVCS_JSON_KEYS = [\"setup\", \"check\", \"build\", \"out\", \"queue\", \"whole\"] as const;\n@@ -238,18 +241,22 @@\n \n \t// Secrets go only where no draft can reach them: a draft runs code nobody\n \t// has published, which could send a secret anywhere.\n-\tconst holding = jobs.filter((j) => j.secrets.length > 0);\n+\t// A writer key (343) the same: it changes the project, so only published work may hold one.\n+\tconst holding = jobs.filter((j) => j.secrets.length > 0 || j.abso === \"writer\");\n \tif (holding.length) {\n \t\tconst who = holding.map((j) => j.name).join(\", \");\n+\t\tconst what = holding.every((j) => j.secrets.length === 0)\n+\t\t\t? \"a writer key\"\n+\t\t\t: holding.some((j) => j.abso === \"writer\")\n+\t\t\t\t? \"secrets or a writer key\"\n+\t\t\t\t: \"secrets\";\n+\t\tconst verb = `hold${holding.length === 1 ? \"s\" : \"\"}`;\n \t\tif (on?.includes(\"draft\"))\n-\t\t\tsay(\n-\t\t\t\t`${at}.on`,\n-\t\t\t\t`includes draft, but ${who} hold${holding.length === 1 ? \"s\" : \"\"} secrets; a draft runs unpublished code`,\n-\t\t\t);\n+\t\t\tsay(`${at}.on`, `includes draft, but ${who} ${verb} ${what}; a draft runs unpublished code`);\n \t\tif (!only || only.some((s) => s !== \"shared\"))\n \t\t\tsay(\n \t\t\t\t`${at}.only`,\n-\t\t\t\t`must be shared, because ${who} hold${holding.length === 1 ? \"s\" : \"\"} secrets and a named draft's version is no one's published work`,\n+\t\t\t\t`must be shared, because ${who} ${verb} ${what} and a named draft's version is no one's published work`,\n \t\t\t);\n \t}\n \n@@ -281,6 +288,11 @@\n \tsecrets.forEach((s, i) => {\n \t\tif (!SECRET.test(s)) say(`${at}.secrets[${i}]`, `${q(s)} isn't a secret name: upper-case letters, digits and _`);\n \t});\n+\tif (j.abso !== undefined) {\n+\t\tif (j.abso !== \"reader\" && j.abso !== \"writer\") say(`${at}.abso`, `must be reader or writer, not ${q(j.abso)}`);\n+\t\telse if (j.uses !== undefined)\n+\t\t\tsay(`${at}.abso`, \"gives a run job a key; a uses step runs on the server and has none\");\n+\t}\n \tconst withs: Record<string, unknown> = {};\n \tfor (const k of settings) if (j[k] !== undefined) withs[k] = j[k];\n \tif (uses === \"deploy\" && typeof j.worker !== \"string\")\n@@ -308,6 +320,7 @@\n \t\tkeep: list(j.keep, `${at}.keep`, say, \"a list of file patterns\"),\n \t\tcache: list(j.cache, `${at}.cache`, say, \"a list of files\"),\n \t\tsecrets,\n+\t\t...((j.abso === \"reader\" || j.abso === \"writer\") && j.uses === undefined ? { abso: j.abso } : {}),\n \t\twith: withs,\n \t\t...machine(j, at, say, false),\n \t};"},{"path":"src/pipeline/test/pipeline.test.ts","added":28,"removed":0,"diff":"--- a/src/pipeline/test/pipeline.test.ts\n+++ b/src/pipeline/test/pipeline.test.ts\n@@ -245,6 +245,34 @@\n \t\thas(ps, \"pipelines.p.jobs.c.packages[2]\", /isn't an npm package name/);\n \t});\n \n+\tit(\"abso: a run job may ask for a reader or writer key; a writer key only where secrets may go\", () => {\n+\t\tconst read = checkPipelines(one({ a: { run: \"abso status\", abso: \"reader\" }, b: { run: \"true\" } }));\n+\t\tok(read);\n+\t\tconst jobs = read.ok ? read.file.pipelines[0]!.jobs : [];\n+\t\tassert.equal(jobs.find((j) => j.name === \"a\")?.abso, \"reader\");\n+\t\tassert.equal(jobs.find((j) => j.name === \"b\")?.abso, undefined);\n+\t\tok(checkPipelines(one({ a: { run: \"abso publish -m x\", abso: \"writer\" } }, { only: [\"shared\"] })));\n+\t\tconst ps = problems(\n+\t\t\tcheckPipelines(\n+\t\t\t\tone({\n+\t\t\t\t\ta: { run: \"x\", abso: \"owner\" },\n+\t\t\t\t\tb: { uses: \"deploy\", worker: \"w\", abso: \"reader\" },\n+\t\t\t\t\tc: { run: \"x\", abso: \"writer\" },\n+\t\t\t\t}),\n+\t\t\t),\n+\t\t);\n+\t\thas(ps, \"pipelines.p.jobs.a.abso\", /must be reader or writer, not \"owner\"/);\n+\t\thas(ps, \"pipelines.p.jobs.b.abso\", /a uses step runs on the server/);\n+\t\thas(ps, \"pipelines.p.only\", /c holds a writer key and a named draft's version is no one's published work/);\n+\t\thas(\n+\t\t\tproblems(checkPipelines(one({ c: { run: \"x\", abso: \"writer\" } }, { on: [\"draft\"], only: [\"shared\"] }))),\n+\t\t\t\"pipelines.p.on\",\n+\t\t\t/includes draft, but c holds a writer key/,\n+\t\t);\n+\t\t// A reader key is fine where a draft runs: it changes nothing.\n+\t\tok(checkPipelines(one({ a: { run: \"abso status\", abso: \"reader\" } }, { on: [\"draft\"] })));\n+\t});\n+\n \tit(\"npm-publish: an optional dist-tag\", () => {\n \t\tconst pack = { run: \"npm pack --pack-destination out\", keep: [\"out\"] };\n \t\tconst read = checkPipelines("}],"ci":null}