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 worker/project/test/project-file.test.ts --json
JSON
/christopher/abso-core/blame/worker/project/test/project-file.test.ts?format=json
71 linesengine 97% · pinch 1% · rename 1%Last change rename in version 100,

71 lines from 3 changes in 3 versions.

engine25Read abso.json first, then avcs.json (abso 224, ask 238): one helper (projectFileIn) for the queue, files kept whole, reviewers and init; publish, init and git intake check both files the same way; when shared has both, abso.json counts and status says avcs.json is ignored (status answer projectFile, printed by abso status). .abso/ is kept out of projects like .avcs/. Old projects with only avcs.json work as before.Compare1// The project file's new name (224): abso.json is read first, then avcs.json
2// from before the rename. Both are checked the same way, and when shared has
3// both, abso.json counts and status says avcs.json is ignored.
4
5import assert from "node:assert/strict";
6import { test } from "node:test";
7import { MemoryStore, Project } from "../project.ts";
8
pinch78Biome is silent: about 90 hints cleared. String joins as templates, dotted keys, unused imports, variables and a private method removed, optional chains (one kept boolean with === true), the preset field instead of the deprecated recommended. Two rules off where they don't fit: noExplicitAny in the hook modules, whose engine types come from the host, and noTemplateCurlyInString in tests, which hold source text as data.Compare9const review = (reviewer: string) => `${JSON.stringify({ review: [{ paths: ["src/**"], reviewer }] })}\n`;
engine25Read abso.json first, then avcs.json (abso 224, ask 238): one helper (projectFileIn) for the queue, files kept whole, reviewers and init; publish, init and git intake check both files the same way; when shared has both, abso.json counts and status says avcs.json is ignored (status answer projectFile, printed by abso status). .abso/ is kept out of projects like .avcs/. Old projects with only avcs.json work as before.Compare10
11function touchSrc(project: Project, time: number): void {
12 project.sync("builder");
13 const a = project.edit("builder", { file: "src/a.ts", old: `${time - 1}`, new: `${time}` }, time);
14 if (!a.ok) throw new Error("edit out of step");
15 project.publish("builder", `a ${time}`, time + 1);
18test("abso.json alone is the project file: its reviewers are told", () => {
19 const project = new Project(new MemoryStore(), { now: () => 100 });
20 project.init({ "abso.json": review("security"), "src/a.ts": "export const a = 0;\n" }, 0);
21 project.sync("security");
22 touchSrc(project, 1);
23 assert.equal(project.news("security").news.length, 1);
24 assert.equal(project.status().projectFile, undefined, "one file: nothing to say");
25});
27test("avcs.json alone still works", () => {
28 const project = new Project(new MemoryStore(), { now: () => 100 });
29 project.init({ "avcs.json": review("security"), "src/a.ts": "export const a = 0;\n" }, 0);
30 project.sync("security");
31 touchSrc(project, 1);
32 assert.equal(project.news("security").news.length, 1);
33});
35test("with both, abso.json counts and status says avcs.json is ignored", () => {
36 const project = new Project(new MemoryStore(), { now: () => 100 });
37 project.init(
38 { "abso.json": review("security"), "avcs.json": review("writer"), "src/a.ts": "export const a = 0;\n" },
39 0,
40 );
41 for (const a of ["security", "writer"]) project.sync(a);
42 touchSrc(project, 1);
43 assert.equal(project.news("security").news.length, 1);
44 assert.equal(project.news("writer").news.length, 0, "avcs.json is ignored");
45 assert.deepEqual(project.status().projectFile, { used: "abso.json", ignored: "avcs.json" });
46});
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.Compare48test("a broken abso.json is refused like a broken avcs.json, at push and at init", () => {
engine25Read abso.json first, then avcs.json (abso 224, ask 238): one helper (projectFileIn) for the queue, files kept whole, reviewers and init; publish, init and git intake check both files the same way; when shared has both, abso.json counts and status says avcs.json is ignored (status answer projectFile, printed by abso status). .abso/ is kept out of projects like .avcs/. Old projects with only avcs.json work as before.Compare49 const project = new Project(new MemoryStore());
50 project.init({ "abso.json": '{"queue": false}\n' }, 0);
51 project.sync("alice");
52 project.record("alice", { "abso.json": '{"queue": "yes"}\n' }, 1);
53 assert.throws(() => project.publish("alice", "queue as text", 2), /abso\.json has "queue" that isn't true or false/);
54 assert.equal(project.files()["abso.json"], '{"queue": false}\n', "shared keeps the good one");
55 // A broken avcs.json is still refused when abso.json is there too: it may be read again once abso.json goes.
56 project.record("alice", { "abso.json": '{"queue": false}\n', "avcs.json": "[1]\n" }, 3);
57 assert.throws(() => project.publish("alice", "old file broken", 4), /avcs\.json must be a JSON object/);
58 assert.throws(
59 () => new Project(new MemoryStore()).init({ "abso.json": "[1]\n" }, 0),
60 /init: abso\.json must be a JSON object/,
61 );
62});
64test(".abso/ stays in the agent's folder, like .avcs/", () => {
65 const project = new Project(new MemoryStore());
66 project.init({ "a.txt": "a\n" }, 0);
67 for (const p of [".abso/config.json", "sub/.ABSO/x", ".avcs/config.json"]) {
68 assert.throws(() => project.record("ann", { [p]: "x\n" }, 1), /is under \.(abso|avcs)\//, p);
69 }
70 assert.equal(project.record("ann", { ".absolutely.txt": "x\n" }, 1) !== undefined, true);
71});