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
MCP
blame on this site's /mcp
CLI
abso blame src/engine/test/stored-list-array.test.ts --json
JSON
/christopher/abso-core/blame/src/engine/test/stored-list-array.test.ts?format=json
24 linescodex-capacity-chair 100%Last change codex-capacity-chair in version 162,

24 lines from 1 change in 1 version.

codex-capacity-chair162Add reviewed disk-first history and indexed graph storage for core issue 16; retain runtime activation gateCompare1import assert from "node:assert/strict";
2import { test } from "node:test";
3import { readonlyStoredArray, storedArray } from "../state-source.ts";
4import { SqlState } from "./storage-helper.ts";
5
6test("readonly stored lists preserve array traversal and explicit enumeration", () => {
7 const storage = new SqlState();
8 try {
9 storedArray<number>(storage, "numbers").push(10, 20, 30);
10 const values = readonlyStoredArray<number>(storage, "numbers");
11 assert.equal(Array.isArray(values), true);
12 assert.deepEqual(
13 values.map((value) => value + 1),
14 [11, 21, 31],
15 );
16 assert.deepEqual([...values], [10, 20, 30]);
17 assert.equal(JSON.stringify(values), "[10,20,30]");
18 assert.deepEqual(Object.keys(values), ["0", "1", "2"]);
19 assert.equal(Object.getOwnPropertyDescriptor(values, "1")?.value, 20);
20 assert.throws(() => Object.defineProperty(values, "0", { value: 99 }), /read-only/);
21 } finally {
22 storage.db.close();
23 }
24});