Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed
MCP
blame on this site's /mcp
CLI
abso blame src/pipeline/test/plan.test.ts --version 100 --json
JSON
/christopher/abso-core/blame/src/pipeline/test/plan.test.ts?version=100&format=json
88 linesinfra-split 98% · rename 2%Last change rename in version 100,

88 lines from 2 changes in 2 versions.

infra-split1The tool as of abso 612: https-only token, and the pipeline plan (abso 161) abso-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. - 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. - 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. Checked here: npm ci, npx biome ci . and npm run check all exit 0 (693 pass, 1 skipped).Compare1// Which pipelines an event starts, and their jobs in waves (abso issue 176).
2
3import assert from "node:assert/strict";
4import { describe, it } from "node:test";
5import { type PipelineFile, readPipelineFile } from "../pipeline.ts";
6import { plan, waves } from "../plan.ts";
7
8const FILE = `pipelines:
9 ci:
10 on: [publish, draft]
11 jobs:
12 setup: { run: npm ci }
13 lint: { needs: [setup], run: npx biome ci . }
14 test: { needs: [setup], run: npm test }
15 bundle: { needs: [lint, test], run: npm run build, keep: ["dist/**"] }
16 required: [lint, test]
17 release:
18 on: [green, hand]
19 only: shared
20 jobs:
21 site: { uses: deploy, from: ci.bundle, worker: w, secrets: [CLOUDFLARE_API_TOKEN] }
22 tell: { needs: [site], uses: notify, to: [issue] }
23 nightly:
24 on: [{ every: "day 06:00 UTC" }]
25 jobs:
26 drill: { run: node ops/restore-drill.ts }
27`;
28const read = (text: string): PipelineFile => {
29 const c = readPipelineFile(text, "abso.yml");
30 assert.ok(c.ok, c.ok ? "" : JSON.stringify(c.problems));
31 return c.file;
32};
33const file = read(FILE);
34const started = (p: ReturnType<typeof plan>) => p.start.map((s) => s.name);
36describe("which pipelines an event starts", () => {
rename100abso publish is now abso push, abso sync is now abso pull (abso 427) Commands, help, flags, messages, MCP tool names and descriptions, hook text, README, SKILL.md and tests say push and pull; "shared" stays the noun ("Pushed version N"). No aliases, no notices. A queued push that was "pulled" is now "turned back", so pull means one thing. push -f/--force/-u/--all/--tags and pull --rebase/--ff-only/--squash refuse with one plain line naming the abso way; push and pull take no remote or branch. Kept as stored: log entry kinds (publish, sync, pulled), HTTP route paths, the pipeline trigger on: publish, the yours (unpublished) marker, npm-publish.Compare37 it("a push to shared starts ci, in waves that can run side by side", () => {
infra-split1The tool as of abso 612: https-only token, and the pipeline plan (abso 161) abso-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. - 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. - 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. Checked here: npm ci, npx biome ci . and npm run check all exit 0 (693 pass, 1 skipped).Compare38 const p = plan(file, { kind: "publish", space: "shared" });
39 assert.deepEqual(started(p), ["ci"]);
40 assert.deepEqual(p.start[0]!.waves, [["setup"], ["lint", "test"], ["bundle"]]);
41 assert.deepEqual(p.start[0]!.required, ["lint", "test"]);
42 assert.deepEqual(p.skip, [
43 { name: "release", why: "doesn't run on publish" },
44 { name: "nightly", why: "doesn't run on publish" },
45 ]);
46 });
48 it("green on shared starts release; green on a named draft doesn't, since release is only shared", () => {
49 assert.deepEqual(started(plan(file, { kind: "green", space: "shared" })), ["release"]);
50 const p = plan(file, { kind: "green", space: "rename-59" });
51 assert.deepEqual(started(p), []);
52 assert.deepEqual(
53 p.skip.find((s) => s.name === "release"),
54 { name: "release", why: "runs only for shared, not rename-59" },
55 );
56 });
58 it("by hand starts only the pipeline named, and only if it runs by hand", () => {
59 assert.deepEqual(started(plan(file, { kind: "hand", pipeline: "release", space: "shared" })), ["release"]);
60 const ci = plan(file, { kind: "hand", pipeline: "ci", space: "shared" });
61 assert.deepEqual(started(ci), []);
62 assert.deepEqual(
63 ci.skip.find((s) => s.name === "ci"),
64 { name: "ci", why: "doesn't run on hand" },
65 );
66 });
68 it("a schedule starts the pipeline with that schedule, on shared", () => {
69 assert.deepEqual(started(plan(file, { kind: "schedule", every: "day 06:00 UTC" })), ["nightly"]);
70 assert.deepEqual(started(plan(file, { kind: "schedule", every: "hour" })), []);
71 });
73 it("a draft never starts a pipeline holding secrets, even if the file said so", () => {
74 const unchecked: PipelineFile = {
75 defaults: {},
76 pipelines: [{ ...file.pipelines[1]!, on: ["draft"], only: undefined } as never],
77 };
78 const p = plan(unchecked, { kind: "draft", space: "shared" });
79 assert.deepEqual(p.start, []);
rename100abso publish is now abso push, abso sync is now abso pull (abso 427) Commands, help, flags, messages, MCP tool names and descriptions, hook text, README, SKILL.md and tests say push and pull; "shared" stays the noun ("Pushed version N"). No aliases, no notices. A queued push that was "pulled" is now "turned back", so pull means one thing. push -f/--force/-u/--all/--tags and pull --rebase/--ff-only/--squash refuse with one plain line naming the abso way; push and pull take no remote or branch. Kept as stored: log entry kinds (publish, sync, pulled), HTTP route paths, the pipeline trigger on: publish, the yours (unpublished) marker, npm-publish.Compare80 assert.match(p.skip[0]!.why, /holds secrets, and a draft runs unpushed code/);
infra-split1The tool as of abso 612: https-only token, and the pipeline plan (abso 161) abso-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. - 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. - 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. Checked here: npm ci, npx biome ci . and npm run check all exit 0 (693 pass, 1 skipped).Compare81 });
83 it("waves stop on jobs that wait on each other rather than loop", () => {
84 const job = (name: string, needs: string[]) =>
85 ({ name, needs, keep: [], cache: [], secrets: [], with: {} }) as never;
86 assert.throws(() => waves([job("a", ["b"]), job("b", ["a"])]), /jobs a, b wait on each other/);
87 });
88});