@cello-protocol/daemon 0.0.184 → 0.0.186
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.
- package/dist/assignment-verify.d.ts.map +1 -1
- package/dist/assignment-verify.js +2 -2
- package/dist/assignment-verify.js.map +1 -1
- package/dist/content-park.js +1 -1
- package/dist/content-park.js.map +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +2 -1
- package/dist/daemon.js.map +1 -1
- package/dist/error-message.d.ts +7 -0
- package/dist/error-message.d.ts.map +1 -0
- package/dist/error-message.js +19 -0
- package/dist/error-message.js.map +1 -0
- package/dist/ipc-server.d.ts.map +1 -1
- package/dist/ipc-server.js +26 -3
- package/dist/ipc-server.js.map +1 -1
- package/dist/reconnect-drain.js +1 -1
- package/dist/reconnect-drain.js.map +1 -1
- package/dist/session-assignment-parser.d.ts.map +1 -1
- package/dist/session-assignment-parser.js +19 -0
- package/dist/session-assignment-parser.js.map +1 -1
- package/dist/session-content-handlers.d.ts +42 -0
- package/dist/session-content-handlers.d.ts.map +1 -1
- package/dist/session-content-handlers.js +193 -4
- package/dist/session-content-handlers.js.map +1 -1
- package/dist/session-node-manager.d.ts +1 -0
- package/dist/session-node-manager.d.ts.map +1 -1
- package/dist/session-node-manager.js +18 -2
- package/dist/session-node-manager.js.map +1 -1
- package/dist/session-relay-client.d.ts +0 -6
- package/dist/session-relay-client.d.ts.map +1 -1
- package/dist/session-relay-client.js +1 -18
- package/dist/session-relay-client.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract a real message from a thrown value. libp2p / cross-package errors are not
|
|
3
|
+
* always `instanceof Error` in this realm (multi-version split), so fall back to a
|
|
4
|
+
* `message` property or JSON — never the useless "[object Object]".
|
|
5
|
+
*/
|
|
6
|
+
export declare function extractErrorMessage(err: unknown): string;
|
|
7
|
+
//# sourceMappingURL=error-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-message.d.ts","sourceRoot":"","sources":["../src/error-message.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAUxD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract a real message from a thrown value. libp2p / cross-package errors are not
|
|
3
|
+
* always `instanceof Error` in this realm (multi-version split), so fall back to a
|
|
4
|
+
* `message` property or JSON — never the useless "[object Object]".
|
|
5
|
+
*/
|
|
6
|
+
export function extractErrorMessage(err) {
|
|
7
|
+
if (err instanceof Error)
|
|
8
|
+
return err.message;
|
|
9
|
+
if (err && typeof err === "object" && typeof err.message === "string") {
|
|
10
|
+
return err.message;
|
|
11
|
+
}
|
|
12
|
+
try {
|
|
13
|
+
return JSON.stringify(err);
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return String(err);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=error-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-message.js","sourceRoot":"","sources":["../src/error-message.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC9C,IAAI,GAAG,YAAY,KAAK;QAAE,OAAO,GAAG,CAAC,OAAO,CAAC;IAC7C,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAQ,GAA6B,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjG,OAAQ,GAA2B,CAAC,OAAO,CAAC;IAC9C,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;AACH,CAAC"}
|
package/dist/ipc-server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ipc-server.d.ts","sourceRoot":"","sources":["../src/ipc-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAKH,OAAO,KAAK,EAAE,MAAM,EAA2B,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ipc-server.d.ts","sourceRoot":"","sources":["../src/ipc-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAKH,OAAO,KAAK,EAAE,MAAM,EAA2B,eAAe,EAAE,MAAM,YAAY,CAAC;AAGnF,kGAAkG;AAClG,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;CAC7C;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEjH,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;AAE5F,MAAM,WAAW,SAAS;IACxB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,kBAAkB,IAAI,MAAM,CAAC;IAC7B,YAAY,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAClD,qFAAqF;IACrF,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,GAAG,OAAO,CAAC;IAC/E,wCAAwC;IACxC,gBAAgB,IAAI,MAAM,EAAE,CAAC;CAC9B;AASD,wBAAgB,eAAe,CAC7B,MAAM,EAAE,eAAe;AACvB;;;;GAIG;AACH,QAAQ,EAAE,aAAa,GACtB,SAAS,CAoWX"}
|
package/dist/ipc-server.js
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
import { createServer } from "node:net";
|
|
31
31
|
import { chmod, stat, unlink } from "node:fs/promises";
|
|
32
32
|
import { randomUUID } from "node:crypto";
|
|
33
|
+
import { extractErrorMessage } from "./error-message.js";
|
|
33
34
|
export function createIpcServer(config,
|
|
34
35
|
/**
|
|
35
36
|
* Looked up per request, never enumerated. Typed as the lookup alone so the daemon can pass a
|
|
@@ -196,12 +197,34 @@ handlers) {
|
|
|
196
197
|
}
|
|
197
198
|
})
|
|
198
199
|
.catch((err) => {
|
|
200
|
+
// extractErrorMessage, NOT String(err): handlers reject with structured plain objects as
|
|
201
|
+
// well as Errors, and String() on a plain object yields the literal "[object Object]" —
|
|
202
|
+
// the cause is destroyed at the point of reporting. The SAME extracted text goes to the
|
|
203
|
+
// log, so a failure is diagnosable from the daemon log alone; the response's guidance
|
|
204
|
+
// sends the reader there and is only true because of this log line.
|
|
205
|
+
const message = extractErrorMessage(err);
|
|
206
|
+
// `reason` alongside the message, because extractErrorMessage returns only the prose and
|
|
207
|
+
// the transport's structured throws carry the discriminator separately — `no_connection`
|
|
208
|
+
// vs `connection_lost` is what decides whether re-dialling can help (transport node.ts).
|
|
209
|
+
// Dropping it here would leave the log the guidance points at unable to answer the first
|
|
210
|
+
// question its reader has.
|
|
211
|
+
const reason = err && typeof err === "object" && !(err instanceof Error)
|
|
212
|
+
&& typeof err.reason === "string"
|
|
213
|
+
? err.reason
|
|
214
|
+
: undefined;
|
|
215
|
+
logger.error("daemon.ipc.request.failed", {
|
|
216
|
+
connectionId: conn.id,
|
|
217
|
+
method: request.method,
|
|
218
|
+
requestId: request.id,
|
|
219
|
+
error: message,
|
|
220
|
+
...(reason !== undefined ? { reason } : {}),
|
|
221
|
+
});
|
|
199
222
|
try {
|
|
200
223
|
const resp = {
|
|
201
224
|
id: request.id,
|
|
202
225
|
error: {
|
|
203
226
|
code: "internal_error",
|
|
204
|
-
message
|
|
227
|
+
message,
|
|
205
228
|
guidance: "An unexpected error occurred. Check daemon logs for details.",
|
|
206
229
|
},
|
|
207
230
|
};
|
|
@@ -318,7 +341,7 @@ handlers) {
|
|
|
318
341
|
if (err.code !== "ENOENT") {
|
|
319
342
|
logger.warn("daemon.ipc.socket.unlink.failed", {
|
|
320
343
|
socketPath,
|
|
321
|
-
error:
|
|
344
|
+
error: extractErrorMessage(err),
|
|
322
345
|
});
|
|
323
346
|
}
|
|
324
347
|
}
|
|
@@ -343,7 +366,7 @@ handlers) {
|
|
|
343
366
|
catch (err) {
|
|
344
367
|
logger.debug("daemon.ipc.notification.write.failed", {
|
|
345
368
|
connectionId,
|
|
346
|
-
error:
|
|
369
|
+
error: extractErrorMessage(err),
|
|
347
370
|
});
|
|
348
371
|
return false;
|
|
349
372
|
}
|
package/dist/ipc-server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ipc-server.js","sourceRoot":"","sources":["../src/ipc-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,YAAY,EAA4B,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ipc-server.js","sourceRoot":"","sources":["../src/ipc-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,YAAY,EAA4B,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,KAAK,EA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,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YAED,MAAM,GAAG,IAAI,CAAC;QAChB,CAAC;QAED,kBAAkB;YAChB,OAAO,WAAW,CAAC,IAAI,CAAC;QAC1B,CAAC;QAED,YAAY,CAAC,OAA6B;YACxC,iBAAiB,GAAG,OAAO,CAAC;QAC9B,CAAC;QAED,gBAAgB,CAAC,YAAoB,EAAE,YAA6B;YAClE,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YAC3C,IAAI,CAAC,IAAI;gBAAE,OAAO,KAAK,CAAC;YACxB,IAAI,CAAC;gBACH,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;gBAClD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAClC,CAAC;YAAC,OAAO,GAAY,EAAE,CAAC;gBACtB,MAAM,CAAC,KAAK,CAAC,sCAAsC,EAAE;oBACnD,YAAY;oBACZ,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC;iBAChC,CAAC,CAAC;gBACH,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QAED,gBAAgB;YACd,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;QACxC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/reconnect-drain.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* Lives in its own module because the ordering IS the contract, and a contract that only exists
|
|
20
20
|
* inside a 3,000-line composition root is one refactor away from being two `void`s again.
|
|
21
21
|
*/
|
|
22
|
-
import { extractErrorMessage } from "./
|
|
22
|
+
import { extractErrorMessage } from "./error-message.js";
|
|
23
23
|
/**
|
|
24
24
|
* Build the `onConnected` callback for an agent's SignalingManager. Fire-and-forget by contract —
|
|
25
25
|
* the signaling manager gets no promise to await — so every failure is logged here, under the name
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"reconnect-drain.js","sourceRoot":"","sources":["../src/reconnect-drain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAkBzD;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAwB;IAC3D,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,sBAAsB,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAEzF,MAAM,KAAK,GAAG,CAAC,SAAiB,EAAiB,EAAE;QACjD,+FAA+F;QAC/F,mFAAmF;QACnF,iGAAiG;QACjG,gGAAgG;QAChG,oCAAoC;QACpC,IAAI,WAAW,EAAE,CAAC;YAChB,KAAK,OAAO,CAAC,OAAO,EAAE;iBACnB,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;iBAClC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;gBACtB,MAAM,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC/G,CAAC,CAAC,CAAC;QACP,CAAC;QACD,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;YACnD,MAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACjH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,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,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-assignment-parser.d.ts","sourceRoot":"","sources":["../src/session-assignment-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAcxE;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG,wBAAwB,GAAG,qBAAqB,CAAC;AAkE9E;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;AAC5B;;;;GAIG;AACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GAC5C,iBAAiB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"session-assignment-parser.d.ts","sourceRoot":"","sources":["../src/session-assignment-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2B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|
|
|
159
159
|
const counterpartySessionAddrs = parseStringArray(raw["counterparty_session_addrs"]) ?? undefined;
|
|
160
160
|
const transportModeRaw = raw["transport_mode"];
|
|
161
161
|
const transportMode = transportModeRaw === "direct" ? "direct" : transportModeRaw === "relay" ? "relay" : undefined;
|
|
162
|
+
/**
|
|
163
|
+
* 017-TBS. These two are read DIFFERENTLY from the peer ids above, and the difference is the
|
|
164
|
+
* whole reason the verifier can reconstruct the right layout.
|
|
165
|
+
*
|
|
166
|
+
* A peer id of `""` means "the directory never learned this endpoint", so it becomes `undefined`
|
|
167
|
+
* and both sides drop to the short layout. These two are not like that: `high_stakes: false` and
|
|
168
|
+
* `prior_relay_id: ""` are ANSWERS — "not high stakes" and "this is a fresh session, no prior
|
|
169
|
+
* relay". Mapping either to `undefined` would silently take the verifier to the 10-field layout
|
|
170
|
+
* while the directory signed 12, and every fresh non-high-stakes session — the common case —
|
|
171
|
+
* would fail to verify.
|
|
172
|
+
*
|
|
173
|
+
* So the test is the TYPE, never truthiness: `typeof === "boolean"` admits `false`, and
|
|
174
|
+
* `typeof === "string"` admits `""`. `undefined` here means only one thing — the field was
|
|
175
|
+
* genuinely absent, i.e. a directory that predates this layout.
|
|
176
|
+
*/
|
|
177
|
+
const highStakes = typeof raw["high_stakes"] === "boolean" ? raw["high_stakes"] : undefined;
|
|
178
|
+
const priorRelayId = typeof raw["prior_relay_id"] === "string" ? raw["prior_relay_id"] : undefined;
|
|
162
179
|
const common = {
|
|
163
180
|
session_id: sessionId,
|
|
164
181
|
participant_a: participantA,
|
|
@@ -174,6 +191,8 @@ onTolerated) {
|
|
|
174
191
|
counterparty_session_peer_id: counterpartySessionPeerId,
|
|
175
192
|
counterparty_session_addrs: counterpartySessionAddrs,
|
|
176
193
|
transport_mode: transportMode,
|
|
194
|
+
high_stakes: highStakes,
|
|
195
|
+
prior_relay_id: priorRelayId,
|
|
177
196
|
};
|
|
178
197
|
if (sigType === "frost") {
|
|
179
198
|
const signerPubkey = toU8Safe(ra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ger } from "./co-attendance.js";
|
|
|
13
13
|
* rather than imply one. `sendContent` returns it per-send rather than stashing it by session,
|
|
14
14
|
* because a side map hands a caller the wrong send's signature the moment two are in flight.
|
|
15
15
|
*/
|
|
16
|
+
/**
|
|
17
|
+
* Did the RELAY witness this leaf — the single fact every `witnessed` in this file is read from.
|
|
18
|
+
*
|
|
19
|
+
* `016-RELAYLOSS` review HIGH-2. The first version of the fix put `witnessed` on two of `cello_send`'s
|
|
20
|
+
* FIVE return paths, which defeats the reason it was added at all: a field that is present on some
|
|
21
|
+
* outcomes and absent on others cannot be branched on, and its absence reads as an older daemon
|
|
22
|
+
* rather than as an answer. Worse, the two it missed are the two that matter most — the diverged
|
|
23
|
+
* path is reachable ONLY after an unwitnessed leaf, and the durably-queued path is the one
|
|
24
|
+
* production takes when the relay is also the transport (behind NAT, content and witness die
|
|
25
|
+
* together), where it was telling operators "No action needed."
|
|
26
|
+
*
|
|
27
|
+
* Read off the PLACEMENT, not re-derived from the sequence number, so this and the
|
|
28
|
+
* `session.tree.own_leaf_unwitnessed` ERROR beside it can never disagree about the same send.
|
|
29
|
+
*
|
|
30
|
+
* ⚠️ A HELD leaf (`placed: false`) is WITNESSED, and that is not a special case being papered over.
|
|
31
|
+
* A leaf is held precisely BECAUSE the relay assigned it a position beyond this side's tail — being
|
|
32
|
+
* held is itself proof of an assignment. Reporting `witnessed: false` there would tell an operator
|
|
33
|
+
* their record had lost a message when the opposite is true.
|
|
34
|
+
*/
|
|
35
|
+
export declare function wasWitnessed(p: {
|
|
36
|
+
placed: true;
|
|
37
|
+
unwitnessed?: true;
|
|
38
|
+
} | {
|
|
39
|
+
placed: false;
|
|
40
|
+
}): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The durably-queued path's guidance: the relay's OWN words, plus what a missing witness costs.
|
|
43
|
+
*
|
|
44
|
+
* **Exported so the test can call THIS rather than re-implement it.** The first version of the
|
|
45
|
+
* composition test rebuilt the string inline and asserted on its own copy — which stays green if
|
|
46
|
+
* production stops composing entirely, and is therefore the hollow shape this milestone keeps
|
|
47
|
+
* finding. A rule worth pinning has to be pinned on the code that runs.
|
|
48
|
+
*
|
|
49
|
+
* The rule, and why it is a composition rather than a choice: `upstream` is where the relay's own
|
|
50
|
+
* retry window reaches the operator ("try again in about 45 seconds"), and a rate-limited park is
|
|
51
|
+
* unwitnessed BY CONSTRUCTION — so choosing between the two messages silently drops the more
|
|
52
|
+
* specific one exactly when it is most useful. Both are true at once and the operator needs both.
|
|
53
|
+
*
|
|
54
|
+
* The default splits on `witnessed` for one reason only: "No action needed" is false for a leaf the
|
|
55
|
+
* relay never recorded.
|
|
56
|
+
*/
|
|
57
|
+
export declare function queuedSendGuidance(upstream: string | undefined, witnessed: boolean): string;
|
|
16
58
|
export declare function sentAuthorship(r: Awaited<ReturnType<SessionNodeManager["sendContent"]>>): {
|
|
17
59
|
senderPubkey: Uint8Array;
|
|
18
60
|
senderSig: Uint8Array;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-content-handlers.d.ts","sourceRoot":"","sources":["../src/session-content-handlers.ts"],"names":[],"mappings":"AAmBA,OAAO,EAA2C,KAAK,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC9G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAwE5D;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,CAAC,GACxD;IAAE,YAA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G,IAAI,CAuyC7E"}
|
|
@@ -83,6 +83,58 @@ const AUTO_REPLY_GUIDANCE = "At least one message here is an AUTOMATIC reply gen
|
|
|
83
83
|
* rather than imply one. `sendContent` returns it per-send rather than stashing it by session,
|
|
84
84
|
* because a side map hands a caller the wrong send's signature the moment two are in flight.
|
|
85
85
|
*/
|
|
86
|
+
/**
|
|
87
|
+
* Did the RELAY witness this leaf — the single fact every `witnessed` in this file is read from.
|
|
88
|
+
*
|
|
89
|
+
* `016-RELAYLOSS` review HIGH-2. The first version of the fix put `witnessed` on two of `cello_send`'s
|
|
90
|
+
* FIVE return paths, which defeats the reason it was added at all: a field that is present on some
|
|
91
|
+
* outcomes and absent on others cannot be branched on, and its absence reads as an older daemon
|
|
92
|
+
* rather than as an answer. Worse, the two it missed are the two that matter most — the diverged
|
|
93
|
+
* path is reachable ONLY after an unwitnessed leaf, and the durably-queued path is the one
|
|
94
|
+
* production takes when the relay is also the transport (behind NAT, content and witness die
|
|
95
|
+
* together), where it was telling operators "No action needed."
|
|
96
|
+
*
|
|
97
|
+
* Read off the PLACEMENT, not re-derived from the sequence number, so this and the
|
|
98
|
+
* `session.tree.own_leaf_unwitnessed` ERROR beside it can never disagree about the same send.
|
|
99
|
+
*
|
|
100
|
+
* ⚠️ A HELD leaf (`placed: false`) is WITNESSED, and that is not a special case being papered over.
|
|
101
|
+
* A leaf is held precisely BECAUSE the relay assigned it a position beyond this side's tail — being
|
|
102
|
+
* held is itself proof of an assignment. Reporting `witnessed: false` there would tell an operator
|
|
103
|
+
* their record had lost a message when the opposite is true.
|
|
104
|
+
*/
|
|
105
|
+
export function wasWitnessed(p) {
|
|
106
|
+
return p.placed ? p.unwitnessed !== true : true;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The durably-queued path's guidance: the relay's OWN words, plus what a missing witness costs.
|
|
110
|
+
*
|
|
111
|
+
* **Exported so the test can call THIS rather than re-implement it.** The first version of the
|
|
112
|
+
* composition test rebuilt the string inline and asserted on its own copy — which stays green if
|
|
113
|
+
* production stops composing entirely, and is therefore the hollow shape this milestone keeps
|
|
114
|
+
* finding. A rule worth pinning has to be pinned on the code that runs.
|
|
115
|
+
*
|
|
116
|
+
* The rule, and why it is a composition rather than a choice: `upstream` is where the relay's own
|
|
117
|
+
* retry window reaches the operator ("try again in about 45 seconds"), and a rate-limited park is
|
|
118
|
+
* unwitnessed BY CONSTRUCTION — so choosing between the two messages silently drops the more
|
|
119
|
+
* specific one exactly when it is most useful. Both are true at once and the operator needs both.
|
|
120
|
+
*
|
|
121
|
+
* The default splits on `witnessed` for one reason only: "No action needed" is false for a leaf the
|
|
122
|
+
* relay never recorded.
|
|
123
|
+
*/
|
|
124
|
+
export function queuedSendGuidance(upstream, witnessed) {
|
|
125
|
+
const base = upstream
|
|
126
|
+
?? (witnessed
|
|
127
|
+
? "The message is queued and will be re-sent automatically when the relay link is back. No action needed."
|
|
128
|
+
: "The message is queued and will be re-sent automatically when the relay link is back.");
|
|
129
|
+
if (witnessed)
|
|
130
|
+
return base;
|
|
131
|
+
return base
|
|
132
|
+
+ " The relay did NOT witness this leaf, so your record is now one leaf ahead of it. "
|
|
133
|
+
+ "Ordering does not repair itself: the next message the relay does witness will report this "
|
|
134
|
+
+ "session as diverged, and a diverged session can never be sealed with the counterparty. The "
|
|
135
|
+
+ "re-send is automatic — do not send it again yourself. If the receipt matters, close rather "
|
|
136
|
+
+ "than continuing.";
|
|
137
|
+
}
|
|
86
138
|
export function sentAuthorship(r) {
|
|
87
139
|
/**
|
|
88
140
|
* ⚠️ NOT `r.ok ? …` — that made two of the five call sites DEAD BY CONSTRUCTION.
|
|
@@ -534,7 +586,34 @@ export function registerSessionContentHandlers(deps) {
|
|
|
534
586
|
// "queued and not in the record yet".
|
|
535
587
|
...(placed.placed ? {} : { held: true }),
|
|
536
588
|
sequence_number: queuedLeaf,
|
|
537
|
-
|
|
589
|
+
/**
|
|
590
|
+
* ⚠️ THE BRANCH PRODUCTION ACTUALLY TAKES — review HIGH-2, and the reason the loopback
|
|
591
|
+
* journey could not find it. Behind NAT the direct path runs over the relay's circuit, so
|
|
592
|
+
* a relay outage kills the transport and the witness TOGETHER and the send lands here
|
|
593
|
+
* rather than on the delivered path. On the harness the two are independent, the direct
|
|
594
|
+
* send succeeds, and this branch is never reached.
|
|
595
|
+
*
|
|
596
|
+
* It was answering "No action needed" for a leaf the relay never witnessed.
|
|
597
|
+
*/
|
|
598
|
+
witnessed: wasWitnessed(placed),
|
|
599
|
+
/**
|
|
600
|
+
* ⚠️ COMPOSED, NEVER CHOSEN — the first version of this fix CHOSE, and that discarded a
|
|
601
|
+
* shipped guarantee. Caught deterministically by the `013-ABSENCE` lane in
|
|
602
|
+
* `dod-m15-park-envelope-coded-error.test.ts`.
|
|
603
|
+
*
|
|
604
|
+
* A RATE-LIMITED park is unwitnessed BY CONSTRUCTION, so making the whole string
|
|
605
|
+
* conditional on witnessing threw away `sendResult.guidance` — which is where the relay's
|
|
606
|
+
* own retry window lives ("about 45 seconds"). That is Invariant 3 aimed back at this
|
|
607
|
+
* unit: a downstream handler replacing an upstream descriptive value with a generic one.
|
|
608
|
+
* The upstream sentence is more specific than anything this layer can produce, and a
|
|
609
|
+
* missing witness does not make it less true.
|
|
610
|
+
*
|
|
611
|
+
* Both facts hold at once and the operator needs both — what the relay said to do, and
|
|
612
|
+
* what the missing witness will cost. So upstream is kept VERBATIM and the unwitnessed
|
|
613
|
+
* note is APPENDED to it, by `queuedSendGuidance`, which the test calls directly rather
|
|
614
|
+
* than re-implementing.
|
|
615
|
+
*/
|
|
616
|
+
guidance: queuedSendGuidance(sendResult.guidance, wasWitnessed(placed)),
|
|
538
617
|
};
|
|
539
618
|
}
|
|
540
619
|
return {
|
|
@@ -572,6 +651,13 @@ export function registerSessionContentHandlers(deps) {
|
|
|
572
651
|
sequence_number: -1,
|
|
573
652
|
held: true,
|
|
574
653
|
held_at: placement.heldAt,
|
|
654
|
+
/**
|
|
655
|
+
* TRUE, and it is not a courtesy default — review HIGH-2. A leaf is HELD precisely because
|
|
656
|
+
* the relay assigned it a position beyond this side's tail, so being held is itself proof
|
|
657
|
+
* that the relay witnessed it. Omitting the field here would leave an agent branching on
|
|
658
|
+
* `witnessed !== true` reading a perfectly healthy message as a lost one.
|
|
659
|
+
*/
|
|
660
|
+
witnessed: wasWitnessed(placement),
|
|
575
661
|
// The screening verdict must survive this return, or an agent whose message was ALTERED is
|
|
576
662
|
// never told — the one thing a redact verdict exists to surface.
|
|
577
663
|
...(modified ? { modified: true, transformations: (outboundVerdict.events ?? []).filter((e) => e.disposition === "redact") } : {}),
|
|
@@ -592,6 +678,22 @@ export function registerSessionContentHandlers(deps) {
|
|
|
592
678
|
ok: true,
|
|
593
679
|
sequence_number: placement.leafIndex,
|
|
594
680
|
diverged: true,
|
|
681
|
+
/**
|
|
682
|
+
* ⚠️ THIS IS `true`, AND THE FIRST VERSION OF THIS COMMENT SAID OTHERWISE — review HIGH-B.
|
|
683
|
+
*
|
|
684
|
+
* The divergence branch is reached only when the relay DID assign a sequence, one behind
|
|
685
|
+
* this side's frontier (`assignedSeq < nextExpected`). So the relay witnessed this leaf; it
|
|
686
|
+
* witnessed it at a position our tree has already passed. `witnessed: true` is the honest
|
|
687
|
+
* answer and `diverged: true` is the field that carries the bad news here.
|
|
688
|
+
*
|
|
689
|
+
* I had written that this return was "reachable only after an unwitnessed leaf" and would
|
|
690
|
+
* otherwise report `witnessed: undefined`, so the operator could never see the `false` the
|
|
691
|
+
* guidance told them to watch for. The first half is true — divergence is caused by an
|
|
692
|
+
* earlier unwitnessed append — and the conclusion drawn from it was not: THIS send was
|
|
693
|
+
* witnessed. Recorded rather than silently corrected, because a comment asserting the wrong
|
|
694
|
+
* value of the field beside it is how the next reader learns the wrong model.
|
|
695
|
+
*/
|
|
696
|
+
witnessed: wasWitnessed(placement),
|
|
595
697
|
...(modified ? { modified: true, transformations: (outboundVerdict.events ?? []).filter((e) => e.disposition === "redact") } : {}),
|
|
596
698
|
guidance: `The message was delivered and is in your transcript. But this session's record has drifted out of step with the relay's ordering, so it can no longer be sealed with the counterparty — there will be no notarized receipt for it. Keep talking if you want to; when you are finished, cello_close_session ${sessionId} { force: true } is the only way it can end. cello_transcript ${sessionId} is the record you keep.`,
|
|
597
699
|
};
|
|
@@ -638,6 +740,8 @@ export function registerSessionContentHandlers(deps) {
|
|
|
638
740
|
delivered: false,
|
|
639
741
|
reason: "dispatched_to_relay",
|
|
640
742
|
modified,
|
|
743
|
+
// Same fact, same shape, both branches — see the note on the delivered path below.
|
|
744
|
+
witnessed: wasWitnessed(placement),
|
|
641
745
|
/**
|
|
642
746
|
* WHAT IS ACTUALLY TRUE, and the previous wording was neither.
|
|
643
747
|
*
|
|
@@ -655,10 +759,38 @@ export function registerSessionContentHandlers(deps) {
|
|
|
655
759
|
*
|
|
656
760
|
* So: say what happened, say what to expect, and claim nothing about their daemon.
|
|
657
761
|
*/
|
|
658
|
-
|
|
659
|
-
|
|
762
|
+
/**
|
|
763
|
+
* `016-RELAYLOSS`: **"witnessed" IS NOT SOMETHING THIS STRING GETS TO ASSERT.**
|
|
764
|
+
*
|
|
765
|
+
* It said so unconditionally, and it is false on exactly the path this order measured: a
|
|
766
|
+
* relay that stops answering fails the hash submit and the leaf is appended unwitnessed,
|
|
767
|
+
* while the content can still reach the counterparty. The reassurance was then strictly
|
|
768
|
+
* worse than silence — it named the property that had just been lost as the reason not to
|
|
769
|
+
* worry. Claimed only when true; the rest of the sentence is unchanged and still right.
|
|
770
|
+
*/
|
|
771
|
+
/**
|
|
772
|
+
* ⚠️ "NO ACTION IS NEEDED" IS CONDITIONAL TOO — review HIGH-C, and the same mistake the
|
|
773
|
+
* queued path had already fixed one branch away.
|
|
774
|
+
*
|
|
775
|
+
* The first version left that reassurance unconditional and then contradicted it three
|
|
776
|
+
* words later: no action is needed… BUT this session is on its way to being unsealable.
|
|
777
|
+
* Telling the operator to relax and then telling them the conversation is dying is worse
|
|
778
|
+
* than either sentence alone, because the one they act on is the first.
|
|
779
|
+
*
|
|
780
|
+
* This branch also named no remedy at all, while its two siblings both say to close. Same
|
|
781
|
+
* situation, same advice.
|
|
782
|
+
*/
|
|
783
|
+
guidance: "Sent. This message went via the relay rather than a direct connection, so it is sealed"
|
|
784
|
+
+ (wasWitnessed(placement) ? ", witnessed" : "") + " and on its way — the counterparty "
|
|
785
|
+
+ "normally has it within seconds. "
|
|
660
786
|
+ "`delivered: false` means it did not go over a direct link, NOT that it failed. "
|
|
661
|
-
+
|
|
787
|
+
+ (wasWitnessed(placement)
|
|
788
|
+
? "No action is needed, and re-sending would duplicate it."
|
|
789
|
+
: "Do not re-send — that would duplicate it. BUT the relay did NOT witness this leaf, so "
|
|
790
|
+
+ "the ordering authority has no copy of it and your record is a leaf ahead of the "
|
|
791
|
+
+ "relay's. Ordering does not repair itself: the next message the relay does witness "
|
|
792
|
+
+ "will report this session as diverged, and a diverged session can never be sealed "
|
|
793
|
+
+ "with the counterparty. If the receipt matters, close rather than continuing."),
|
|
662
794
|
...(modified ? { transformations: (outboundVerdict.events ?? []).filter((e) => e.disposition === "redact") } : {}),
|
|
663
795
|
};
|
|
664
796
|
}
|
|
@@ -674,6 +806,63 @@ export function registerSessionContentHandlers(deps) {
|
|
|
674
806
|
sequence_number: leafIndex,
|
|
675
807
|
delivered: true,
|
|
676
808
|
modified,
|
|
809
|
+
/**
|
|
810
|
+
* ─── `016-RELAYLOSS`: THE ONE FACT THIS RESPONSE WAS MISSING ─────────────────────────────
|
|
811
|
+
*
|
|
812
|
+
* Measured, not supposed: with the relay black-holed mid-conversation, this send stalled ten
|
|
813
|
+
* seconds and returned exactly the object above — the same `ok`, the same `delivered`, and a
|
|
814
|
+
* `sequence_number` that is a LOCAL leaf index and therefore looks just as healthy. The
|
|
815
|
+
* daemon logged `session.tree.own_leaf_unwitnessed` at ERROR, correctly and in detail, into a
|
|
816
|
+
* file the agent cannot read. The operator's message arrived, they were told it succeeded,
|
|
817
|
+
* and the ordering authority has no copy of it.
|
|
818
|
+
*
|
|
819
|
+
* `witnessed` is stated on BOTH outcomes rather than only the bad one. A field that appears
|
|
820
|
+
* only when something is wrong cannot be relied on by a reader who has never seen it — its
|
|
821
|
+
* absence is indistinguishable from an older daemon, and "absence is not a pass" is the rule
|
|
822
|
+
* this milestone keeps re-learning. Present always, it is a fact the caller can branch on.
|
|
823
|
+
*/
|
|
824
|
+
witnessed: wasWitnessed(placement),
|
|
825
|
+
/**
|
|
826
|
+
* ⚠️ THIS ONCE SAID *"send the next message normally — ordering re-establishes itself."* It
|
|
827
|
+
* was false, and it was the most damaging sentence in the unit that added it — review HIGH-1.
|
|
828
|
+
*
|
|
829
|
+
* `placeOwnLeaf` states the opposite sixty lines away: an unwitnessed append leaves this
|
|
830
|
+
* side's tree one leaf AHEAD of the relay's counter, so "from then on every ack comes back
|
|
831
|
+
* behind our frontier and the two can never agree again — the seal was already lost at the
|
|
832
|
+
* unwitnessed append, not here." The next WITNESSED send therefore takes the divergence
|
|
833
|
+
* branch and marks the session permanently unsealable. Telling the operator to keep talking
|
|
834
|
+
* was telling them to perform the act that makes the loss permanent.
|
|
835
|
+
*
|
|
836
|
+
* Which is this unit's own subject — a reassuring sentence asserting a property already lost
|
|
837
|
+
* — reproduced one clause later in its replacement. Kept as a comment, not quietly deleted,
|
|
838
|
+
* because the reasoning is the part that stops it coming back.
|
|
839
|
+
*
|
|
840
|
+
* `cello status` came out of the advice for the same reason: measured in this unit's own
|
|
841
|
+
* runs, its relay fields read identically during the outage and before it.
|
|
842
|
+
*/
|
|
843
|
+
...(wasWitnessed(placement)
|
|
844
|
+
? {}
|
|
845
|
+
: {
|
|
846
|
+
guidance:
|
|
847
|
+
/**
|
|
848
|
+
* ⚠️ NOT "the counterparty's record cannot gain it" — review MED-D. On THIS branch the
|
|
849
|
+
* direct send succeeded, and the receiving side appends unwitnessed content in arrival
|
|
850
|
+
* order rather than refusing it (refusing would make the relay a precondition for
|
|
851
|
+
* reading your mail). So they do get the message. What nobody gets is an independent
|
|
852
|
+
* record that you sent it — which is the thing actually lost, and the thing the remedy
|
|
853
|
+
* below is for. The old sentence would have had an operator conclude the conversation
|
|
854
|
+
* was already broken bilaterally when the two trees may still agree.
|
|
855
|
+
*/
|
|
856
|
+
"Delivered and in your transcript — but the relay did not witness it, so the ordering "
|
|
857
|
+
+ "authority has no copy of it: the counterparty has your message, and neither of you "
|
|
858
|
+
+ "has independent proof you sent it. Do NOT resend: "
|
|
859
|
+
+ "that adds a second copy to your record and does not witness the first. "
|
|
860
|
+
+ "ORDERING DOES NOT REPAIR ITSELF — your record is now one leaf ahead of the relay's, "
|
|
861
|
+
+ "so the next message the relay DOES witness will report this session as diverged, "
|
|
862
|
+
+ "and a diverged session can never be sealed with the counterparty. If the receipt "
|
|
863
|
+
+ "matters, stop sending and close now; if you keep talking, do it knowing this "
|
|
864
|
+
+ "conversation is unlikely to produce one.",
|
|
865
|
+
}),
|
|
677
866
|
// On a redact, tell the agent exactly what was transformed (the §6 sender-side surface).
|
|
678
867
|
...(modified ? { transformations: (outboundVerdict.events ?? []).filter((e) => e.disposition === "redact") } : {}),
|
|
679
868
|
};
|