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 116 to 117

Compare

+12 −3 in 4 places
Lines 1–9 at 117 (were 1–7 at 116)
11// The views a project lays out from sets of atoms, cached under a byte budget (#46, disk-first 1). Published
2−// versions never change, so their views are kept by name; any other set is kept by its exact contents.
2+// versions never change, so their views are kept by name. Immutable indexed sets use their identity;
3+// ordinary in-memory sets use their exact contents.
34
45import { type AtomId, type Graph, View } from "../../src/engine/index.ts";
6+import { StableSet } from "../../src/engine/state-source.ts";
57
68/**
79 * About how many bytes the cached views may hold together (#46). A laid-out
Lines 15–21 at 117 (were 13–19 at 116)
1315/** Views by key, most recently used last, held under VIEW_BUDGET bytes and 32 views. */
1416export class ViewCache {
1517 readonly #graph: Graph;
16− readonly #cache = new Map<string, View>();
18+ readonly #cache = new Map<string | StableSet<AtomId>, View>();
1719
1820 constructor(graph: Graph) {
1921 this.#graph = graph;
Lines 36–46 at 117 (were 34–41 at 116)
3436 }
3537 }
3638
37− /** A view of a set, cached by the set's exact contents. */
39+ /** Indexed snapshots use identity; ordinary sets use their exact contents. */
3840 view(set: ReadonlySet<AtomId>): View {
41+ // Immutable indexed membership is already a stable identity. Building
42+ // a sorted history-sized key defeats its external-storage contract.
43+ if (set instanceof StableSet) return this.#get(set, () => set);
3944 const key = [...set]
4045 .map((id) => this.#graph.atom(id).seq)
4146 .sort((a, b) => a - b)
Lines 50–59 at 117 (were 45–50 at 116)
4550
4651 /** A view cached under `key`, made from `set()` when it isn't there. */
4752 keyed(key: string, set: () => ReadonlySet<AtomId>): View {
53+ return this.#get(key, set);
54+ }
56+ #get(key: string | StableSet<AtomId>, set: () => ReadonlySet<AtomId>): View {
4857 let view = this.#cache.get(key);
4958 if (view) {
5059 // Most recently used last, so eviction takes the oldest.
MCP
compare on this site's /mcp
CLI
abso diff 116 117 worker/project/views.ts --json
JSON
/christopher/abso-core/compare/116..117?file=worker%2Fproject%2Fviews.ts&format=json