@cello-protocol/daemon 0.0.121 → 0.0.123

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,445 @@
1
+ /**
2
+ * DOD-DOC-WRITE-1 — the write path (§16.2).
3
+ *
4
+ * **The document is a real file.** The agent edits it with Read/Edit like any other file, and the
5
+ * human can open the same file; the daemon diffs it at publish and converts the diff into Yjs
6
+ * operations. No new editing surface exists — that is the design, not a shortcut.
7
+ *
8
+ * ── THE FOLD ORDER IS THE DESIGN ──────────────────────────────────────────────────────────────
9
+ *
10
+ * On admission (§16.2): fold the agent's UNPUBLISHED file edits into the `Y.Doc` as local
11
+ * operations FIRST, then merge the incoming update, then rewrite the file. Reversing the first
12
+ * two silently destroys the agent's unpublished work, and §4.1's overlap flag — which IS whether
13
+ * the merge touched what the fold just wrote — disappears with it.
14
+ *
15
+ * ── WHY THE PROJECTION IS PERSISTED ───────────────────────────────────────────────────────────
16
+ *
17
+ * §16.2 says publish diffs the file against "the last-known projection", and that baseline has to
18
+ * outlive the process. Diffing against the DOC's current text instead looks equivalent and is not:
19
+ * `admit` merges into the doc and rewrites the file as two separate steps, so a crash between them
20
+ * leaves a stale file beside an advanced doc. Diffing that against the doc reads the peer's
21
+ * admitted content as something the agent deleted, and publishes the deletion as deliberate
22
+ * intent. Measured, so the projection is written to disk beside the document and read back.
23
+ */
24
+ import { mkdir, readFile, writeFile, rename } from "node:fs/promises";
25
+ import { join } from "node:path";
26
+ /** Yjs roots a materialized document projects from. TEXT_ROOT must match DocumentEngine's. */
27
+ const TEXT_ROOT = "content";
28
+ const MAP_ROOT = "data";
29
+ const TEXT_TYPES = new Set(["markdown", "text", "plaintext"]);
30
+ const JSON_TYPES = new Set(["json"]);
31
+ /** Ids are hex identities, never names, and they become path components. */
32
+ const ID_PATTERN = /^[0-9a-f]{64}$/;
33
+ export class DocumentWriteError extends Error {
34
+ reason;
35
+ detail;
36
+ constructor(reason, detail) {
37
+ super(`${reason}: ${detail}`);
38
+ this.name = "DocumentWriteError";
39
+ this.reason = reason;
40
+ this.detail = detail;
41
+ }
42
+ }
43
+ export class DocumentWritePath {
44
+ engine;
45
+ #root;
46
+ #logger;
47
+ constructor(engine, workspaceRoot, logger) {
48
+ this.engine = engine;
49
+ this.#root = workspaceRoot;
50
+ this.#logger = logger;
51
+ }
52
+ /**
53
+ * The file a document lives at. Keyed on the FULL `agent_id`/`document_id` — truncating them
54
+ * would let two documents sharing a prefix collide onto one file and destroy each other, and
55
+ * both ids are validated because they become path components.
56
+ */
57
+ filePath(agentId, documentId, documentType) {
58
+ this.#assertId(agentId, "agent_id");
59
+ this.#assertId(documentId, "document_id");
60
+ const extension = JSON_TYPES.has(documentType) ? "json" : "md";
61
+ return join(this.#root, agentId, `${documentId}.${extension}`);
62
+ }
63
+ /** Write the document's projection to disk and record it as the diff baseline. */
64
+ async materialize(agentId, documentId, documentType, doc) {
65
+ this.#assertSupported(documentType);
66
+ const path = this.filePath(agentId, documentId, documentType);
67
+ const content = this.#project(doc, documentType);
68
+ await this.#writeAtomic(agentId, path, content);
69
+ await this.#saveProjection(agentId, documentId, documentType, content);
70
+ this.#logger.info("document.file.materialized", { documentId, bytes: content.length });
71
+ return path;
72
+ }
73
+ /**
74
+ * Diff the file against the LAST-KNOWN PROJECTION and apply the difference as local operations.
75
+ * Returns the resulting update, or null when the file is unchanged.
76
+ *
77
+ * Null is a real answer: publish is an intent, so a publish with nothing to say must produce no
78
+ * envelope rather than an empty one that still costs a leaf and a round trip.
79
+ */
80
+ async publish(agentId, documentId, documentType, doc) {
81
+ this.#assertSupported(documentType);
82
+ const path = this.filePath(agentId, documentId, documentType);
83
+ const onDisk = await this.#readOrRefuse(path, documentId);
84
+ const projection = await this.#loadProjection(agentId, documentId, documentType);
85
+ if (projection === null) {
86
+ throw new DocumentWriteError("document_file_missing", `no recorded projection for document ${documentId} — materialize it before publishing`);
87
+ }
88
+ // A file that matches NEITHER the recorded projection nor the document's current state means
89
+ // a rewrite did not complete (admit merges into the doc and rewrites the file as two steps).
90
+ // Diffing it would read the peer's admitted content as an agent deletion and publish that
91
+ // deletion as deliberate intent. Refuse and re-materialize instead.
92
+ // THE BASELINE MUST MATCH THE DOCUMENT. Hunks are offsets into the projection, applied to the
93
+ // doc's text, so they are sound only while the two agree. An earlier version refused only when
94
+ // the file was ALSO untouched, which let through the one state that matters: the doc advanced
95
+ // past the projection AND the agent edited the file. That applies projection-offset hunks to a
96
+ // longer document and mutilates the peer's admitted content — measured. The condition is the
97
+ // invariant itself, not a symptom of it.
98
+ const current = this.#project(doc, documentType);
99
+ if (projection !== current) {
100
+ throw new DocumentWriteError("document_file_stale", `the recorded projection for ${documentId} no longer matches the document — a rewrite did ` +
101
+ `not complete, so re-materialize before publishing rather than diffing against a ` +
102
+ `baseline the document has moved past`);
103
+ }
104
+ const before = this.engine.encodeStateVector(doc);
105
+ const changed = this.#fold(doc, projection, onDisk, documentType) !== null;
106
+ if (!changed)
107
+ return null;
108
+ await this.#saveProjection(agentId, documentId, documentType, onDisk);
109
+ this.#logger.info("document.publish.diffed", { documentId, bytes: onDisk.length });
110
+ return this.engine.encodeState(doc, before);
111
+ }
112
+ /** Admit a peer's update: fold local edits, merge, rewrite, report overlap. */
113
+ async admit(agentId, documentId, documentType, doc, incoming) {
114
+ this.#assertSupported(documentType);
115
+ const path = this.filePath(agentId, documentId, documentType);
116
+ // 1. FOLD unpublished local edits in as local operations.
117
+ let onDisk = null;
118
+ try {
119
+ onDisk = await readFile(path, "utf8");
120
+ }
121
+ catch (err) {
122
+ // ONLY a missing file means "nothing local to lose". Any other errno — EACCES, EIO, EMFILE —
123
+ // read as that would skip the fold and then overwrite the file with the merged projection,
124
+ // discarding the agent's unpublished work with no event at all.
125
+ if (err?.code !== "ENOENT") {
126
+ throw new DocumentWriteError("document_file_unreadable", `the file for ${documentId} could not be read (${err?.code ?? "unknown"}) — ` +
127
+ `refusing rather than treating it as absent and overwriting unpublished edits`);
128
+ }
129
+ onDisk = null;
130
+ }
131
+ // REFUSE a missing baseline rather than substituting "". Diffing "" against the file yields a
132
+ // whole-file hunk inserted at offset 0 of a document that already holds that content — the
133
+ // body duplicated into the CRDT and out to the peer, permanently.
134
+ const projection = await this.#loadProjection(agentId, documentId, documentType);
135
+ if (onDisk !== null && projection === null) {
136
+ throw new DocumentWriteError("document_projection_missing", `no recorded projection for document ${documentId} — re-materialize before admitting, ` +
137
+ `since without a baseline the file cannot be told apart from an empty document`);
138
+ }
139
+ let localText = null;
140
+ const localKeys = new Set();
141
+ if (onDisk !== null) {
142
+ const folded = this.#fold(doc, projection, onDisk, documentType);
143
+ if (folded && "from" in folded)
144
+ localText = folded;
145
+ else if (folded)
146
+ for (const k of folded.keys)
147
+ localKeys.add(k);
148
+ }
149
+ // 2. MERGE, observing what the incoming update touches — in BOTH coordinate spaces, because
150
+ // a JSON document's edits live in the map and a text observer sees none of them.
151
+ // Inserts and deletes are compared DIFFERENTLY, and the asymmetry is the point. A re-homed
152
+ // insert landing exactly on the local edit's boundary IS overlap — Yjs put it there because
153
+ // the local fold deleted the characters it was anchored to. A deletion landing on that
154
+ // boundary is NOT: it happened above the local edit and merely shifted it down, which is the
155
+ // ordinary case of a peer editing the paragraph above yours.
156
+ const inserted = [];
157
+ const deletedAt = [];
158
+ const mergedKeys = new Set();
159
+ const onText = (event) => {
160
+ let cursor = 0;
161
+ for (const delta of event.delta) {
162
+ if (delta.retain !== undefined)
163
+ cursor += delta.retain;
164
+ else if (typeof delta.insert === "string") {
165
+ inserted.push({ from: cursor, to: cursor + delta.insert.length });
166
+ // Shift any local region that sits at or after this insert into the SAME coordinate
167
+ // system. Without it the flag depends on how LONG the peer's insert was rather than
168
+ // where it landed — a disjoint edit reads as overlapping once the insert is big enough.
169
+ if (localText && localText.from >= cursor) {
170
+ localText = { from: localText.from + delta.insert.length, to: localText.to + delta.insert.length };
171
+ }
172
+ cursor += delta.insert.length;
173
+ }
174
+ else if (delta.delete !== undefined) {
175
+ // A POINT in post-delete coordinates. Recording the delete's OLD width made any local
176
+ // edit within N characters after it read as overlapping — the flag sensitive to how BIG
177
+ // the peer's delete was rather than where it landed.
178
+ deletedAt.push(cursor);
179
+ if (localText && localText.from >= cursor) {
180
+ const shift = Math.min(delta.delete, Math.max(0, localText.from - cursor));
181
+ localText = { from: localText.from - shift, to: localText.to - shift };
182
+ }
183
+ }
184
+ }
185
+ };
186
+ const onMap = (event) => {
187
+ for (const key of event.keysChanged)
188
+ mergedKeys.add(key);
189
+ };
190
+ const text = doc.getText(TEXT_ROOT);
191
+ const map = doc.getMap(MAP_ROOT);
192
+ text.observe(onText);
193
+ map.observe(onMap);
194
+ try {
195
+ this.engine.applyUpdateOrThrow(doc, incoming);
196
+ }
197
+ finally {
198
+ text.unobserve(onText);
199
+ map.unobserve(onMap);
200
+ }
201
+ // 3. REWRITE so the agent sees the merged projection — refusing if the file moved under us.
202
+ if (onDisk !== null) {
203
+ // Re-read the CONTENT rather than trusting mtime: second-granularity filesystems hide a save
204
+ // inside the merge window, and a stat that itself fails must not read as "unchanged" — this
205
+ // guard exists precisely to prevent a silent clobber.
206
+ let nowOnDisk;
207
+ try {
208
+ nowOnDisk = await readFile(path, "utf8");
209
+ }
210
+ catch (err) {
211
+ throw new DocumentWriteError("document_file_unreadable", `the file for ${documentId} became unreadable during the merge ` +
212
+ `(${err?.code ?? "unknown"}) — refusing rather than rewriting it`);
213
+ }
214
+ if (nowOnDisk !== onDisk) {
215
+ throw new DocumentWriteError("document_file_changed_during_merge", `the file for ${documentId} was written while the merge was in flight — its content was ` +
216
+ `not folded in, so rewriting would discard it`);
217
+ }
218
+ }
219
+ const merged = this.#project(doc, documentType);
220
+ await this.#writeAtomic(agentId, path, merged);
221
+ await this.#saveProjection(agentId, documentId, documentType, merged);
222
+ // 4. OVERLAP falls out of the fold, in whichever space the document lives in.
223
+ // Endpoints are INCLUSIVE: when the local fold deletes the characters an incoming insert
224
+ // was anchored to, Yjs re-homes that insert onto the boundary of the local edit — and
225
+ // which side depends on its random clientID tie-break, so exclusive comparison answers a
226
+ // definite question with a coin flip.
227
+ const region = localText;
228
+ const overlap = region
229
+ ? inserted.some((t) => t.from <= region.to && region.from <= t.to) ||
230
+ // STRICTLY inside: a deletion at the region's own boundary is adjacency, not overlap.
231
+ deletedAt.some((at) => at > region.from && at < region.to)
232
+ : [...localKeys].some((k) => mergedKeys.has(k));
233
+ this.#logger.info("document.file.rewritten", { documentId, bytes: merged.length });
234
+ if (overlap)
235
+ this.#logger.info("document.file.overlap_detected", { documentId });
236
+ return { overlap };
237
+ }
238
+ // ─── internals ────────────────────────────────────────────────────────────
239
+ #project(doc, documentType) {
240
+ if (JSON_TYPES.has(documentType)) {
241
+ return `${JSON.stringify(doc.getMap(MAP_ROOT).toJSON(), null, 2)}\n`;
242
+ }
243
+ return this.engine.readTextRoot(doc);
244
+ }
245
+ /**
246
+ * Apply the file's content to the document, diffing against the recorded projection.
247
+ * Returns the region (text) or key set (JSON) the local edit occupies, or null if unchanged.
248
+ */
249
+ #fold(doc, projection, onDisk, documentType) {
250
+ if (JSON_TYPES.has(documentType)) {
251
+ const keys = this.#foldJson(doc, onDisk);
252
+ return keys.length > 0 ? { keys } : null;
253
+ }
254
+ return this.#foldText(doc, projection, onDisk);
255
+ }
256
+ /**
257
+ * Text diff producing N hunks, not one span.
258
+ *
259
+ * A single prefix/suffix range is coarse in a way §16.2 does NOT licence: a publish batch with
260
+ * two separated edits would delete and re-insert everything between them as new operations,
261
+ * which resurrects text a peer concurrently deleted and re-homes their insertions into the
262
+ * middle of it. Measured. Publish-on-intent makes multi-hunk the NORMAL shape — an agent edits
263
+ * across a turn and publishes once — so the line-level hunks below are the granularity the
264
+ * design actually wants, and they collapse to the old behaviour for one contiguous edit.
265
+ */
266
+ #foldText(doc, projection, onDisk) {
267
+ const text = doc.getText(TEXT_ROOT);
268
+ if (text.toString() === onDisk)
269
+ return null;
270
+ const hunks = lineHunks(projection, onDisk);
271
+ if (hunks.length === 0)
272
+ return null;
273
+ // Apply back to front so earlier offsets stay valid.
274
+ doc.transact(() => {
275
+ for (const hunk of [...hunks].reverse()) {
276
+ if (hunk.to > hunk.from)
277
+ text.delete(hunk.from, hunk.to - hunk.from);
278
+ if (hunk.insert.length > 0)
279
+ text.insert(hunk.from, hunk.insert);
280
+ }
281
+ });
282
+ // The span the local edits occupy AFTER folding — the coordinate system the merge's deltas
283
+ // will be reported in.
284
+ let shift = 0;
285
+ let low = Number.POSITIVE_INFINITY;
286
+ let high = 0;
287
+ for (const hunk of hunks) {
288
+ const from = hunk.from + shift;
289
+ const to = from + hunk.insert.length;
290
+ low = Math.min(low, from);
291
+ high = Math.max(high, to);
292
+ shift += hunk.insert.length - (hunk.to - hunk.from);
293
+ }
294
+ return { from: low, to: high };
295
+ }
296
+ /** Key diff: set what changed, delete what is gone. Returns the keys written. */
297
+ #foldJson(doc, onDisk) {
298
+ let parsed;
299
+ try {
300
+ parsed = JSON.parse(onDisk);
301
+ }
302
+ catch (err) {
303
+ throw new DocumentWriteError("document_file_unparseable", `the document's file is not valid JSON — ${err instanceof Error ? err.message : String(err)}`);
304
+ }
305
+ const map = doc.getMap(MAP_ROOT);
306
+ const written = [];
307
+ doc.transact(() => {
308
+ for (const [key, value] of Object.entries(parsed)) {
309
+ if (JSON.stringify(map.get(key)) !== JSON.stringify(value)) {
310
+ map.set(key, value);
311
+ written.push(key);
312
+ }
313
+ }
314
+ for (const key of [...map.keys()]) {
315
+ if (!(key in parsed)) {
316
+ map.delete(key);
317
+ written.push(key);
318
+ }
319
+ }
320
+ });
321
+ return written;
322
+ }
323
+ /** tmp + rename, so an interrupted write cannot leave a truncated file a later diff reads as
324
+ * a deliberate mass deletion. */
325
+ async #writeAtomic(agentId, path, content) {
326
+ await mkdir(join(this.#root, agentId), { recursive: true });
327
+ const tmp = `${path}.tmp`;
328
+ await writeFile(tmp, content, "utf8");
329
+ await rename(tmp, path);
330
+ }
331
+ /**
332
+ * The baseline lives in a dot-directory, NOT beside the document. §16.2's premise is that the
333
+ * agent edits an ordinary file and no new surface exists — a sibling `<name>.md.projection` IS
334
+ * a new surface, one an agent may open, edit, or tidy away, and deleting it used to duplicate
335
+ * the document.
336
+ */
337
+ #projectionPath(agentId, documentId, documentType) {
338
+ const extension = JSON_TYPES.has(documentType) ? "json" : "md";
339
+ return join(this.#root, ".cello", agentId, `${documentId}.${extension}.projection`);
340
+ }
341
+ /** The projection is persisted so it survives a restart — see the header. */
342
+ async #saveProjection(agentId, documentId, documentType, content) {
343
+ const path = this.#projectionPath(agentId, documentId, documentType);
344
+ await mkdir(join(this.#root, ".cello", agentId), { recursive: true });
345
+ await writeFile(`${path}.tmp`, content, "utf8");
346
+ await rename(`${path}.tmp`, path);
347
+ }
348
+ async #loadProjection(agentId, documentId, documentType) {
349
+ try {
350
+ return await readFile(this.#projectionPath(agentId, documentId, documentType), "utf8");
351
+ }
352
+ catch {
353
+ return null;
354
+ }
355
+ }
356
+ async #readOrRefuse(path, documentId) {
357
+ try {
358
+ return await readFile(path, "utf8");
359
+ }
360
+ catch {
361
+ throw new DocumentWriteError("document_file_missing", `no materialized file for document ${documentId} at ${path} — materialize it before publishing`);
362
+ }
363
+ }
364
+ #assertSupported(documentType) {
365
+ if (!TEXT_TYPES.has(documentType) && !JSON_TYPES.has(documentType)) {
366
+ throw new DocumentWriteError("document_type_unsupported", `no diff strategy for '${documentType}' — supported types are ${[...TEXT_TYPES, ...JSON_TYPES].join(", ")}`);
367
+ }
368
+ }
369
+ #assertId(value, field) {
370
+ if (!ID_PATTERN.test(value)) {
371
+ throw new DocumentWriteError("document_id_invalid", `${field} must be 64 lowercase hex characters — it becomes a path component, and an ` +
372
+ `unvalidated one escapes the workspace`);
373
+ }
374
+ }
375
+ }
376
+ /**
377
+ * Line-level hunks between two texts, as character offsets into `before`.
378
+ *
379
+ * Lines are represented as CHUNKS — each line carries its own trailing newline, except the last,
380
+ * which does not. That representation is what makes newline handling fall out instead of being
381
+ * special-cased: appending a line to "a\nb" turns the chunk "b" into "b\n" + "c", so the LCS
382
+ * sees the last line as changed and the hunk replaces "b" with "b\nc". A hand-rolled
383
+ * prefix/suffix trim got this wrong for every edit that changed the line count — measured, four
384
+ * of six ordinary markdown edits published text that was not what the file said.
385
+ *
386
+ * A real LCS (not a prefix/suffix trim) is required because the whole point is to emit SEPARATE
387
+ * hunks for separated edits: one span from the first change to the last would delete and
388
+ * re-insert everything between them as new operations, resurrecting text a peer concurrently
389
+ * deleted. Under publish-on-intent, multi-edit publishes are the modal case.
390
+ */
391
+ export function lineHunks(before, after) {
392
+ if (before === after)
393
+ return [];
394
+ const a = toChunks(before);
395
+ const b = toChunks(after);
396
+ // O(n·m) table. Documents this large are not the collaborative-editing case, and a quadratic
397
+ // table on them would be the wrong kind of thorough — fall back to one hunk and say so.
398
+ if (a.length > LCS_LINE_LIMIT || b.length > LCS_LINE_LIMIT) {
399
+ return [{ from: 0, to: before.length, insert: after }];
400
+ }
401
+ // Longest common subsequence over chunks.
402
+ const lcs = Array.from({ length: a.length + 1 }, () => new Array(b.length + 1).fill(0));
403
+ for (let i = a.length - 1; i >= 0; i--) {
404
+ for (let j = b.length - 1; j >= 0; j--) {
405
+ lcs[i][j] = a[i] === b[j] ? lcs[i + 1][j + 1] + 1 : Math.max(lcs[i + 1][j], lcs[i][j + 1]);
406
+ }
407
+ }
408
+ // Walk the table, collecting contiguous runs of non-matching chunks into hunks.
409
+ const offsets = [0];
410
+ for (const chunk of a)
411
+ offsets.push(offsets[offsets.length - 1] + chunk.length);
412
+ const hunks = [];
413
+ let i = 0;
414
+ let j = 0;
415
+ while (i < a.length || j < b.length) {
416
+ if (i < a.length && j < b.length && a[i] === b[j]) {
417
+ i++;
418
+ j++;
419
+ continue;
420
+ }
421
+ const startI = i;
422
+ const startJ = j;
423
+ while ((i < a.length || j < b.length) &&
424
+ !(i < a.length && j < b.length && a[i] === b[j])) {
425
+ if (j < b.length && (i === a.length || lcs[i][j + 1] >= lcs[i + 1][j]))
426
+ j++;
427
+ else
428
+ i++;
429
+ }
430
+ hunks.push({
431
+ from: offsets[startI],
432
+ to: offsets[i],
433
+ insert: b.slice(startJ, j).join(""),
434
+ });
435
+ }
436
+ return hunks;
437
+ }
438
+ /** Above this many lines the LCS table is not worth building — see `lineHunks`. */
439
+ const LCS_LINE_LIMIT = 4000;
440
+ /** Lines carrying their own trailing newline; the last line carries none. */
441
+ function toChunks(text) {
442
+ const lines = text.split("\n");
443
+ return lines.map((line, index) => (index < lines.length - 1 ? `${line}\n` : line));
444
+ }
445
+ //# sourceMappingURL=document-write-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-write-path.js","sourceRoot":"","sources":["../src/document-write-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC,8FAA8F;AAC9F,MAAM,SAAS,GAAG,SAAS,CAAC;AAC5B,MAAM,QAAQ,GAAG,MAAM,CAAC;AAExB,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AAC9D,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAErC,4EAA4E;AAC5E,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAYpC,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,MAAM,CAAuB;IAC7B,MAAM,CAAS;IACxB,YAAY,MAA4B,EAAE,MAAc;QACtD,KAAK,CAAC,GAAG,MAAM,KAAK,MAAM,EAAE,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC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  isAgentOnline: (agentName: string) => boolean;
6
6
  ensureStandingReceiver: (agentName: string) => Promise<void>;
