Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed
MCP
show on this site's /mcp
CLI
abso show 258 --json
JSON
/christopher/abso-core/versions/258?format=json

Told lists out of agent rows, in 64 bucket rows per agent; layout pages read through the writer cache; a laid-out file's authors counted by writer (abso Capacity, issue 664; Security yes on ask 2102; Agent VCS approved).

of shared·capacity··Not checked

  • writer-agents.ts: each agent's told keys (the news it has been told) live in 64 rows of their own, project:agents:told, keyed by the agent's name and a fixed hash bucket (FNV-1a mod 64), each holding its bucket's keys sorted; the agent row no longer carries them. told.has reads one bucket and told.add rewrites one; status, where and drafts never read them. A row written before keeps its list, read alongside the buckets (StoredTold.listed) until the agent's row is next written, which moves the list into the buckets; a fresh adoption writes the new form from the start. Removing an agent clears its buckets; delete and purge clear the writer state with them. abso's 109 agent rows were 4.3 MB, the largest 100.9 KB.
  • CachedStateStorage can read collections straight through; the writer passes file-lines, file-texts and file-deletes pages, which are read only to lay a file out (the view keeps the layout) and pushed out the small rows read on every call.
  • authorsInView: a laid-out file's lines by author from its visible lines' writers, each writer's author once (tree with authors, folder blame, and the totals adoption keeps), instead of an atom id and line id per line.

