{"version":233,"agent":"capacity","message":"A view's blobs come from file attributes alone (disk-first 2; abso Capacity).\n\nEngineProject.shared() lists shared's binary files on every call, and the Worker reads shared().version before and after most operations. View.blobs went through paths(), which lays out every file in the set to see whether it exists. On abso's export with a fresh writer, that was about 15 s on the first call.\n\nA file with a blob attribute exists, so blobs now reads each candidate path's attributes (the packed attribute history) and lays nothing out. Same files, same order.\n\nOn abso adopted fresh: the harness's first read (status, shared, paths) went from about 20 s to 3 s.\n\nNew test blobs-stored: a file binary from the start, one that turns binary and back to text, and one deleted; a stored writer's blob list matches the in-memory project's at every version and in each agent's draft. Named tests: every engine test (288 of 288), blobs-stored, blobs, attributes, project-file, files-reads, draft-reads-stored, authors-stored, project, version-files (46 of 46); tsc and biome clean.","time":1792057743326,"timeIso":"2026-10-15T09:49:03.326Z","changes":2,"change":3669,"files":["src/engine/view.ts","worker/project/test/blobs-stored.test.ts"],"draft":null,"diff":[{"path":"src/engine/view.ts","added":5,"removed":2,"diff":"--- a/src/engine/view.ts\n+++ b/src/engine/view.ts\n@@ -1042,9 +1042,12 @@\n \n \t/** Binary files, path -> the SHA-256 of their bytes, in path order. */\n \tblobs(): Record<string, string> {\n+\t\t// From attributes alone (abso Capacity): a file with a blob exists, so no file is laid out to find them. Going\n+\t\t// through paths() laid out every file in the set, and shared() asks for blobs on every call.\n \t\tconst out: Record<string, string> = {};\n-\t\tfor (const path of this.paths()) {\n-\t\t\tconst blob = this.#file(path).attrs.blob;\n+\t\tconst candidates = this.#stable ? [...this.graph.knownFiles()].sort() : this.#known;\n+\t\tfor (const path of candidates) {\n+\t\t\tconst blob = this.attrs(path).blob;\n \t\t\tif (blob !== null) out[path] = blob;\n \t\t}\n \t\treturn out;"},{"path":"worker/project/test/blobs-stored.test.ts","added":53,"removed":0,"diff":"--- /dev/null\n+++ b/worker/project/test/blobs-stored.test.ts\n@@ -0,0 +1,53 @@\n+// Binary files on a writer-backed project (abso Capacity, View.blobs): the blob list is read from file attributes\n+// alone, with no file laid out. It must answer as the in-memory project does: a file binary from the start, one that\n+// turns binary and back to text, and one deleted, at every version and in each agent's draft.\n+\n+import assert from \"node:assert/strict\";\n+import { test } from \"node:test\";\n+import { storedArray } from \"../../../src/engine/state-source.ts\";\n+import { SqlState } from \"../../../src/engine/test/storage-helper.ts\";\n+import { MemoryStore, Project } from \"../project.ts\";\n+import type { Entry, ProjectStore } from \"../project-types.ts\";\n+\n+const A = \"a\".repeat(64);\n+const B = \"b\".repeat(64);\n+const C = \"c\".repeat(64);\n+const held = (sha: string) => [A, B, C].includes(sha);\n+\n+function writer() {\n+\tconst storage = new SqlState();\n+\tconst entries = storedArray<Entry>(storage, \"canonical-log\");\n+\tconst store: ProjectStore = {\n+\t\tappend(batch) {\n+\t\t\tfor (const entry of batch) entries.push(entry);\n+\t\t},\n+\t};\n+\treturn new Project(store, { writerStorage: storage, hasBlob: held });\n+}\n+\n+function history(project: Project) {\n+\tproject.init({ \"README.md\": \"hi\\n\", \"notes.txt\": \"notes\\n\" }, 0, {}, { \"logo.png\": A, \"old.bin\": B });\n+\tproject.sync(\"ann\");\n+\tproject.sync(\"bob\");\n+\tproject.record(\"ann\", { \"old.bin\": null }, 1, {}, { \"logo.png\": B, \"README.md\": C });\n+\tassert.equal(project.publish(\"ann\", \"README turns binary, old.bin goes\", 2).ok, true);\n+\tproject.sync(\"bob\");\n+\tproject.record(\"bob\", { \"README.md\": \"text again\\n\" }, 3);\n+\tassert.equal(project.publish(\"bob\", \"README is text again\", 4).ok, true);\n+\tproject.sync(\"cy\");\n+\tproject.record(\"cy\", {}, 5, {}, { \"icon.png\": C });\n+}\n+\n+test(\"a stored writer's blob list matches the in-memory project's at every version and draft\", () => {\n+\tconst oracle = new Project(new MemoryStore(), { hasBlob: held });\n+\tconst project = writer();\n+\thistory(oracle);\n+\thistory(project);\n+\tassert.deepEqual(oracle.blobs(), { \"logo.png\": B });\n+\tassert.deepEqual(project.blobs(), oracle.blobs());\n+\tfor (let v = 0; v <= oracle.version; v++)\n+\t\tassert.deepEqual(project.viewAt(v).blobs(), oracle.viewAt(v).blobs(), `version ${v}`);\n+\tfor (const agent of [\"ann\", \"bob\", \"cy\"])\n+\t\tassert.deepEqual(project.draftOf(agent)?.view.blobs(), oracle.draftOf(agent)?.view.blobs(), agent);\n+\tassert.deepEqual(oracle.draftOf(\"cy\")?.view.blobs(), { \"icon.png\": C, \"logo.png\": B });\n+});"}],"ci":null}