{"version":1,"agent":"infra-split","message":"The tool as of abso 612: https-only token, and the pipeline plan (abso 161)\n\nabso-core's version 0 is the tool cut from abso 609. This is the difference to abso 612, reviewed by Agent VCS before the cut, so abso's pin can switch to an exact match.\n\n- abso 611 (Pinch, Security's fix): off this machine, the client sends the token only over https. localhost, 127.0.0.1 and [::1] are still allowed. That's in client/src/core.ts and the view mod's copy (client/view/hooks/register.tsx), with tests and the README.\n- abso 612 (infra-pipeline): src/pipeline/plan.ts answers which pipelines an event starts, and their jobs in waves. `abso pipeline check --on <event>` shows the plan. Tests are in src/pipeline/test/plan.test.ts and client/test/pipeline-commands.test.ts.\n\nChecked here: npm ci, npx biome ci . and npm run check all exit 0 (693 pass, 1 skipped).","time":1791507661723,"timeIso":"2026-10-09T01:01:01.723Z","changes":9,"change":5,"files":["client/README.md","client/src/core.ts","client/src/main.ts","client/src/pipeline-commands.ts","client/test/client.test.ts","client/test/pipeline-commands.test.ts","client/view/hooks/register.tsx","src/pipeline/plan.ts","src/pipeline/test/plan.test.ts"],"draft":null,"diff":[{"path":"client/README.md","added":4,"removed":1,"diff":"--- a/client/README.md\n+++ b/client/README.md\n@@ -28,6 +28,9 @@\n \n `AVCS_TRUSTED_SERVERS` (comma-separated) adds servers for one shell, and\n `AVCS_ISSUES_SERVER` names the Issues Worker. The mods follow the same rule.\n+Off this machine only `https://` servers count. A server you trust gets your\n+token: the same token goes to every server named, so name only servers you\n+would hand it to.\n \n Every path a sync, switch, join or restore answer names is checked before\n the client touches the disk: nothing is written outside the folder, into\n@@ -89,7 +92,7 @@\n | `abso label <name> [--version n] [--remove]` / `abso labels` | Puts a label on a version of shared (the newest by default) or takes it off, like a git tag; `labels` lists them all. |\n | `abso follow <label>` / `abso follow --none` | Makes this folder follow a label: every sync takes it to the newest version of shared with that label. `--none` goes back to shared's newest. Saved in `.avcs/config.json`. |\n | `abso check-ignore <path...>` | Whether abso leaves each path out, and which line of which ignore file decided (see \"What is left out\"). |\n-| `abso pipeline check [file]` | Reads the folder's pipeline file (abso.yml, abso.yaml or avcs.json, or the file named) and lists each problem as `<path>: <message>`: a cycle in needs, a job or pipeline that doesn't exist, secrets in a pipeline a draft can start, keys it doesn't know. Exits 1 on problems; otherwise lists each pipeline's jobs in the order they run. Reads only the file. The shape is still a draft (abso issue 138). |\n+| `abso pipeline check [file] [--on <event>]` | Reads the folder's pipeline file (abso.yml, abso.yaml or avcs.json, or the file named) and lists each problem as `<path>: <message>`: a cycle in needs, a job or pipeline that doesn't exist, secrets in a pipeline a draft can start, keys it doesn't know. Exits 1 on problems; otherwise lists each pipeline's jobs in the order they run. With `--on publish|draft|green|land|hand|schedule` (and `--space`, `--pipeline` or `--every`), says which pipelines that event starts, with their jobs in waves that can run side by side, and why the others don't. Reads only the file. The shape is still a draft (abso issue 138). |\n | `abso issues [--open] [--status <s>] [--agent <a>] [--parent <N>] [--label <l,l>]` | The project's issues (#54), most recently updated first. Statuses come from the work: `abso start --issue N` puts an issue In progress, an open ask makes it Blocked (In review for a review), and `publish --done` closes it. `--label friction` keeps the issues with every label named: a ready list of work to pick up. `abso issues --labels` lists the labels in use, with how many issues are open under each. |\n | `abso issue new \"<title>\" --label <l,l>` / `abso issue <N> --label <l,l> --unlabel <l,l>` | Labels an issue, or changes its labels. A label is 1-40 lower-case letters, digits and `- _ . :` (`friction`, `area:client`); what you type is lower-cased. An edit that only changes labels tells nobody unless `--notify` names people. Tool friction goes in its own issue, labeled `friction`. |\n | `abso issue draft \"<title>\"` / `abso issues --drafts` | A draft of an issue: yours alone, with no number and no news. Takes the same fields as `issue new`. `abso issue draft <D> [fields]` changes one, `--open` opens it as an issue (with any fields given over the draft's), `--delete` deletes it. |"},{"path":"client/src/core.ts","added":2,"removed":0,"diff":"--- a/client/src/core.ts\n+++ b/client/src/core.ts\n@@ -161,6 +161,8 @@\n \tif (o === undefined) return false;\n \tconst host = o.replace(/^https?:\\/\\//, \"\").replace(/:\\d+$/, \"\");\n \tif (host === \"localhost\" || host === \"127.0.0.1\" || host === \"[::1]\") return true;\n+\t// Off this machine only https: a token over plain http goes in clear text (Security, 608).\n+\tif (!o.startsWith(\"https://\")) return false;\n \treturn [...TOKEN_SERVERS, ...(trusted ?? \"\").split(\",\")].some((t) => t.trim() !== \"\" && origin(t) === o);\n }\n "},{"path":"client/src/main.ts","added":4,"removed":3,"diff":"--- a/client/src/main.ts\n+++ b/client/src/main.ts\n@@ -649,10 +649,11 @@\n \t\trun: runCheckIgnore,\n \t},\n \tpipeline: {\n-\t\tflags: {},\n-\t\tusage: \"abso pipeline check [file]\",\n+\t\tflags: { on: \"string\", space: \"string\", pipeline: \"string\", every: \"string\" },\n+\t\tusage:\n+\t\t\t\"abso pipeline check [file] [--on publish|draft|green|land|hand|schedule [--space <name>] [--pipeline <name>] [--every <when>]]\",\n \t\tabout:\n-\t\t\t\"Read the folder's pipeline file (abso.yml, abso.yaml or avcs.json, or the file named) and say what's wrong with it, place by place: a cycle in needs, a job that doesn't exist, secrets a draft could reach, a key it doesn't know. Exits 1 when it has problems. It reads only the file.\",\n+\t\t\t\"Read the folder's pipeline file (abso.yml, abso.yaml or avcs.json, or the file named) and say what's wrong with it, place by place: a cycle in needs, a job that doesn't exist, secrets a draft could reach, a key it doesn't know. Exits 1 when it has problems. With --on, it says which pipelines that event starts (in shared, or --space), with their jobs in waves that can run side by side, and why each other pipeline doesn't start. It reads only the file.\",\n \t\t// Loaded only here, so the yaml package it needs can't stop every other command\n \t\t// when a checkout lacks it (abso issue 168).\n \t\trun: async (args, env) => {"},{"path":"client/src/pipeline-commands.ts","added":43,"removed":1,"diff":"--- a/client/src/pipeline-commands.ts\n+++ b/client/src/pipeline-commands.ts\n@@ -5,7 +5,8 @@\n import { existsSync, readFileSync } from \"node:fs\";\n import { basename, join, resolve } from \"node:path\";\n import { readPipelineFile } from \"../../src/pipeline/pipeline.ts\";\n-import { type Parsed, UsageError } from \"./args.ts\";\n+import { type PipelineEvent, plan } from \"../../src/pipeline/plan.ts\";\n+import { type Parsed, str, UsageError } from \"./args.ts\";\n import { type Env, EXIT, type Output } from \"./command-env.ts\";\n import { findRoot } from \"./config.ts\";\n \n@@ -36,6 +37,28 @@\n \t\t};\n \t}\n \tconst { pipelines } = checked.file;\n+\tconst on = str(args, \"on\");\n+\tif (on !== undefined) {\n+\t\tconst event = eventFrom(on, args);\n+\t\tconst planned = plan(checked.file, event);\n+\t\tconst said =\n+\t\t\tevent.kind === \"schedule\"\n+\t\t\t\t? `On the schedule \"${event.every}\"`\n+\t\t\t\t: `On ${event.kind}${event.kind === \"hand\" ? ` of ${event.pipeline}` : \"\"} in ${event.space}`;\n+\t\tconst lines = [\n+\t\t\t...planned.start.flatMap((p) => [\n+\t\t\t\t`  ${p.name} starts:`,\n+\t\t\t\t...p.waves.map(\n+\t\t\t\t\t(w, i) => `    ${i + 1}. ${w.map((j) => `${j}${p.required.includes(j) ? \" (required)\" : \"\"}`).join(\", \")}`,\n+\t\t\t\t),\n+\t\t\t]),\n+\t\t\t...planned.skip.map((s) => `  ${s.name} doesn't start: ${s.why}`),\n+\t\t];\n+\t\treturn {\n+\t\t\ttext: `${said}, ${planned.start.length === 0 ? \"nothing in\" : `${planned.start.length === 1 ? \"1 pipeline\" : `${planned.start.length} pipelines`} from`} ${name} starts; jobs on one line can run side by side.\\n${lines.join(\"\\n\")}\\n`,\n+\t\t\tjson: { file: name, event, ...planned },\n+\t\t};\n+\t}\n \tconst lines = pipelines.flatMap((p) => [\n \t\t`  ${p.name}, on ${p.on.map((t) => (typeof t === \"string\" ? t : `every ${t.every}`)).join(\", \")}${p.only ? `, only ${p.only.join(\", \")}` : \"\"}:`,\n \t\t...p.jobs.map(\n@@ -48,3 +71,22 @@\n \t\tjson: { file: name, pipelines },\n \t};\n }\n+\n+const KINDS = [\"publish\", \"draft\", \"green\", \"land\", \"hand\", \"schedule\"] as const;\n+\n+/** --on, with --space, --pipeline (by hand) and --every (a schedule), as an event. */\n+function eventFrom(on: string, args: Parsed): PipelineEvent {\n+\tif (!(KINDS as readonly string[]).includes(on)) throw new UsageError(`--on is one of ${KINDS.join(\", \")}`);\n+\tconst space = str(args, \"space\") ?? \"shared\";\n+\tif (on === \"schedule\") {\n+\t\tconst every = str(args, \"every\");\n+\t\tif (!every) throw new UsageError('--on schedule takes --every \"<when>\", as the file writes it');\n+\t\treturn { kind: \"schedule\", every };\n+\t}\n+\tif (on === \"hand\") {\n+\t\tconst pipeline = str(args, \"pipeline\");\n+\t\tif (!pipeline) throw new UsageError(\"--on hand takes --pipeline <name>\");\n+\t\treturn { kind: \"hand\", pipeline, space };\n+\t}\n+\treturn { kind: on as \"publish\" | \"draft\" | \"green\" | \"land\", space };\n+}"},{"path":"client/test/client.test.ts","added":4,"removed":0,"diff":"--- a/client/test/client.test.ts\n+++ b/client/test/client.test.ts\n@@ -1528,6 +1528,10 @@\n \t\t\tassert.equal(tokenGoesTo(bad), false, bad);\n \t\t}\n \t\tassert.equal(tokenGoesTo(\"https://mine.example\", \"https://other.example, https://mine.example\"), true);\n+\t\t// Off this machine only https: plain http would carry the token in clear text, trusted or not.\n+\t\tassert.equal(tokenGoesTo(\"http://example.com\", \"http://example.com\"), false);\n+\t\tassert.equal(tokenGoesTo(\"http://localhost:8787\"), true);\n+\t\tassert.equal(tokenGoesTo(\"http://127.0.0.1:8787\"), true);\n \t});\n \n \tit(\"trusts the servers this machine's servers.json names, and their Issues Workers, and nothing malformed\", () => {"},{"path":"client/test/pipeline-commands.test.ts","added":47,"removed":0,"diff":"--- a/client/test/pipeline-commands.test.ts\n+++ b/client/test/pipeline-commands.test.ts\n@@ -111,3 +111,50 @@\n \t\tassert.match(main, /await import\\(\"\\.\\/pipeline-commands\\.ts\"\\)/);\n \t});\n });\n+\n+describe(\"abso pipeline check --on (abso issue 176)\", () => {\n+\tconst FILE = `pipelines:\n+  ci:\n+    on: [publish, draft]\n+    jobs:\n+      setup: { run: npm ci }\n+      lint: { needs: [setup], run: lint }\n+      test: { needs: [setup], run: npm test }\n+    required: [test]\n+  release:\n+    on: [green, hand]\n+    only: shared\n+    jobs:\n+      site: { uses: deploy, worker: w, secrets: [CLOUDFLARE_API_TOKEN] }\n+`;\n+\tit(\"says which pipelines a draft starts, in waves, and why the others don't\", async () => {\n+\t\tconst r = await run(folder({ \"abso.yml\": FILE }), \"check\", \"--on\", \"draft\");\n+\t\tassert.equal(r.exit, 0, r.stderr);\n+\t\tassert.equal(\n+\t\t\tr.stdout,\n+\t\t\t\"On draft in shared, 1 pipeline from abso.yml starts; jobs on one line can run side by side.\\n  ci starts:\\n    1. setup\\n    2. lint, test (required)\\n  release doesn't start: doesn't run on draft\\n\",\n+\t\t);\n+\t});\n+\n+\tit(\"takes the space, the pipeline started by hand, and answers --json\", async () => {\n+\t\tconst dir = folder({ \"abso.yml\": FILE });\n+\t\tassert.match(\n+\t\t\t(await run(dir, \"check\", \"--on\", \"green\", \"--space\", \"rename-59\")).stdout,\n+\t\t\t/^On green in rename-59, nothing in abso\\.yml starts/,\n+\t\t);\n+\t\tconst j = JSON.parse((await run(dir, \"check\", \"--on\", \"hand\", \"--pipeline\", \"release\", \"--json\")).stdout);\n+\t\tassert.equal(j.ok, true);\n+\t\tassert.deepEqual(j.event, { kind: \"hand\", pipeline: \"release\", space: \"shared\" });\n+\t\tassert.deepEqual(j.start, [{ name: \"release\", waves: [[\"site\"]], required: [] }]);\n+\t});\n+\n+\tit(\"refuses an event it doesn't know, or one missing what it needs\", async () => {\n+\t\tconst dir = folder({ \"abso.yml\": FILE });\n+\t\tassert.match(\n+\t\t\t(await run(dir, \"check\", \"--on\", \"merge\")).stderr,\n+\t\t\t/--on is one of publish, draft, green, land, hand, schedule/,\n+\t\t);\n+\t\tassert.match((await run(dir, \"check\", \"--on\", \"hand\")).stderr, /--on hand takes --pipeline <name>/);\n+\t\tassert.match((await run(dir, \"check\", \"--on\", \"schedule\")).stderr, /--on schedule takes --every/);\n+\t});\n+});"},{"path":"client/view/hooks/register.tsx","added":1,"removed":0,"diff":"--- a/client/view/hooks/register.tsx\n+++ b/client/view/hooks/register.tsx\n@@ -100,6 +100,7 @@\n \tif (o === undefined) return false;\n \tconst host = o.replace(/^https?:\\/\\//, \"\").replace(/:\\d+$/, \"\");\n \tif (host === \"localhost\" || host === \"127.0.0.1\" || host === \"[::1]\") return true;\n+\tif (!o.startsWith(\"https://\")) return false;\n \treturn [...TOKEN_SERVERS, ...(trusted ?? \"\").split(\",\")].some((t) => t.trim() !== \"\" && origin(t) === o);\n }\n "},{"path":"src/pipeline/plan.ts","added":71,"removed":0,"diff":"--- /dev/null\n+++ b/src/pipeline/plan.ts\n@@ -0,0 +1,71 @@\n+// Which pipelines an event starts, and their jobs in waves (abso issue 176,\n+// under 138). A pure function of a checked pipeline file (pipeline.ts) and the\n+// event: nothing runs here. A wave is every job whose needs are all in earlier\n+// waves, so the jobs of one wave can run side by side. `abso pipeline check\n+// --on <event>` shows it, and a runner reads the same plan.\n+\n+import type { Job, Pipeline, PipelineFile } from \"./pipeline.ts\";\n+\n+/** What happened, and in which space (shared, or a named draft). */\n+export type PipelineEvent =\n+\t| { readonly kind: \"publish\" | \"draft\" | \"green\" | \"land\"; readonly space: string }\n+\t/** Someone starts one pipeline by name. */\n+\t| { readonly kind: \"hand\"; readonly pipeline: string; readonly space: string }\n+\t/** A schedule's time came: `every` as the file wrote it. Schedules run on shared. */\n+\t| { readonly kind: \"schedule\"; readonly every: string };\n+\n+export interface PlannedPipeline {\n+\treadonly name: string;\n+\t/** Job names, wave by wave. */\n+\treadonly waves: readonly (readonly string[])[];\n+\treadonly required: readonly string[];\n+}\n+\n+export interface Plan {\n+\treadonly start: readonly PlannedPipeline[];\n+\t/** The pipelines that don't start, each with why. */\n+\treadonly skip: readonly { readonly name: string; readonly why: string }[];\n+}\n+\n+export function plan(file: PipelineFile, event: PipelineEvent): Plan {\n+\tconst start: PlannedPipeline[] = [];\n+\tconst skip: { name: string; why: string }[] = [];\n+\tconst space = event.kind === \"schedule\" ? \"shared\" : event.space;\n+\tfor (const p of file.pipelines) {\n+\t\tconst why = notStarting(p, event, space);\n+\t\tif (why) skip.push({ name: p.name, why });\n+\t\telse start.push({ name: p.name, waves: waves(p.jobs), required: p.required });\n+\t}\n+\treturn { start, skip };\n+}\n+\n+/** Why `p` doesn't start on `event`, or undefined when it does. */\n+function notStarting(p: Pipeline, event: PipelineEvent, space: string): string | undefined {\n+\tif (event.kind === \"hand\" && event.pipeline !== p.name) return \"another pipeline was started by hand\";\n+\tconst on =\n+\t\tevent.kind === \"schedule\"\n+\t\t\t? p.on.some((t) => typeof t !== \"string\" && t.every === event.every)\n+\t\t\t: p.on.includes(event.kind);\n+\tif (!on) return event.kind === \"schedule\" ? `has no schedule \"${event.every}\"` : `doesn't run on ${event.kind}`;\n+\tif (p.only && !p.only.includes(space)) return `runs only for ${p.only.join(\", \")}, not ${space}`;\n+\t// The file check refuses this already; the plan holds the line too.\n+\tif (event.kind === \"draft\" && p.jobs.some((j) => j.secrets.length > 0))\n+\t\treturn \"holds secrets, and a draft runs unpublished code\";\n+\treturn undefined;\n+}\n+\n+/** The jobs in waves: each wave holds every job whose needs all came in earlier waves. */\n+export function waves(jobs: readonly Job[]): string[][] {\n+\tconst done = new Set<string>();\n+\tconst out: string[][] = [];\n+\tlet left = [...jobs];\n+\twhile (left.length > 0) {\n+\t\tconst wave = left.filter((j) => j.needs.every((n) => done.has(n)));\n+\t\t// A checked file has no cycles; stop rather than loop if one ever got here.\n+\t\tif (wave.length === 0) throw new Error(`jobs ${left.map((j) => j.name).join(\", \")} wait on each other`);\n+\t\tfor (const j of wave) done.add(j.name);\n+\t\tout.push(wave.map((j) => j.name));\n+\t\tleft = left.filter((j) => !done.has(j.name));\n+\t}\n+\treturn out;\n+}"},{"path":"src/pipeline/test/plan.test.ts","added":88,"removed":0,"diff":"--- /dev/null\n+++ b/src/pipeline/test/plan.test.ts\n@@ -0,0 +1,88 @@\n+// Which pipelines an event starts, and their jobs in waves (abso issue 176).\n+\n+import assert from \"node:assert/strict\";\n+import { describe, it } from \"node:test\";\n+import { type PipelineFile, readPipelineFile } from \"../pipeline.ts\";\n+import { plan, waves } from \"../plan.ts\";\n+\n+const FILE = `pipelines:\n+  ci:\n+    on: [publish, draft]\n+    jobs:\n+      setup:  { run: npm ci }\n+      lint:   { needs: [setup], run: npx biome ci . }\n+      test:   { needs: [setup], run: npm test }\n+      bundle: { needs: [lint, test], run: npm run build, keep: [\"dist/**\"] }\n+    required: [lint, test]\n+  release:\n+    on: [green, hand]\n+    only: shared\n+    jobs:\n+      site: { uses: deploy, from: ci.bundle, worker: w, secrets: [CLOUDFLARE_API_TOKEN] }\n+      tell: { needs: [site], uses: notify, to: [issue] }\n+  nightly:\n+    on: [{ every: \"day 06:00 UTC\" }]\n+    jobs:\n+      drill: { run: node ops/restore-drill.ts }\n+`;\n+const read = (text: string): PipelineFile => {\n+\tconst c = readPipelineFile(text, \"abso.yml\");\n+\tassert.ok(c.ok, c.ok ? \"\" : JSON.stringify(c.problems));\n+\treturn c.file;\n+};\n+const file = read(FILE);\n+const started = (p: ReturnType<typeof plan>) => p.start.map((s) => s.name);\n+\n+describe(\"which pipelines an event starts\", () => {\n+\tit(\"a publish to shared starts ci, in waves that can run side by side\", () => {\n+\t\tconst p = plan(file, { kind: \"publish\", space: \"shared\" });\n+\t\tassert.deepEqual(started(p), [\"ci\"]);\n+\t\tassert.deepEqual(p.start[0]!.waves, [[\"setup\"], [\"lint\", \"test\"], [\"bundle\"]]);\n+\t\tassert.deepEqual(p.start[0]!.required, [\"lint\", \"test\"]);\n+\t\tassert.deepEqual(p.skip, [\n+\t\t\t{ name: \"release\", why: \"doesn't run on publish\" },\n+\t\t\t{ name: \"nightly\", why: \"doesn't run on publish\" },\n+\t\t]);\n+\t});\n+\n+\tit(\"green on shared starts release; green on a named draft doesn't, since release is only shared\", () => {\n+\t\tassert.deepEqual(started(plan(file, { kind: \"green\", space: \"shared\" })), [\"release\"]);\n+\t\tconst p = plan(file, { kind: \"green\", space: \"rename-59\" });\n+\t\tassert.deepEqual(started(p), []);\n+\t\tassert.deepEqual(\n+\t\t\tp.skip.find((s) => s.name === \"release\"),\n+\t\t\t{ name: \"release\", why: \"runs only for shared, not rename-59\" },\n+\t\t);\n+\t});\n+\n+\tit(\"by hand starts only the pipeline named, and only if it runs by hand\", () => {\n+\t\tassert.deepEqual(started(plan(file, { kind: \"hand\", pipeline: \"release\", space: \"shared\" })), [\"release\"]);\n+\t\tconst ci = plan(file, { kind: \"hand\", pipeline: \"ci\", space: \"shared\" });\n+\t\tassert.deepEqual(started(ci), []);\n+\t\tassert.deepEqual(\n+\t\t\tci.skip.find((s) => s.name === \"ci\"),\n+\t\t\t{ name: \"ci\", why: \"doesn't run on hand\" },\n+\t\t);\n+\t});\n+\n+\tit(\"a schedule starts the pipeline with that schedule, on shared\", () => {\n+\t\tassert.deepEqual(started(plan(file, { kind: \"schedule\", every: \"day 06:00 UTC\" })), [\"nightly\"]);\n+\t\tassert.deepEqual(started(plan(file, { kind: \"schedule\", every: \"hour\" })), []);\n+\t});\n+\n+\tit(\"a draft never starts a pipeline holding secrets, even if the file said so\", () => {\n+\t\tconst unchecked: PipelineFile = {\n+\t\t\tdefaults: {},\n+\t\t\tpipelines: [{ ...file.pipelines[1]!, on: [\"draft\"], only: undefined } as never],\n+\t\t};\n+\t\tconst p = plan(unchecked, { kind: \"draft\", space: \"shared\" });\n+\t\tassert.deepEqual(p.start, []);\n+\t\tassert.match(p.skip[0]!.why, /holds secrets, and a draft runs unpublished code/);\n+\t});\n+\n+\tit(\"waves stop on jobs that wait on each other rather than loop\", () => {\n+\t\tconst job = (name: string, needs: string[]) =>\n+\t\t\t({ name, needs, keep: [], cache: [], secrets: [], with: {} }) as never;\n+\t\tassert.throws(() => waves([job(\"a\", [\"b\"]), job(\"b\", [\"a\"])]), /jobs a, b wait on each other/);\n+\t});\n+});"}],"ci":null}