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

+64 −1 in 3 places
Lines 824–869 at 318 (were 824–829 at 175)
824824 );
825825 });
826826
827+ it("shows and exports a version without earlier ones, refuses one a kept version builds on, and leaves shared alone", async () => {
828+ const { name, folders } = await project({ "a.txt": "a\n", "b.txt": "b\n" }, "alice", "bob");
829+ const [alice, bob] = [folders.alice!, folders.bob!];
830+ write(alice, { "a.txt": "a, changed\n" });
831+ assert.equal((await avcs(alice, "push", "-m", "change a")).exit, 0);
832+ write(alice, { "b.txt": "b, changed\n" });
833+ assert.equal((await avcs(alice, "push", "-m", "change b")).exit, 0);
834+ write(alice, { "a.txt": "a, changed again\n" });
835+ assert.equal((await avcs(alice, "push", "-m", "change a again")).exit, 0);
836+ const before = shared(name);
838+ const shown = await text(bob, "show", "2", "--without", "1");
839+ assert.equal(shown.exit, 0, shown.stderr);
840+ assert.match(
841+ shown.stdout,
842+ /^Version 2 of shared without version 1:\n {2}version 1 by alice: change a\nCompared with version 2: 1 file, 1 line added, 1 removed\.\nThe files hash to [0-9a-f]{64}; the same ask gives the same hash\. Shared doesn't change\./,
843+ );
844+ assert.match(shown.stdout, /-a, changed\n\+a\n/);
845+ assert.equal((await text(bob, "show", "2:a.txt", "--without", "1")).stdout, "a\n");
846+ assert.equal((await text(bob, "show", "2:b.txt", "--without", "1")).stdout, "b, changed\n");
848+ const refused = await text(bob, "show", "3", "--without", "1");
849+ assert.equal(refused.exit, 2);
850+ assert.equal(
851+ refused.stdout,
852+ "Version 3 of shared can't leave out version 1: versions it keeps build on it.\n version 3 by alice: change a again\n builds on version 1 (a.txt)\nLeaving those out too works: abso show 3 --without 1,3\n",
853+ );
854+ const out = join(temp(), "without");
855+ const blocked = await avcs(bob, "export", out, "--version", "3", "--without", "1");
856+ assert.equal(blocked.exit, 2);
857+ assert.deepEqual(blocked.json.suggestion, [1, 3]);
858+ const exported = await avcs(bob, "export", out, "--version", "3", "--without", "1,3");
859+ assert.equal(exported.exit, 0, exported.out);
860+ assert.deepEqual(exported.json.without, [1, 3]);
861+ assert.equal(readFileSync(join(out, "a.txt"), "utf8"), "a\n");
862+ assert.equal(readFileSync(join(out, "b.txt"), "utf8"), "b, changed\n");
863+ assert.deepEqual(shared(name), before, "shared doesn't change");
864+ assert.equal((await text(bob, "show", "3", "--without", "x")).exit, 1);
865+ });
827867 it("refuses a push that builds on lines a drop took out, plainly, with exit 2", async () => {
828868 const { folders } = await project({ "a.txt": "one\ntwo\n" }, "alice", "bob");
829869 const [alice, bob] = [folders.alice!, folders.bob!];
Lines 3236–3242 at 318 (were 3196–3202 at 175)
31963236 "Not checked yet. Version 4 is being checked (35 s so far).",
31973237 ]);
31983238 assert.deepEqual(ciText({ ...base, checked: { version: 2, result: "none" }, running: null }, 3, now), [
3199− "CI couldn't check version 2 (the box failed twice, or abso.json has nothing to run). Versions after 2 aren't checked yet.",
3239+ "CI couldn't check version 2 (the box failed twice, or the pipeline file has nothing to run). Versions after 2 aren't checked yet.",
32003240 ]);
32013241 assert.deepEqual(
32023242 ciText({ ...base, running: null, red: { version: 1, agent: null, message: null, lastGood: null } }, 1, now),
Lines 3748–3776 at 318 (were 3708–3713 at 175)
37083748 assert.equal((await avcs(dir, "push", "-m", "rep writes")).exit, 0);
37093749 });
37103750
3751+ it("a reader talks: it announces, notes lines and closes notes, but still can't start or push (abso 682)", async () => {
3752+ const { name, folders } = await project({ "a.txt": "a\n" }, "alice");
3753+ const dir = temp();
3754+ const joined = await main(["join", name, "--agent", "rep", "--server", fake.url, "--reader"], {
3755+ cwd: dir,
3756+ env: ENV,
3757+ write: () => {},
3758+ });
3759+ assert.equal(joined.exit, 0, joined.stdout + joined.stderr);
3760+ // Talking: news to the other agents, and notes on lines, made and closed.
3761+ const said = await avcs(dir, "announce", "reader here");
3762+ assert.equal(said.exit, 0, said.out);
3763+ assert.deepEqual(said.json.to, ["alice"]);
3764+ const noted = await avcs(dir, "note", "a.txt:1", "why this line?");
3765+ assert.equal(noted.exit, 0, noted.out);
3766+ assert.equal((await avcs(dir, "note", "--close", String(noted.json.id), "--withdrawn")).exit, 0);
3767+ // Code: still refused.
3768+ const started = await main(["start", "reader work"], { cwd: dir, env: ENV, write: () => {} });
3769+ assert.match(started.stdout + started.stderr, /agent rep is a reader: it records nothing/);
3770+ assert.equal((await main(["push", "-m", "x"], { cwd: dir, env: ENV, write: () => {} })).exit, 1);
3771+ assert.equal((await avcs(folders.alice!, "news")).json.news.length > 0, true, "alice heard the reader");
3772+ });
37113774 it("reader on is refused while the agent has unpushed work, and changes nothing here", async () => {
37123775 const { folders } = await project({ "a.txt": "a\n" }, "alice");
37133776 write(folders.alice!, { "a.txt": "a, unpushed\n" });
MCP
compare on this site's /mcp
CLI
abso diff 175 318 client/test/client.test.ts --json
JSON
/christopher/abso-core/compare/175..318?file=client%2Ftest%2Fclient.test.ts&format=json