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/draft-files-kept.test.ts --json
JSON
/christopher/abso-core/blame/worker/project/test/draft-files-kept.test.ts?format=json
72 linesengine 89% · rename 11%Last change rename in version 100,

72 lines from 3 changes in 2 versions.

engine55Issue 6: status no longer builds every agent's view. On abso's log (13,148 entries, 48 agents) status went from about 330 ms to 1 ms median (30 ms max) in Node. - markedCollisions skips the view when the agent has no marked files (most have none). This was most of the cost. - draftFiles skips the view when the draft is empty, and Project keeps each agent's draft files under their view key plus the draft, so they're worked out again only when either moves. Overlaps and overlap news use the kept ones too. - New test (draft-files-kept): status from a warm project equals a cold load after every step, in shared and with two agents in one named draft (Pinch's case). A weaker key fails it.Compare1// Each agent's draft files are kept between calls (abso-core issue 6). Status
2// must answer as a project that works them out cold does, after every kind of
3// step, in shared and in a named draft.
4
5import assert from "node:assert/strict";
6import { test } from "node:test";
7import { MemoryStore, Project } from "../project.ts";
8
9const START = {
10 "core.ts": "export function step(x: number) {\n return x + 1;\n}\n\nexport const version = 1;\n",
11 "notes.md": "one\ntwo\nthree\n",
12};
14function setup() {
15 const store = new MemoryStore();
16 const project = new Project(store);
17 project.init(START, 0);
18 for (const a of ["ann", "bob", "cat"]) project.sync(a);
19 // Warm: every agent's draft files are kept from here on.
20 project.status();
21 return { project, store };
24/** Status from the warm project, checked against the same log loaded cold. */
25function same(project: Project, store: MemoryStore, step: string) {
26 const warm = project.status();
27 assert.deepEqual(warm, Project.load(store.entries, new MemoryStore()).status(), `after ${step}`);
28 return warm;
31const filesOf = (status: ReturnType<Project["status"]>, agent: string) =>
32 status.agents.find((a) => a.agent === agent)!.files;
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.Compare34test("status answers the same warm and cold through records, pushes and pulls in shared", () => {
engine55Issue 6: status no longer builds every agent's view. On abso's log (13,148 entries, 48 agents) status went from about 330 ms to 1 ms median (30 ms max) in Node. - markedCollisions skips the view when the agent has no marked files (most have none). This was most of the cost. - draftFiles skips the view when the draft is empty, and Project keeps each agent's draft files under their view key plus the draft, so they're worked out again only when either moves. Overlaps and overlap news use the kept ones too. - New test (draft-files-kept): status from a warm project equals a cold load after every step, in shared and with two agents in one named draft (Pinch's case). A weaker key fails it.Compare35 const { project, store } = setup();
36 project.edit("ann", { file: "core.ts", old: " return x + 1;", new: " return x + 2;" }, 1);
37 assert.deepEqual(filesOf(same(project, store, "ann's edit"), "ann"), ["core.ts"]);
38 project.edit("ann", { file: "notes.md", old: "two\n", new: "two!\n" }, 2);
39 assert.deepEqual(filesOf(same(project, store, "ann's second edit"), "ann"), ["core.ts", "notes.md"]);
40 project.edit("bob", { file: "notes.md", old: "three\n", new: "three!\n" }, 3);
41 same(project, store, "bob's edit");
42 project.publish("ann", "Ann's two", 4);
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.Compare43 assert.deepEqual(filesOf(same(project, store, "ann's push"), "ann"), []);
engine55Issue 6: status no longer builds every agent's view. On abso's log (13,148 entries, 48 agents) status went from about 330 ms to 1 ms median (30 ms max) in Node. - markedCollisions skips the view when the agent has no marked files (most have none). This was most of the cost. - draftFiles skips the view when the draft is empty, and Project keeps each agent's draft files under their view key plus the draft, so they're worked out again only when either moves. Overlaps and overlap news use the kept ones too. - New test (draft-files-kept): status from a warm project equals a cold load after every step, in shared and with two agents in one named draft (Pinch's case). A weaker key fails it.Compare44 project.sync("bob");
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.Compare45 assert.deepEqual(filesOf(same(project, store, "bob's pull"), "bob"), ["notes.md"]);
engine55Issue 6: status no longer builds every agent's view. On abso's log (13,148 entries, 48 agents) status went from about 330 ms to 1 ms median (30 ms max) in Node. - markedCollisions skips the view when the agent has no marked files (most have none). This was most of the cost. - draftFiles skips the view when the draft is empty, and Project keeps each agent's draft files under their view key plus the draft, so they're worked out again only when either moves. Overlaps and overlap news use the kept ones too. - New test (draft-files-kept): status from a warm project equals a cold load after every step, in shared and with two agents in one named draft (Pinch's case). A weaker key fails it.Compare46 project.record("cat", { "new.ts": "export {};\n" }, 5);
47 assert.deepEqual(filesOf(same(project, store, "cat's new file"), "cat"), ["new.ts"]);
48 project.publish("cat", "Cat's file", 6);
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.Compare49 same(project, store, "cat's push");
engine55Issue 6: status no longer builds every agent's view. On abso's log (13,148 entries, 48 agents) status went from about 330 ms to 1 ms median (30 ms max) in Node. - markedCollisions skips the view when the agent has no marked files (most have none). This was most of the cost. - draftFiles skips the view when the draft is empty, and Project keeps each agent's draft files under their view key plus the draft, so they're worked out again only when either moves. Overlaps and overlap news use the kept ones too. - New test (draft-files-kept): status from a warm project equals a cold load after every step, in shared and with two agents in one named draft (Pinch's case). A weaker key fails it.Compare50});
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.Compare52test("two agents in one named draft: one pushes, and the other's status still matches a cold load", () => {
engine55Issue 6: status no longer builds every agent's view. On abso's log (13,148 entries, 48 agents) status went from about 330 ms to 1 ms median (30 ms max) in Node. - markedCollisions skips the view when the agent has no marked files (most have none). This was most of the cost. - draftFiles skips the view when the draft is empty, and Project keeps each agent's draft files under their view key plus the draft, so they're worked out again only when either moves. Overlaps and overlap news use the kept ones too. - New test (draft-files-kept): status from a warm project equals a cold load after every step, in shared and with two agents in one named draft (Pinch's case). A weaker key fails it.Compare53 const { project, store } = setup();
54 project.switchTo("ann", "rw", 1);
55 project.switchTo("bob", "rw", 2);
56 same(project, store, "both switch");
57 project.edit("ann", { file: "core.ts", old: " return x + 1;", new: " return x * 2;" }, 3);
58 project.edit("bob", { file: "notes.md", old: "one\n", new: "one (rw)\n" }, 4);
59 const before = same(project, store, "both edit in rw");
60 assert.deepEqual(filesOf(before, "bob"), ["notes.md"]);
61 project.publish("ann", "Double", 5);
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.Compare62 const after = same(project, store, "ann pushes into rw");
engine55Issue 6: status no longer builds every agent's view. On abso's log (13,148 entries, 48 agents) status went from about 330 ms to 1 ms median (30 ms max) in Node. - markedCollisions skips the view when the agent has no marked files (most have none). This was most of the cost. - draftFiles skips the view when the draft is empty, and Project keeps each agent's draft files under their view key plus the draft, so they're worked out again only when either moves. Overlaps and overlap news use the kept ones too. - New test (draft-files-kept): status from a warm project equals a cold load after every step, in shared and with two agents in one named draft (Pinch's case). A weaker key fails it.Compare63 assert.deepEqual(filesOf(after, "ann"), []);
64 project.sync("bob");
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.Compare65 assert.deepEqual(filesOf(same(project, store, "bob pulls in rw"), "bob"), ["notes.md"]);
engine55Issue 6: status no longer builds every agent's view. On abso's log (13,148 entries, 48 agents) status went from about 330 ms to 1 ms median (30 ms max) in Node. - markedCollisions skips the view when the agent has no marked files (most have none). This was most of the cost. - draftFiles skips the view when the draft is empty, and Project keeps each agent's draft files under their view key plus the draft, so they're worked out again only when either moves. Overlaps and overlap news use the kept ones too. - New test (draft-files-kept): status from a warm project equals a cold load after every step, in shared and with two agents in one named draft (Pinch's case). A weaker key fails it.Compare66 project.publish("bob", "Note", 6);
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.Compare67 assert.deepEqual(filesOf(same(project, store, "bob pushes into rw"), "bob"), []);
engine55Issue 6: status no longer builds every agent's view. On abso's log (13,148 entries, 48 agents) status went from about 330 ms to 1 ms median (30 ms max) in Node. - markedCollisions skips the view when the agent has no marked files (most have none). This was most of the cost. - draftFiles skips the view when the draft is empty, and Project keeps each agent's draft files under their view key plus the draft, so they're worked out again only when either moves. Overlaps and overlap news use the kept ones too. - New test (draft-files-kept): status from a warm project equals a cold load after every step, in shared and with two agents in one named draft (Pinch's case). A weaker key fails it.Compare68 project.land("ann", "Land rw", 7);
69 same(project, store, "rw lands");
70 project.switchTo("ann", "shared", 8);
71 same(project, store, "ann back in shared");
72});