@cello-protocol/daemon 0.0.211 → 0.0.213
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/agent-admin-handlers.d.ts.map +1 -1
- package/dist/agent-admin-handlers.js +3 -0
- package/dist/agent-admin-handlers.js.map +1 -1
- package/dist/agent-handlers.d.ts.map +1 -1
- package/dist/agent-handlers.js +44 -0
- package/dist/agent-handlers.js.map +1 -1
- package/dist/agent-id-migration.d.ts.map +1 -1
- package/dist/agent-id-migration.js +11 -2
- package/dist/agent-id-migration.js.map +1 -1
- 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/attendance-wiring.d.ts +2 -21
- package/dist/attendance-wiring.d.ts.map +1 -1
- package/dist/attendance-wiring.js +57 -251
- package/dist/attendance-wiring.js.map +1 -1
- package/dist/away-detection.d.ts +16 -21
- package/dist/away-detection.d.ts.map +1 -1
- package/dist/away-detection.js +34 -23
- package/dist/away-detection.js.map +1 -1
- package/dist/boot-agents.d.ts.map +1 -1
- package/dist/close-session-handler.d.ts.map +1 -1
- package/dist/close-session-handler.js +79 -6
- package/dist/close-session-handler.js.map +1 -1
- package/dist/co-attendance.d.ts +1 -1
- package/dist/co-attendance.js +1 -1
- package/dist/consortium-fingerprint.d.ts +115 -0
- package/dist/consortium-fingerprint.d.ts.map +1 -0
- package/dist/consortium-fingerprint.js +175 -0
- package/dist/consortium-fingerprint.js.map +1 -0
- package/dist/content-park.d.ts.map +1 -1
- package/dist/content-park.js +80 -0
- package/dist/content-park.js.map +1 -1
- package/dist/daemon-handle.d.ts +1 -1
- package/dist/daemon-handle.d.ts.map +1 -1
- package/dist/daemon-status-report.d.ts +10 -2
- package/dist/daemon-status-report.d.ts.map +1 -1
- package/dist/daemon-status-report.js +6 -3
- package/dist/daemon-status-report.js.map +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +57 -27
- package/dist/daemon.js.map +1 -1
- package/dist/directory-bootstrap.d.ts +3 -1
- package/dist/directory-bootstrap.d.ts.map +1 -1
- package/dist/directory-bootstrap.js +3 -1
- package/dist/directory-bootstrap.js.map +1 -1
- package/dist/directory-connect.d.ts.map +1 -1
- package/dist/directory-connect.js +10 -2
- package/dist/directory-connect.js.map +1 -1
- package/dist/disconnect-cleanup.d.ts +7 -0
- package/dist/disconnect-cleanup.d.ts.map +1 -1
- package/dist/disconnect-cleanup.js +16 -1
- package/dist/disconnect-cleanup.js.map +1 -1
- package/dist/document-flag.d.ts +58 -0
- package/dist/document-flag.d.ts.map +1 -0
- package/dist/document-flag.js +70 -0
- package/dist/document-flag.js.map +1 -0
- package/dist/document-gate-wiring.d.ts +61 -0
- package/dist/document-gate-wiring.d.ts.map +1 -0
- package/dist/document-gate-wiring.js +119 -0
- package/dist/document-gate-wiring.js.map +1 -0
- package/dist/document-notify.d.ts +0 -1
- package/dist/document-notify.d.ts.map +1 -1
- package/dist/document-notify.js +0 -1
- package/dist/document-notify.js.map +1 -1
- package/dist/document-store.d.ts +0 -1
- package/dist/document-store.d.ts.map +1 -1
- package/dist/document-store.js +0 -1
- package/dist/document-store.js.map +1 -1
- package/dist/document-write-path.d.ts.map +1 -1
- package/dist/document-write-path.js +2 -9
- package/dist/document-write-path.js.map +1 -1
- package/dist/inbound-sessions.d.ts +3 -1
- package/dist/inbound-sessions.d.ts.map +1 -1
- package/dist/inbound-sessions.js +12 -4
- package/dist/inbound-sessions.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/initiate-session-handler.d.ts.map +1 -1
- package/dist/initiate-session-handler.js +5 -1
- package/dist/initiate-session-handler.js.map +1 -1
- package/dist/ipc-server.d.ts.map +1 -1
- package/dist/ipc-server.js +52 -2
- package/dist/ipc-server.js.map +1 -1
- package/dist/park-envelope.d.ts +68 -0
- package/dist/park-envelope.d.ts.map +1 -1
- package/dist/park-envelope.js +86 -1
- package/dist/park-envelope.js.map +1 -1
- package/dist/park-recovery.d.ts +46 -0
- package/dist/park-recovery.d.ts.map +1 -1
- package/dist/park-recovery.js +100 -1
- package/dist/park-recovery.js.map +1 -1
- package/dist/relay-only.d.ts.map +1 -1
- package/dist/relay-only.js +7 -4
- package/dist/relay-only.js.map +1 -1
- package/dist/relay-receipt-store.d.ts +75 -17
- package/dist/relay-receipt-store.d.ts.map +1 -1
- package/dist/relay-receipt-store.js +109 -27
- package/dist/relay-receipt-store.js.map +1 -1
- package/dist/seal-carried-close.d.ts +37 -0
- package/dist/seal-carried-close.d.ts.map +1 -0
- package/dist/seal-carried-close.js +179 -0
- package/dist/seal-carried-close.js.map +1 -0
- package/dist/seal-certified-root-check.d.ts +37 -0
- package/dist/seal-certified-root-check.d.ts.map +1 -0
- package/dist/seal-certified-root-check.js +127 -0
- package/dist/seal-certified-root-check.js.map +1 -0
- package/dist/seal-coordinator.d.ts +6 -1
- package/dist/seal-coordinator.d.ts.map +1 -1
- package/dist/seal-coordinator.js +2 -1
- package/dist/seal-coordinator.js.map +1 -1
- package/dist/seal-escalation.d.ts.map +1 -1
- package/dist/seal-escalation.js +54 -0
- package/dist/seal-escalation.js.map +1 -1
- package/dist/seal-local-terminus.d.ts +41 -0
- package/dist/seal-local-terminus.d.ts.map +1 -0
- package/dist/seal-local-terminus.js +170 -0
- package/dist/seal-local-terminus.js.map +1 -0
- package/dist/seal-relay-silence.d.ts +51 -0
- package/dist/seal-relay-silence.d.ts.map +1 -0
- package/dist/seal-relay-silence.js +76 -0
- package/dist/seal-relay-silence.js.map +1 -0
- package/dist/seal-settle.d.ts +38 -0
- package/dist/seal-settle.d.ts.map +1 -0
- package/dist/seal-settle.js +33 -0
- package/dist/seal-settle.js.map +1 -0
- package/dist/session-assignment-parser.d.ts.map +1 -1
- package/dist/session-assignment-parser.js +5 -0
- package/dist/session-assignment-parser.js.map +1 -1
- package/dist/session-ceremony.d.ts +21 -14
- package/dist/session-ceremony.d.ts.map +1 -1
- package/dist/session-ceremony.js +25 -15
- package/dist/session-ceremony.js.map +1 -1
- package/dist/session-content-context.d.ts +11 -2
- package/dist/session-content-context.d.ts.map +1 -1
- package/dist/session-content-ingest.d.ts +0 -3
- package/dist/session-content-ingest.d.ts.map +1 -1
- package/dist/session-content-ingest.js +18 -111
- package/dist/session-content-ingest.js.map +1 -1
- package/dist/session-content-send.d.ts +5 -0
- package/dist/session-content-send.d.ts.map +1 -1
- package/dist/session-content-send.js +58 -0
- package/dist/session-content-send.js.map +1 -1
- package/dist/session-delivery-acks.d.ts +195 -0
- package/dist/session-delivery-acks.d.ts.map +1 -0
- package/dist/session-delivery-acks.js +674 -0
- package/dist/session-delivery-acks.js.map +1 -0
- package/dist/session-leaf-records.d.ts +28 -1
- package/dist/session-leaf-records.d.ts.map +1 -1
- package/dist/session-leaf-records.js +86 -1
- package/dist/session-leaf-records.js.map +1 -1
- package/dist/session-lifecycle.js +12 -12
- package/dist/session-lifecycle.js.map +1 -1
- package/dist/session-node-manager.d.ts +49 -22
- package/dist/session-node-manager.d.ts.map +1 -1
- package/dist/session-node-manager.js +113 -42
- package/dist/session-node-manager.js.map +1 -1
- package/dist/session-node-types.d.ts +18 -12
- package/dist/session-node-types.d.ts.map +1 -1
- package/dist/session-node-types.js +1 -9
- package/dist/session-node-types.js.map +1 -1
- package/dist/session-read-handlers.d.ts.map +1 -1
- package/dist/session-read-handlers.js +125 -4
- package/dist/session-read-handlers.js.map +1 -1
- package/dist/session-records.d.ts +17 -0
- package/dist/session-records.d.ts.map +1 -1
- package/dist/session-records.js +32 -0
- package/dist/session-records.js.map +1 -1
- package/dist/session-relay-client.d.ts +103 -6
- package/dist/session-relay-client.d.ts.map +1 -1
- package/dist/session-relay-client.js +380 -41
- package/dist/session-relay-client.js.map +1 -1
- package/dist/session-relay.d.ts +24 -2
- package/dist/session-relay.d.ts.map +1 -1
- package/dist/session-relay.js +23 -8
- package/dist/session-relay.js.map +1 -1
- package/dist/session-schema.d.ts.map +1 -1
- package/dist/session-schema.js +43 -0
- package/dist/session-schema.js.map +1 -1
- package/dist/session-seal-leaf-store.d.ts +6 -0
- package/dist/session-seal-leaf-store.d.ts.map +1 -1
- package/dist/session-seal-leaf-store.js +21 -4
- package/dist/session-seal-leaf-store.js.map +1 -1
- package/dist/session-seal.d.ts +30 -32
- package/dist/session-seal.d.ts.map +1 -1
- package/dist/session-seal.js +145 -116
- package/dist/session-seal.js.map +1 -1
- package/dist/session-views.d.ts +1 -0
- package/dist/session-views.d.ts.map +1 -1
- package/dist/session-views.js +81 -1
- package/dist/session-views.js.map +1 -1
- package/dist/signaling-connect.d.ts +1 -0
- package/dist/signaling-connect.d.ts.map +1 -1
- package/dist/signaling-connect.js +0 -1
- package/dist/signaling-connect.js.map +1 -1
- package/dist/status-handler.d.ts +9 -1
- package/dist/status-handler.d.ts.map +1 -1
- package/dist/status-handler.js +5 -2
- package/dist/status-handler.js.map +1 -1
- package/dist/test-handlers.js +4 -3
- package/dist/test-handlers.js.map +1 -1
- package/dist/trust-signal-store.d.ts +4 -2
- package/dist/trust-signal-store.d.ts.map +1 -1
- package/dist/trust-signal-store.js +4 -2
- package/dist/trust-signal-store.js.map +1 -1
- package/dist/types.d.ts +64 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/vocabulary.d.ts +22 -4
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +66 -21
- package/dist/vocabulary.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `DOD-M15-CARRIEDSEAL-1` — THE CLOSING LEAF THIS SIDE WRITES WHEN THERE IS NO RELAY LEFT TO ASK.
|
|
3
|
+
*
|
|
4
|
+
* ─── What this exists to fix ───────────────────────────────────────────────────────────────────
|
|
5
|
+
*
|
|
6
|
+
* A seal needed the relay alive, and for exactly one reason. Every message in a conversation is
|
|
7
|
+
* countersigned by the relay when it is ordered and held by BOTH parties from that moment
|
|
8
|
+
* (`069-ORDERPROOF`), so the record itself survives the relay being restarted, rolled or deleted.
|
|
9
|
+
* What did not survive was the last line: the SEAL control leaf that ends the record was handed to
|
|
10
|
+
* the relay for a sequence number like any other leaf, so a relay that was gone at close time cost
|
|
11
|
+
* the conversation its receipt — a record that was fully witnessed, fully held, and unusable.
|
|
12
|
+
*
|
|
13
|
+
* This writes that one leaf here instead.
|
|
14
|
+
*
|
|
15
|
+
* ─── Why nothing is being taken on trust ───────────────────────────────────────────────────────
|
|
16
|
+
*
|
|
17
|
+
* The leaf invents no facts. **Every field is read out of the carry it closes over**, which is the
|
|
18
|
+
* relay's own ordered log as both parties received it:
|
|
19
|
+
*
|
|
20
|
+
* - **position** — one past the last carried leaf. Contiguity from 1 is checked first, so there is
|
|
21
|
+
* no position to choose.
|
|
22
|
+
* - **`prev_root`** — the RFC 6962 fold over the carried leaves in the Structure 2 domain. This is
|
|
23
|
+
* the value the directory's own chain walk arrives at when it reaches this leaf, so naming any
|
|
24
|
+
* other one breaks the walk rather than fooling it.
|
|
25
|
+
* - **`last_seen`** — the counterparty's newest carried leaf, sequence and content hash.
|
|
26
|
+
* - **`prev_own`** — this side's newest carried leaf.
|
|
27
|
+
* - **`final_root`** — the content-only root, which is what each party signs and what the
|
|
28
|
+
* counterparty's copy must agree with.
|
|
29
|
+
*
|
|
30
|
+
* So the only thing this side supplies that is genuinely its own is the CHOICE TO STOP HERE. That is
|
|
31
|
+
* truncation, it is bounded by design, the counterparty refutes it from their own copy, and the work
|
|
32
|
+
* order says in terms not to chase it.
|
|
33
|
+
*
|
|
34
|
+
* ⚠️ **THE RECEIPT FIELDS ARE ABSENT, AND ABSENT IS NOT THE SAME AS EMPTY.** A leaf carrying a blank
|
|
35
|
+
* relay id would be CLAIMING a witness it cannot produce, and the directory judges that as a
|
|
36
|
+
* malformed receipt — correctly, because missing and malformed must not be told apart. The
|
|
37
|
+
* directory's exemption is for a terminal control leaf with no receipt AT ALL, so this writes none.
|
|
38
|
+
*
|
|
39
|
+
* Crypto refs: RFC 8032 (Ed25519, the sender signature), RFC 6962 §2.1 (the Merkle fold).
|
|
40
|
+
*/
|
|
41
|
+
import { createHash } from "node:crypto";
|
|
42
|
+
import { buildMerkleTree, merkleRoot } from "@cello-protocol/crypto";
|
|
43
|
+
import { encodeSealPayload, encodeStructure1, encodeStructure2, decodeStructure1, SCAN_RESULT_SENTINEL, } from "@cello-protocol/protocol-types";
|
|
44
|
+
/** The SEAL control leaf's kind byte — the same 0x02 the relay path hashes under. */
|
|
45
|
+
const LEAF_KIND_CTRL = 0x02;
|
|
46
|
+
/**
|
|
47
|
+
* ⚠️ FOUR DOMAINS, NOT TWO — review HIGH-2, and the collapsed form is a trust-boundary bug the
|
|
48
|
+
* directory's own `LEAF_KINDS` table already carries a comment about having removed.
|
|
49
|
+
*
|
|
50
|
+
* `prev_root` is a fold over `leafHashFor(kind, structure2)`, and that function prefixes each leaf
|
|
51
|
+
* with its own domain byte. Writing "anything but 0x02 is a message" here makes every session that
|
|
52
|
+
* ever exchanged a DOCUMENT (0x04) or carried a refusal leaf (0x05) compute a prefix root the
|
|
53
|
+
* directory cannot reproduce. It fails as a broken chain and reaches the operator as
|
|
54
|
+
* `unilateral_root_unverifiable`, whose guidance tells them their transcript ORDER is in dispute
|
|
55
|
+
* with their counterparty and to compare copies out of band — a hash-domain bug on this machine,
|
|
56
|
+
* reported as the other person's fault, on exactly the sessions where the receipt matters most.
|
|
57
|
+
*
|
|
58
|
+
* `undefined` for a byte this build cannot name. Guessing a domain for it produces a root nobody
|
|
59
|
+
* else computes, which is the same failure reached by coercion instead of by a refusal.
|
|
60
|
+
*/
|
|
61
|
+
const LEAF_DOMAINS = {
|
|
62
|
+
0x00: "msg",
|
|
63
|
+
0x02: "ctrl",
|
|
64
|
+
0x04: "doc",
|
|
65
|
+
0x05: "reject",
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Refusals, and each one is a case where writing a leaf anyway would make things worse:
|
|
69
|
+
*
|
|
70
|
+
* `seal_carry_empty` nothing was ever witnessed, so there is no record to close.
|
|
71
|
+
* `seal_carry_noncontiguous` a witnessed leaf never reached us; a terminus over a record with a
|
|
72
|
+
* hole in it would be signing a history we know is not the history.
|
|
73
|
+
* `seal_carry_own_ctrl_present` we already closed. A SECOND control leaf from one party makes the
|
|
74
|
+
* session unsealable by any directory, permanently — the caller must
|
|
75
|
+
* reuse the one that is there, never add to it.
|
|
76
|
+
* `seal_carry_unreadable` a leaf this daemon cannot decode is one it cannot chain onto.
|
|
77
|
+
* `seal_carry_leaf_kind_unknown` a leaf kind this build cannot name has no domain to hash in, and
|
|
78
|
+
* a guessed one yields a root nobody else computes.
|
|
79
|
+
*/
|
|
80
|
+
export async function buildLocalSealTerminus(input) {
|
|
81
|
+
const { carry, ownPubkeyHex, sessionIdBytes, genesis, finalRootHex, closeTimestamp, sign } = input;
|
|
82
|
+
if (carry.length === 0)
|
|
83
|
+
return { ok: false, reason: "seal_carry_empty" };
|
|
84
|
+
// Ascending and exactly 1..N. Sorted rather than assumed: the store returns rows ordered, and a
|
|
85
|
+
// terminus that trusted that ordering would be depending on a detail of a query it does not own.
|
|
86
|
+
const ordered = [...carry].sort((a, b) => a.sequenceNumber - b.sequenceNumber);
|
|
87
|
+
for (let i = 0; i < ordered.length; i++) {
|
|
88
|
+
if (ordered[i].sequenceNumber !== i + 1)
|
|
89
|
+
return { ok: false, reason: "seal_carry_noncontiguous" };
|
|
90
|
+
}
|
|
91
|
+
if (ordered.some((l) => l.leafKind === LEAF_KIND_CTRL && l.senderPubkeyHex === ownPubkeyHex)) {
|
|
92
|
+
return { ok: false, reason: "seal_carry_own_ctrl_present" };
|
|
93
|
+
}
|
|
94
|
+
// ── The links, read out of the leaves each party actually authored ──
|
|
95
|
+
// `ordered` is ascending, so the LAST match in each direction is that party's newest leaf. A
|
|
96
|
+
// decode failure anywhere refuses: this side cannot honestly say what it has seen if it cannot
|
|
97
|
+
// read what it holds.
|
|
98
|
+
let lastSeenSeq = 0;
|
|
99
|
+
let lastSeenHash = genesis;
|
|
100
|
+
let prevOwnHash = genesis;
|
|
101
|
+
for (const leaf of ordered) {
|
|
102
|
+
const s1 = decodeStructure1(leaf.structure1Cbor);
|
|
103
|
+
if (!s1.ok)
|
|
104
|
+
return { ok: false, reason: "seal_carry_unreadable" };
|
|
105
|
+
if (leaf.senderPubkeyHex === ownPubkeyHex) {
|
|
106
|
+
prevOwnHash = s1.fields.contentHash;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
lastSeenSeq = leaf.sequenceNumber;
|
|
110
|
+
lastSeenHash = s1.fields.contentHash;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The prefix root, in the STRUCTURE 2 domain — which is not the domain the certified root lives
|
|
115
|
+
* in, and conflating the two is the easiest mistake available here. `prev_root` is checked by the
|
|
116
|
+
* directory's incremental walk over `leafHashFor(kind, encodeStructure2(s2))`; the certified root
|
|
117
|
+
* is the fold over raw content hashes. Same leaves, different pre-images, different values.
|
|
118
|
+
*/
|
|
119
|
+
const prefixInputs = [];
|
|
120
|
+
for (const l of ordered) {
|
|
121
|
+
const domain = LEAF_DOMAINS[l.leafKind];
|
|
122
|
+
if (!domain)
|
|
123
|
+
return { ok: false, reason: "seal_carry_leaf_kind_unknown" };
|
|
124
|
+
prefixInputs.push({ kind: domain, data: l.structure2Cbor });
|
|
125
|
+
}
|
|
126
|
+
const prevRoot = merkleRoot(buildMerkleTree(prefixInputs));
|
|
127
|
+
// The payload and its hash come from ONE derivation, deliberately. When they diverge the directory
|
|
128
|
+
// answers `seal_payload_unbound`, whose guidance accuses the relay of altering bytes — a correct
|
|
129
|
+
// relay named as an attacker for a mismatch made on this machine.
|
|
130
|
+
const payload = encodeSealPayload({
|
|
131
|
+
session_id: sessionIdBytes,
|
|
132
|
+
final_root: new Uint8Array(Buffer.from(finalRootHex, "hex")),
|
|
133
|
+
close_timestamp: closeTimestamp,
|
|
134
|
+
attestation: "PENDING",
|
|
135
|
+
});
|
|
136
|
+
const contentHash = new Uint8Array(createHash("sha256").update(new Uint8Array([LEAF_KIND_CTRL])).update(payload).digest());
|
|
137
|
+
const structure1Cbor = encodeStructure1({
|
|
138
|
+
contentHash,
|
|
139
|
+
senderPubkey: input.ownPubkey,
|
|
140
|
+
sessionId: sessionIdBytes,
|
|
141
|
+
lastSeenSeq,
|
|
142
|
+
timestamp: closeTimestamp,
|
|
143
|
+
lastSeenHash,
|
|
144
|
+
prevOwnHash,
|
|
145
|
+
});
|
|
146
|
+
const senderSignature = await sign(structure1Cbor);
|
|
147
|
+
const sequenceNumber = ordered.length + 1;
|
|
148
|
+
const structure2Cbor = encodeStructure2({
|
|
149
|
+
sequence_number: sequenceNumber,
|
|
150
|
+
sender_pubkey: input.ownPubkey,
|
|
151
|
+
content_hash: contentHash,
|
|
152
|
+
sender_signature: senderSignature,
|
|
153
|
+
scan_result: SCAN_RESULT_SENTINEL,
|
|
154
|
+
prev_root: prevRoot,
|
|
155
|
+
});
|
|
156
|
+
return {
|
|
157
|
+
ok: true,
|
|
158
|
+
payload,
|
|
159
|
+
contentHashHex: Buffer.from(contentHash).toString("hex"),
|
|
160
|
+
// No relay fields. See the header — absent, never blank.
|
|
161
|
+
leaf: {
|
|
162
|
+
sequenceNumber,
|
|
163
|
+
leafKind: LEAF_KIND_CTRL,
|
|
164
|
+
senderPubkeyHex: ownPubkeyHex,
|
|
165
|
+
structure2Cbor,
|
|
166
|
+
structure1Cbor,
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=seal-local-terminus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seal-local-terminus.js","sourceRoot":"","sources":["../src/seal-local-terminus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,UAAU,E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d,QAAQ,EAAE,cAAc;YACxB,eAAe,EAAE,YAAY;YAC7B,cAAc;YACd,cAAc;SACf;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `DOD-M15-CARRIEDSEAL-1` — WHEN THE RELAY GAVE NO ANSWER, as opposed to giving a bad one.
|
|
3
|
+
*
|
|
4
|
+
* The seal writes its own closing leaf only when there was nobody to ask. That is a narrower
|
|
5
|
+
* condition than "the submit failed", and the difference is load-bearing: a relay that REFUSED a
|
|
6
|
+
* leaf has ruled on it, and routing around a ruling is exactly the behaviour a trust layer must not
|
|
7
|
+
* have. A relay that never answered has ruled on nothing.
|
|
8
|
+
*
|
|
9
|
+
* ⚠️ **THE LIST IS AN ALLOW-SET, AND THE DEFAULT IS THE OLD BEHAVIOUR.** A reason that is not here
|
|
10
|
+
* does not unlock the local terminus — the close fails as it does today. That asymmetry is the whole
|
|
11
|
+
* design: a new relay refusal reason added next year cannot silently widen this, because widening
|
|
12
|
+
* requires someone to come here and add it. The reverse default — "fall back unless the reason is
|
|
13
|
+
* one of these known refusals" — would have let every future refusal become a bypass.
|
|
14
|
+
*
|
|
15
|
+
* Every reason below is produced by THIS daemon, in `session-relay-client.ts` or
|
|
16
|
+
* `session-seal.ts`'s transport resolution, at a point where no `hash_submit_ack` came back.
|
|
17
|
+
*
|
|
18
|
+
* Three that are deliberately NOT here, and why each one is an answer rather than a silence:
|
|
19
|
+
* - `relay_assignment_rejected` — the relay considered the session and declined it.
|
|
20
|
+
* - `relay_ack_unverified` / `relay_ack_malformed` — the relay ANSWERED and the answer did not
|
|
21
|
+
* check out. That is a relay to distrust, and letting distrust promote us onto a path with
|
|
22
|
+
* weaker evidence is the wrong direction entirely.
|
|
23
|
+
* - `standing_receiver_unavailable` — this agent is not started. Local, fixable, and the existing
|
|
24
|
+
* guidance ("start the agent and retry") is the correct thing to tell someone.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* ⚠️ THE ALLOW-SET IS NOT SUFFICIENT ON ITS OWN, AND THIS IS THE HALF THAT MAKES IT SOUND.
|
|
28
|
+
*
|
|
29
|
+
* The submit boundary COLLAPSES almost every relay refusal into `relay_unavailable`. Only three
|
|
30
|
+
* token faults survive under their own names (`DOD-M15-TOKENSTALE-1` split those out); everything
|
|
31
|
+
* else the relay actually said — rate limited, over its slot cap, this agent's token rejected as
|
|
32
|
+
* invalid, and by that code's own documented default every future relay-side reason — arrives at
|
|
33
|
+
* this file wearing the label for an outage.
|
|
34
|
+
*
|
|
35
|
+
* So the reason string alone cannot tell "nobody was there" from "they authenticated me and said
|
|
36
|
+
* no". A relay exercising judgement about this agent would have been read as silence and sealed
|
|
37
|
+
* around, which is the one thing this whole design says must never happen.
|
|
38
|
+
*
|
|
39
|
+
* The standing refusal is the signal the boundary drops, and the client still holds it. Ask for it
|
|
40
|
+
* directly rather than trying to infer it from a label that was never going to carry it.
|
|
41
|
+
*
|
|
42
|
+
* **A ruling is anything the relay answered with.** Not a list of known-bad reasons: a set like that
|
|
43
|
+
* defaults to "silence" for anything unfamiliar, which is the wrong direction here — a reason added
|
|
44
|
+
* next year would quietly become a bypass. Present means refused.
|
|
45
|
+
*/
|
|
46
|
+
export declare function relayRefusedUs(refusal: {
|
|
47
|
+
reason: string;
|
|
48
|
+
} | null | undefined): boolean;
|
|
49
|
+
/** The relay never ruled. See the header — this is an allow-set and the default is to fail as before. */
|
|
50
|
+
export declare const RELAY_GAVE_NO_ANSWER: ReadonlySet<string>;
|
|
51
|
+
//# sourceMappingURL=seal-relay-silence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seal-relay-silence.d.ts","sourceRoot":"","sources":["../src/seal-relay-silence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEtF;AAED,yGAAyG;AACzG,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,MAAM,CAyBnD,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `DOD-M15-CARRIEDSEAL-1` — WHEN THE RELAY GAVE NO ANSWER, as opposed to giving a bad one.
|
|
3
|
+
*
|
|
4
|
+
* The seal writes its own closing leaf only when there was nobody to ask. That is a narrower
|
|
5
|
+
* condition than "the submit failed", and the difference is load-bearing: a relay that REFUSED a
|
|
6
|
+
* leaf has ruled on it, and routing around a ruling is exactly the behaviour a trust layer must not
|
|
7
|
+
* have. A relay that never answered has ruled on nothing.
|
|
8
|
+
*
|
|
9
|
+
* ⚠️ **THE LIST IS AN ALLOW-SET, AND THE DEFAULT IS THE OLD BEHAVIOUR.** A reason that is not here
|
|
10
|
+
* does not unlock the local terminus — the close fails as it does today. That asymmetry is the whole
|
|
11
|
+
* design: a new relay refusal reason added next year cannot silently widen this, because widening
|
|
12
|
+
* requires someone to come here and add it. The reverse default — "fall back unless the reason is
|
|
13
|
+
* one of these known refusals" — would have let every future refusal become a bypass.
|
|
14
|
+
*
|
|
15
|
+
* Every reason below is produced by THIS daemon, in `session-relay-client.ts` or
|
|
16
|
+
* `session-seal.ts`'s transport resolution, at a point where no `hash_submit_ack` came back.
|
|
17
|
+
*
|
|
18
|
+
* Three that are deliberately NOT here, and why each one is an answer rather than a silence:
|
|
19
|
+
* - `relay_assignment_rejected` — the relay considered the session and declined it.
|
|
20
|
+
* - `relay_ack_unverified` / `relay_ack_malformed` — the relay ANSWERED and the answer did not
|
|
21
|
+
* check out. That is a relay to distrust, and letting distrust promote us onto a path with
|
|
22
|
+
* weaker evidence is the wrong direction entirely.
|
|
23
|
+
* - `standing_receiver_unavailable` — this agent is not started. Local, fixable, and the existing
|
|
24
|
+
* guidance ("start the agent and retry") is the correct thing to tell someone.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* ⚠️ THE ALLOW-SET IS NOT SUFFICIENT ON ITS OWN, AND THIS IS THE HALF THAT MAKES IT SOUND.
|
|
28
|
+
*
|
|
29
|
+
* The submit boundary COLLAPSES almost every relay refusal into `relay_unavailable`. Only three
|
|
30
|
+
* token faults survive under their own names (`DOD-M15-TOKENSTALE-1` split those out); everything
|
|
31
|
+
* else the relay actually said — rate limited, over its slot cap, this agent's token rejected as
|
|
32
|
+
* invalid, and by that code's own documented default every future relay-side reason — arrives at
|
|
33
|
+
* this file wearing the label for an outage.
|
|
34
|
+
*
|
|
35
|
+
* So the reason string alone cannot tell "nobody was there" from "they authenticated me and said
|
|
36
|
+
* no". A relay exercising judgement about this agent would have been read as silence and sealed
|
|
37
|
+
* around, which is the one thing this whole design says must never happen.
|
|
38
|
+
*
|
|
39
|
+
* The standing refusal is the signal the boundary drops, and the client still holds it. Ask for it
|
|
40
|
+
* directly rather than trying to infer it from a label that was never going to carry it.
|
|
41
|
+
*
|
|
42
|
+
* **A ruling is anything the relay answered with.** Not a list of known-bad reasons: a set like that
|
|
43
|
+
* defaults to "silence" for anything unfamiliar, which is the wrong direction here — a reason added
|
|
44
|
+
* next year would quietly become a bypass. Present means refused.
|
|
45
|
+
*/
|
|
46
|
+
export function relayRefusedUs(refusal) {
|
|
47
|
+
return refusal != null;
|
|
48
|
+
}
|
|
49
|
+
/** The relay never ruled. See the header — this is an allow-set and the default is to fail as before. */
|
|
50
|
+
export const RELAY_GAVE_NO_ANSWER = new Set([
|
|
51
|
+
// No relay client, no stream, or the session is gone from the relay's side.
|
|
52
|
+
"relay_unavailable",
|
|
53
|
+
"relay_client_unavailable",
|
|
54
|
+
"relay_client_closed",
|
|
55
|
+
"relay_stream_closed",
|
|
56
|
+
/**
|
|
57
|
+
* ⚠️ KEPT DELIBERATELY, against a review finding that called it "a relay answer". It is one, and
|
|
58
|
+
* it is still the right side of this line.
|
|
59
|
+
*
|
|
60
|
+
* The relay answers `session_not_found` for a session it no longer holds — and a relay that has
|
|
61
|
+
* RESTARTED holds nothing, because its leaf log is a map in process memory. That is precisely the
|
|
62
|
+
* scenario this order exists for: the witness is gone even though the process is up and talking.
|
|
63
|
+
* Excluding it would mean a restarted relay still costs a conversation its receipt, which is the
|
|
64
|
+
* defect, not the fix.
|
|
65
|
+
*
|
|
66
|
+
* The refusals that must NOT unlock this path are the relay exercising judgement about this agent,
|
|
67
|
+
* and those are caught by `relayRefusedUs` above rather than by this list.
|
|
68
|
+
*/
|
|
69
|
+
"relay_session_gone",
|
|
70
|
+
// The frame never left, or left and was never answered.
|
|
71
|
+
"relay_submit_send_failed",
|
|
72
|
+
"relay_submit_timeout",
|
|
73
|
+
// This daemon has no endpoint to dial any more — the relay is gone as far as it can tell.
|
|
74
|
+
"no_persisted_relay_endpoint",
|
|
75
|
+
]);
|
|
76
|
+
//# sourceMappingURL=seal-relay-silence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seal-relay-silence.js","sourceRoot":"","sources":["../src/seal-relay-silence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,cAAc,CAAC,OAA8C;IAC3E,OAAO,OAAO,IAAI,IAAI,CAAC;AACzB,CAAC;AAED,yGAAyG;AACzG,MAAM,CAAC,MAAM,oBAAoB,GAAwB,IAAI,GAAG,CAAC;IAC/D,4EAA4E;IAC5E,mBAAmB;IACnB,0BAA0B;IAC1B,qBAAqB;IACrB,qBAAqB;IACrB;;;;;;;;;;;;OAYG;IACH,oBAAoB;IACpB,wDAAwD;IACxD,0BAA0B;IAC1B,sBAAsB;IACtB,0FAA0F;IAC1F,6BAA6B;CAC9B,CAAC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOD-M15-SEALPRECOND-1 — wait for this side's own record to stop moving before signing it.
|
|
3
|
+
*
|
|
4
|
+
* ⚠️ THIS IS NOT A DELAY, AND THE DISTINCTION IS THE WHOLE UNIT. On 2026-09-11 the daemon held the
|
|
5
|
+
* relay's ordering confirmation for 352 milliseconds and signed without it; a 14-millisecond gap
|
|
6
|
+
* and a 14-second gap fail identically, so nothing here may be tuned to a window. What is waited
|
|
7
|
+
* ON is a condition of state — `sealReadiness().ownLeavesOrdered`, the leaves of ours the relay has
|
|
8
|
+
* already ordered and this tree has not placed. The bound exists only so a send that never
|
|
9
|
+
* resolves cannot hold the operator's close forever; it is the escape, not the mechanism.
|
|
10
|
+
*
|
|
11
|
+
* The condition is re-read every poll and the wait returns the instant it clears, which is what a
|
|
12
|
+
* fixed sleep cannot do and what the tests assert.
|
|
13
|
+
*/
|
|
14
|
+
import type { SessionNodeManager } from "./session-node-manager.js";
|
|
15
|
+
/**
|
|
16
|
+
* How long a close may wait for its own in-flight send to take its place in the record.
|
|
17
|
+
*
|
|
18
|
+
* Two seconds against a condition that resolved in 14ms when it was measured. Generous on purpose:
|
|
19
|
+
* the cost of waiting too long is an operator's close taking a moment, and the cost of not waiting
|
|
20
|
+
* is a signature no directory can verify and a receipt that is gone for both parties permanently.
|
|
21
|
+
*/
|
|
22
|
+
export declare const SEAL_SETTLE_DEADLINE_MS = 2000;
|
|
23
|
+
export type SealSettleOutcome = {
|
|
24
|
+
settled: true;
|
|
25
|
+
waitedMs: number;
|
|
26
|
+
} | {
|
|
27
|
+
settled: false;
|
|
28
|
+
waitedMs: number;
|
|
29
|
+
ownLeavesOrdered: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Block until this session has no own leaf the relay has ordered and the tree has not placed.
|
|
33
|
+
*
|
|
34
|
+
* Returns immediately — no timer, no microtask hop beyond the read — when the record is already
|
|
35
|
+
* level, which is every ordinary close.
|
|
36
|
+
*/
|
|
37
|
+
export declare function awaitOwnRecordSettled(sessionNodeManager: Pick<SessionNodeManager, "sealReadiness">, agentName: string, sessionId: string, deadlineMs?: number): Promise<SealSettleOutcome>;
|
|
38
|
+
//# sourceMappingURL=seal-settle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seal-settle.d.ts","sourceRoot":"","sources":["../src/seal-settle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,OAAQ,CAAC;AAK7C,MAAM,MAAM,iBAAiB,GACzB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAAE,eAAe,CAAC,EAC7D,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,UAAU,GAAE,MAAgC,GAC3C,OAAO,CAAC,iBAAiB,CAAC,CAe5B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How long a close may wait for its own in-flight send to take its place in the record.
|
|
3
|
+
*
|
|
4
|
+
* Two seconds against a condition that resolved in 14ms when it was measured. Generous on purpose:
|
|
5
|
+
* the cost of waiting too long is an operator's close taking a moment, and the cost of not waiting
|
|
6
|
+
* is a signature no directory can verify and a receipt that is gone for both parties permanently.
|
|
7
|
+
*/
|
|
8
|
+
export const SEAL_SETTLE_DEADLINE_MS = 2_000;
|
|
9
|
+
/** How often the condition is re-read. Short enough that a settled record is not made to wait. */
|
|
10
|
+
const SEAL_SETTLE_POLL_MS = 20;
|
|
11
|
+
/**
|
|
12
|
+
* Block until this session has no own leaf the relay has ordered and the tree has not placed.
|
|
13
|
+
*
|
|
14
|
+
* Returns immediately — no timer, no microtask hop beyond the read — when the record is already
|
|
15
|
+
* level, which is every ordinary close.
|
|
16
|
+
*/
|
|
17
|
+
export async function awaitOwnRecordSettled(sessionNodeManager, agentName, sessionId, deadlineMs = SEAL_SETTLE_DEADLINE_MS) {
|
|
18
|
+
const started = Date.now();
|
|
19
|
+
let readiness = sessionNodeManager.sealReadiness(agentName, sessionId);
|
|
20
|
+
while (readiness.ownLeavesOrdered > 0 && Date.now() - started < deadlineMs) {
|
|
21
|
+
await new Promise((resolve) => {
|
|
22
|
+
const t = setTimeout(resolve, SEAL_SETTLE_POLL_MS);
|
|
23
|
+
// Never hold the process — or a test runner — open on a session that is going nowhere.
|
|
24
|
+
t.unref?.();
|
|
25
|
+
});
|
|
26
|
+
readiness = sessionNodeManager.sealReadiness(agentName, sessionId);
|
|
27
|
+
}
|
|
28
|
+
const waitedMs = Date.now() - started;
|
|
29
|
+
return readiness.ownLeavesOrdered > 0
|
|
30
|
+
? { settled: false, waitedMs, ownLeavesOrdered: readiness.ownLeavesOrdered }
|
|
31
|
+
: { settled: true, waitedMs };
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=seal-settle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seal-settle.js","sourceRoot":"","sources":["../src/seal-settle.ts"],"names":[],"mappings":"AAeA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAE7C,kGAAkG;AAClG,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAM/B;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,kBAA6D,EAC7D,SAAiB,EACjB,SAAiB,EACjB,aAAqB,uBAAuB;IAE5C,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,IAAI,SAAS,GAAG,kBAAkB,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACvE,OAAO,SAAS,CAAC,gBAAgB,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,GAAG,UAAU,EAAE,CAAC;QAC3E,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YAClC,MAAM,CAAC,GAAG,UAAU,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;YACnD,uFAAuF;YACvF,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;QACH,SAAS,GAAG,kBAAkB,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACrE,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC;IACtC,OAAO,SAAS,CAAC,gBAAgB,GAAG,CAAC;QACnC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,CAAC,gBAAgB,EAAE;QAC5E,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-assignment-parser.d.ts","sourceRoot":"","sources":["../src/session-assignment-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;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":["../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GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAGtF"}
|
|
@@ -181,6 +181,10 @@ onTolerated) {
|
|
|
181
181
|
*/
|
|
182
182
|
const highStakes = typeof raw["high_stakes"] === "boolean" ? raw["high_stakes"] : undefined;
|
|
183
183
|
const priorRelayId = typeof raw["prior_relay_id"] === "string" ? raw["prior_relay_id"] : undefined;
|
|
184
|
+
// 069-ORDERPROOF: read the same way and for the same reason — `""` is the ANSWER "this session
|
|
185
|
+
// has no relay", not an absence. Mapping it to `undefined` would take the verifier to the
|
|
186
|
+
// 12-field layout while the directory signed 13, and every direct session would fail to verify.
|
|
187
|
+
const relayId = typeof raw["relay_id"] === "string" ? raw["relay_id"] : undefined;
|
|
184
188
|
const common = {
|
|
185
189
|
session_id: sessionId,
|
|
186
190
|
participant_a: participantA,
|
|
@@ -198,6 +202,7 @@ onTolerated) {
|
|
|
198
202
|
transport_mode: transportMode,
|
|
199
203
|
high_stakes: highStakes,
|
|
200
204
|
prior_relay_id: priorRelayId,
|
|
205
|
+
relay_id: relayId,
|
|
201
206
|
};
|
|
202
207
|
if (sigType === "frost") {
|
|
203
208
|
const signerPubkey = toU8Safe(raw["signer_pubkey"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-assignment-parser.js","sourceRoot":"","sources":["../src/session-assignment-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAIH,SAAS,QAAQ,CAAC,CAAU;IAC1B,IAAI,CAAC,YAAY,UAAU;QAAE,OAAO,CAAC,CAAC;IACtC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,IAAI,UAAU,CAAC,CAAW,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,gBAAgB,CAAC,CAAU;IAClC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC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;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,YAA2B;IAChE,IAAI,YAAY,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5C,OAAO,eAAe,CAAC,YAAY,CAAC,IAAI,SAAS,CAAC;AACpD,CAAC"}
|
|
@@ -196,9 +196,14 @@ export declare function sendSealFrostSignature(deps: {
|
|
|
196
196
|
* channel. Rebuilds the canonical seal TBS from the cert fields and verifies the signature
|
|
197
197
|
* against a key trusted independently of the delivering frame: the session primary_pubkey
|
|
198
198
|
* (commitments[0] of this agent's FROST share) for 'frost'. A channel-swapped sealed_root
|
|
199
|
-
* (or any TBS-bound field) fails this check (SI-003).
|
|
200
|
-
*
|
|
201
|
-
*
|
|
199
|
+
* (or any TBS-bound field) fails this check (SI-003).
|
|
200
|
+
*
|
|
201
|
+
* 'single' is not a second variant this function is missing — it is a DOWNGRADE, refused by name
|
|
202
|
+
* before a session exists (`assignment_signature_type_downgraded`, assignment-verify.ts, checked
|
|
203
|
+
* against the directory's only producer of `signature_type`). A cert carrying it is a shape no
|
|
204
|
+
* honest peer can produce, so the branch below refuses rather than verifying. Do not "finish" it
|
|
205
|
+
* by adding a manifest-key path: that would make the downgrade verifiable instead of refused,
|
|
206
|
+
* which is the outcome the upstream check exists to prevent.
|
|
202
207
|
*/
|
|
203
208
|
export declare function verifyUnilateralCertificate(deps: {
|
|
204
209
|
persistence: DaemonRegistrationPersistence;
|
|
@@ -240,18 +245,20 @@ export declare function verifyUnilateralCertificate(deps: {
|
|
|
240
245
|
* primary value is OUT-OF-BAND (any holder of the signer's primary — e.g. an arbitrator — can verify
|
|
241
246
|
* an exported cert's legibility).
|
|
242
247
|
*
|
|
243
|
-
* SYMMETRY
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
248
|
+
* SYMMETRY: both closing orders verify locally, and it takes BOTH bindings to stay that way. The
|
|
249
|
+
* initiator learns the responder's primary from `participant_b_primary_pubkey` with a binding
|
|
250
|
+
* signed by participant_b's own K_local, recorded by `initiate-session-handler.ts`; the responder
|
|
251
|
+
* learns the initiator's from `signer_pubkey` with `participant_a_key_binding`, verified before the
|
|
252
|
+
* assignment's threshold signature is checked at all and recorded by `inbound-sessions.ts`. Both
|
|
253
|
+
* are refused by name when absent or invalid (`assignment-verify.ts`).
|
|
254
|
+
*
|
|
255
|
+
* The binding, not the key, is the load-bearing part: carrying a group key alone would let a
|
|
256
|
+
* directory name one of its choosing, so a change that keeps either key and drops its binding
|
|
257
|
+
* breaks verification while appearing to work.
|
|
251
258
|
*
|
|
252
|
-
* `signer_key_not_held` therefore
|
|
253
|
-
*
|
|
254
|
-
*
|
|
259
|
+
* `signer_key_not_held` is therefore NOT the ordinary responder-first outcome. It remains reachable
|
|
260
|
+
* for a session row that predates the recording, or one whose assignment never reached this path,
|
|
261
|
+
* and it is the honest answer there, which is why the branch stays.
|
|
255
262
|
*
|
|
256
263
|
* `legibility` MUST be the AS-RECEIVED wire object (not a normalised copy) — the directory signed
|
|
257
264
|
* over the canonical hash of exactly what it sent.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-ceremony.d.ts","sourceRoot":"","sources":["../src/session-ceremony.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAG3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,KAAK,EAAE,aAAa,EAAE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OAAO,GAAG,QAAQ,CAAC;CACnC,GACA,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAiCvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAsB,8BAA8B,CAClD,IAAI,EAAE;IAAE,WAAW,EAAE,6BAA6B,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,sBAAsB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EACpI,IAAI,EAAE;IACJ,SAAS,EAAE,UAAU,CAAC;IACtB,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,UAAU,CAAC;IAC3B,YAAY,EAAE,UAAU,CAAC;IACzB,aAAa,EAAE,OAAO,GAAG,QAAQ,CAAC;IAClC,UAAU,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACtC,GACA,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAmD3F;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,IAAI,CAwE/E"}
|
package/dist/session-ceremony.js
CHANGED
|
@@ -733,9 +733,14 @@ export async function sendSealFrostSignature(deps, sessionId, sidHex, frostSigna
|
|
|
733
733
|
* channel. Rebuilds the canonical seal TBS from the cert fields and verifies the signature
|
|
734
734
|
* against a key trusted independently of the delivering frame: the session primary_pubkey
|
|
735
735
|
* (commitments[0] of this agent's FROST share) for 'frost'. A channel-swapped sealed_root
|
|
736
|
-
* (or any TBS-bound field) fails this check (SI-003).
|
|
737
|
-
*
|
|
738
|
-
*
|
|
736
|
+
* (or any TBS-bound field) fails this check (SI-003).
|
|
737
|
+
*
|
|
738
|
+
* 'single' is not a second variant this function is missing — it is a DOWNGRADE, refused by name
|
|
739
|
+
* before a session exists (`assignment_signature_type_downgraded`, assignment-verify.ts, checked
|
|
740
|
+
* against the directory's only producer of `signature_type`). A cert carrying it is a shape no
|
|
741
|
+
* honest peer can produce, so the branch below refuses rather than verifying. Do not "finish" it
|
|
742
|
+
* by adding a manifest-key path: that would make the downgrade verifiable instead of refused,
|
|
743
|
+
* which is the outcome the upstream check exists to prevent.
|
|
739
744
|
*/
|
|
740
745
|
export async function verifyUnilateralCertificate(deps, cert) {
|
|
741
746
|
const tbs = buildSealTbs(cert.sessionId, cert.sealedRoot, cert.leafCount, cert.closeTimestamp);
|
|
@@ -793,18 +798,20 @@ export async function verifyUnilateralCertificate(deps, cert) {
|
|
|
793
798
|
* primary value is OUT-OF-BAND (any holder of the signer's primary — e.g. an arbitrator — can verify
|
|
794
799
|
* an exported cert's legibility).
|
|
795
800
|
*
|
|
796
|
-
* SYMMETRY
|
|
797
|
-
*
|
|
798
|
-
*
|
|
799
|
-
*
|
|
800
|
-
*
|
|
801
|
-
*
|
|
802
|
-
*
|
|
803
|
-
*
|
|
801
|
+
* SYMMETRY: both closing orders verify locally, and it takes BOTH bindings to stay that way. The
|
|
802
|
+
* initiator learns the responder's primary from `participant_b_primary_pubkey` with a binding
|
|
803
|
+
* signed by participant_b's own K_local, recorded by `initiate-session-handler.ts`; the responder
|
|
804
|
+
* learns the initiator's from `signer_pubkey` with `participant_a_key_binding`, verified before the
|
|
805
|
+
* assignment's threshold signature is checked at all and recorded by `inbound-sessions.ts`. Both
|
|
806
|
+
* are refused by name when absent or invalid (`assignment-verify.ts`).
|
|
807
|
+
*
|
|
808
|
+
* The binding, not the key, is the load-bearing part: carrying a group key alone would let a
|
|
809
|
+
* directory name one of its choosing, so a change that keeps either key and drops its binding
|
|
810
|
+
* breaks verification while appearing to work.
|
|
804
811
|
*
|
|
805
|
-
* `signer_key_not_held` therefore
|
|
806
|
-
*
|
|
807
|
-
*
|
|
812
|
+
* `signer_key_not_held` is therefore NOT the ordinary responder-first outcome. It remains reachable
|
|
813
|
+
* for a session row that predates the recording, or one whose assignment never reached this path,
|
|
814
|
+
* and it is the honest answer there, which is why the branch stays.
|
|
808
815
|
*
|
|
809
816
|
* `legibility` MUST be the AS-RECEIVED wire object (not a normalised copy) — the directory signed
|
|
810
817
|
* over the canonical hash of exactly what it sent.
|
|
@@ -854,7 +861,10 @@ export async function verifyBilateralSealCertificate(deps, cert) {
|
|
|
854
861
|
else {
|
|
855
862
|
// We do not hold the signer's key (no counterparty primary recorded) → cannot verify; accept
|
|
856
863
|
// (the live frame arrived over the authenticated Noise channel; the binding aids out-of-band).
|
|
857
|
-
//
|
|
864
|
+
// Reachable only for a session whose assignment never carried (or never recorded) the
|
|
865
|
+
// counterparty's bound primary — a pre-038-KEYBIND row. A CURRENT session reaching here means
|
|
866
|
+
// `recordCounterpartyPrimary` did not run on either side (`initiate-session-handler.ts` for the
|
|
867
|
+
// initiator, `inbound-sessions.ts` for the responder), which is a defect, not a close order.
|
|
858
868
|
return { ok: true, verified: false, reason: "signer_key_not_held" };
|
|
859
869
|
}
|
|
860
870
|
const tbs = bindLegibilityToTbs(buildSealTbs(cert.sessionId, cert.sealedRoot, cert.leafCount, cert.closeTimestamp), cert.legibility);
|