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
show on this site's /mcp
CLI
abso show 275 --json
JSON
/christopher/abso-core/versions/275?format=json

Definition code: setDefinitionCodeInMemory for tests (abso's kept-reader test puts a 100 KB file through scratch, as before the 4 MB limit), and 274's test formatted as Biome wants (274's check failed on it).

of shared·capacity··Not checked

Version 274 · Files at version 275

2 files, 16 lines added, 7 removed.

--- a/worker/project/definition-code.ts
+++ b/worker/project/definition-code.ts
@@ -9,12 +9,24 @@
99 */
1010export const DEFINITION_CODE_IN_MEMORY = 4_000_000;
1111
12+let inMemoryLimit = DEFINITION_CODE_IN_MEMORY;
14+/**
15+ * Tests only: the in-memory limit for every later call, so a small file takes the scratch path (abso's kept-reader
16+ * test checks scratch is let go). Answers the limit it replaces, to put back.
17+ */
18+export function setDefinitionCodeInMemory(limit: number): number {
19+ const before = inMemoryLimit;
20+ inMemoryLimit = limit;
21+ return before;
22+}
1224/** Parsed code is temporary derived data, discarded with the scratch transaction. */
1325export function withDefinitionCode<T>(
1426 view: ReadView,
1527 visible: readonly VisibleLine[],
1628 operation: (code: readonly string[]) => T,
17− inMemory = DEFINITION_CODE_IN_MEMORY,
29+ inMemory = inMemoryLimit,
1830): T {
1931 function* source() {
2032 for (const line of visible) yield line.text;
--- a/worker/project/test/definition-code.test.ts
+++ b/worker/project/test/definition-code.test.ts
@@ -44,8 +44,8 @@
4444 view.buildLines("f.ts"),
4545 (code) => {
4646 escaped = code;
47− assert.deepEqual(code.slice(0, 4), expected.slice(0, 4));
48− for (let i = code.length - 1; i >= 0; i--) assert.equal(code[i], expected[i]);
47+ assert.deepEqual(code.slice(0, 4), expected.slice(0, 4));
48+ for (let i = code.length - 1; i >= 0; i--) assert.equal(code[i], expected[i]);
4949 for (let i = 0; i < code.length; i++) assert.equal(code[i], expected[i]);
5050 },
5151 65536,
@@ -56,9 +56,6 @@
5656 assert.deepEqual(definedTwice(view, "f.ts"), definedTwice(new View(memory, ["a0"]), "f.ts"));
5757 assert.deepEqual(rows(), before);
5858 storage.failWrite = storage.writes + 2;
59− assert.throws(
60− () => withDefinitionCode(view, view.buildLines("f.ts"), () => [], 65536),
61− /injected storage failure/,
62− );
59+ assert.throws(() => withDefinitionCode(view, view.buildLines("f.ts"), () => [], 65536), /injected storage failure/);
6360 assert.deepEqual(rows(), before);
6461});