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 20 to 318

Compare

+50 −0 in 1 place
new file, 50 lines
1+// What abso waiting --mine says about your own publishes in the merge queue: where each stands, a pause, and how
2+// the outcome comes. Nothing when none of yours waits.
3+
4+import assert from "node:assert/strict";
5+import { describe, it } from "node:test";
6+import type { QueueItem, QueueState } from "../src/api.ts";
7+import { queuedLines } from "../src/queue.ts";
8+
9+const item = (id: number, agent: string, checking = false): QueueItem => ({
10+ id,
11+ agent,
12+ message: `push ${id}`,
13+ time: 0,
14+ changes: 1,
15+ checking,
16+});
17+const state = (items: QueueItem[], paused: QueueState["paused"] = null): QueueState =>
18+ ({ items, paused }) as unknown as QueueState;
20+describe("waiting: your pushes in the merge queue", () => {
21+ it("says nothing when none of yours waits, or there's no queue to read", () => {
22+ assert.deepEqual(queuedLines(undefined, "ann"), []);
23+ assert.deepEqual(queuedLines(state([]), "ann"), []);
24+ assert.deepEqual(queuedLines(state([item(1, "bob")]), "ann"), []);
25+ });
27+ it("says where yours stands, and how the outcome comes", () => {
28+ assert.deepEqual(queuedLines(state([item(1, "bob", true), item(2, "ann")]), "ann"), [
29+ 'Your push 2 ("push 2") is in the merge queue: waiting, 1 push ahead of it.',
30+ "It lands or is turned back once the project's check runs on it; the outcome comes as news, and abso unqueue takes it back.",
31+ ]);
32+ assert.deepEqual(queuedLines(state([item(3, "ann", true), item(4, "bob", true), item(5, "ann")]), "ann"), [
33+ 'Your push 3 ("push 3") is in the merge queue: being checked in a batch of 2.',
34+ 'Your push 5 ("push 5") is in the merge queue: waiting, 2 pushes ahead of it.',
35+ "Each lands or is turned back once the project's check runs on it; the outcome comes as news, and abso unqueue takes them back.",
36+ ]);
37+ });
39+ it("says when the queue is paused", () => {
40+ const paused = {
41+ reason: "the box failed twice",
42+ since: "2026-01-01T00:00:00.000Z",
43+ nextTry: "2026-01-01T00:05:00.000Z",
44+ };
45+ assert.equal(
46+ queuedLines(state([item(1, "ann")], paused), "ann")[1],
47+ "The merge queue is paused: the box failed twice.",
48+ );
49+ });
50+});
MCP
compare on this site's /mcp
CLI
abso diff 20 318 client/test/queue-waiting.test.ts --json
JSON
/christopher/abso-core/compare/20..318?file=client%2Ftest%2Fqueue-waiting.test.ts&format=json