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

Versions 175 to 318

Compare

+55 −6 in 4 places
Lines 51–60 at 318 (were 51–57 at 175)
5151 shared > v ? (ci.running !== null ? running : ci.skipped ? "" : ` Versions after ${v} aren't checked yet.`) : "";
5252 if (ci.checked.result === "pass") lines.push(`Shared is green: version ${v} passed its check.${newer}`);
5353 else if (ci.checked.result === "fail") lines.push(`Version ${v} failed its check. abso ci ${v} shows why.${newer}`);
54− else lines.push(`CI couldn't check version ${v} (the box failed twice, or abso.json has nothing to run).${newer}`);
54+ else
55+ lines.push(
56+ `CI couldn't check version ${v} (the box failed twice, or the pipeline file has nothing to run).${newer}`,
57+ );
5558 } else {
5659 lines.push(
5760 ci.running === null
Lines 80–122 at 318 (were 77–82 at 175)
7780 return lines;
7881}
7982
83+/** A stored pipeline run as runRuns lists it: what the CI lines need of it. */
84+interface StoredRun {
85+ readonly id: number;
86+ readonly version: number;
87+ readonly state: string;
88+ readonly file: string;
89+}
91+/** The stored pipeline runs, newest first, from the server's `pipelines` read; empty for anything else. */
92+export function storedRuns(raw: unknown): StoredRun[] {
93+ const runs = (raw as { runs?: unknown } | null)?.runs;
94+ if (!Array.isArray(runs)) return [];
95+ return runs.filter(
96+ (r): r is StoredRun =>
97+ typeof r === "object" &&
98+ r !== null &&
99+ Number.isInteger((r as StoredRun).id) &&
100+ Number.isInteger((r as StoredRun).version) &&
101+ typeof (r as StoredRun).state === "string" &&
102+ typeof (r as StoredRun).file === "string",
103+ );
104+}
106+/** One stored run in a line, with where its jobs are. */
107+export function runLine(run: StoredRun): string {
108+ const how = run.state === "planned" ? "was planned, not run," : run.state === "running" ? "is running" : run.state;
109+ return `Pipeline run ${run.id} (${run.file}) ${how} on version ${run.version}. abso pipeline runs ${run.id} shows its jobs.`;
110+}
112+/**
113+ * Whether the built-in check (abso.json's setup, build and check) had nothing of its own to run. With stored runs, that is
114+ * about the built-in check, not the project's CI, so it isn't said as the project's (abso 719).
115+ */
116+export function builtInHasNothing(ci: CiStatus): boolean {
117+ return ci.red === null && ci.skipped?.reason.startsWith("nothing to run") === true;
118+}
80120/** A shared version's mark in abso log; "not checked" says nothing, since most versions in a busy hour are covered by a newer one's job. */
81121export function ciMarkText(mark: CiMark | undefined): string {
82122 switch (mark) {
Lines 154–160 at 318 (were 114–120 at 175)
114154 ? `Version ${job.version} passed${covered}${took === "" ? "" : ` (${took})`}${job.built ? "; its build is kept for the preview" : ""}.`
115155 : job.result === "fail"
116156 ? `Version ${job.version} failed at ${job.step ?? "a step"}${job.exit === undefined || job.exit === null ? "" : ` (exit ${job.exit})`}${covered}${took === "" ? "" : `, ${took}`}.`
117− : `Version ${job.version} wasn't checked${job.step === undefined ? "" : ` (${job.step})`}: the box failed twice, or abso.json has nothing to run.`;
157+ : `Version ${job.version} wasn't checked${job.step === undefined ? "" : ` (${job.step})`}: the box failed twice, or the pipeline file has nothing to run.`;
118158 const output = job.output?.trimEnd() ?? "";
119159 return [
120160 head,
Lines 180–199 at 318 (were 140–150 at 175)
140180 }
141181 if (typed !== undefined) {
142182 if (!/^\d+$/.test(typed)) throw new UsageError(`a version is a number (got ${JSON.stringify(typed)})`);
143− const job = await api.ci(Number(typed));
144− return { text: jobText(job).join("\n"), json: { ...job } };
183+ const [job, raw] = await Promise.all([api.ci(Number(typed)), api.pipelineRuns().catch(() => null)]);
184+ const run = storedRuns(raw).find((r) => r.version === job.version);
185+ // A version the built-in check never ran, with a pipeline run of its own: the run is its CI (abso 719).
186+ const text = run !== undefined && job.result === "none" ? [runLine(run)] : jobText(job);
187+ return { text: text.join("\n"), json: { ...job } };
145188 }
146− const [ci, status] = await Promise.all([api.ci(), api.status()]);
147− const lines = ciText(ci, status.version);
189+ const [ci, status, raw] = await Promise.all([api.ci(), api.status(), api.pipelineRuns().catch(() => null)]);
190+ const newest = storedRuns(raw)[0];
191+ const lines =
192+ newest === undefined
193+ ? ciText(ci, status.version)
194+ : builtInHasNothing(ci)
195+ ? [runLine(newest)]
196+ : [...ciText(ci, status.version), runLine(newest)];
148197 return {
149198 text: [
150199 `shared is at version ${status.version}.`,
MCP
compare on this site's /mcp
CLI
abso diff 175 318 client/src/ci.ts --json
JSON
/christopher/abso-core/compare/175..318?file=client%2Fsrc%2Fci.ts&format=json