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

+24 −0 in 1 place
Lines 1–34 at 117 (were 1–10 at 116)
11import assert from "node:assert/strict";
22import { test } from "node:test";
33import { buildBase, Graph, View } from "../../../src/engine/index.ts";
4+import { StableOverlaySet } from "../../../src/engine/state-source.ts";
5+import type { AtomId } from "../../../src/engine/types.ts";
46import { ViewCache } from "../views.ts";
57
68const VIEW_BUDGET = 24_000_000;
79
10+test("indexed view cache keys never enumerate membership and remain bounded by eviction", () => {
11+ class Counted extends StableOverlaySet<AtomId> {
12+ iterations = 0;
13+ override values(): SetIterator<AtomId> {
14+ this.iterations++;
15+ return super.values();
16+ }
17+ }
18+ const graph = new Graph();
19+ graph.add(buildBase({ "a.txt": "one\n" }, { author: "test", message: "base" }));
20+ const cache = new ViewCache(graph);
21+ const set = new Counted(["a0"]);
22+ const view = cache.view(set);
23+ assert.equal(set.iterations, 1, "only View closure validation enumerates membership");
24+ assert.equal(cache.view(set), view);
25+ assert.equal(set.iterations, 1, "cache hit must not construct a full-history key");
26+ assert.equal(view.text("a.txt"), "one\n");
27+ for (let i = 0; i < 33; i++) cache.view(new Counted(["a0"]));
28+ assert.notEqual(cache.view(set), view, "indexed identities obey the same cache eviction limit");
29+ assert.equal(set.iterations, 2);
30+});
832type WeightControls = {
933 setIncomingWeights(values: number[]): void;
1034 setWeight(view: View, weight: number): void;
MCP
compare on this site's /mcp
CLI
abso diff 116 117 worker/project/test/view-cache.test.ts --json
JSON
/christopher/abso-core/compare/116..117?file=worker%2Fproject%2Ftest%2Fview-cache.test.ts&format=json