{"version":216,"agent":"capacity","message":"Moves picked as walks reach them, and shared's file list from kept shapes (disk-first 2; abso Capacity), for abso's status, drafts and file list.\n\n- view.ts: a view picks a moved line's relocation only when a walk to find a line's file reaches that line. That is #relocations' own pick, right whenever the walk goes on to a file's start, since only lines on a loop have their relocation set aside; a walk that comes back to a line it passed resolves every move as before. shareMoves now takes the other view's moves only when this view first needs all of them, such as for a layout, so a view that only finds a few lines' files never resolves them. weight() counts the picks.\n- pathindex.ts keptPaths: shared's files at a version, folded from version 0 over each version's kept files made and taken out, with no file laid out. Only on a stored writer, and only when every version up to it has a kept row that describes it; otherwise the version is laid out as before. pathsAt uses it.\n\nOn abso's export (81,855 entries, 1,224 versions), one opened project, answers matching Project.load:\n- status: 104 s to 5.8 s (under the profiler)\n- drafts: over 60 s to 5.7 s\n- files at head: over 60 s to 1.2 s\n- files at 612: 54 s to 0.3 s\n\nversion-files.test.ts now also checks the file list at every version against the in-memory project. 124 of 124 related tests pass; tsc clean.","time":1792040841430,"timeIso":"2026-10-15T05:07:21.430Z","changes":5,"change":3561,"files":["src/engine/view.ts","worker/project/pathindex.ts","worker/project/project-status.ts","worker/project/project.ts","worker/project/test/version-files.test.ts"],"draft":null,"diff":[{"path":"src/engine/view.ts","added":55,"removed":5,"diff":"--- a/src/engine/view.ts\n+++ b/src/engine/view.ts\n@@ -295,6 +295,8 @@\n \t */\n \t#relocations(): Map<LineId, RelocationInfo> {\n \t\tif (this.#relocs) return this.#relocs;\n+\t\tthis.#takeShared();\n+\t\tif (this.#relocs) return this.#relocs;\n \t\tconst graph = this.graph;\n \t\tconst skeleton = skeletonOf(graph);\n \t\tconst stronger = (a: RelocationInfo, b: RelocationInfo): boolean => graph.comparePriority(a.atom, b.atom) > 0;\n@@ -365,13 +367,25 @@\n \t\treturn this.#relocs;\n \t}\n \n+\t/** The view whose moves this one may take, until it needs them all; then the view it took them from. */\n+\t#movesFrom: View | undefined;\n+\t#movesTaken: View | undefined;\n+\n \t/**\n \t * Take another view's resolved moves (abso Capacity), when both sets hold the very same atoms that move lines: the\n-\t * moves then resolve the same, and every line sits where it sits there. Checked here, so any caller may ask.\n+\t * moves then resolve the same, and every line sits where it sits there. Checked when this view first needs all its\n+\t * moves, so any caller may ask, and a view that only finds a few lines' files never resolves them.\n \t */\n \tshareMoves(from: View): void {\n-\t\tif (from.graph !== this.graph || from.#hasMoves !== this.#hasMoves || !this.#hasMoves) return;\n-\t\tif (this.#relocs || from.#scratchMoves()) return;\n+\t\tif (from.graph !== this.graph || from.#hasMoves !== this.#hasMoves || !this.#hasMoves || this.#relocs) return;\n+\t\tthis.#movesFrom = from;\n+\t}\n+\n+\t#takeShared(): void {\n+\t\tconst from = this.#movesFrom;\n+\t\tif (!from) return;\n+\t\tthis.#movesFrom = undefined;\n+\t\tif (from.#scratchMoves()) return;\n \t\tfor (const id of this.graph.movers()) {\n \t\t\tconst seq = seqOf(id);\n \t\t\tif (this.#has(seq) !== from.#has(seq)) return;\n@@ -379,9 +393,29 @@\n \t\tthis.#relocs = from.#relocations();\n \t\tthis.#relocsN = from.#relocationsN();\n \t\tthis.#movesOnDisk = false;\n-\t\tthis.#movedFrom = from.#movedInFrom();\n+\t\tthis.#movesTaken = from;\n \t}\n \n+\t/** Moved lines' relocations picked one at a time, before the view resolves them all (null: not moved here). */\n+\treadonly #picked = new Map<number, MoveEntry | null>();\n+\n+\t/**\n+\t * The relocation of moved line n that counts here, as #relocations picks it before any loop: right whenever the\n+\t * walk that reached n goes on to a file's start, since only lines on a loop have their relocation set aside.\n+\t */\n+\t#pickOne(n: number): MoveEntry | undefined {\n+\t\tlet picked = this.#picked.get(n);\n+\t\tif (picked === undefined) {\n+\t\t\tconst graph = this.graph;\n+\t\t\tlet best: MoveEntry | undefined;\n+\t\t\tfor (const e of skeletonOf(graph).byLine.get(n) ?? []) {\n+\t\t\t\tif (this.#has(seqOf(e.r.atom)) && (!best || graph.comparePriority(e.r.atom, best.r.atom) > 0)) best = e;\n+\t\t\t}\n+\t\t\tthis.#picked.set(n, (picked = best ?? null));\n+\t\t}\n+\t\treturn picked ?? undefined;\n+\t}\n+\n \t/** Whether moves are resolved on disk for each layout: only a stored graph's view with more than MOVED_LINES_KEPT. */\n \t#scratchMoves(): boolean {\n \t\tif (!this.#hasMoves || !this.graph.hasOrderedChildren) return false;\n@@ -453,8 +487,21 @@\n \t/** The file a node sits in, in this set: up by where lines were written, through the moves that count here. */\n \t#fileOfCode(code: number): string {\n \t\tconst graph = this.graph;\n-\t\tconst relocs = this.#relocationsN();\n \t\tconst skeleton = skeletonOf(graph);\n+\t\tif (!this.#relocsN) {\n+\t\t\t// One moved line at a time, until a walk comes back to a line it passed: then moves loop, and are resolved whole.\n+\t\t\tconst passed = new Set<number>();\n+\t\t\tlet c = code;\n+\t\t\tfor (;;) {\n+\t\t\t\tc = skeleton.climb(c);\n+\t\t\t\tif (c < 0) return graph.nodeOf(c).slice(1);\n+\t\t\t\tif (passed.has(c)) break;\n+\t\t\t\tpassed.add(c);\n+\t\t\t\tconst e = this.#pickOne(c);\n+\t\t\t\tc = e ? e.parent : graph.parentCodeOf(c);\n+\t\t\t}\n+\t\t}\n+\t\tconst relocs = this.#relocationsN();\n \t\tlet c = code;\n \t\tfor (;;) {\n \t\t\tc = skeleton.climb(c);\n@@ -569,6 +616,8 @@\n \t#movedFrom: Map<string, Set<number>> | undefined;\n \t#movedInFrom(): Map<string, Set<number>> {\n \t\tif (this.#movedFrom) return this.#movedFrom;\n+\t\tthis.#relocations();\n+\t\tif (this.#movesTaken) return (this.#movedFrom = this.#movesTaken.#movedInFrom());\n \t\tconst graph = this.graph;\n \t\tconst out = new Map<string, Set<number>>();\n \t\tif (this.#hasMoves) {\n@@ -962,6 +1011,7 @@\n \t\tif (this.#knownList) n += ARRAY_HEADER_BYTES + REFERENCE_BYTES * this.#knownList.length;\n \t\tif (this.#relocs) n += MAP_HEADER_BYTES + MAP_ENTRY_BYTES * this.#relocs.size;\n \t\tif (this.#relocsN) n += MAP_HEADER_BYTES + (MAP_ENTRY_BYTES + OBJECT_BYTES) * this.#relocsN.size;\n+\t\tn += MAP_ENTRY_BYTES * this.#picked.size;\n \t\tfor (const f of this.#files.values()) {\n \t\t\tn += MAP_ENTRY_BYTES;\n \t\t\tif (f !== NO_FILE) {"},{"path":"worker/project/pathindex.ts","added":22,"removed":0,"diff":"--- a/worker/project/pathindex.ts\n+++ b/worker/project/pathindex.ts\n@@ -41,6 +41,28 @@\n \t/** Each version's files made and taken out, and moves (#41), worked out with its files. */\n \treadonly #shapeCache = new WeakMap<Space, Map<number, VersionShape>>();\n \n+\t/** The files at the newest version folded so far from kept shapes, per space (keptPaths). */\n+\treadonly #keptPaths = new WeakMap<Space, { version: number; files: Set<string> }>();\n+\n+\t/**\n+\t * The files a space has at a version, from the kept rows of every version up to it: each one's files made and\n+\t * taken out, folded from version 0 (abso Capacity). Undefined when a version has no kept row that describes it;\n+\t * then the caller lays the version out.\n+\t */\n+\tkeptPaths(space: Space, version: number): string[] | undefined {\n+\t\tlet fold = this.#keptPaths.get(space);\n+\t\tif (!fold || fold.version > version) fold = { version: -1, files: new Set() };\n+\t\tconst files = new Set(fold.files);\n+\t\tfor (let v = fold.version + 1; v <= version; v++) {\n+\t\t\tif (!this.#keptFiles(space, v)) return undefined;\n+\t\t\tconst shape = this.#shapeCache.get(space)!.get(v)!;\n+\t\t\tfor (const f of shape.gone) files.delete(f);\n+\t\t\tfor (const f of shape.made) files.add(f);\n+\t\t}\n+\t\tthis.#keptPaths.set(space, { version, files });\n+\t\treturn [...files].sort();\n+\t}\n+\n \t/** Each space's path index (#41): built the first time it's asked for, then kept up as versions land. */\n \treadonly #pathIndex = new WeakMap<Space, { upTo: number; paths: Map<string, PathLife> }>();\n "},{"path":"worker/project/project-status.ts","added":3,"removed":1,"diff":"--- a/worker/project/project-status.ts\n+++ b/worker/project/project-status.ts\n@@ -40,6 +40,8 @@\n \tspaceNamed(name: string | null): Space;\n \tcheckVersion(space: Space, version: number): void;\n \tviewAt(space: Space, version: number): ReadView;\n+\t/** A version's file list from kept version shapes, when every version up to it has one (pathindex.ts). */\n+\tkeptPaths?(space: Space, version: number): string[] | undefined;\n \tagentView(agent: AgentState): ReadView;\n \tversion(): number;\n \t/** Shared's project file (224), or undefined before init or without one. */\n@@ -74,7 +76,7 @@\n \tconst space = host.spaceNamed(draft);\n \tconst v = version ?? last(space);\n \thost.checkVersion(space, v);\n-\treturn { version: v, draft, files: host.viewAt(space, v).paths() };\n+\treturn { version: v, draft, files: host.keptPaths?.(space, v) ?? host.viewAt(space, v).paths() };\n }\n \n /**"},{"path":"worker/project/project.ts","added":3,"removed":0,"diff":"--- a/worker/project/project.ts\n+++ b/worker/project/project.ts\n@@ -2643,6 +2643,9 @@\n \t\t\tspaceNamed: (name) => this.#spaceNamed(name),\n \t\t\tcheckVersion: (space, version) => this.#checkVersion(space, version),\n \t\t\tviewAt: (space, version) => this.#viewAt(space, version),\n+\t\t\t// Shared's lists from kept shapes on a stored writer, where a version's layout reads its files from disk.\n+\t\t\tkeptPaths: (space, version) =>\n+\t\t\t\tthis.#writerStorage && space.name === SHARED ? this.#paths.keptPaths(space, version) : undefined,\n \t\t\tagentView: (agent) => this.#agentView(agent),\n \t\t\tversion: () => this.version,\n \t\t\tprojectFile: () => (this.initialized ? projectFileIn(this.#sharedView()) : undefined),"},{"path":"worker/project/test/version-files.test.ts","added":3,"removed":0,"diff":"--- a/worker/project/test/version-files.test.ts\n+++ b/worker/project/test/version-files.test.ts\n@@ -52,6 +52,9 @@\n \tfor (const path of [\"a.txt\", \"b.txt\", \"c.txt\", \"d.txt\", \"e.txt\", \"gone.txt\"])\n \t\tassert.deepEqual(project.log({ limit: 100, path }), oracle.log({ limit: 100, path }), path);\n \tfor (let v = 0; v <= oracle.version; v++) assert.deepEqual(project.show(v), oracle.show(v), `version ${v}`);\n+\t// The file list at each version, folded from the kept shapes' files made and taken out: newest first, then from 0.\n+\tassert.deepEqual(project.pathsAt(oracle.version), oracle.pathsAt(oracle.version));\n+\tfor (let v = 0; v <= oracle.version; v++) assert.deepEqual(project.pathsAt(v), oracle.pathsAt(v), `paths at ${v}`);\n \t// A compare reads the kept lists for the versions between (version-log.ts): both ways, and across the drop.\n \tfor (const [from, to] of [\n \t\t[0, oracle.version],"}],"ci":null}