Tests: told-buckets (new: news on a stored writer against the in-memory project, every step's news asked twice, before and after an agent's told keys are half in an old row's list and half in buckets, with a writer opened afresh; the old list moves into the buckets on the agent's next write; an agent never reads another's buckets; a rollback leaves the buckets as they were). state-cache: a collection read straight through is never kept and pushes nothing out. All of src/engine/test (295) and worker/project/test (351, one skipped) pass.

Version 257 · Files at version 258

8 files, 361 lines added, 20 removed.

--- a/src/engine/state-source.ts
+++ b/src/engine/state-source.ts
@@ -41,7 +41,19 @@
4141 * all the news it was told: 4.3 MB for abso's 109 agents) otherwise push every small page out of the cache.
4242 */
4343 readonly #maxEntryBytes: number;
44− constructor(source: GraphStateStorage, maxBytes = 1_048_576, maxEntries = 4096, maxEntryBytes = maxBytes) {
44+ /**
45+ * Collections read straight through, never kept (abso Capacity): a file's packed line pages are read only to lay the
46+ * file out, and the view keeps the layout, so keeping the pages too held them twice and pushed out the small rows
47+ * read on every call (an agent's tree re-read 3,500 of them each time).
48+ */
49+ readonly #passThrough: (collection: string) => boolean;
50+ constructor(
51+ source: GraphStateStorage,
52+ maxBytes = 1_048_576,
53+ maxEntries = 4096,
54+ maxEntryBytes = maxBytes,
55+ passThrough: (collection: string) => boolean = () => false,
56+ ) {
4557 if (
4658 !Number.isSafeInteger(maxBytes) ||
4759 maxBytes < 0 ||
@@ -55,6 +67,7 @@
5567 this.#maxBytes = maxBytes;
5668 this.#maxEntries = maxEntries;
5769 this.#maxEntryBytes = Math.min(maxEntryBytes, maxBytes);
70+ this.#passThrough = passThrough;
5871 }
5972 get retainedBytes(): number {
6073 return this.#bytes;
@@ -74,6 +87,7 @@
7487 }
7588 }
7689 read(collection: string, key: string): unknown {
90+ if (this.#passThrough(collection)) return this.#source.read(collection, key);
7791 const cacheKey = JSON.stringify([collection, key]);
7892 const hit = this.#cache.get(cacheKey);
7993 if (hit) {
--- a/src/engine/test/state-cache.test.ts
+++ b/src/engine/test/state-cache.test.ts
@@ -163,3 +163,24 @@
163163 source.db.close();
164164 }
165165});
167+test("a collection read straight through is never kept, and pushes nothing out (abso Capacity)", () => {
168+ const source = new SqlState();
169+ try {
170+ const cache = new CachedStateStorage(source, 8192, 2, 8192, (collection) => collection === "pages");
171+ source.write("rows", "a", "A");
172+ source.write("rows", "b", "B");
173+ for (let i = 0; i < 10; i++) source.write("pages", String(i), [i]);
174+ cache.read("rows", "a");
175+ cache.read("rows", "b");
176+ const reads = source.reads;
177+ for (let i = 0; i < 10; i++) assert.deepEqual(cache.read("pages", String(i)), [i]);
178+ assert.equal(source.reads, reads + 10);
179+ assert.equal(cache.read("rows", "a"), "A");
180+ assert.equal(cache.read("rows", "b"), "B");
181+ assert.equal(source.reads, reads + 10, "the two kept rows were not pushed out by the pages");
182+ assert.equal(cache.retainedEntries, 2);
183+ } finally {
184+ source.db.close();
185+ }
186+});
--- a/worker/project/blame.ts
+++ b/worker/project/blame.ts
@@ -11,6 +11,7 @@
1111import type { Project } from "./project.ts";
1212import { projectFileIn } from "./project-helpers.ts";
1313import { type TrailStep, trail } from "./trail.ts";
14+import { authorsInView } from "./version-files.ts";
1415
1516export interface BlameLine {
1617 n: number;
@@ -427,10 +428,9 @@
427428 }
428429 continue;
429430 }
430− for (const l of view.lines(path)) {
431− const author = authorOf(l.atom);
432− counts.set(author, (counts.get(author) ?? 0) + 1);
433− total++;
431+ for (const [author, n] of authorsInView(view, path, graph, authorOf)) {
432+ counts.set(author, (counts.get(author) ?? 0) + n);
433+ total += n;
434434 }
435435 }
436436 if (want.length > 0 && stored === undefined)
--- a/worker/project/history.ts
+++ b/worker/project/history.ts
@@ -6,7 +6,7 @@
66import { pathKey } from "./pathkey.ts";
77import { checkReadPath, differs, type LastChange, ProjectError, utf8Bytes } from "./project.ts";
88import { last, SHARED, type Space } from "./spaces.ts";
9−import type { FileTotals } from "./version-files.ts";
9+import { authorsInView, type FileTotals } from "./version-files.ts";
1010
1111/** What the history reads need from a project. */
1212export interface HistoryHost {
@@ -171,10 +171,8 @@
171171 for (const [author, n] of totals.authors) counts.set(author, (counts.get(author) ?? 0) + n);
172172 if (blob === null) e.bytes += totals.bytes;
173173 } else {
174− for (const l of view.lines(path)) {
175− const author = authorOf(l.atom);
176− counts.set(author, (counts.get(author) ?? 0) + 1);
177− }
174+ for (const [author, n] of authorsInView(view, path, graph, authorOf))
175+ counts.set(author, (counts.get(author) ?? 0) + n);
178176 if (blob === null) e.bytes += utf8Bytes(view.text(path));
179177 }
180178 if (blob !== null) (e.blobs ??= []).push(blob);
--- a/worker/project/project.ts
+++ b/worker/project/project.ts
@@ -255,6 +255,8 @@
255255const WRITER_CACHE_ROWS = 16_384;
256256/** The biggest row the writer cache keeps (abso Capacity): an agent and all the news it was told can be 100 KB. */
257257const WRITER_CACHE_ROW_BYTES = 16_384;
258+/** A file's packed line pages: read only to lay it out, and the view keeps the layout (abso Capacity). */
259+const LAYOUT_PAGES: ReadonlySet<string> = new Set(["file-lines:pages", "file-texts:pages", "file-deletes:pages"]);
258260export interface WriterSource {
259261 readonly generation: number;
260262 readonly logLength: number;
@@ -405,7 +407,13 @@
405407 throw Error("accepted atom indexing requires writer storage");
406408 this.#store = store;
407409 this.#writerStorage = options.writerStorage
408− ? new CachedStateStorage(options.writerStorage, WRITER_CACHE_BYTES, WRITER_CACHE_ROWS, WRITER_CACHE_ROW_BYTES)
410+ ? new CachedStateStorage(
411+ options.writerStorage,
412+ WRITER_CACHE_BYTES,
413+ WRITER_CACHE_ROWS,
414+ WRITER_CACHE_ROW_BYTES,
415+ (collection) => LAYOUT_PAGES.has(collection),
416+ )
409417 : undefined;
410418 if (this.#writerStorage) {
411419 const storage = this.#writerStorage;
--- /dev/null
+++ b/worker/project/test/told-buckets.test.ts
@@ -0,0 +1,127 @@
1+// Each agent's told keys in bucket rows of their own (abso Capacity, issue 664; Security yes on ask 2102;
2+// writer-agents.ts). News on a stored writer must match the in-memory project's, every step answered twice so no news
3+// repeats: for agents whose keys are in buckets, and for an agent read mid-move, its keys half in an old row's list and
4+// half in its buckets. A write moves an old row's list into the buckets; one agent never reads another's; a rollback
5+// leaves the buckets as they were.
6+
7+import assert from "node:assert/strict";
8+import { test } from "node:test";
9+import { storedArray } from "../../../src/engine/state-source.ts";
10+import { SqlState } from "../../../src/engine/test/storage-helper.ts";
11+import { MemoryStore, Project } from "../project.ts";
12+import type { Entry, ProjectStore } from "../project-types.ts";
13+import { StoredTold, TOLD_BUCKETS } from "../writer-agents.ts";
15+const TOLD = "project:agents:told";
16+const AGENTS = "project:agents";
17+const agentKey = (name: string) => JSON.stringify(["string", name]);
18+const toldRow = (name: string, bucket: number) => JSON.stringify([name, bucket]);
20+function writer() {
21+ const storage = new SqlState();
22+ const entries = storedArray<Entry>(storage, "canonical-log");
23+ const store: ProjectStore = {
24+ append(batch) {
25+ for (const entry of batch) entries.push(entry);
26+ },
27+ };
28+ return { storage, entries, store, project: new Project(store, { writerStorage: storage }) };
29+}
31+/** Each step's answer, and the news each agent has then, asked twice: as JSON, as a client gets them. */
32+function step(project: Project, f: (p: Project) => unknown): unknown {
33+ const answer = f(project);
34+ // The news texts (each item's time is the clock when it was written, which differs between the two).
35+ const news = ["ann", "bob", "cy"].map((a) => [project.news(a).news, project.news(a).news]);
36+ return JSON.parse(JSON.stringify({ answer, news }));
37+}
39+const FIRST: ((p: Project) => unknown)[] = [
40+ (p) => p.init({ "a.ts": "one\ntwo\nthree\n", "b.ts": "export function f() {}\n", "c.ts": "c\n" }, 0),
41+ (p) => p.edit("ann", { file: "a.ts", old: "two", new: "TWO" }, 1),
42+ (p) => p.edit("bob", { file: "a.ts", old: "two", new: "Two" }, 2),
43+ (p) => p.edit("cy", { file: "c.ts", old: "c", new: "C" }, 3),
44+ (p) => p.publish("ann", "Shout two", 4),
45+ (p) => p.record("bob", { "a.ts": "one\nTwo\nthree\nfour\n" }, 5),
46+ (p) => p.record("bob", { "a.ts": "one\nTwo\nthree\nfour\nfive\n" }, 6),
47+ (p) => p.announce("ann", "First announcement", undefined, 7),
48+ (p) => p.announce("ann", "Second announcement", ["bob"], 8),
49+];
50+const THEN: ((p: Project) => unknown)[] = [
51+ (p) => p.record("bob", { "a.ts": "one\nTwo\nthree\nfour\nfive\nsix\n" }, 9),
52+ (p) => p.edit("ann", { file: "a.ts", old: "three", new: "THREE" }, 10),
53+ (p) => p.edit("bob", { file: "a.ts", old: "three", new: "Three" }, 11),
54+ (p) => p.publish("ann", "Shout three", 12),
55+ (p) => p.record("bob", { "a.ts": "one\nTwo\nThree\nfour\nfive\nsix\nseven\n" }, 13),
56+ (p) => p.announce("cy", "Third announcement", undefined, 14),
57+ (p) => p.sync("cy"),
58+];
60+const bucketKeys = (storage: SqlState, name: string) => {
61+ const out: string[] = [];
62+ for (let b = 0; b < TOLD_BUCKETS; b++)
63+ out.push(...((storage.read(TOLD, toldRow(name, b)) as string[] | undefined) ?? []));
64+ return out.sort();
65+};
67+test("news on a stored writer matches the in-memory project, before and after an agent's told keys are half moved", () => {
68+ const oracle = new Project(new MemoryStore());
69+ const { storage, entries, store, project: first } = writer();
70+ try {
71+ for (const f of FIRST) assert.deepEqual(step(first, f), step(oracle, f));
72+ // bob's keys are in buckets, and its row lists none.
73+ const keys = bucketKeys(storage, "bob");
74+ assert.ok(keys.length >= 2, `bob was told ${keys.length} keys`);
75+ const row = storage.read(AGENTS, agentKey("bob")) as { slot: number; value: Record<string, unknown> };
76+ assert.equal(row.value.told, undefined);
77+ // Make bob's row an old one mid-move: half its keys back in the row's list, out of its buckets.
78+ const moved = keys.filter((_, i) => i % 2 === 0);
79+ storage.write(AGENTS, agentKey("bob"), { ...row, value: { ...row.value, told: moved } });
80+ const told = new StoredTold(storage, "bob");
81+ for (const key of moved) told.delete(key);
82+ assert.deepEqual(
83+ bucketKeys(storage, "bob"),
84+ keys.filter((_, i) => i % 2 === 1),
85+ );
86+ // A writer opened afresh reads bob's told keys from both, and news goes on as in memory.
87+ const project = Project.openWriter(store, storage, entries.length);
88+ assert.deepEqual([...new StoredTold(storage, "bob", moved)].sort(), keys);
89+ for (const f of THEN) assert.deepEqual(step(project, f), step(oracle, f));
90+ // bob was written since: its row lists nothing, and its buckets hold every key it had and the new ones.
91+ const after = storage.read(AGENTS, agentKey("bob")) as { value: Record<string, unknown> };
92+ assert.equal(after.value.told, undefined);
93+ const now = bucketKeys(storage, "bob");
94+ for (const key of keys) assert.ok(now.includes(key), key);
95+ assert.ok(now.length > keys.length, "bob was told more since");
96+ } finally {
97+ storage.db.close();
98+ }
99+});
101+test("an agent's told keys are its own, and a rollback leaves the buckets as they were", () => {
102+ const storage = new SqlState();
103+ try {
104+ const bob = new StoredTold(storage, "bob");
105+ const ann = new StoredTold(storage, "ann");
106+ bob.add("ann bob");
107+ bob.add("announce 1");
108+ assert.equal(bob.has("ann bob"), true);
109+ assert.equal(ann.has("ann bob"), false);
110+ assert.equal(ann.has("announce 1"), false);
111+ assert.throws(
112+ () =>
113+ storage.transaction(() => {
114+ bob.add("announce 2");
115+ assert.equal(bob.has("announce 2"), true);
116+ throw new Error("rollback");
117+ }),
118+ /rollback/,
119+ );
120+ assert.equal(bob.has("announce 2"), false);
121+ assert.deepEqual([...bob].sort(), ["ann bob", "announce 1"]);
122+ bob.clear();
123+ assert.deepEqual([...bob], []);
124+ } finally {
125+ storage.db.close();
126+ }
127+});
--- a/worker/project/version-files.ts
+++ b/worker/project/version-files.ts
@@ -79,14 +79,38 @@
7979 return a.length === 0 && bytes === 0 ? null : { a, b: bytes };
8080}
8181
82+/**
83+ * A laid-out file's lines by author, from its visible lines' writers (abso Capacity): each writer's author once, instead
84+ * of making an atom id and a line id for every line (an agent's tree spent 0.4 s on that for its draft's files).
85+ */
86+export function authorsInView(
87+ view: ReadView,
88+ path: string,
89+ graph: Graph,
90+ authorOf: (id: AtomId) => string,
91+): Map<string, number> {
92+ const out = new Map<string, number>();
93+ const writers = (view as { visibleWriters?(path: string): readonly number[] }).visibleWriters?.call(view, path);
94+ if (!writers) {
95+ for (const l of view.lines(path)) {
96+ const author = authorOf(l.atom);
97+ out.set(author, (out.get(author) ?? 0) + 1);
98+ }
99+ return out;
100+ }
101+ const bySeq = new Map<number, number>();
102+ for (const seq of writers) bySeq.set(seq, (bySeq.get(seq) ?? 0) + 1);
103+ for (const [seq, n] of bySeq) {
104+ const author = authorOf(graph.idOfSeq(seq));
105+ out.set(author, (out.get(author) ?? 0) + n);
106+ }
107+ return out;
108+}
82110/** A file's totals from its layout in a view, as tree with authors counts them. */
83111function laidOutTotals(view: ReadView, path: string, authorOf: (id: AtomId) => string): StoredTotals | null {
84112 if (!view.hasFile(path)) return null;
85− const authors = new Map<string, number>();
86− for (const l of view.lines(path)) {
87− const author = authorOf(l.atom);
88− authors.set(author, (authors.get(author) ?? 0) + 1);
89− }
113+ const authors = authorsInView(view, path, view.graph, authorOf);
90114 return normalTotals(authors, authors.size === 0 ? 0 : utf8Bytes(view.text(path)));
91115}
92116
--- a/worker/project/writer-agents.ts
+++ b/worker/project/writer-agents.ts
@@ -2,11 +2,150 @@
22import type { AgentState } from "./project-types.ts";
33
44type StoredAgent = Omit<AgentState, "told" | "parked"> & {
5− told: string[];
5+ /** The told list as rows written before the told buckets kept it (abso Capacity); absent since. */
6+ told?: string[];
67 parked: [string, { base: number; mine: AgentState["mine"] }][];
78};
89
910/**
11+ * Each agent's told keys (the news it has been told about) in TOLD_BUCKETS rows of their own, beside its agent row
12+ * (abso Capacity, issue 664; Security yes on ask 2102). The list grows for as long as the agent works and was most of
13+ * its row: abso's 109 agent rows were 4.3 MB, read in full by every status, where and drafts, none of which reads it.
14+ * A row is keyed by the agent's name and a bucket (a fixed hash of the key), and holds that bucket's keys, sorted.
15+ */
16+const TOLD = "project:agents:told";
17+export const TOLD_BUCKETS = 64;
19+/** The bucket a told key goes in: 32-bit FNV-1a of its UTF-16 code units. */
20+export function toldBucket(key: string): number {
21+ let hash = 0x811c9dc5;
22+ for (let i = 0; i < key.length; i++) {
23+ hash ^= key.charCodeAt(i);
24+ hash = Math.imul(hash, 0x01000193);
25+ }
26+ return (hash >>> 0) % TOLD_BUCKETS;
27+}
29+const toldRow = (agent: string, bucket: number) => JSON.stringify([agent, bucket]);
31+function sortedIndex(keys: readonly string[], key: string): number {
32+ let lo = 0;
33+ let hi = keys.length;
34+ while (lo < hi) {
35+ const mid = (lo + hi) >> 1;
36+ if (keys[mid]! < key) lo = mid + 1;
37+ else hi = mid;
38+ }
39+ return lo;
40+}
42+/**
43+ * An agent's told keys on a stored writer: has() reads one bucket and add() rewrites one. A row written before the
44+ * buckets carries its list itself (`listed`), read alongside the buckets until the agent's row is next written, which
45+ * moves the list into the buckets (WriterAgents' encode).
46+ */
47+export class StoredTold extends Set<string> {
48+ readonly #storage: GraphStateStorage;
49+ readonly #agent: string;
50+ readonly #listed: Set<string>;
51+ constructor(storage: GraphStateStorage, agent: string, listed: Iterable<string> = []) {
52+ super();
53+ this.#storage = storage;
54+ this.#agent = agent;
55+ this.#listed = new Set(listed);
56+ }
57+ /** Keys an old row listed and the buckets don't hold yet. */
58+ get listed(): ReadonlySet<string> {
59+ return this.#listed;
60+ }
61+ #bucket(bucket: number): string[] {
62+ return (this.#storage.read(TOLD, toldRow(this.#agent, bucket)) as string[] | undefined) ?? [];
63+ }
64+ #inBuckets(key: string): boolean {
65+ const keys = this.#bucket(toldBucket(key));
66+ return keys[sortedIndex(keys, key)] === key;
67+ }
68+ override has(key: string): boolean {
69+ return this.#listed.has(key) || this.#inBuckets(key);
70+ }
71+ override add(key: string): this {
72+ if (this.has(key)) return this;
73+ storeTold(this.#storage, this.#agent, [key]);
74+ return this;
75+ }
76+ override delete(key: string): boolean {
77+ const listed = this.#listed.delete(key);
78+ const bucket = toldBucket(key);
79+ const keys = this.#bucket(bucket);
80+ const at = sortedIndex(keys, key);
81+ if (keys[at] !== key) return listed;
82+ keys.splice(at, 1);
83+ if (keys.length > 0) this.#storage.write(TOLD, toldRow(this.#agent, bucket), keys);
84+ else this.#storage.remove(TOLD, toldRow(this.#agent, bucket));
85+ return true;
86+ }
87+ override clear(): void {
88+ this.#listed.clear();
89+ clearTold(this.#storage, this.#agent);
90+ }
91+ override get size(): number {
92+ let n = 0;
93+ for (const _ of this.values()) n++;
94+ return n;
95+ }
96+ override *values(): SetIterator<string> {
97+ yield* this.#listed;
98+ for (let bucket = 0; bucket < TOLD_BUCKETS; bucket++)
99+ for (const key of this.#bucket(bucket)) if (!this.#listed.has(key)) yield key;
100+ }
101+ override keys(): SetIterator<string> {
102+ return this.values();
103+ }
104+ override *entries(): SetIterator<[string, string]> {
105+ for (const key of this.values()) yield [key, key];
106+ }
107+ override [Symbol.iterator](): SetIterator<string> {
108+ return this.values();
109+ }
110+ override forEach(callback: (value: string, key: string, set: Set<string>) => void, thisArg?: unknown): void {
111+ for (const key of this.values()) callback.call(thisArg, key, key, this);
112+ }
113+ /** Move an old row's list into the buckets. */
114+ moveListed(): void {
115+ if (this.#listed.size === 0) return;
116+ storeTold(this.#storage, this.#agent, this.#listed);
117+ this.#listed.clear();
118+ }
119+}
121+/** Put keys in an agent's buckets: each bucket read and written once. */
122+function storeTold(storage: GraphStateStorage, agent: string, keys: Iterable<string>): void {
123+ const byBucket = new Map<number, string[]>();
124+ for (const key of keys) {
125+ const bucket = toldBucket(key);
126+ let list = byBucket.get(bucket);
127+ if (!list) byBucket.set(bucket, (list = []));
128+ list.push(key);
129+ }
130+ for (const [bucket, adding] of byBucket) {
131+ const keys = (storage.read(TOLD, toldRow(agent, bucket)) as string[] | undefined) ?? [];
132+ let changed = false;
133+ for (const key of adding) {
134+ const at = sortedIndex(keys, key);
135+ if (keys[at] === key) continue;
136+ keys.splice(at, 0, key);
137+ changed = true;
138+ }
139+ if (changed) storage.write(TOLD, toldRow(agent, bucket), keys);
140+ }
141+}
143+/** Take out every bucket of an agent's (when the agent is removed). */
144+function clearTold(storage: GraphStateStorage, agent: string): void {
145+ for (let bucket = 0; bucket < TOLD_BUCKETS; bucket++) storage.remove(TOLD, toldRow(agent, bucket));
146+}
148+/**
10149 * Identity map for agents touched by the current operation. Project's existing
11150 * reducers share mutable agent references, so copies cannot be substituted
12151 * halfway through an operation. Flush those rows with the canonical append,
@@ -14,14 +153,22 @@
14153 */
15154export class WriterAgents extends StoredMap<string, AgentState> {
16155 readonly #touched = new Map<string, AgentState>();
156+ readonly #storage: GraphStateStorage;
17157 constructor(storage: GraphStateStorage) {
18158 super(storage, "project:agents", {
19− encode: (agent) => ({ ...agent, told: [...agent.told], parked: [...agent.parked] }),
159+ // The row without its told keys, which go to the agent's buckets: an old row's list moves there now.
160+ encode: (agent) => {
161+ const { told, ...rest } = agent;
162+ if (told instanceof StoredTold) told.moveListed();
163+ else storeTold(storage, agent.name, told);
164+ return { ...rest, parked: [...agent.parked] };
165+ },
20166 decode: (value) => {
21− const agent = value as StoredAgent;
22− return { ...agent, told: new Set(agent.told), parked: new Map(agent.parked) };
167+ const { told, ...agent } = value as StoredAgent;
168+ return { ...agent, told: new StoredTold(storage, agent.name, told), parked: new Map(agent.parked) };
23169 },
24170 });
171+ this.#storage = storage;
25172 }
26173 override get(key: string): AgentState | undefined {
27174 let value = this.#touched.get(key);
@@ -38,6 +185,8 @@
38185 }
39186 override delete(key: string): boolean {
40187 this.#touched.delete(key);
188+ // Its told keys go with it (Security on ask 2102).
189+ clearTold(this.#storage, key);
41190 return super.delete(key);
42191 }
43192 override *entries(): MapIterator<[string, AgentState]> {