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 258 to 318

Compare

+12 −16 in 5 places
Lines 41–47 at 318 (were 41–59 at 258)
4141 * all the news it was told: 4.3 MB for abso's 109 agents) otherwise push every small page out of the cache.
4242 */
4343 readonly #maxEntryBytes: number;
44− /**
45− * Collections read straight through, never kept (abso Capacity): a file's packed line pages are read only to lay the
46− * file out, and the view keeps the layout, so keeping the pages too held them twice and pushed out the small rows
47− * read on every call (an agent's tree re-read 3,500 of them each time).
48− */
49− readonly #passThrough: (collection: string) => boolean;
50− constructor(
51− source: GraphStateStorage,
52− maxBytes = 1_048_576,
53− maxEntries = 4096,
54− maxEntryBytes = maxBytes,
55− passThrough: (collection: string) => boolean = () => false,
56− ) {
44+ constructor(source: GraphStateStorage, maxBytes = 1_048_576, maxEntries = 4096, maxEntryBytes = maxBytes) {
5745 if (
5846 !Number.isSafeInteger(maxBytes) ||
5947 maxBytes < 0 ||
Lines 55–60 at 318 (were 67–73 at 258)
6755 this.#maxBytes = maxBytes;
6856 this.#maxEntries = maxEntries;
6957 this.#maxEntryBytes = Math.min(maxEntryBytes, maxBytes);
70− this.#passThrough = passThrough;
7158 }
7259 get retainedBytes(): number {
7360 return this.#bytes;
Lines 74–79 at 318 (were 87–93 at 258)
8774 }
8875 }
8976 read(collection: string, key: string): unknown {
90− if (this.#passThrough(collection)) return this.#source.read(collection, key);
9177 const cacheKey = JSON.stringify([collection, key]);
9278 const hit = this.#cache.get(cacheKey);
9379 if (hit) {
Lines 348–356 at 318 (were 362–368 at 258)
362348 return new Proxy([] as T[], {
363349 get(target, key, receiver) {
364350 if (key === "length") return length();
365− if (indexKey(key)) return Number(key) < length() ? read(key) : undefined;
351+ // No length read first (abso Capacity): set writes the row and the length together and nothing shrinks, so no
352+ // row lies past the length. Half of a cold layout's reads were this length.
353+ if (indexKey(key)) return read(key);
366354 return Reflect.get(target, key, receiver);
367355 },
368356 set(_target, key, value) {
Lines 421–434 at 318 (were 433–438 at 258)
433421 }
434422 for (const [key] of storage.entries(`${name}:lengths`)) yield key;
435423 },
424+ /** Values [index * PAGE, (index + 1) * PAGE) of `key`'s list: one page, not the whole list (abso Capacity). */
425+ pageAt(key: string, index: number): readonly V[] {
426+ const count = length(key);
427+ const values = page(key, index);
428+ if (values.length !== Math.min(pageSize, count - index * pageSize))
429+ throw new Error(`incomplete writer list page in ${name}`);
430+ return values;
431+ },
436432 *values(key: string): IterableIterator<V> {
437433 const count = length(key);
438434 for (let start = 0; start < count; start += pageSize) {
MCP
compare on this site's /mcp
CLI
abso diff 258 318 src/engine/state-source.ts --json
JSON
/christopher/abso-core/compare/258..318?file=src%2Fengine%2Fstate-source.ts&format=json