7
7
  drainParked: (agentName: string) => Promise<void>;
8
+ /**
9
+ * M12-P12: the SENDER half. `drainParked` pulls what OTHERS parked for this agent; this re-parks
10
+ * what THIS agent failed to deposit. Both are stranded by the same relay churn, so both belong on
11
+ * the same reconnect — draining only the inbound half leaves the outbound message lost.
12
+ * Optional so existing callers/tests keep compiling; absent means sender re-park is skipped.
13
+ */
14
+ flushSender?: (agentName: string) => Promise<void>;
8
15
  }
9
16
  /**
10
17
  * Build the `onConnected` callback for an agent's SignalingManager. Fire-and-forget by contract —
@@ -1 +1 @@
1
- {"version":3,"file":"reconnect-drain.d.ts","sourceRoot":"","sources":["../src/reconnect-drain.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,iGAAiG;IACjG,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,sBAAsB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,kBAAkB,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CA4B1F"}
1
+ {"version":3,"file":"reconnect-drain.d.ts","sourceRoot":"","sources":["../src/reconnect-drain.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,iGAAiG;IACjG,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,sBAAsB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,kBAAkB,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAyC1F"}
@@ -26,10 +26,24 @@ import { extractErrorMessage } from "./session-relay-client.js";
26
26
  * of the stage that produced it.
27
27
  */
