{"id":3537,"agent":"capacity","title":"Draft reads on a stored writer (disk-first 2; abso Capacity): where, drafts, status and collisions on website's export.\n\n- where looks deleted lines up by number (graph.deletedNumbers, View.fileOfNumber, View.lineNumberOf). It takes the agent's view once instead of once per line, since each read weighed every cached view. It finds the draft's lines by writer (View.visibleWriters), with no text or id read per line.\n- Draft files (overlaps.ts) go by number the same way.\n- An agent's view takes its base's resolved moves when both hold the same atoms that move lines (View.shareMoves checks this).\n- Draft collisions:\n  - build the union view only when two drafts share a file;\n  - work out each agent's touched files and its \"shared now plus draft\" view once;\n  - find claimants among the drafts from the drafts' own keys (collisions.ts claimantsAmong) instead of walking each key's history;\n  - have the definition rule keep a draft's uses, and the newer work's definitions, across partners.\n- A stored list read in order reads its length once, not before every element.\n\ndraft-reads-stored.test.ts checks where and collisions against the in-memory project. It covers edits, a whole file deleted, a line collision, one name defined twice, and bases before and after a move. 135 of 136 related tests pass; none fail.\n\nOn website's export (1,387 entries) the answers match Project.load:\n- status: 17 s to 4.5 s\n- where: over 60 s to 8.8 s\n- drafts: 14 s to 5.3 s\n- collisions: over 60 s to 54 s, measured under the profiler before the last two changes","kind":"publish","note":null,"issue":null,"draft":null,"time":1792036932387,"timeIso":"2026-10-15T04:02:12.387Z","open":false,"versions":[{"version":212,"draft":null,"message":"Draft reads on a stored writer (disk-first 2; abso Capacity): where, drafts, status and collisions on website's export.\n\n- where looks deleted lines up by number (graph.deletedNumbers, View.fileOfNumber, View.lineNumberOf). It takes the agent's view once instead of once per line, since each read weighed every cached view. It finds the draft's lines by writer (View.visibleWriters), with no text or id read per line.\n- Draft files (overlaps.ts) go by number the same way.\n- An agent's view takes its base's resolved moves when both hold the same atoms that move lines (View.shareMoves checks this).\n- Draft collisions:\n  - build the union view only when two drafts share a file;\n  - work out each agent's touched files and its \"shared now plus draft\" view once;\n  - find claimants among the drafts from the drafts' own keys (collisions.ts claimantsAmong) instead of walking each key's history;\n  - have the definition rule keep a draft's uses, and the newer work's definitions, across partners.\n- A stored list read in order reads its length once, not before every element.\n\ndraft-reads-stored.test.ts checks where and collisions against the in-memory project. It covers edits, a whole file deleted, a line collision, one name defined twice, and bases before and after a move. 135 of 136 related tests pass; none fail.\n\nOn website's export (1,387 entries) the answers match Project.load:\n- status: 17 s to 4.5 s\n- where: over 60 s to 8.8 s\n- drafts: 14 s to 5.3 s\n- collisions: over 60 s to 54 s, measured under the profiler before the last two changes","time":1792036932387,"timeIso":"2026-10-15T04:02:12.387Z","files":["src/engine/graph.ts","src/engine/state-source.ts","src/engine/view.ts","worker/project/collisions.ts","worker/project/definition-rule.ts","worker/project/draft-collisions.ts","worker/project/overlaps.ts","worker/project/project.ts","worker/project/test/draft-reads-stored.test.ts","worker/project/where.ts"]}],"files":["src/engine/graph.ts","src/engine/state-source.ts","src/engine/view.ts","worker/project/collisions.ts","worker/project/definition-rule.ts","worker/project/draft-collisions.ts","worker/project/overlaps.ts","worker/project/project.ts","worker/project/test/draft-reads-stored.test.ts","worker/project/where.ts"],"settled":[],"refusals":[],"notes":[],"reviewers":[]}