{"version":181,"agent":"codex-capacity-chair","message":"Batch changed text toward the 16 MiB push limit. Preserve pending old text and binary files in intermediate commits, retain intended deletions and parent ancestry, and leave single oversized files unsplit. Review 56 cleared the two-file change; disk-first activation remains off.","time":1791976047265,"timeIso":"2026-10-14T11:07:27.265Z","changes":2,"change":2919,"files":["server/src/push.ts","server/test/push.test.ts"],"draft":null,"diff":[{"path":"server/src/push.ts","added":17,"removed":10,"diff":"--- a/server/src/push.ts\n+++ b/server/src/push.ts\n@@ -179,21 +179,16 @@\n \t// Each file goes into the tree as a blob with its mode (#27): 100755 for exec, 120000 for a link, whose blob is\n \t// its target.\n \tconst enc = new TextEncoder();\n-\tfor (const path of Object.keys(shared.files)) {\n-\t\tconst mode = shared.modes?.[path];\n-\t\tconst link = typeof mode?.link === \"string\" ? mode.link : null;\n-\t\tconst bytes = enc.encode(link ?? shared.files[path]!);\n-\t\tawait put(path, bytes, link !== null ? \"120000\" : mode?.exec ? \"100755\" : \"100644\", await blobOid(bytes));\n-\t}\n \tconst agent = shared.last?.agent ?? \"abso\";\n \tconst author = { name: agent, email: `${agent}@abso.invalid` };\n \tconst committer = { name: \"abso\", email: \"abso@abso.invalid\" };\n \tconst say = (p: string) => `${shared.last?.message ?? \"Start the project\"}${p}\\n\\nabso-version: ${shared.version}\\n`;\n \tlet parent = head;\n-\t// A part holds what's written so far, and the last push's entries for the binary files not reached yet.\n+\t// A part holds what's written so far and preserves old entries for files not reached yet.\n \tconst commitNow = async (message: string) => {\n \t\tconst files = new Map(now);\n-\t\tfor (const [path, f] of old.files) if (!files.has(path) && path in blobs) files.set(path, f);\n+\t\tfor (const [path, f] of old.files)\n+\t\t\tif (!files.has(path) && (path in blobs || path in shared.files)) files.set(path, f);\n \t\tconst tree = await writeTrees(fs, dir, files, old.trees, changed);\n \t\tparent = await git.commit({\n \t\t\tcache,\n@@ -208,12 +203,24 @@\n \t\t});\n \t\treturn parent;\n \t};\n-\t// Binary files (#27) aren't in files: their bytes come from the blob store.\n-\t// Artifacts refuses a push much over 20 MB, so when the new blobs add up\n+\t// Artifacts refuses a push much over 20 MB, so when new text or binary blobs add up\n \t// to more than PUSH_BATCH, the earlier ones go in commits of their own\n \t// first. Every part carries abso-version, so intake never takes them in.\n \tlet pending = 0;\n \tlet parts = 0;\n+\tfor (const path of Object.keys(shared.files)) {\n+\t\tconst mode = shared.modes?.[path];\n+\t\tconst link = typeof mode?.link === \"string\" ? mode.link : null;\n+\t\tconst bytes = enc.encode(link ?? shared.files[path]!);\n+\t\tconst oid = await blobOid(bytes);\n+\t\tconst fresh = old.files.get(path)?.oid !== oid;\n+\t\tif (fresh && pending > 0 && pending + bytes.byteLength > PUSH_BATCH) {\n+\t\t\tawait part(await commitNow(say(` (part ${++parts})`)));\n+\t\t\tpending = 0;\n+\t\t}\n+\t\tif (fresh) pending += bytes.byteLength;\n+\t\tawait put(path, bytes, link !== null ? \"120000\" : mode?.exec ? \"100755\" : \"100644\", oid);\n+\t}\n \tfor (const [path, sha] of Object.entries(blobs)) {\n \t\tconst bytes = readBlob(sha);\n \t\tif (!bytes) throw new Error(`${path}: blob ${sha} is missing from the project's store`);"},{"path":"server/test/push.test.ts","added":37,"removed":0,"diff":"--- a/server/test/push.test.ts\n+++ b/server/test/push.test.ts\n@@ -28,6 +28,43 @@\n });\n \n describe(\"commitShared\", () => {\n+\tit(\"batches changed text and preserves pending old files in intermediate commits\", async () => {\n+\t\tconst fs = new MemoryFS(),\n+\t\t\tdir = \"/repo\";\n+\t\tawait git.init({ fs, dir, defaultBranch: \"main\" });\n+\t\tconst first = await commitShared(\n+\t\t\tfs,\n+\t\t\tdir,\n+\t\t\tnull,\n+\t\t\t{ version: 0, files: { \"a.txt\": \"old a\", \"b.txt\": \"old b\", \"gone.txt\": \"delete\" } },\n+\t\t\t() => null,\n+\t\t);\n+\t\tconst parts: string[] = [];\n+\t\tconst body = \"x\".repeat(9 * 1024 * 1024);\n+\t\tconst next = await commitShared(\n+\t\t\tfs,\n+\t\t\tdir,\n+\t\t\tfirst.commit,\n+\t\t\t{ version: 1, files: { \"a.txt\": body, \"b.txt\": body + \"b\" } },\n+\t\t\t() => null,\n+\t\t\tasync (commit) => {\n+\t\t\t\tparts.push(commit);\n+\t\t\t\tassert.equal(\n+\t\t\t\t\tnew TextDecoder().decode((await git.readBlob({ fs, dir, oid: commit, filepath: \"b.txt\" })).blob),\n+\t\t\t\t\t\"old b\",\n+\t\t\t\t);\n+\t\t\t\tassert.equal((await git.readBlob({ fs, dir, oid: commit, filepath: \"a.txt\" })).blob.length, body.length);\n+\t\t\t\tawait assert.rejects(() => git.readBlob({ fs, dir, oid: commit, filepath: \"gone.txt\" }));\n+\t\t\t},\n+\t\t);\n+\t\tassert.equal(parts.length, 1);\n+\t\tassert.deepEqual((await git.readCommit({ fs, dir, oid: next.commit })).commit.parent, parts);\n+\t\tassert.equal(\n+\t\t\tnew TextDecoder().decode((await git.readBlob({ fs, dir, oid: next.commit, filepath: \"b.txt\" })).blob),\n+\t\t\tbody + \"b\",\n+\t\t);\n+\t\tassert.equal(absoVersion((await git.readCommit({ fs, dir, oid: parts[0]! })).commit.message), 1);\n+\t});\n \tit(\"reads one lazy file at a time and does not read symlink placeholder text\", async (t) => {\n \t\tconst fs = new MemoryFS();\n \t\tconst dir = \"/repo\";"}],"ci":null}