@cello-protocol/daemon 0.0.53 → 0.0.55

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.
Files changed (177) hide show
  1. package/dist/agent-handlers.d.ts +57 -0
  2. package/dist/agent-handlers.d.ts.map +1 -0
  3. package/dist/agent-handlers.js +360 -0
  4. package/dist/agent-handlers.js.map +1 -0
  5. package/dist/agent-id-migration.d.ts.map +1 -1
  6. package/dist/agent-id-migration.js +1 -0
  7. package/dist/agent-id-migration.js.map +1 -1
  8. package/dist/agent-loader.d.ts +3 -4
  9. package/dist/agent-loader.d.ts.map +1 -1
  10. package/dist/agent-loader.js +3 -4
  11. package/dist/agent-loader.js.map +1 -1
  12. package/dist/cbor-blob-migration.d.ts +8 -0
  13. package/dist/cbor-blob-migration.d.ts.map +1 -0
  14. package/dist/cbor-blob-migration.js +115 -0
  15. package/dist/cbor-blob-migration.js.map +1 -0
  16. package/dist/close-session-handler.d.ts +41 -0
  17. package/dist/close-session-handler.d.ts.map +1 -0
  18. package/dist/close-session-handler.js +399 -0
  19. package/dist/close-session-handler.js.map +1 -0
  20. package/dist/consortium-bootstrap.d.ts +83 -0
  21. package/dist/consortium-bootstrap.d.ts.map +1 -0
  22. package/dist/consortium-bootstrap.js +120 -0
  23. package/dist/consortium-bootstrap.js.map +1 -0
  24. package/dist/contact-handlers.d.ts +56 -0
  25. package/dist/contact-handlers.d.ts.map +1 -0
  26. package/dist/contact-handlers.js +303 -0
  27. package/dist/contact-handlers.js.map +1 -0
  28. package/dist/content-park-client.d.ts.map +1 -1
  29. package/dist/content-park-client.js +7 -7
  30. package/dist/content-park-client.js.map +1 -1
  31. package/dist/content-park.d.ts +15 -0
  32. package/dist/content-park.d.ts.map +1 -0
  33. package/dist/content-park.js +227 -0
  34. package/dist/content-park.js.map +1 -0
  35. package/dist/daemon.d.ts +4 -10
  36. package/dist/daemon.d.ts.map +1 -1
  37. package/dist/daemon.js +430 -4563
  38. package/dist/daemon.js.map +1 -1
  39. package/dist/db-identity-store.d.ts +31 -35
  40. package/dist/db-identity-store.d.ts.map +1 -1
  41. package/dist/db-identity-store.js +62 -66
  42. package/dist/db-identity-store.js.map +1 -1
  43. package/dist/directory-bootstrap.d.ts +27 -31
  44. package/dist/directory-bootstrap.d.ts.map +1 -1
  45. package/dist/directory-bootstrap.js +18 -21
  46. package/dist/directory-bootstrap.js.map +1 -1
  47. package/dist/frame-values.d.ts +3 -0
  48. package/dist/frame-values.d.ts.map +1 -0
  49. package/dist/frame-values.js +73 -0
  50. package/dist/frame-values.js.map +1 -0
  51. package/dist/identity-migration.d.ts +8 -8
  52. package/dist/identity-migration.d.ts.map +1 -1
  53. package/dist/identity-migration.js +30 -31
  54. package/dist/identity-migration.js.map +1 -1
  55. package/dist/inbound-seal-request.d.ts +17 -0
  56. package/dist/inbound-seal-request.d.ts.map +1 -0
  57. package/dist/inbound-seal-request.js +155 -0
  58. package/dist/inbound-seal-request.js.map +1 -0
  59. package/dist/inbound-sessions.d.ts +54 -0
  60. package/dist/inbound-sessions.d.ts.map +1 -0
  61. package/dist/inbound-sessions.js +603 -0
  62. package/dist/inbound-sessions.js.map +1 -0
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +8 -10
  65. package/dist/index.js.map +1 -1
  66. package/dist/initiate-session-handler.d.ts +22 -0
  67. package/dist/initiate-session-handler.d.ts.map +1 -0
  68. package/dist/initiate-session-handler.js +150 -0
  69. package/dist/initiate-session-handler.js.map +1 -0
  70. package/dist/network-directory-node.d.ts +6 -6
  71. package/dist/network-directory-node.d.ts.map +1 -1
  72. package/dist/network-directory-node.js +29 -28
  73. package/dist/network-directory-node.js.map +1 -1
  74. package/dist/notification-handlers.d.ts +32 -0
  75. package/dist/notification-handlers.d.ts.map +1 -0
  76. package/dist/notification-handlers.js +73 -0
  77. package/dist/notification-handlers.js.map +1 -0
  78. package/dist/outbound-sessions.d.ts +54 -0
  79. package/dist/outbound-sessions.d.ts.map +1 -0
  80. package/dist/outbound-sessions.js +429 -0
  81. package/dist/outbound-sessions.js.map +1 -0
  82. package/dist/park-envelope.d.ts.map +1 -1
  83. package/dist/park-envelope.js +3 -2
  84. package/dist/park-envelope.js.map +1 -1
  85. package/dist/register-handler.d.ts +35 -0
  86. package/dist/register-handler.d.ts.map +1 -0
  87. package/dist/register-handler.js +179 -0
  88. package/dist/register-handler.js.map +1 -0
  89. package/dist/registration-manager.d.ts.map +1 -1
  90. package/dist/registration-manager.js +3 -6
  91. package/dist/registration-manager.js.map +1 -1
  92. package/dist/relay-receipt-store.d.ts.map +1 -1
  93. package/dist/relay-receipt-store.js +1 -2
  94. package/dist/relay-receipt-store.js.map +1 -1
  95. package/dist/retry-queue.d.ts +18 -60
  96. package/dist/retry-queue.d.ts.map +1 -1
  97. package/dist/retry-queue.js +46 -97
  98. package/dist/retry-queue.js.map +1 -1
  99. package/dist/seal-coordinator.d.ts +47 -0
  100. package/dist/seal-coordinator.d.ts.map +1 -0
  101. package/dist/seal-coordinator.js +551 -0
  102. package/dist/seal-coordinator.js.map +1 -0
  103. package/dist/seal-flows.d.ts +50 -0
  104. package/dist/seal-flows.d.ts.map +1 -0
  105. package/dist/seal-flows.js +454 -0
  106. package/dist/seal-flows.js.map +1 -0
  107. package/dist/seal-frontier-verify.d.ts +9 -9
  108. package/dist/seal-frontier-verify.d.ts.map +1 -1
  109. package/dist/seal-frontier-verify.js +11 -12
  110. package/dist/seal-frontier-verify.js.map +1 -1
  111. package/dist/seal-leaf.d.ts +58 -0
  112. package/dist/seal-leaf.d.ts.map +1 -0
  113. package/dist/seal-leaf.js +111 -0
  114. package/dist/seal-leaf.js.map +1 -0
  115. package/dist/seal-receipt-upgrade.d.ts +1 -1
  116. package/dist/seal-receipt-upgrade.js +1 -1
  117. package/dist/seal-upgrade.d.ts +10 -10
  118. package/dist/seal-upgrade.d.ts.map +1 -1
  119. package/dist/seal-upgrade.js +23 -24
  120. package/dist/seal-upgrade.js.map +1 -1
  121. package/dist/session-assignment-parser.d.ts +16 -19
  122. package/dist/session-assignment-parser.d.ts.map +1 -1
  123. package/dist/session-assignment-parser.js +30 -29
  124. package/dist/session-assignment-parser.js.map +1 -1
  125. package/dist/session-ceremony.d.ts +3 -6
  126. package/dist/session-ceremony.d.ts.map +1 -1
  127. package/dist/session-ceremony.js +7 -9
  128. package/dist/session-ceremony.js.map +1 -1
  129. package/dist/session-connection-gater.d.ts +4 -2
  130. package/dist/session-connection-gater.d.ts.map +1 -1
  131. package/dist/session-connection-gater.js +16 -10
  132. package/dist/session-connection-gater.js.map +1 -1
  133. package/dist/session-content-handlers.d.ts +25 -0
  134. package/dist/session-content-handlers.d.ts.map +1 -0
  135. package/dist/session-content-handlers.js +436 -0
  136. package/dist/session-content-handlers.js.map +1 -0
  137. package/dist/session-name.d.ts +35 -0
  138. package/dist/session-name.d.ts.map +1 -0
  139. package/dist/session-name.js +60 -0
  140. package/dist/session-name.js.map +1 -0
  141. package/dist/session-node-manager.d.ts +47 -62
  142. package/dist/session-node-manager.d.ts.map +1 -1
  143. package/dist/session-node-manager.js +297 -97
  144. package/dist/session-node-manager.js.map +1 -1
  145. package/dist/session-read-handlers.d.ts +38 -0
  146. package/dist/session-read-handlers.d.ts.map +1 -0
  147. package/dist/session-read-handlers.js +233 -0
  148. package/dist/session-read-handlers.js.map +1 -0
  149. package/dist/session-relay-client.d.ts +8 -8
  150. package/dist/session-relay-client.d.ts.map +1 -1
  151. package/dist/session-relay-client.js +44 -46
  152. package/dist/session-relay-client.js.map +1 -1
  153. package/dist/session-tree.d.ts +11 -23
  154. package/dist/session-tree.d.ts.map +1 -1
  155. package/dist/session-tree.js +14 -26
  156. package/dist/session-tree.js.map +1 -1
  157. package/dist/signaling-connect.d.ts +13 -5
  158. package/dist/signaling-connect.d.ts.map +1 -1
  159. package/dist/signaling-connect.js +55 -13
  160. package/dist/signaling-connect.js.map +1 -1
  161. package/dist/sqlcipher-db.d.ts +18 -19
  162. package/dist/sqlcipher-db.d.ts.map +1 -1
  163. package/dist/sqlcipher-db.js +30 -30
  164. package/dist/sqlcipher-db.js.map +1 -1
  165. package/dist/telegram-doorbell.d.ts +38 -0
  166. package/dist/telegram-doorbell.d.ts.map +1 -0
  167. package/dist/telegram-doorbell.js +139 -0
  168. package/dist/telegram-doorbell.js.map +1 -0
  169. package/dist/types.d.ts +86 -79
  170. package/dist/types.d.ts.map +1 -1
  171. package/dist/types.js +0 -1
  172. package/dist/types.js.map +1 -1
  173. package/dist/vocabulary.d.ts +30 -30
  174. package/dist/vocabulary.d.ts.map +1 -1
  175. package/dist/vocabulary.js +41 -49
  176. package/dist/vocabulary.js.map +1 -1
  177. package/package.json +5 -5
