Versions 161 to 162
Lines 63–114 at 162 (were 63–104 at 161)
66− /** Persist only pages reachable from the final root of a bounded update batch. */
71− const staged = new Map<string, unknown>();
72− const storage: GraphStateStorage = {
73− read: (collection, key) =>
74− collection === this.#collection && staged.has(key) ? staged.get(key) : this.#storage.read(collection, key),
75− write: (collection, key, value) => {
76− if (collection !== this.#collection) throw Error("unexpected batch collection");
77− staged.set(key, value);
78− },
79− remove: () => {
80− throw Error("unexpected batch removal");
81− },
82− entries: () => {
83− throw Error("unexpected batch scan");
84− },
85− transaction: (body) => body(),
87− // The namespace is encoded into the collection at construction.
88− const namespace = JSON.parse(this.#collection.slice("experimental-locator:".length)) as string;
89− const index = new ProjectionLocator<T>(storage, namespace, this.#decode);
90− let result = root;
91− for (const [id, value] of values) result = index.set(result, id, value);
92− const retained = new Set<number>();
93− const visit = (id: Page): void => {
94− if (id === null || retained.has(id) || !staged.has(String(id))) return;
95− retained.add(id);
96− const node = staged.get(String(id)) as Node;
97− if (node.kind === "branch") for (const child of Object.values(node.children)) visit(child);
83+ for (const [id, value] of values) checked.set(keyOf(id), structuredClone(this.#decode(structuredClone(value))));
85+ const visit = (current: Page, edits: [string, T][], parent?: string, digit?: string, depth = 0): Page => {
95+ if (prefix.length === 8) return write({ format: 1, kind: "leaf", prefix, value: edits[edits.length - 1]![1] });
99− visit(result);
100− for (const id of retained) this.#storage.write(this.#collection, String(id), staged.get(String(id)));
101− if (staged.has("next")) this.#storage.write(this.#collection, "next", staged.get("next"));
- MCP
- compare on this site's /mcp
- CLI
- abso diff 161 162 src/engine/experimental/projection-locator.ts --json
- JSON
- /christopher/abso-core/compare/161..162?file=src%2Fengine%2Fexperimental%2Fprojection-locator.ts&format=json