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 142 to 143

Compare

+16 −4 in 4 places
Lines 2–8 at 143 (were 2–8 at 142)
22// versions never change, so their views are kept by name. Immutable indexed sets use their identity;
33// ordinary in-memory sets use their exact contents.
44
5−import { type AtomId, type Graph, View } from "../../src/engine/index.ts";
5+import { type AtomId, type Graph, type ReadView, View } from "../../src/engine/index.ts";
66import { StableSet } from "../../src/engine/state-source.ts";
77
88/**
Lines 12–35 at 143 (were 12–25 at 142)
1212 */
1313const VIEW_BUDGET = 24_000_000;
1414
15+/** Internal opt-in. The owner validates identity and lifetime on every returned reader. */
16+export interface ReadViewProvider {
17+ keyed(key: string): ReadView;
18+}
1520/** Views by key, most recently used last, held under VIEW_BUDGET bytes and 32 views. */
1621export class ViewCache {
1722 readonly #graph: Graph;
23+ readonly #provider?: ReadViewProvider;
1824 readonly #cache = new Map<string | StableSet<AtomId>, View>();
1925
20− constructor(graph: Graph) {
26+ constructor(graph: Graph, provider?: (graph: Graph) => ReadViewProvider) {
2127 this.#graph = graph;
28+ this.#provider = provider?.(graph);
2229 }
30+ assertUnkeyedAllowed(): void {
31+ if (this.#provider) throw Error("unsupported unkeyed projection membership");
32+ }
2333
2434 /**
2535 * Keep the cached views under VIEW_BUDGET bytes (the website project, #43,
Lines 47–54 at 143 (were 37–43 at 142)
3747 }
3848
3949 /** Indexed snapshots use identity; ordinary sets use their exact contents. */
40− view(set: ReadonlySet<AtomId>): View {
50+ view(set: ReadonlySet<AtomId>): ReadView {
51+ this.assertUnkeyedAllowed();
4152 // Immutable indexed membership is already a stable identity. Building
4253 // a sorted history-sized key defeats its external-storage contract.
4354 if (set instanceof StableSet) return this.#get(set, () => set);
Lines 60–67 at 143 (were 49–55 at 142)
4960 }
5061
5162 /** A view cached under `key`, made from `set()` when it isn't there. */
52− keyed(key: string, set: () => ReadonlySet<AtomId>): View {
63+ keyed(key: string, set: () => ReadonlySet<AtomId>): ReadView {
64+ if (this.#provider) return this.#provider.keyed(key);
5365 return this.#get(key, set);
5466 }
5567
MCP
compare on this site's /mcp
CLI
abso diff 142 143 worker/project/views.ts --json
JSON
/christopher/abso-core/compare/142..143?file=worker%2Fproject%2Fviews.ts&format=json