@@ -1,20 +1,16 @@
1
1
  /**
2
- * CELLO-M7-PERSIST-002 — DB-backed identity store (the `agents` table).
2
+ * DB-backed identity store (the `agents` table).
3
3
  *
4
4
  * Every piece of an agent's persisted identity — the K_local Ed25519 seed, the ML-DSA keypair, the
5
5
  * FROST signing share, the registration record, and the agent↔user link — lives as ONE row of the
6
- * `agents` table in the SQLCipher-encrypted daemon DB. This replaces the per-agent plaintext flat
7
- * files (`agents/<name>/key`, `frost-share.json`, `ml-dsa-keypair.json`, `registration-state.json`,
8
- * `agent-user-link.json`).
6
+ * `agents` table in the SQLCipher-encrypted daemon DB. There is no flat-file home for any of it.
9
7
  *
10
- * `DbRegistrationPersistence` implements the SAME `DaemonRegistrationPersistence` interface the
11
- * daemon's RegistrationManager and the ceremony/seal signer-reconstruction already consume so the
12
- * call sites change only their construction (a DB handle + agent name instead of an `agentDir`), not
13
- * their behaviour. Writes are AWAITED single-row UPSERTs (SI-003: a register-success implies a
14
- * durably committed row — fixing the old fire-and-forget at registration-manager.ts:229).
8
+ * `DbRegistrationPersistence` implements the `DaemonRegistrationPersistence` interface the daemon's
9
+ * RegistrationManager and the ceremony/seal signer-reconstruction consume. Writes are AWAITED
10
+ * single-row UPSERTs never fire-and-forget so a register-success implies a durably committed row.
15
11
  *
16
12
  * The K_local seed and FROST/ML-DSA secrets are stored as BLOB columns inside the encrypted DB; they
17
- * are NEVER written to a flat file and NEVER logged (SI-001). The row is the only home.
13
+ * are NEVER written to a flat file and NEVER logged. The row is the only home.
18
14
  */
