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 261 to 262

Compare

+33 −1 in 2 places
Lines 1–4 at 262 (were 1–4 at 261)
1−import { type GraphStateStorage, StoredMap } from "../../src/engine/state-source.ts";
1+import { type GraphStateStorage, StoredMap, storedArray } from "../../src/engine/state-source.ts";
22import type { AgentState } from "./project-types.ts";
33
44type StoredAgent = Omit<AgentState, "told" | "parked"> & {
Lines 205–240 at 262 (were 205–208 at 261)
205205 for (const [key, value] of this.#touched) super.set(key, value);
206206 this.#touched.clear();
207207 }
209+ /**
210+ * Move up to `limit` more agents' old told lists into their buckets (abso Capacity, issue 664; Agent VCS's go): a
211+ * cursor walks the agents in the order they joined, once, a few rows at each write, so a project adopted before the
212+ * buckets moves every row over without a separate step. Rows written since are in the new form already, and an
213+ * agent read in between answers the same (StoredTold.listed). Returns how many rows it rewrote.
214+ */
215+ moveOldTold(limit: number): number {
216+ const done = (this.#storage.read(TOLD_META, "cursor") as number | undefined) ?? 0;
217+ const order = this.#order();
218+ if (done >= order.length) return 0;
219+ let at = done;
220+ let moved = 0;
221+ for (; at < order.length && at < done + limit; at++) {
222+ const key = order[at]!;
223+ if (this.#touched.has(key)) continue; // written with this operation: its row is new already
224+ const agent = super.get(key);
225+ if (!(agent?.told instanceof StoredTold) || agent.told.listed.size === 0) continue;
226+ super.set(key, agent);
227+ moved++;
228+ }
229+ this.#storage.write(TOLD_META, "cursor", at);
230+ return moved;
231+ }
233+ /** The agents' keys in the order they joined (StoredMap's slots, a removed agent's included: it reads as absent). */
234+ #order(): readonly string[] {
235+ return storedArray<string>(this.#storage, "project:agents:order");
236+ }
208237}
239+/** Where the move of old told lists into buckets has got to (WriterAgents.moveOldTold). */
240+const TOLD_META = "project:agents:told:meta";
MCP
compare on this site's /mcp
CLI
abso diff 261 262 worker/project/writer-agents.ts --json
JSON
/christopher/abso-core/compare/261..262?file=worker%2Fproject%2Fwriter-agents.ts&format=json