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
show on this site's /mcp
CLI
abso show 112 --json
JSON
/christopher/abso-core/versions/112?format=json

Read one actor head without projecting every agent draft

of shared·codex-capacity-chair··Not checked

Version 111 · Files at version 112

2 files, 30 lines added, 0 removed.

--- a/worker/project/project.ts
+++ b/worker/project/project.ts
@@ -2430,6 +2430,16 @@
24302430 return snapshotStatus(this.#snapshot);
24312431 }
24322432
2433+ /** The operation fence needs one actor's heads, not every agent's file projection. */
2434+ actorHead(name: string): { base: number; draftChanges: number; draft: string | null } | undefined {
2435+ const agent = this.#agents.get(name);
2436+ if (!agent) return undefined;
2437+ const published = this.#setOf(this.#spaceOf(agent));
2438+ let draftChanges = 0;
2439+ for (const id of agent.mine) if (!published.has(id)) draftChanges++;
2440+ return { base: agent.base, draftChanges, draft: agent.space === SHARED ? null : agent.space };
2441+ }
24332443 /** A space's contents at one of its versions. */
24342444 #at(space: Space, version: number): ReadonlySet<AtomId> {
24352445 return this.#membership.at(space, version);
--- a/worker/project/test/project-writer-storage.test.ts
+++ b/worker/project/test/project-writer-storage.test.ts
@@ -4,6 +4,7 @@
44import { SqlState } from "../../../src/engine/test/storage-helper.ts";
55import { MemoryStore, Project } from "../project.ts";
66import type { Entry, ProjectStore } from "../project-types.ts";
7+import { WriterAgents } from "../writer-agents.ts";
78
89function setup() {
910 const storage = new SqlState();
@@ -30,6 +31,25 @@
3031 };
3132}
3233
34+test("actor fence reads neither enumerate other agents nor project their files", (t) => {
35+ const { storage, entries, store } = setup();
36+ let project = new Project(store, { writerStorage: storage });
37+ storage.transaction(() => project.init({ "a.txt": "one\n" }, 0));
38+ storage.transaction(() => project.record("writer", { "a.txt": "ONE\n" }, 1));
39+ storage.transaction(() => project.record("other", { "a.txt": "OTHER\n" }, 2));
40+ const status = project.status().agents.find((agent) => agent.agent === "writer")!;
41+ project = Project.openWriter(store, storage, entries.length);
42+ t.mock.method(WriterAgents.prototype, "entries", () => {
43+ throw new Error("all-agent scan forbidden");
44+ });
45+ t.mock.method(Project.prototype, "status", () => {
46+ throw new Error("full status projection forbidden");
47+ });
48+ assert.deepEqual(project.actorHead("writer"), { base: status.base, draftChanges: status.draftChanges, draft: null });
49+ assert.equal(project.actorHead("absent"), undefined);
50+ storage.db.close();
51+});
3353test("actual Project record and publish use persistent graph, membership and positional indexes", (t) => {
3454 t.mock.method(Date, "now", () => 100);
3555 const { storage, entries, store } = setup();