19
15
  import type { DaemonDatabase } from "./sqlcipher-db.js";
20
16
  import type { Logger } from "./types.js";
@@ -22,14 +18,14 @@ import type { DaemonRegistrationPersistence, RegistrationStateRecord, MlDsaKeypa
22
18
  /**
23
19
  * Idempotent schema for the identity store. Called once at daemon init AND defensively by each
24
20
  * DbRegistrationPersistence constructor, so the store works whether or not the composition root has
25
- * run its own ensure. Creates the table on a fresh DB, re-keys a pre-REMOVE-001 table to the
26
- * stable-agent_id shape once, and (always) ensures the active-name partial unique index.
21
+ * run its own ensure. Creates the table on a fresh DB, re-keys a legacy table to the stable agent_id
22
+ * shape once, and (always) ensures the active-name partial unique index.
27
23
  */
28
24
  export declare function ensureIdentitySchema(db: DaemonDatabase): void;
29
25
  /**
30
- * Row CRUD for the K_local identity — used by the agent-creation path (AC-004) and the DB-backed
31
- * agent loader (AC-007). Separate from the registration-persistence seam because it owns the
32
- * seed/lifecycle, not the registration material.
26
+ * Row CRUD for the K_local identity — used by the agent-creation path and the DB-backed agent loader.
27
+ * Separate from the registration-persistence seam because it owns the seed/lifecycle, not the
28
+ * registration material.
33
29
  */
34
30
  export interface AgentRow {
35
31
  agentId: string;
@@ -42,7 +38,7 @@ export declare class DbIdentityStore {
42
38
  #private;
43
39
  constructor(db: DaemonDatabase, logger: Logger);
44
40
  /**
45
- * CELLO-M8-TRUST-001: store a received + verified trust signal. Idempotent on signal_hash (the same
41
+ * Store a received + verified trust signal. Idempotent on signal_hash (the same
46
42
  * signal delivered/pulled twice stores once). `payload` is the recovered plaintext JSON.
47
43
  */
48
44
  storeTrustSignal(args: {
@@ -51,7 +47,7 @@ export declare class DbIdentityStore {
51
47
  signalKind: string;
52
48
  payload: Uint8Array;
53
49
  }): void;
54
- /** Read a stored trust signal back by its hash anchor (TRUST-001 — proves local storage). */
50
+ /** Read a stored trust signal back by its hash anchor. */
55
51
  getTrustSignal(signalHash: string): {
56
52
  signalKind: string;
57
53
  payload: Uint8Array;
@@ -59,23 +55,23 @@ export declare class DbIdentityStore {
59
55
  /** True if an ACTIVE (non-retired) agent row with this name exists — the create-collision check. */
60
56
  hasActiveAgent(agentName: string): boolean;
61
57
  /**
62
- * Create a new agent row holding a fresh K_local seed (AC-004), keyed by a freshly-minted stable
63
- * agent_id (REMOVE-001 DOD-REMOVE-1; guardrail #1). Explicit only — callers generate the seed
64
- * (crypto) and pass it in. Throws if an ACTIVE agent already holds the name (no silent overwrite); a
65
- * RETIRED row with the same name does NOT block — the name has been freed. Returns the new agent_id.
58
+ * Create a new agent row holding a fresh K_local seed, keyed by a freshly-minted stable agent_id.
59
+ * Explicit only — callers generate the seed (crypto) and pass it in. Throws if an ACTIVE agent
60
+ * already holds the name (no silent overwrite); a RETIRED row with the same name does NOT block
61
+ * the name has been freed. Returns the new agent_id.
66
62
  */
67
63
  createAgent(agentName: string, kLocalSeed: Uint8Array, kLocalPubkeyHex: string): string;
68
64
  /**
69
- * Retire (REMOVE-001 DOD-REMOVE-1): flip the ACTIVE row for `agentName` to state='retired' WITHOUT
70
- * deleting the row, its keys, or its history (SI-002 — accountability survives). One-way. The name
71
- * is freed (the partial unique index excludes retired rows). Returns the retired agent_id, or null if
72
- * there was no active agent with that name (fail-loud at the caller).
65
+ * Retire: flip the ACTIVE row for `agentName` to state='retired' WITHOUT deleting the row, its keys,
66
+ * or its history — accountability must survive a removal. One-way. The name is freed (the partial
67
+ * unique index excludes retired rows). Returns the retired agent_id, or null if there was no active
68
+ * agent with that name (fail-loud at the caller).
73
69
  */
74
70
  retireAgent(agentName: string): string | null;
75
71
  /**
76
- * Read the row to act on for a removal / directory-revocation re-push (REMOVE-001 DOD-REMOVE-2): the
77
- * ACTIVE row for the name if one exists (a fresh removal), else the MOST-RECENTLY-retired row (a
78
- * re-push of an already-retired agent whose directory revocation did not land — DB-001). Includes the
72
+ * Read the row to act on for a removal / directory-revocation re-push: the ACTIVE row for the name if
73
+ * one exists (a fresh removal), else the MOST-RECENTLY-retired row (a re-push of an already-retired
74
+ * agent whose directory revocation did not land). Includes the
79
75
  * K_local seed (to re-sign the revocation) and the DIRECTORY-known reg_agent_id (what the directory is
80
76
  * asked to revoke; null if the agent was never registered). Returns null if no row with this name
81
77
  * exists at all.
@@ -89,20 +85,20 @@ export declare class DbIdentityStore {
89
85
  /**
90
86
  * Enumerate ACTIVE agents (agent_id + name + seed + pubkey + state) for the daemon's startup loader.
91
87
  * Retired rows are EXCLUDED — they must never be resurrected into the runtime — but remain in the DB
92
- * and are readable directly for accountability (SI-002).
88
+ * and are readable directly for accountability.
93
89
  */
94
90
  listAgents(): AgentRow[];
95
91
  /**
96
- * MONIKER-1 AC2/AC3: set (or clear, via null) the outbound-name override on the ACTIVE row.
92
+ * Set (or clear, via null) the outbound-name override on the ACTIVE row.
97
93
  * Returns false when no active agent holds the name (fail-loud at the caller — never a silent
98
94
  * no-op success). THROWS on an invalid moniker: callers validate first for a friendly error;
99
95
  * this is the backstop that makes "an invalid value can never be stored" true at the lowest layer.
100
96
  */
101
97
  setMoniker(agentName: string, moniker: string | null): boolean;
102
- /** MONIKER-1: the stored override for the ACTIVE agent, or null (no override / no such agent). */
98
+ /** The stored override for the ACTIVE agent, or null (no override / no such agent). */
103
99
  getMoniker(agentName: string): string | null;
104
100
  /**
105
- * MONIKER-1 AC1: the agent's outbound name — the override when set, else the agent name itself.
101
+ * The agent's outbound name — the override when set, else the agent name itself.
106
102
  * There is no separate "self-moniker" concept; the default is valid by construction (the agent
107
103
  * name already satisfies MONIKER_RE at creation). Null only when no active agent holds the name.
108
104
  */
@@ -111,8 +107,8 @@ export declare class DbIdentityStore {
111
107
  /**
112
108
  * DB-backed `DaemonRegistrationPersistence`. Scoped to a single agent's row. All persist operations
113
109
  * are single-row UPSERTs that update the named agent's row; a register-success therefore implies the
114
- * material is durably committed (SI-003). A persist against a non-existent agent throws — the row is
115
- * created by the agent-creation path (AC-004) before registration runs.
110
+ * material is durably committed. A persist against a non-existent agent throws — the row is created by
111
+ * the agent-creation path before registration runs.
116
112
  */
117
113
  export declare class DbRegistrationPersistence implements DaemonRegistrationPersistence {
118
114
  #private;
@@ -141,7 +137,7 @@ export declare class DbRegistrationPersistence implements DaemonRegistrationPers
141
137
  commitmentsCbor: Uint8Array;
142
138
  verifyingSharesCbor: Uint8Array;
143
139
  dkgMethod: "trusted_dealer" | "network_dkg";
144
- /** M8B quorum: the directory nodeIds (Q) the DKG ran among; a restored signer targets these. */
140
+ /** The directory nodeIds (Q) the DKG ran among; a restored signer targets these. */
145
141
  directoryNodeIds?: string[];
146
142
  }): Promise<void>;
147
143
  persistAgentUserLink(opts: {
@@ -1 +1 @@
1
- {"version":3,"file":"db-identity-store.d.ts","sourceRoot":"","sources":["../src/db-identity-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,+BAA+B,CAAC;AAmHvC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,cAAc,GAAG,IAAI,CAsB7D;AAuBD;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,eAAe;;gBAId,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM;IAM9C;;;OAGG;IACH,gBAAgB,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC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AE,gBAAgB,GAAG,aAAa,CAAC;QAC5C,oFAAoF;QACpF,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC7B,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BX,oBAAoB,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBtG,qBAAqB,IAAI,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC;IAYhE,gBAAgB,IAAI,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAUtD,uBAAuB,IAAI,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IA6B9D,iBAAiB,IAAI,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;CAS/D"}
@@ -1,45 +1,41 @@
1
1
  /**
2
- * CELLO-M7-PERSIST-002 — DB-backed identity store (the `agents` table).
2
+ * DB-backed identity store (the `agents` table).
3
3
  *
4
4
  * Every piece of an agent's persisted identity — the K_local Ed25519 seed, the ML-DSA keypair, the
5
5
  * FROST signing share, the registration record, and the agent↔user link — lives as ONE row of the
6
- * `agents` table in the SQLCipher-encrypted daemon DB. This replaces the per-agent plaintext flat
7
- * files (`agents/<name>/key`, `frost-share.json`, `ml-dsa-keypair.json`, `registration-state.json`,
8
- * `agent-user-link.json`).
6
+ * `agents` table in the SQLCipher-encrypted daemon DB. There is no flat-file home for any of it.
9
7
  *
10
- * `DbRegistrationPersistence` implements the SAME `DaemonRegistrationPersistence` interface the
11
- * daemon's RegistrationManager and the ceremony/seal signer-reconstruction already consume so the
12
- * call sites change only their construction (a DB handle + agent name instead of an `agentDir`), not
13
- * their behaviour. Writes are AWAITED single-row UPSERTs (SI-003: a register-success implies a
14
- * durably committed row — fixing the old fire-and-forget at registration-manager.ts:229).
8
+ * `DbRegistrationPersistence` implements the `DaemonRegistrationPersistence` interface the daemon's
9
+ * RegistrationManager and the ceremony/seal signer-reconstruction consume. Writes are AWAITED
10
+ * single-row UPSERTs never fire-and-forget so a register-success implies a durably committed row.
15
11
  *
16
12
  * The K_local seed and FROST/ML-DSA secrets are stored as BLOB columns inside the encrypted DB; they
17
- * are NEVER written to a flat file and NEVER logged (SI-001). The row is the only home.
13
+ * are NEVER written to a flat file and NEVER logged. The row is the only home.
18
14
  */
19
15
  import { randomUUID } from "node:crypto";
20
16
  import { MONIKER_RE, validateMoniker } from "@cello-protocol/protocol-types";
21
17
  const ML_DSA_ALGORITHM = "ML-DSA-44";
22
18
  /**
23
- * The `agents` schema (CELLO-M7-REMOVE-001 DOD-REMOVE-1). The store is keyed by a STABLE `agent_id`,
24
- * not by `agent_name` — guardrail #1: durable identity hangs off agent_id; the human name and the
25
- * pubkey are mutable ATTRIBUTES. A partial unique index makes `agent_name` unique only among
26
- * NON-retired rows, so removal (state='retired') frees the name for reuse while the retired identity
27
- * survives for accountability (SI-002). `state`: 'created' | 'registered' | 'retired'.
19
+ * The `agents` schema. The store is keyed by a STABLE `agent_id`, never by `agent_name` — durable
20
+ * identity hangs off agent_id; the human name and the pubkey are mutable ATTRIBUTES. A partial unique
21
+ * index makes `agent_name` unique only among NON-retired rows, so removal (state='retired') frees the
22
+ * name for reuse while the retired identity survives for accountability.
23
+ * `state`: 'created' | 'registered' | 'retired'.
28
24
  */
29
25
  const CREATE_AGENTS_SQL = `
30
26
  CREATE TABLE IF NOT EXISTS agents (
31
27
  agent_id TEXT PRIMARY KEY,
32
28
  agent_name TEXT NOT NULL,
33
- -- K_local Ed25519 identity (PERSIST-002: seed moves from agents/<name>/key into this BLOB).
29
+ -- K_local Ed25519 identity: the seed lives ONLY in this BLOB, never on the filesystem.
34
30
  k_local_seed BLOB NOT NULL,
35
31
  k_local_pubkey TEXT NOT NULL,
36
- -- lifecycle: 'created' (K_local exists, not yet registered) | 'registered' | 'retired' (REMOVE-001).
32
+ -- lifecycle: 'created' (K_local exists, not yet registered) | 'registered' | 'retired'.
37
33
  state TEXT NOT NULL DEFAULT 'created',
38
- -- ML-DSA keypair (was ml-dsa-keypair.json).
34
+ -- ML-DSA keypair.
39
35
  ml_dsa_pubkey TEXT,
40
36
  ml_dsa_secret BLOB,
41
37
  ml_dsa_algorithm TEXT,
42
- -- FROST signing share (was frost-share.json).
38
+ -- FROST signing share.
43
39
  frost_epoch_id TEXT,
44
40
  frost_primary_pubkey TEXT,
45
41
  frost_identifier TEXT,
@@ -49,19 +45,19 @@ const CREATE_AGENTS_SQL = `
49
45
  frost_commitments BLOB,
50
46
  frost_verifying_shares BLOB,
51
47
  frost_dkg_method TEXT,
52
- -- M8B quorum: JSON array of the directory nodeIds (Q) the DKG ran among, so a restored signer
53
- -- targets the actual share-holders (not the full live roster). NULL for pre-quorum agents.
48
+ -- JSON array of the directory nodeIds (Q) the DKG ran among, so a restored signer targets the
49
+ -- actual share-holders, not the full live roster. NULL for agents registered before quorum DKG.
54
50
  frost_directory_node_ids TEXT,
55
- -- MONIKER-1: optional outbound-name override. The outbound name defaults to agent_name; this
56
- -- column only holds an explicit override. Local-only — never sent to the directory (AC4).
51
+ -- Optional outbound-name override. The outbound name defaults to agent_name; this column only
52
+ -- holds an explicit override. Local-only — never sent to the directory.
57
53
  moniker TEXT,
58
- -- registration record (was registration-state.json).
54
+ -- registration record.
59
55
  reg_agent_id TEXT,
60
56
  reg_primary_pubkey TEXT,
61
57
  reg_ml_dsa_pubkey TEXT,
62
58
  reg_registered_at INTEGER,
63
59
  reg_status TEXT,
64
- -- agent↔user link captured at registration (was agent-user-link.json).
60
+ -- agent↔user link captured at registration.
65
61
  link_agent_id TEXT,
66
62
  link_pre_auth_token TEXT,
67
63
  link_linked_at INTEGER,
@@ -71,8 +67,8 @@ const CREATE_AGENTS_SQL = `
71
67
  `;
72
68
  // A name is unique only among NON-retired agents — the DB-level backstop for "free the name on removal".
73
69
  const CREATE_ACTIVE_NAME_INDEX_SQL = "CREATE UNIQUE INDEX IF NOT EXISTS agents_active_name ON agents(agent_name) WHERE state != 'retired'";
74
- // The columns of the PRE-REMOVE-001 `agents` table (agent_name PK, no agent_id), in order. Used to
75
- // copy rows verbatim during the one-time re-key rebuild.
70
+ // The columns of the legacy `agents` table (agent_name PK, no agent_id), in order. Used to copy rows
71
+ // verbatim during the one-time re-key rebuild.
76
72
  const PRE_REKEY_COLUMNS = [
77
73
  "agent_name",
78
74
  "k_local_seed",
@@ -102,11 +98,11 @@ const PRE_REKEY_COLUMNS = [
102
98
  "updated_at",
103
99
  ];
104
100
  /**
105
- * One-time re-key of a PRE-REMOVE-001 `agents` table (PRIMARY KEY agent_name, no agent_id) to the new
106
- * stable-agent_id shape. Rebuilds the table, backfilling a fresh agent_id per existing row. Runs at
107
- * most once — `ensureIdentitySchema` guards it behind a column-presence check — and is wrapped in a
108
- * transaction so a crash mid-rebuild leaves the original table intact. Works on node:sqlite (in-memory
109
- * test handles) and SQLCipher alike.
101
+ * One-time re-key of a legacy `agents` table (PRIMARY KEY agent_name, no agent_id) to the stable
102
+ * agent_id shape. Rebuilds the table, backfilling a fresh agent_id per existing row. Runs at most once
103
+ * — `ensureIdentitySchema` guards it behind a column-presence check — and is wrapped in a transaction
104
+ * so a crash mid-rebuild leaves the original table intact. Works on node:sqlite (in-memory test
105
+ * handles) and SQLCipher alike.
110
106
  */
111
107
  function rebuildAgentsToAgentIdPk(db) {
112
108
  const cols = PRE_REKEY_COLUMNS.join(", ");
@@ -130,8 +126,8 @@ function rebuildAgentsToAgentIdPk(db) {
130
126
  /**
131
127
  * Idempotent schema for the identity store. Called once at daemon init AND defensively by each
132
128
  * DbRegistrationPersistence constructor, so the store works whether or not the composition root has
133
- * run its own ensure. Creates the table on a fresh DB, re-keys a pre-REMOVE-001 table to the
134
- * stable-agent_id shape once, and (always) ensures the active-name partial unique index.
129
+ * run its own ensure. Creates the table on a fresh DB, re-keys a legacy table to the stable agent_id
130
+ * shape once, and (always) ensures the active-name partial unique index.
135
131
  */
136
132
  export function ensureIdentitySchema(db) {
137
133
  const cols = db.prepare("PRAGMA table_info(agents)").all();
@@ -139,7 +135,7 @@ export function ensureIdentitySchema(db) {
139
135
  db.exec(CREATE_AGENTS_SQL);
140
136
  }
141
137
  else if (!cols.some((c) => c.name === "agent_id")) {
142
- // A pre-REMOVE-001 table exists (agent_name PK). Re-key it once to the stable-agent_id shape.
138
+ // A legacy table exists (agent_name PK). Re-key it once to the stable agent_id shape.
143
139
  rebuildAgentsToAgentIdPk(db);
144
140
  }
145
141
  else {
@@ -147,11 +143,11 @@ export function ensureIdentitySchema(db) {
147
143
  // CREATE_AGENTS_SQL). SQLite has no ADD COLUMN IF NOT EXISTS, so each is PRAGMA-guarded — and
148
144
  // each guard is an INDEPENDENT `if`: a table missing several must receive every ALTER.
149
145
  if (!cols.some((c) => c.name === "frost_directory_node_ids")) {
150
- // M8B quorum. Nullable → pre-quorum agents keep the full-roster fallback; no data touched.
146
+ // Nullable → agents predating quorum DKG keep the full-roster fallback; no data touched.
151
147
  db.exec("ALTER TABLE agents ADD COLUMN frost_directory_node_ids TEXT");
152
148
  }
153
149
  if (!cols.some((c) => c.name === "moniker")) {
154
- // MONIKER-1: outbound-name override. Nullable → existing agents keep the agent-name default.
150
+ // Outbound-name override. Nullable → existing agents keep the agent-name default.
155
151
  db.exec("ALTER TABLE agents ADD COLUMN moniker TEXT");
156
152
  }
157
153
  }
@@ -159,7 +155,7 @@ export function ensureIdentitySchema(db) {
159
155
  db.exec(CREATE_TRUST_SIGNALS_SQL);
160
156
  }
161
157
  /**
162
- * CELLO-M8-TRUST-001: received trust signals — the daemon's local copy of a signal it pulled from the
158
+ * Received trust signals — the daemon's local copy of a signal it pulled from the
163
159
  * directory pickup queue, opened (k_local), and HASH-VERIFIED against the directory anchor. Keyed by
164
160
  * signal_hash (the verification anchor) → storing the same signal twice is idempotent. The payload is
165
161
  * the recovered plaintext JSON — the ONLY plaintext copy of the signal (the server side holds only
@@ -185,7 +181,7 @@ export class DbIdentityStore {
185
181
  ensureIdentitySchema(db);
186
182
  }
187
183
  /**
188
- * CELLO-M8-TRUST-001: store a received + verified trust signal. Idempotent on signal_hash (the same
184
+ * Store a received + verified trust signal. Idempotent on signal_hash (the same
189
185
  * signal delivered/pulled twice stores once). `payload` is the recovered plaintext JSON.
190
186
  */
191
187
  storeTrustSignal(args) {
@@ -194,7 +190,7 @@ export class DbIdentityStore {
194
190
  VALUES (?, ?, ?, ?, ?)`)
195
191
  .run(args.signalHash, args.agentId, args.signalKind, toBuf(args.payload), Date.now());
196
192
  }
197
- /** Read a stored trust signal back by its hash anchor (TRUST-001 — proves local storage). */
193
+ /** Read a stored trust signal back by its hash anchor. */
198
194
  getTrustSignal(signalHash) {
199
195
  const row = this.#db
200
196
  .prepare("SELECT signal_kind, payload FROM trust_signals WHERE signal_hash = ?")
@@ -209,10 +205,10 @@ export class DbIdentityStore {
209
205
  return row !== undefined;
210
206
  }
211
207
  /**
212
- * Create a new agent row holding a fresh K_local seed (AC-004), keyed by a freshly-minted stable
213
- * agent_id (REMOVE-001 DOD-REMOVE-1; guardrail #1). Explicit only — callers generate the seed
214
- * (crypto) and pass it in. Throws if an ACTIVE agent already holds the name (no silent overwrite); a
215
- * RETIRED row with the same name does NOT block — the name has been freed. Returns the new agent_id.
208
+ * Create a new agent row holding a fresh K_local seed, keyed by a freshly-minted stable agent_id.
209
+ * Explicit only — callers generate the seed (crypto) and pass it in. Throws if an ACTIVE agent
210
+ * already holds the name (no silent overwrite); a RETIRED row with the same name does NOT block
211
+ * the name has been freed. Returns the new agent_id.
216
212
  */
217
213
  createAgent(agentName, kLocalSeed, kLocalPubkeyHex) {
218
214
  if (this.hasActiveAgent(agentName)) {
@@ -224,15 +220,15 @@ export class DbIdentityStore {
224
220
  .prepare(`INSERT INTO agents (agent_id, agent_name, k_local_seed, k_local_pubkey, state, created_at, updated_at)
225
221
  VALUES (?, ?, ?, ?, 'created', ?, ?)`)
226
222
  .run(agentId, agentName, toBuf(kLocalSeed), kLocalPubkeyHex, now, now);
227
- // SI-001: the seed is NEVER logged — only the agent name, the agent_id, and the PUBLIC key.
223
+ // The seed is NEVER logged — only the agent name, the agent_id, and the PUBLIC key.
228
224
  this.#logger.info("persist.identity.created", { agentName, agentId, agentPubkey: kLocalPubkeyHex });
229
225
  return agentId;
230
226
  }
231
227
  /**
232
- * Retire (REMOVE-001 DOD-REMOVE-1): flip the ACTIVE row for `agentName` to state='retired' WITHOUT
233
- * deleting the row, its keys, or its history (SI-002 — accountability survives). One-way. The name
234
- * is freed (the partial unique index excludes retired rows). Returns the retired agent_id, or null if
235
- * there was no active agent with that name (fail-loud at the caller).
228
+ * Retire: flip the ACTIVE row for `agentName` to state='retired' WITHOUT deleting the row, its keys,
229
+ * or its history — accountability must survive a removal. One-way. The name is freed (the partial
230
+ * unique index excludes retired rows). Returns the retired agent_id, or null if there was no active
231
+ * agent with that name (fail-loud at the caller).
236
232
  */
237
233
  retireAgent(agentName) {
238
234
  const active = this.#db
@@ -248,9 +244,9 @@ export class DbIdentityStore {
248
244
  return active.agent_id;
249
245
  }
250
246
  /**
251
- * Read the row to act on for a removal / directory-revocation re-push (REMOVE-001 DOD-REMOVE-2): the
252
- * ACTIVE row for the name if one exists (a fresh removal), else the MOST-RECENTLY-retired row (a
253
- * re-push of an already-retired agent whose directory revocation did not land — DB-001). Includes the
247
+ * Read the row to act on for a removal / directory-revocation re-push: the ACTIVE row for the name if
248
+ * one exists (a fresh removal), else the MOST-RECENTLY-retired row (a re-push of an already-retired
249
+ * agent whose directory revocation did not land). Includes the
254
250
  * K_local seed (to re-sign the revocation) and the DIRECTORY-known reg_agent_id (what the directory is
255
251
  * asked to revoke; null if the agent was never registered). Returns null if no row with this name
256
252
  * exists at all.
@@ -272,7 +268,7 @@ export class DbIdentityStore {
272
268
  /**
273
269
  * Enumerate ACTIVE agents (agent_id + name + seed + pubkey + state) for the daemon's startup loader.
274
270
  * Retired rows are EXCLUDED — they must never be resurrected into the runtime — but remain in the DB
275
- * and are readable directly for accountability (SI-002).
271
+ * and are readable directly for accountability.
276
272
  */
277
273
  listAgents() {
278
274
  const rows = this.#db
@@ -287,7 +283,7 @@ export class DbIdentityStore {
287
283
  }));
288
284
  }
289
285
  /**
290
- * MONIKER-1 AC2/AC3: set (or clear, via null) the outbound-name override on the ACTIVE row.
286
+ * Set (or clear, via null) the outbound-name override on the ACTIVE row.
291
287
  * Returns false when no active agent holds the name (fail-loud at the caller — never a silent
292
288
  * no-op success). THROWS on an invalid moniker: callers validate first for a friendly error;
293
289
  * this is the backstop that makes "an invalid value can never be stored" true at the lowest layer.
@@ -301,7 +297,7 @@ export class DbIdentityStore {
301
297
  .run(moniker, Date.now(), agentName);
302
298
  return Number(res.changes) > 0;
303
299
  }
304
- /** MONIKER-1: the stored override for the ACTIVE agent, or null (no override / no such agent). */
300
+ /** The stored override for the ACTIVE agent, or null (no override / no such agent). */
305
301
  getMoniker(agentName) {
306
302
  const row = this.#db
307
303
  .prepare("SELECT moniker FROM agents WHERE agent_name = ? AND state != 'retired'")
@@ -309,7 +305,7 @@ export class DbIdentityStore {
309
305
  return row?.moniker ?? null;
310
306
  }
311
307
  /**
312
- * MONIKER-1 AC1: the agent's outbound name — the override when set, else the agent name itself.
308
+ * The agent's outbound name — the override when set, else the agent name itself.
313
309
  * There is no separate "self-moniker" concept; the default is valid by construction (the agent
314
310
  * name already satisfies MONIKER_RE at creation). Null only when no active agent holds the name.
315
311
  */
@@ -325,8 +321,8 @@ export class DbIdentityStore {
325
321
  /**
326
322
  * DB-backed `DaemonRegistrationPersistence`. Scoped to a single agent's row. All persist operations
327
323
  * are single-row UPSERTs that update the named agent's row; a register-success therefore implies the
328
- * material is durably committed (SI-003). A persist against a non-existent agent throws — the row is
329
- * created by the agent-creation path (AC-004) before registration runs.
324
+ * material is durably committed. A persist against a non-existent agent throws — the row is created by
325
+ * the agent-creation path before registration runs.
330
326
  */
331
327
  export class DbRegistrationPersistence {
332
328
  #db;
@@ -340,7 +336,7 @@ export class DbRegistrationPersistence {
340
336
  }
341
337
  #updateRow(setClause, params) {
342
338
  const now = Date.now();
343
- // REMOVE-001: target the ACTIVE row for this name. After name reuse a retired row and a new active
339
+ // Target the ACTIVE row for this name. After name reuse a retired row and a new active
344
340
  // row can share a name; the partial unique index guarantees at most one active row, so this is
345
341
  // unambiguous. A retired identity's registration material is never mutated.
346
342
  const res = this.#db
@@ -348,12 +344,12 @@ export class DbRegistrationPersistence {
348
344
  .run(...params, now, this.#agentName);
349
345
  if (Number(res.changes) === 0) {
350
346
  // The agent row must exist (created by the agent-creation path before registration). A missing
351
- // row is a real fault, not something to paper over — fail loud so registration fails (AC-012).
347
+ // row is a real fault, not something to paper over — FAIL LOUD so registration fails.
352
348
  throw new Error(`identity_persist_failed: no agent row for '${this.#agentName}'`);
353
349
  }
354
350
  }
355
351
  async persistMlDsaKeypair(opts) {
356
- // SI-001: secretKeyBlob is written to the encrypted DB only — never logged.
352
+ // secretKeyBlob is written to the encrypted DB only — never logged.
357
353
  this.#updateRow("ml_dsa_pubkey = ?, ml_dsa_secret = ?, ml_dsa_algorithm = ?", [
358
354
  opts.mlDsaPubkey,
359
355
  toBuf(opts.secretKeyBlob),
@@ -369,7 +365,7 @@ export class DbRegistrationPersistence {
369
365
  });
370
366
  }
371
367
  async persistFrostKeyShare(opts) {
372
- // SI-001: signingShare is written to the encrypted DB only — never logged.
368
+ // signingShare is written to the encrypted DB only — never logged.
373
369
  this.#updateRow(`frost_epoch_id = ?, frost_primary_pubkey = ?, frost_identifier = ?, frost_signing_share = ?,
374
370
  frost_threshold = ?, frost_participants = ?, frost_commitments = ?, frost_verifying_shares = ?,
375
371
  frost_dkg_method = ?, frost_directory_node_ids = ?`, [
@@ -392,7 +388,7 @@ export class DbRegistrationPersistence {
392
388
  });
393
389
  }
394
390
  async persistAgentUserLink(opts) {
395
- // SI: the preAuthToken is a bearer ticket — written to the encrypted DB only, never logged.
391
+ // The preAuthToken is a bearer ticket — written to the encrypted DB only, never logged.
396
392
  this.#updateRow("link_agent_id = ?, link_pre_auth_token = ?, link_linked_at = ?", [
397
393
  opts.agentId,
398
394
  opts.preAuthToken,
@@ -402,7 +398,7 @@ export class DbRegistrationPersistence {
402
398
  }
403
399
  // ─── Load (restart rehydration) ──────────────────────────────────────────────
404
400
  #row() {
405
- // REMOVE-001: load the ACTIVE row for this name (never a retired tombstone).
401
+ // Load the ACTIVE row for this name (never a retired tombstone).
406
402
  return this.#db.prepare("SELECT * FROM agents WHERE agent_name = ? AND state != 'retired'").get(this.#agentName);
407
403
  }
408
404
  async loadRegistrationState() {
@@ -431,8 +427,8 @@ export class DbRegistrationPersistence {
431
427
  const r = this.#row();
432
428
  if (!r || r["frost_signing_share"] == null)
433
429
  return null;
434
- // M8B quorum: the DKG's quorum Q (nodeIds). NULL for pre-quorum agents → undefined → seal falls
435
- // back to the full roster. Defensive parse: malformed data must not break share loading.
430
+ // The DKG's quorum Q (nodeIds). NULL → undefined → the seal falls back to the full roster.
431
+ // Defensive parse: malformed data must not break share loading.
436
432
  let directoryNodeIds;
437
433
  const rawIds = r["frost_directory_node_ids"];
438
434
  if (rawIds != null) {
@@ -1 +1 @@
1
- {"version":3,"file":"db-identity-store.js","sourceRoot":"","sources":["../src/db-identity-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAW7E,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CzB,CAAC;AAEF,yGAAyG;AACzG,MAAM,4BAA4B,GAChC,qGAAqG,CAAC;AAExG,mGAAmG;AACnG,yDAAyD;AACzD,MAAM,iBAAiB,GAAG;IACxB,YAAY;IACZ,cAAc;IACd,gBAAgB;IAChB,OAAO;IACP,eAAe;IACf,eAAe;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