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 159 to 160

Compare

+36 −1 in 2 places
Lines 1–6 at 160 (were 1–6 at 159)
11// A held push from end to end, as two agents meet it: alice and bob change
22// the same line, bob's push is held, he pulls, settles and pushes again.
3−// What each step prints has to be true.
3+// What each step prints has to be true, and the record has to keep his reason.
44
55import assert from "node:assert/strict";
66import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
Lines 68–108 at 160 (were 68–73 at 159)
6868 assert.match(policy(bob), /^<<<<<<< yours \(unpublished\)$/m, "the pull wrote a marker block");
6969 });
7070
71+ for (const how of ["yours", "theirs", "both"] as const) {
72+ it(`why names the collision a line was kept from, settled --${how}`, async () => {
73+ const { alice, bob } = await held();
74+ assert.equal((await run(bob, "pull")).exit, 0);
75+ const settled = await run(bob, "settle", "store-policy.md", `--${how}`);
76+ assert.equal(settled.exit, 0, settled.out);
77+ const pushed = await run(bob, "push", "-m", `Settle: keep ${how}`);
78+ assert.equal(pushed.exit, 0, pushed.out);
79+ assert.equal((await run(alice, "pull")).exit, 0);
80+ const why = await run(alice, "why", "store-policy.md:3");
81+ assert.equal(why.exit, 0, why.out);
82+ assert.match(why.out, /It was kept when bob settled a collision between:\n {2}alice, version 1 by alice/);
83+ assert.match(why.out, new RegExp(`\\n {2}bob, a held push: "${HELD.replace(/\$/g, "\\$")}"`));
84+ });
85+ }
87+ it("keeps its message: why on the settling line shows it, and so do the change page and the news", async () => {
88+ const { alice, bob } = await held();
89+ assert.equal((await run(bob, "pull")).exit, 0);
90+ writeFileSync(join(bob, "store-policy.md"), POLICY.replace("$50", "$60"));
91+ const pushed = await run(bob, "push", "-m", "Settle with alice: meet at $60");
92+ assert.equal(pushed.exit, 0, pushed.out);
93+ const why = await run(bob, "why", "store-policy.md:3");
94+ assert.match(
95+ why.out,
96+ /It settled a collision between:\n {2}alice, version 1 by alice[^\n]*\n {2}bob, a held push: "/,
97+ );
98+ assert.ok(why.out.includes(HELD), why.out);
99+ const review = await run(alice, "review", "bob");
100+ assert.match(review.out, /Settled: store-policy\.md \(rewrote both sides, against alice's version 1\)\./);
101+ assert.ok(review.out.includes(`Refused 1 time on the way: lines (store-policy.md): "${HELD}"`), review.out);
102+ const news = await run(alice, "news");
103+ assert.ok(news.out.includes(`Its held push said: "${HELD}"`), news.out);
104+ });
71106 it("the change page says what a settle kept in words that read for each choice", async () => {
72107 for (const [how, said] of [
73108 ["yours", "kept bob's"],
MCP
compare on this site's /mcp
CLI
abso diff 159 160 client/test/held-push.test.ts --json
JSON
/christopher/abso-core/compare/159..160?file=client%2Ftest%2Fheld-push.test.ts&format=json