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 54 to 55

Compare

+23 −5 in 4 places
Lines 225–232 at 55 (were 225–230 at 54)
225225 readonly #graph: Graph;
226226 /** Views laid out from atom sets, cached under a byte budget (views.ts). */
227227 readonly #views: ViewCache;
228+ /** Each agent's draft files, under the key they were worked out for (#draftFiles). */
229+ readonly #draftFilesKept = new Map<string, { key: string; files: Set<string> }>();
228230 /** Each version's files and each path's history (pathindex.ts). */
229231 readonly #paths: PathIndex;
230232 /** For each atom (by seq) that wrote lines, the log position of the entry that recorded it (#46). */
Lines 994–1013 at 55 (were 992–1000 at 54)
992994 }
993995 }
994996
995− /** The files the agent's unpublished changes touch, in its own view. */
996− #draftFiles(...args: Tail<Parameters<typeof hostedDraftFiles>>): ReturnType<typeof hostedDraftFiles> {
997− return hostedDraftFiles(this.#overlapHost, ...args);
997+ /**
998+ * The files the agent's unpublished changes touch, in its own view. Kept per agent under what they're
999+ * made of (abso-core issue 6): its view's key and its draft. Most agents haven't moved since the last
1000+ * status, and the view cache holds fewer views than a big project has agents, so working them out again
1001+ * on every call cost about 0.5 s on abso. A copy goes out, so no caller can change what's kept.
1002+ */
1003+ #draftFiles(agent: AgentState): Set<string> {
1004+ const key = `${this.#agentViewKey(agent)}|${this.#draft(agent).join(",")}`;
1005+ let kept = this.#draftFilesKept.get(agent.name);
1006+ if (kept?.key !== key) {
1007+ kept = { key, files: hostedDraftFiles(this.#overlapHost, agent) };
1008+ this.#draftFilesKept.set(agent.name, kept);
1009+ }
1010+ return new Set(kept.files);
9981011 }
9991012
10001013 /** Other agents in the agent's space whose unpublished changes or starting note meet `patterns`. */
Lines 2041–2047 at 55 (were 2028–2033 at 54)
20282041 agents: this.#agents,
20292042 agentView: (agent) => this.#agentView(agent),
20302043 draft: (agent) => this.#draft(agent),
2044+ draftFiles: (agent) => this.#draftFiles(agent),
20312045 liveNote: (agent) => this.#liveNote(agent),
20322046 queueNews: (agent, items, entries) => this.#queueNews(agent, items, entries),
20332047 };
Lines 2231–2244 at 55 (were 2217–2226 at 54)
22172231 }
22182232
22192233 #agentView(agent: AgentState): View {
2220− // Keyed by what the set is made of, not by sorting every atom in it (#46): that cost more than the work.
2221− return this.#viewKeyed(`a ${agent.space}@${agent.base}+${agent.mine.join(",")}`, () => this.#agentSet(agent));
2234+ return this.#viewKeyed(this.#agentViewKey(agent), () => this.#agentSet(agent));
22222235 }
22232236
2237+ /** An agent's view, keyed by what the set is made of, not by sorting every atom in it (#46): that cost more than the work. */
2238+ #agentViewKey(agent: AgentState): string {
2239+ return `a ${agent.space}@${agent.base}+${agent.mine.join(",")}`;
2240+ }
22242242 /** A space at a version: published versions never change, so the key is just their names (#46). */
22252243 #viewAt(space: Space, version: number): View {
22262244 return this.#viewKeyed(`v ${space.name}@${version}`, () => this.#at(space, version));
MCP
compare on this site's /mcp
CLI
abso diff 54 55 worker/project/project.ts --json
JSON
/christopher/abso-core/compare/54..55?file=worker%2Fproject%2Fproject.ts&format=json