28
28
  export function createReconnectDrain(deps) {
29
- const { logger, isAgentOnline, ensureStandingReceiver, drainParked } = deps;
30
- const drain = (agentName) => drainParked(agentName).catch((err) => {
31
- logger.warn("content.recover.auto.failed", { agentName, stage: "reconnect", error: extractErrorMessage(err) });
32
- });
29
+ const { logger, isAgentOnline, ensureStandingReceiver, drainParked, flushSender } = deps;
30
+ const drain = (agentName) => {
31
+ // Sender re-park first: it needs the receiver the ensure step just rebuilt, and a failure here
32
+ // must not cost the inbound pull — hence its own catch rather than a shared chain.
33
+ // Wrapped rather than `flushSender(agentName).catch(...)`: a dep that throws SYNCHRONOUSLY would
34
+ // otherwise propagate out of drain() and take the inbound pull with it — the exact coupling the
35
+ // separate catch exists to prevent.
36
+ if (flushSender) {
37
+ void Promise.resolve()
38
+ .then(() => flushSender(agentName))
39
+ .catch((err) => {
40
+ logger.warn("content.park.flush.failed", { agentName, stage: "reconnect", error: extractErrorMessage(err) });
41
+ });
42
+ }
43
+ return drainParked(agentName).catch((err) => {
44
+ logger.warn("content.recover.auto.failed", { agentName, stage: "reconnect", error: extractErrorMessage(err) });
45
+ });
46
+ };
33
47
  return (agentName) => {
34
48
  // The ensure fires on the FIRST connect too, and an agent that was never started must not
35
49
  // acquire a receiver here. Re-entry at start is harmless — the ensure returns immediately when
@@ -1 +1 @@
1
- {"version":3,"file":"reconnect-drain.js","sourceRoot":"","sources":["../src/reconnect-drain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAWhE;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAwB;IAC3D,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,sBAAsB,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAE5E,MAAM,KAAK,GAAG,CAAC,SAAiB,EAAiB,EAAE,CACjD,WAAW,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;QAC5C,MAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACjH,CAAC,CAAC,CAAC;IAEL,OAAO,CAAC,SAAiB,EAAQ,EAAE;QACjC,0FAA0F;QAC1F,+FAA+F;QAC/F,yCAAyC;QACzC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,CAAC;YAC9B,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;YACtB,OAAO;QACT,CAAC;QACD,KAAK,sBAAsB,CAAC,SAAS,CAAC,CAAC,IAAI,CACzC,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,EACtB,CAAC,GAAY,EAAE,EAAE;YACf,MAAM,CAAC,IAAI,CAAC,6CAA6C,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC3G,oFAAoF;YACpF,sFAAsF;YACtF,0FAA0F;YAC1F,4FAA4F;YAC5F,OAAO,KAAK,CAAC,SAAS,CAAC,CAAC;QAC1B,CAAC,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAA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SAAS,CAAC,CAAC;YACtB,OAAO;QACT,CAAC;QACD,KAAK,sBAAsB,CAAC,SAAS,CAAC,CAAC,IAAI,CACzC,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,EACtB,CAAC,GAAY,EAAE,EAAE;YACf,MAAM,CAAC,IAAI,CAAC,6CAA6C,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC3G,oFAAoF;YACpF,sFAAsF;YACtF,0FAA0F;YAC1F,4FAA4F;YAC5F,OAAO,KAAK,CAAC,SAAS,CAAC,CAAC;QAC1B,CAAC,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
@@ -45,6 +45,14 @@ export interface AwaitingContentEntry {
45
45
  sessionId: string;
46
46
  contentHashHex: string;
47
47
  contentBlob: Uint8Array;
48
+ /** M12-P12 (review F2): the relay's signed ordering record, carried so a RE-park is self-ordering
49
+ * exactly like the live park. Without it `recoverParkedFromRelay` falls back to the in-memory
50
+ * #witnessedSeq map, which is empty after a receiver restart — the content then appends at its
51
+ * ARRIVAL index instead of its witnessed sequence, and the session tree diverges at seal.
52
+ * Nullable: rows written before this column existed, and the agent-less direct-retry rows,
53
+ * legitimately have none. */
54
+ structure1Cbor?: Uint8Array;
55
+ structure2Cbor?: Uint8Array;
48
56
  queuedAt: number;
49
57
  position: number;
50
58
  }
@@ -82,7 +90,7 @@ export declare class RetryQueue {
82
90
  * retry_queue table (awaiting_ack = 1) so a crash before the relay park confirms is
83
91
  * recoverable at startup. Idempotent on (agentId, sessionId, contentHash).
84
92
  */
85
- enqueueAwaitingContent(agentId: string, sessionId: string, contentHash: Uint8Array, contentBlob: Uint8Array): void;
93
+ enqueueAwaitingContent(agentId: string, sessionId: string, contentHash: Uint8Array, contentBlob: Uint8Array, structure1Cbor?: Uint8Array, structure2Cbor?: Uint8Array): void;
86
94
  /** Remove an awaiting-ACK entry once its `persisted` ACK arrives. */
87
95
  markContentAcked(agentId: string, sessionId: string, contentHash: Uint8Array): void;
88
96
  /** Awaiting-ACK depth for a session (un-acked content count). */
@@ -1 +1 @@
1
- {"version":3,"file":"retry-queue.d.ts","sourceRoot":"","sources":["../src/retry-queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,gEAAgE;AAChE,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,+CAA+C;AAC/C,MAAM,MAAM,YAAY,GAAG;IAAE,SAAS,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,SAAS,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAErF,MAAM,MAAM,QAAQ,GAAG,CAAC,WAAW,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;sFAIkF;IAClF,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,8DAA8D;AAC9D,MAAM,MAAM,UAAU,GAAG;IAAE,MAAM,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7E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