{"version":236,"agent":"capacity","message":"Fix 235's wrong draft diff: a draft view's shared files count everything it holds beyond its base (disk-first 2; abso Capacity).\n\nDisk-first Testing found a wrong answer on typescript-rs with 235: diff for cloud-ts-01 showed lib.rs and passes.rs before cloud-ts-01's own version 326. The diff's before view is cloud-ts-01's base (293) plus three of its atoms that touch only reports/cloud-ts-01.md. A view's set is closed under dependencies, so it also holds atoms those three depend on that 293 lacks, including the ones that added passes.rs and rewrote lib.rs. 235 counted only the draft's own atoms as touched, so it took those two files from version 293.\n\nThe files a draft's view can't take from its base are now worked out over everything the view holds beyond the base: the draft, plus whatever it depends on that the base lacks. Sharing is still off when any of those moves lines.\n\nCheck: on typescript-rs adopted fresh, diff for cloud-ts-01 differs from replay on 235's code and matches with this. The unit tests do not reproduce this state; the export comparison does. Named tests: every worker/project test (338 of 338) and every engine test; tsc and biome clean.","time":1792064861376,"timeIso":"2026-10-15T11:47:41.376Z","changes":1,"change":3690,"files":["worker/project/project.ts"],"draft":null,"diff":[{"path":"worker/project/project.ts","added":17,"removed":6,"diff":"--- a/worker/project/project.ts\n+++ b/worker/project/project.ts\n@@ -2744,13 +2744,24 @@\n \t\t\tconst base = this.#viewAt(this.#spaceOf(agent), agent.base);\n \t\t\tif (base instanceof View) {\n \t\t\t\tview.shareMoves(base);\n-\t\t\t\t// And its layout of every file the draft doesn't touch, when the draft moves nothing (abso Capacity).\n+\t\t\t\t// And its layout of every file the draft doesn't touch, when the draft moves nothing (abso Capacity). What the\n+\t\t\t\t// view holds beyond its base is the draft and whatever the draft depends on that the base lacks (the view's\n+\t\t\t\t// set is closed): each of those can change a file, so all of them count.\n \t\t\t\tconst mine = agent.mine;\n-\t\t\t\tview.shareFiles(base, () =>\n-\t\t\t\t\tmine.some((id) => (this.#graph.atom(id).moves?.length ?? 0) > 0)\n-\t\t\t\t\t\t? undefined\n-\t\t\t\t\t\t: this.#touchedFiles(mine, [base, view]),\n-\t\t\t\t);\n+\t\t\t\tview.shareFiles(base, () => {\n+\t\t\t\t\tconst graph = this.#graph;\n+\t\t\t\t\tconst below = base.set;\n+\t\t\t\t\tconst beyond = new Set<AtomId>();\n+\t\t\t\t\tconst stack = [...mine];\n+\t\t\t\t\twhile (stack.length) {\n+\t\t\t\t\t\tconst id = stack.pop()!;\n+\t\t\t\t\t\tif (beyond.has(id) || below.has(id)) continue;\n+\t\t\t\t\t\tbeyond.add(id);\n+\t\t\t\t\t\tfor (const dep of graph.atom(id).deps) if (!beyond.has(dep) && !below.has(dep)) stack.push(dep);\n+\t\t\t\t\t}\n+\t\t\t\t\tfor (const id of beyond) if ((graph.atom(id).moves?.length ?? 0) > 0) return undefined;\n+\t\t\t\t\treturn this.#touchedFiles(beyond, [base, view]);\n+\t\t\t\t});\n \t\t\t}\n \t\t}\n \t\treturn view;"}],"ci":null}