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/plan.ts --json
JSON
/christopher/abso-core/blame/src/pipeline/plan.ts?format=json
72 linesinfra-split 94% · rename 6%Last change rename in version 101,

72 lines from 3 changes in 3 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// under 138). A pure function of a checked pipeline file (pipeline.ts) and the
3// event: nothing runs here. A wave is every job whose needs are all in earlier
4// waves, so the jobs of one wave can run side by side. `abso pipeline check
5// --on <event>` shows it, and a runner reads the same plan.
6
rename101Pipeline trigger: on: [push] replaces on: [publish] (abso 427) A pipeline file writes on: [push] (abso.yml, abso.yaml, avcs.json). The word publish is no longer accepted, with no alias. The check messages, "doesn't run on push", `abso pipeline check --on push` and its --json say push. The stored event kind stays "publish" underneath.Compare7import { type Job, type Pipeline, type PipelineFile, triggerWord } from "./pipeline.ts";
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).Compare8
9/** What happened, and in which space (shared, or a named draft). */
10export type PipelineEvent =
11 | { readonly kind: "publish" | "draft" | "green" | "land"; readonly space: string }
12 /** Someone starts one pipeline by name. */
13 | { readonly kind: "hand"; readonly pipeline: string; readonly space: string }
14 /** A schedule's time came: `every` as the file wrote it. Schedules run on shared. */
15 | { readonly kind: "schedule"; readonly every: string };
17export interface PlannedPipeline {
18 readonly name: string;
19 /** Job names, wave by wave. */
20 readonly waves: readonly (readonly string[])[];
21 readonly required: readonly string[];
24export interface Plan {
25 readonly start: readonly PlannedPipeline[];
26 /** The pipelines that don't start, each with why. */
27 readonly skip: readonly { readonly name: string; readonly why: string }[];
30export function plan(file: PipelineFile, event: PipelineEvent): Plan {
31 const start: PlannedPipeline[] = [];
32 const skip: { name: string; why: string }[] = [];
33 const space = event.kind === "schedule" ? "shared" : event.space;
34 for (const p of file.pipelines) {
35 const why = notStarting(p, event, space);
36 if (why) skip.push({ name: p.name, why });
37 else start.push({ name: p.name, waves: waves(p.jobs), required: p.required });
38 }
39 return { start, skip };
42/** Why `p` doesn't start on `event`, or undefined when it does. */
43function notStarting(p: Pipeline, event: PipelineEvent, space: string): string | undefined {
44 if (event.kind === "hand" && event.pipeline !== p.name) return "another pipeline was started by hand";
45 const on =
46 event.kind === "schedule"
47 ? p.on.some((t) => typeof t !== "string" && t.every === event.every)
48 : p.on.includes(event.kind);
rename101Pipeline trigger: on: [push] replaces on: [publish] (abso 427) A pipeline file writes on: [push] (abso.yml, abso.yaml, avcs.json). The word publish is no longer accepted, with no alias. The check messages, "doesn't run on push", `abso pipeline check --on push` and its --json say push. The stored event kind stays "publish" underneath.Compare49 if (!on)
50 return event.kind === "schedule" ? `has no schedule "${event.every}"` : `doesn't run on ${triggerWord(event.kind)}`;
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).Compare51 if (p.only && !p.only.includes(space)) return `runs only for ${p.only.join(", ")}, not ${space}`;
52 // The file check refuses this already; the plan holds the line too.
53 if (event.kind === "draft" && p.jobs.some((j) => j.secrets.length > 0))
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.Compare54 return "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).Compare55 return undefined;
58/** The jobs in waves: each wave holds every job whose needs all came in earlier waves. */
59export function waves(jobs: readonly Job[]): string[][] {
60 const done = new Set<string>();
61 const out: string[][] = [];
62 let left = [...jobs];
63 while (left.length > 0) {
64 const wave = left.filter((j) => j.needs.every((n) => done.has(n)));
65 // A checked file has no cycles; stop rather than loop if one ever got here.
66 if (wave.length === 0) throw new Error(`jobs ${left.map((j) => j.name).join(", ")} wait on each other`);
67 for (const j of wave) done.add(j.name);
68 out.push(wave.map((j) => j.name));
69 left = left.filter((j) => !done.has(j.name));
70 }
71 return out;