{"version":275,"agent":"capacity","message":"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).","time":1792103844377,"timeIso":"2026-10-15T22:37:24.377Z","changes":2,"change":4143,"files":["worker/project/definition-code.ts","worker/project/test/definition-code.test.ts"],"draft":null,"diff":[{"path":"worker/project/definition-code.ts","added":13,"removed":1,"diff":"--- a/worker/project/definition-code.ts\n+++ b/worker/project/definition-code.ts\n@@ -9,12 +9,24 @@\n  */\n export const DEFINITION_CODE_IN_MEMORY = 4_000_000;\n \n+let inMemoryLimit = DEFINITION_CODE_IN_MEMORY;\n+\n+/**\n+ * Tests only: the in-memory limit for every later call, so a small file takes the scratch path (abso's kept-reader\n+ * test checks scratch is let go). Answers the limit it replaces, to put back.\n+ */\n+export function setDefinitionCodeInMemory(limit: number): number {\n+\tconst before = inMemoryLimit;\n+\tinMemoryLimit = limit;\n+\treturn before;\n+}\n+\n /** Parsed code is temporary derived data, discarded with the scratch transaction. */\n export function withDefinitionCode<T>(\n \tview: ReadView,\n \tvisible: readonly VisibleLine[],\n \toperation: (code: readonly string[]) => T,\n-\tinMemory = DEFINITION_CODE_IN_MEMORY,\n+\tinMemory = inMemoryLimit,\n ): T {\n \tfunction* source() {\n \t\tfor (const line of visible) yield line.text;"},{"path":"worker/project/test/definition-code.test.ts","added":3,"removed":6,"diff":"--- a/worker/project/test/definition-code.test.ts\n+++ b/worker/project/test/definition-code.test.ts\n@@ -44,8 +44,8 @@\n \t\tview.buildLines(\"f.ts\"),\n \t\t(code) => {\n \t\t\tescaped = code;\n-\t\tassert.deepEqual(code.slice(0, 4), expected.slice(0, 4));\n-\t\tfor (let i = code.length - 1; i >= 0; i--) assert.equal(code[i], expected[i]);\n+\t\t\tassert.deepEqual(code.slice(0, 4), expected.slice(0, 4));\n+\t\t\tfor (let i = code.length - 1; i >= 0; i--) assert.equal(code[i], expected[i]);\n \t\t\tfor (let i = 0; i < code.length; i++) assert.equal(code[i], expected[i]);\n \t\t},\n \t\t65536,\n@@ -56,9 +56,6 @@\n \tassert.deepEqual(definedTwice(view, \"f.ts\"), definedTwice(new View(memory, [\"a0\"]), \"f.ts\"));\n \tassert.deepEqual(rows(), before);\n \tstorage.failWrite = storage.writes + 2;\n-\tassert.throws(\n-\t\t() => withDefinitionCode(view, view.buildLines(\"f.ts\"), () => [], 65536),\n-\t\t/injected storage failure/,\n-\t);\n+\tassert.throws(() => withDefinitionCode(view, view.buildLines(\"f.ts\"), () => [], 65536), /injected storage failure/);\n \tassert.deepEqual(rows(), before);\n });"}],"ci":null}