@remnic/core 9.26.0 → 9.28.0

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 (440) hide show
  1. package/dist/access-admin-ops-surface.d.ts +13 -10
  2. package/dist/access-admin-ops-surface.js +43 -38
  3. package/dist/access-audit.js +2 -2
  4. package/dist/access-authorization-probe.d.ts +13 -10
  5. package/dist/access-authorization-probe.js +44 -39
  6. package/dist/access-boundary.d.ts +13 -10
  7. package/dist/access-boundary.js +43 -38
  8. package/dist/access-cli.js +100 -94
  9. package/dist/access-cli.js.map +1 -1
  10. package/dist/access-health-types.d.ts +10 -1
  11. package/dist/access-http-lcm-compaction.d.ts +13 -10
  12. package/dist/access-http.d.ts +13 -10
  13. package/dist/access-http.js +53 -48
  14. package/dist/access-identity-continuity-surface.d.ts +9 -8
  15. package/dist/access-identity-continuity-surface.js +43 -38
  16. package/dist/access-lcm-surface.d.ts +13 -10
  17. package/dist/access-lcm-surface.js +43 -38
  18. package/dist/access-mcp.d.ts +13 -10
  19. package/dist/access-mcp.js +48 -43
  20. package/dist/access-memory-search-fanout.d.ts +2 -2
  21. package/dist/{access-namespace-preflight-wRSZEO5V.d.ts → access-namespace-preflight-BiQ_-iUJ.d.ts} +1 -1
  22. package/dist/access-namespace-preflight.d.ts +3 -3
  23. package/dist/access-namespace-preflight.js +43 -38
  24. package/dist/access-observe-write-surface.d.ts +13 -10
  25. package/dist/access-observe-write-surface.js +43 -38
  26. package/dist/access-operations-batch.js +45 -40
  27. package/dist/access-operations.d.ts +16 -13
  28. package/dist/access-operations.js +47 -42
  29. package/dist/access-recall-concurrency.d.ts +13 -10
  30. package/dist/access-recall-concurrency.js +43 -38
  31. package/dist/access-recall-response.d.ts +13 -10
  32. package/dist/access-recall-response.js +43 -38
  33. package/dist/access-recall-surface.d.ts +13 -10
  34. package/dist/access-recall-surface.js +43 -38
  35. package/dist/access-schema.d.ts +80 -80
  36. package/dist/access-schema.js +4 -4
  37. package/dist/{access-service-DL8FJnTj.d.ts → access-service-CXkIgcGh.d.ts} +12 -8
  38. package/dist/access-service.d.ts +13 -10
  39. package/dist/access-service.js +43 -38
  40. package/dist/access-surface-catalog.d.ts +13 -10
  41. package/dist/access-wearables-meetings-surface.d.ts +4 -3
  42. package/dist/action-confidence.d.ts +1 -1
  43. package/dist/active-memory-bridge.d.ts +1 -1
  44. package/dist/active-recall.d.ts +1 -1
  45. package/dist/active-recall.js +4 -2
  46. package/dist/active-recall.js.map +1 -1
  47. package/dist/adapters/index.js +7 -7
  48. package/dist/adapters/registry.js +3 -3
  49. package/dist/behavior-learner.d.ts +1 -1
  50. package/dist/behavior-signals.d.ts +1 -1
  51. package/dist/bootstrap.d.ts +9 -8
  52. package/dist/briefing.d.ts +3 -2
  53. package/dist/briefing.js +12 -10
  54. package/dist/buffer-surprise-report.d.ts +1 -1
  55. package/dist/buffer.d.ts +3 -2
  56. package/dist/bulk-import/index.d.ts +3 -3
  57. package/dist/calibration.d.ts +1 -1
  58. package/dist/capabilities.d.ts +1 -1
  59. package/dist/{capsule-crypto-YO5QJ6L3.js → capsule-crypto-7FJQINUR.js} +2 -2
  60. package/dist/{catalog-BLLxZ5L5.d.ts → catalog-Bouj8Gfg.d.ts} +1 -1
  61. package/dist/causal-behavior.d.ts +1 -1
  62. package/dist/causal-consolidation.d.ts +1 -1
  63. package/dist/causal-consolidation.js +13 -11
  64. package/dist/causal-consolidation.js.map +1 -1
  65. package/dist/causal-trajectory-graph.d.ts +1 -1
  66. package/dist/{chunk-7RZJWZ46.js → chunk-227UFSEQ.js} +5 -5
  67. package/dist/{chunk-VGEH3STZ.js → chunk-2BEJ4XCF.js} +2 -2
  68. package/dist/{chunk-LIIQPDFN.js → chunk-2FYNLDKJ.js} +24 -3
  69. package/dist/chunk-2FYNLDKJ.js.map +1 -0
  70. package/dist/{chunk-BXLOS5AJ.js → chunk-2NLLXCJG.js} +2 -2
  71. package/dist/{chunk-6NNNURLK.js → chunk-2PHX3I5C.js} +8 -8
  72. package/dist/{chunk-YN4AUGNF.js → chunk-2TQ2UFKH.js} +65 -60
  73. package/dist/chunk-2TQ2UFKH.js.map +1 -0
  74. package/dist/{chunk-XAAIUXJO.js → chunk-3BSJBIZ3.js} +2 -2
  75. package/dist/{chunk-JCVQV6QX.js → chunk-3UOSVTFR.js} +11 -11
  76. package/dist/{chunk-AJ7QCSIS.js → chunk-7CPOZH6Y.js} +2 -2
  77. package/dist/{chunk-EXM2Q555.js → chunk-AHFZXUZM.js} +7 -5
  78. package/dist/chunk-AHFZXUZM.js.map +1 -0
  79. package/dist/{chunk-M2KGXXTL.js → chunk-ALTP3MFS.js} +2 -2
  80. package/dist/{chunk-77CNV7DY.js → chunk-BLAKS3CP.js} +4 -4
  81. package/dist/{chunk-FE5FKTCI.js → chunk-BR4UFMLO.js} +2 -2
  82. package/dist/chunk-CVILPI77.js +432 -0
  83. package/dist/chunk-CVILPI77.js.map +1 -0
  84. package/dist/{chunk-H2PBM562.js → chunk-DKQM5Q6Q.js} +2 -2
  85. package/dist/{chunk-CSXHRAJJ.js → chunk-EG64LXKL.js} +3 -3
  86. package/dist/{chunk-PTN6UAUA.js → chunk-ES36HTSC.js} +4 -4
  87. package/dist/{chunk-WMDRLTNA.js → chunk-EZWWCN7I.js} +2 -2
  88. package/dist/{chunk-XKGPIWGI.js → chunk-FBZTWUK5.js} +5 -5
  89. package/dist/{chunk-GJJBPI6I.js → chunk-FOCEI3TN.js} +6 -3
  90. package/dist/chunk-FOCEI3TN.js.map +1 -0
  91. package/dist/{chunk-Y6E37WRG.js → chunk-GJPCP5CA.js} +2 -2
  92. package/dist/{chunk-IHMXPG4P.js → chunk-GQSMYXKL.js} +6 -4
  93. package/dist/{chunk-IHMXPG4P.js.map → chunk-GQSMYXKL.js.map} +1 -1
  94. package/dist/{chunk-TGQ2NTWH.js → chunk-IJ6WHMFB.js} +16 -2
  95. package/dist/{chunk-TGQ2NTWH.js.map → chunk-IJ6WHMFB.js.map} +1 -1
  96. package/dist/{chunk-VDX2J7OX.js → chunk-IPLYGWQF.js} +6 -6
  97. package/dist/{chunk-XNUBF6RF.js → chunk-IYT632D5.js} +3 -3
  98. package/dist/{chunk-2QSZNTDO.js → chunk-JBPKEARU.js} +7 -7
  99. package/dist/{chunk-67DSDRUB.js → chunk-JIF3VRKQ.js} +8 -8
  100. package/dist/{chunk-V25OWXAC.js → chunk-JQ7T5VDC.js} +1 -1
  101. package/dist/chunk-JQ7T5VDC.js.map +1 -0
  102. package/dist/{chunk-MIFF37NN.js → chunk-KKBTBUVT.js} +2 -2
  103. package/dist/{chunk-ZHP4SUPB.js → chunk-LIHC3T43.js} +2 -2
  104. package/dist/{chunk-PX7VDW7R.js → chunk-MJPV4LBH.js} +79 -79
  105. package/dist/{chunk-PX7VDW7R.js.map → chunk-MJPV4LBH.js.map} +1 -1
  106. package/dist/{chunk-UGH6VPPO.js → chunk-MWTMTW2T.js} +2 -2
  107. package/dist/{chunk-F6LSNPPB.js → chunk-MXJ3VP6S.js} +6 -6
  108. package/dist/{chunk-KPWLZBXZ.js → chunk-NBNDVNJ2.js} +186 -25
  109. package/dist/chunk-NBNDVNJ2.js.map +1 -0
  110. package/dist/{chunk-M5EPMNS4.js → chunk-P2CLYN6H.js} +2 -2
  111. package/dist/{chunk-7XXCIO6X.js → chunk-PXQM2HOG.js} +13 -6
  112. package/dist/{chunk-7XXCIO6X.js.map → chunk-PXQM2HOG.js.map} +1 -1
  113. package/dist/{chunk-UZK7VVPD.js → chunk-Q5VJUNXA.js} +1858 -272
  114. package/dist/chunk-Q5VJUNXA.js.map +1 -0
  115. package/dist/{chunk-KGTD2KZJ.js → chunk-Q6YJW6KE.js} +2 -2
  116. package/dist/{chunk-X3SQYAPP.js → chunk-R372P2EH.js} +2 -2
  117. package/dist/{chunk-HBVOJNV4.js → chunk-RKXZ7P4V.js} +3 -3
  118. package/dist/chunk-RMMVQQA6.js +70 -0
  119. package/dist/chunk-RMMVQQA6.js.map +1 -0
  120. package/dist/{chunk-E6EAB4J6.js → chunk-S24E4MBQ.js} +14 -14
  121. package/dist/chunk-S24E4MBQ.js.map +1 -0
  122. package/dist/{chunk-RYHWZ52A.js → chunk-S2BBISHU.js} +4 -4
  123. package/dist/{chunk-LLISELSY.js → chunk-TBMRQZDY.js} +2 -2
  124. package/dist/{chunk-FMLKOL2Z.js → chunk-TC3VNKGX.js} +4 -4
  125. package/dist/{chunk-7K5Q6COX.js → chunk-TVVEYCNW.js} +4 -4
  126. package/dist/{chunk-2XP3PWL3.js → chunk-UR5SIN7H.js} +53 -35
  127. package/dist/chunk-UR5SIN7H.js.map +1 -0
  128. package/dist/{chunk-NKDVXEFU.js → chunk-VFNI3RPT.js} +2 -2
  129. package/dist/chunk-VNA7W7QF.js +134 -0
  130. package/dist/chunk-VNA7W7QF.js.map +1 -0
  131. package/dist/{chunk-PQPSZICJ.js → chunk-VYYNBJXH.js} +5 -5
  132. package/dist/chunk-WNIUPHWV.js +152 -0
  133. package/dist/chunk-WNIUPHWV.js.map +1 -0
  134. package/dist/chunk-WRJVB3C2.js +118 -0
  135. package/dist/chunk-WRJVB3C2.js.map +1 -0
  136. package/dist/{chunk-SN3ZESWQ.js → chunk-WVVK2RFM.js} +6 -6
  137. package/dist/{chunk-DQEMWVMT.js → chunk-X7Y7WX73.js} +1 -1
  138. package/dist/{chunk-4KKV7W62.js → chunk-YOBNCD3Z.js} +6 -6
  139. package/dist/chunk-YXZG5TVN.js +40 -0
  140. package/dist/chunk-YXZG5TVN.js.map +1 -0
  141. package/dist/{chunk-4DJQYKMN.js → chunk-ZIKENA2C.js} +2 -2
  142. package/dist/chunk-ZIKENA2C.js.map +1 -0
  143. package/dist/{chunk-SK3EYPKC.js → chunk-ZN4UZWMT.js} +2 -2
  144. package/dist/{cli-BoouX6LX.d.ts → cli-DJbkaZBU.d.ts} +5 -5
  145. package/dist/cli.d.ts +14 -12
  146. package/dist/cli.js +79 -74
  147. package/dist/compounding/engine.d.ts +3 -2
  148. package/dist/compounding/engine.js +12 -10
  149. package/dist/compounding/preference-consolidator.d.ts +1 -1
  150. package/dist/compression-optimizer.d.ts +1 -1
  151. package/dist/config.d.ts +1 -1
  152. package/dist/config.js +4 -2
  153. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  154. package/dist/connectors/codex-materialize-runner.js +12 -10
  155. package/dist/connectors/codex-materialize.d.ts +1 -1
  156. package/dist/connectors/index.d.ts +1 -1
  157. package/dist/connectors/index.js +12 -10
  158. package/dist/consolidation-provenance-check.d.ts +3 -2
  159. package/dist/consolidation-undo.d.ts +3 -2
  160. package/dist/contradiction/index.d.ts +3 -2
  161. package/dist/conversation-index/backend.d.ts +1 -1
  162. package/dist/conversation-index/backend.js +2 -2
  163. package/dist/conversation-index/chunker.d.ts +1 -1
  164. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  165. package/dist/conversation-index/indexer.d.ts +1 -1
  166. package/dist/conversation-index/search.d.ts +1 -1
  167. package/dist/corpus-watermark.d.ts +15 -2
  168. package/dist/corpus-watermark.js +25 -21
  169. package/dist/day-summary.d.ts +1 -1
  170. package/dist/delinearize.d.ts +1 -1
  171. package/dist/direct-answer-wiring.d.ts +1 -1
  172. package/dist/direct-answer.d.ts +1 -1
  173. package/dist/embedding-fallback.d.ts +1 -1
  174. package/dist/enrichment/index.d.ts +1 -1
  175. package/dist/entity-id-normalization.d.ts +4 -0
  176. package/dist/entity-id-normalization.js +10 -0
  177. package/dist/entity-id-normalization.js.map +1 -0
  178. package/dist/entity-retrieval-boundaries.d.ts +3 -0
  179. package/dist/entity-retrieval-boundaries.js +8 -0
  180. package/dist/entity-retrieval-boundaries.js.map +1 -0
  181. package/dist/entity-retrieval.d.ts +3 -2
  182. package/dist/entity-retrieval.js +13 -10
  183. package/dist/entity-schema.d.ts +1 -1
  184. package/dist/entity-schema.js +1 -1
  185. package/dist/explicit-capture.d.ts +9 -8
  186. package/dist/extraction-error-classification.d.ts +1 -1
  187. package/dist/extraction-faithfulness.d.ts +1 -1
  188. package/dist/extraction-judge-telemetry.d.ts +1 -1
  189. package/dist/extraction-judge-training.d.ts +1 -1
  190. package/dist/extraction-judge.d.ts +1 -1
  191. package/dist/extraction-liveness.d.ts +1 -1
  192. package/dist/extraction.d.ts +1 -1
  193. package/dist/fallback-llm.d.ts +1 -1
  194. package/dist/{first-start-migration-LEXL3XYL.js → first-start-migration-BKNGOFED.js} +4 -4
  195. package/dist/graph-dashboard-diff.d.ts +1 -1
  196. package/dist/graph-dashboard-key.d.ts +1 -1
  197. package/dist/graph-dashboard-parser.d.ts +1 -1
  198. package/dist/graph-edge-reinforcement.d.ts +1 -1
  199. package/dist/graph-snapshot.d.ts +1 -1
  200. package/dist/graph.d.ts +1 -1
  201. package/dist/importance.d.ts +1 -1
  202. package/dist/importers/index.d.ts +1 -1
  203. package/dist/in-flight-reads.d.ts +1 -1
  204. package/dist/index.d.ts +409 -407
  205. package/dist/index.js +147 -141
  206. package/dist/intent.d.ts +1 -1
  207. package/dist/lcm/engine.d.ts +1 -1
  208. package/dist/lcm/engine.js +3 -3
  209. package/dist/lcm/index.d.ts +1 -1
  210. package/dist/lcm/index.js +9 -9
  211. package/dist/lcm/tools.d.ts +1 -1
  212. package/dist/lifecycle.d.ts +1 -1
  213. package/dist/live-connectors-runner.d.ts +1 -1
  214. package/dist/local-llm.d.ts +1 -1
  215. package/dist/local-model-endpoint.d.ts +1 -1
  216. package/dist/maintenance/memory-governance.d.ts +1 -1
  217. package/dist/maintenance/memory-governance.js +12 -10
  218. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +3 -2
  219. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +12 -10
  220. package/dist/maintenance/rebuild-memory-projection.d.ts +3 -2
  221. package/dist/maintenance/rebuild-memory-projection.js +13 -11
  222. package/dist/{maintenance-DD22oIx9.d.ts → maintenance-DveW6azo.d.ts} +3 -3
  223. package/dist/mcp-memory-inspector-app.d.ts +13 -10
  224. package/dist/memory-action-policy.d.ts +1 -1
  225. package/dist/memory-cache.d.ts +1 -1
  226. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  227. package/dist/memory-projection-mutations.d.ts +4 -0
  228. package/dist/memory-projection-mutations.js +15 -0
  229. package/dist/memory-projection-mutations.js.map +1 -0
  230. package/dist/memory-projection-store.d.ts +1 -1
  231. package/dist/memory-provenance.d.ts +1 -1
  232. package/dist/memory-worth-outcomes.d.ts +3 -2
  233. package/dist/models-json.d.ts +1 -1
  234. package/dist/namespaces/migrate.d.ts +4 -3
  235. package/dist/namespaces/migrate.js +22 -20
  236. package/dist/namespaces/principal.d.ts +1 -1
  237. package/dist/namespaces/search.d.ts +1 -1
  238. package/dist/namespaces/search.js +9 -9
  239. package/dist/namespaces/storage.d.ts +4 -3
  240. package/dist/namespaces/storage.js +12 -10
  241. package/dist/native-knowledge.d.ts +1 -1
  242. package/dist/offline-sync-impression-drain.d.ts +1 -1
  243. package/dist/offline-sync-impression-drain.js +3 -3
  244. package/dist/operator-doctor-corpus.d.ts +22 -3
  245. package/dist/operator-doctor-corpus.js +32 -22
  246. package/dist/operator-doctor-replica.d.ts +52 -0
  247. package/dist/operator-doctor-replica.js +15 -0
  248. package/dist/operator-doctor-replica.js.map +1 -0
  249. package/dist/operator-toolkit.d.ts +7 -3
  250. package/dist/operator-toolkit.js +33 -27
  251. package/dist/orchestration/compression-guideline-coordinator.d.ts +3 -2
  252. package/dist/orchestration/maintenance.d.ts +5 -4
  253. package/dist/orchestration/maintenance.js +17 -15
  254. package/dist/{orchestrator-CFJ_TG6D.d.ts → orchestrator-Cvlgpe6I.d.ts} +7 -7
  255. package/dist/orchestrator.d.ts +9 -8
  256. package/dist/orchestrator.js +99 -93
  257. package/dist/patterns-cli.d.ts +1 -1
  258. package/dist/{pipeline-Bq5zU6Bp.d.ts → pipeline-BveYVaz7.d.ts} +1 -1
  259. package/dist/policy-runtime.d.ts +1 -1
  260. package/dist/proactive-contention.d.ts +1 -1
  261. package/dist/provenance.d.ts +1 -1
  262. package/dist/{qmd-3ILJkC70.d.ts → qmd-CLWDsbYR.d.ts} +1 -1
  263. package/dist/qmd-preflight.d.ts +2 -2
  264. package/dist/qmd-recall-cache.d.ts +1 -1
  265. package/dist/qmd.d.ts +2 -2
  266. package/dist/recall-concurrency-config.d.ts +1 -1
  267. package/dist/recall-disclosure-escalation.d.ts +1 -1
  268. package/dist/recall-explain-renderer.d.ts +1 -1
  269. package/dist/recall-explain-renderer.js +3 -3
  270. package/dist/recall-memory-map.d.ts +1 -1
  271. package/dist/recall-planner-llm.d.ts +1 -1
  272. package/dist/recall-state.d.ts +1 -1
  273. package/dist/recall-state.js +2 -2
  274. package/dist/recall-tag-filter.d.ts +1 -1
  275. package/dist/recall-timings.d.ts +1 -1
  276. package/dist/recall-xray-cli.d.ts +1 -1
  277. package/dist/recall-xray-cli.js +4 -4
  278. package/dist/recall-xray-renderer.d.ts +1 -1
  279. package/dist/recall-xray-renderer.js +3 -3
  280. package/dist/recall-xray.d.ts +1 -1
  281. package/dist/recall-xray.js +2 -2
  282. package/dist/replay/normalizers/chatgpt.d.ts +1 -1
  283. package/dist/replay/normalizers/claude.d.ts +1 -1
  284. package/dist/replay/normalizers/openclaw.d.ts +1 -1
  285. package/dist/replay/normalizers/shared.d.ts +1 -1
  286. package/dist/replay/runner.d.ts +1 -1
  287. package/dist/replay/types.d.ts +1 -1
  288. package/dist/replica-divergence.d.ts +279 -0
  289. package/dist/replica-divergence.js +28 -0
  290. package/dist/replica-divergence.js.map +1 -0
  291. package/dist/replica-peers-config.d.ts +5 -0
  292. package/dist/replica-peers-config.js +13 -0
  293. package/dist/replica-peers-config.js.map +1 -0
  294. package/dist/resolve-auth-token.d.ts +21 -2
  295. package/dist/resolve-auth-token.js +5 -1
  296. package/dist/resume-bundles.js +5 -3
  297. package/dist/retrieval-agents.d.ts +2 -2
  298. package/dist/retrieval-tiers.d.ts +1 -1
  299. package/dist/routing/engine.d.ts +1 -1
  300. package/dist/routing/store.d.ts +1 -1
  301. package/dist/salvage-envelope.d.ts +1 -1
  302. package/dist/schemas.d.ts +76 -76
  303. package/dist/{scope-profiles-D0-ff4xT.d.ts → scope-profiles-BVf3DZ7z.d.ts} +1 -1
  304. package/dist/search/embed-helper.d.ts +1 -1
  305. package/dist/search/factory.d.ts +1 -1
  306. package/dist/search/factory.js +8 -8
  307. package/dist/search/index.d.ts +1 -1
  308. package/dist/search/index.js +13 -13
  309. package/dist/search/lancedb-backend.d.ts +1 -1
  310. package/dist/search/lancedb-backend.js +2 -2
  311. package/dist/search/meilisearch-backend.d.ts +1 -1
  312. package/dist/search/meilisearch-backend.js +2 -2
  313. package/dist/search/noop-backend.d.ts +1 -1
  314. package/dist/search/orama-backend.d.ts +1 -1
  315. package/dist/search/orama-backend.js +2 -2
  316. package/dist/search/port.d.ts +1 -1
  317. package/dist/search/remote-backend.d.ts +1 -1
  318. package/dist/{semantic-consolidation-4Tfh7c1g.d.ts → semantic-consolidation-DXLV47y2.d.ts} +1 -1
  319. package/dist/semantic-consolidation.d.ts +2 -2
  320. package/dist/semantic-consolidation.js +13 -11
  321. package/dist/semantic-rule-promotion.js +12 -10
  322. package/dist/semantic-rule-verifier.d.ts +1 -1
  323. package/dist/semantic-rule-verifier.js +12 -10
  324. package/dist/{service-Z8uzoAST.d.ts → service-DbgPTeMJ.d.ts} +2 -2
  325. package/dist/session-observer-bands.d.ts +1 -1
  326. package/dist/session-observer-state.d.ts +1 -1
  327. package/dist/shared-context/manager.d.ts +9 -9
  328. package/dist/signal.d.ts +1 -1
  329. package/dist/{storage-BZVMn8yJ.d.ts → storage-DOzTm8wG.d.ts} +13 -22
  330. package/dist/storage.d.ts +3 -2
  331. package/dist/storage.js +13 -10
  332. package/dist/summarizer.d.ts +1 -1
  333. package/dist/summary-snapshot.d.ts +1 -1
  334. package/dist/temporal-supersession.d.ts +3 -2
  335. package/dist/temporal-timeline-recall.d.ts +1 -1
  336. package/dist/temporal-validity.d.ts +1 -1
  337. package/dist/threading.d.ts +1 -1
  338. package/dist/tier-migration.d.ts +3 -2
  339. package/dist/tier-routing.d.ts +1 -1
  340. package/dist/topics.d.ts +1 -1
  341. package/dist/transcript.d.ts +1 -1
  342. package/dist/transfer/autodetect.js +1 -1
  343. package/dist/transfer/backup.js +2 -2
  344. package/dist/transfer/capsule-export.js +3 -3
  345. package/dist/transfer/capsule-import.js +2 -2
  346. package/dist/transfer/types.d.ts +66 -66
  347. package/dist/trust-score-stage.d.ts +1 -1
  348. package/dist/trust-score.d.ts +1 -1
  349. package/dist/{types-DHBxIF0s.d.ts → types-BA7W-_xy.d.ts} +53 -4
  350. package/dist/types.d.ts +1 -1
  351. package/dist/types.js +1 -1
  352. package/dist/utility-runtime.d.ts +1 -1
  353. package/dist/verified-recall.js +12 -10
  354. package/dist/write-envelope.d.ts +1 -1
  355. package/package.json +2 -2
  356. package/src/access-health-types.ts +8 -0
  357. package/src/access-http.test.ts +4 -0
  358. package/src/access-service-health.test.ts +23 -0
  359. package/src/access-service.ts +27 -4
  360. package/src/cli.ts +9 -7
  361. package/src/config.ts +2 -1
  362. package/src/corpus-watermark.test.ts +21 -0
  363. package/src/corpus-watermark.ts +25 -3
  364. package/src/entity-id-normalization.ts +55 -0
  365. package/src/entity-retrieval-boundaries.ts +134 -0
  366. package/src/entity-retrieval.ts +253 -27
  367. package/src/entity-schema.ts +2 -1
  368. package/src/memory-projection-mutations.ts +132 -0
  369. package/src/namespaces/storage.ts +5 -3
  370. package/src/operator-doctor-corpus.ts +41 -0
  371. package/src/operator-doctor-replica.test.ts +261 -0
  372. package/src/operator-doctor-replica.ts +129 -0
  373. package/src/operator-toolkit.ts +5 -4
  374. package/src/orchestration/orchestrator-init.ts +2 -2
  375. package/src/replica-divergence.test.ts +1475 -0
  376. package/src/replica-divergence.ts +910 -0
  377. package/src/replica-peers-config.ts +250 -0
  378. package/src/resolve-auth-token.ts +38 -0
  379. package/src/storage/entity-canonical-id-migration-adapter.ts +72 -0
  380. package/src/storage/entity-canonical-id-migration-runner.ts +68 -0
  381. package/src/storage/entity-canonical-id-migration.ts +904 -0
  382. package/src/storage/entity-store.ts +44 -0
  383. package/src/storage/memory-frontmatter-metadata.ts +17 -0
  384. package/src/storage/memory-migration-serialization.ts +37 -0
  385. package/src/storage/memory-read-store.ts +3 -2
  386. package/src/storage/profile-header.ts +898 -0
  387. package/src/storage-profile-timestamp.test.ts +3358 -0
  388. package/src/storage.ts +73 -77
  389. package/src/testing/subjects/profile-header-write.test.ts +71 -0
  390. package/src/types.ts +3 -3
  391. package/dist/chunk-2XP3PWL3.js.map +0 -1
  392. package/dist/chunk-4DJQYKMN.js.map +0 -1
  393. package/dist/chunk-E6EAB4J6.js.map +0 -1
  394. package/dist/chunk-EXM2Q555.js.map +0 -1
  395. package/dist/chunk-GJJBPI6I.js.map +0 -1
  396. package/dist/chunk-KPWLZBXZ.js.map +0 -1
  397. package/dist/chunk-LIIQPDFN.js.map +0 -1
  398. package/dist/chunk-UZK7VVPD.js.map +0 -1
  399. package/dist/chunk-V25OWXAC.js.map +0 -1
  400. package/dist/chunk-YN4AUGNF.js.map +0 -1
  401. /package/dist/{capsule-crypto-YO5QJ6L3.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
  402. /package/dist/{chunk-7RZJWZ46.js.map → chunk-227UFSEQ.js.map} +0 -0
  403. /package/dist/{chunk-VGEH3STZ.js.map → chunk-2BEJ4XCF.js.map} +0 -0
  404. /package/dist/{chunk-BXLOS5AJ.js.map → chunk-2NLLXCJG.js.map} +0 -0
  405. /package/dist/{chunk-6NNNURLK.js.map → chunk-2PHX3I5C.js.map} +0 -0
  406. /package/dist/{chunk-XAAIUXJO.js.map → chunk-3BSJBIZ3.js.map} +0 -0
  407. /package/dist/{chunk-JCVQV6QX.js.map → chunk-3UOSVTFR.js.map} +0 -0
  408. /package/dist/{chunk-AJ7QCSIS.js.map → chunk-7CPOZH6Y.js.map} +0 -0
  409. /package/dist/{chunk-M2KGXXTL.js.map → chunk-ALTP3MFS.js.map} +0 -0
  410. /package/dist/{chunk-77CNV7DY.js.map → chunk-BLAKS3CP.js.map} +0 -0
  411. /package/dist/{chunk-FE5FKTCI.js.map → chunk-BR4UFMLO.js.map} +0 -0
  412. /package/dist/{chunk-H2PBM562.js.map → chunk-DKQM5Q6Q.js.map} +0 -0
  413. /package/dist/{chunk-CSXHRAJJ.js.map → chunk-EG64LXKL.js.map} +0 -0
  414. /package/dist/{chunk-PTN6UAUA.js.map → chunk-ES36HTSC.js.map} +0 -0
  415. /package/dist/{chunk-WMDRLTNA.js.map → chunk-EZWWCN7I.js.map} +0 -0
  416. /package/dist/{chunk-XKGPIWGI.js.map → chunk-FBZTWUK5.js.map} +0 -0
  417. /package/dist/{chunk-Y6E37WRG.js.map → chunk-GJPCP5CA.js.map} +0 -0
  418. /package/dist/{chunk-VDX2J7OX.js.map → chunk-IPLYGWQF.js.map} +0 -0
  419. /package/dist/{chunk-XNUBF6RF.js.map → chunk-IYT632D5.js.map} +0 -0
  420. /package/dist/{chunk-2QSZNTDO.js.map → chunk-JBPKEARU.js.map} +0 -0
  421. /package/dist/{chunk-67DSDRUB.js.map → chunk-JIF3VRKQ.js.map} +0 -0
  422. /package/dist/{chunk-MIFF37NN.js.map → chunk-KKBTBUVT.js.map} +0 -0
  423. /package/dist/{chunk-ZHP4SUPB.js.map → chunk-LIHC3T43.js.map} +0 -0
  424. /package/dist/{chunk-UGH6VPPO.js.map → chunk-MWTMTW2T.js.map} +0 -0
  425. /package/dist/{chunk-F6LSNPPB.js.map → chunk-MXJ3VP6S.js.map} +0 -0
  426. /package/dist/{chunk-M5EPMNS4.js.map → chunk-P2CLYN6H.js.map} +0 -0
  427. /package/dist/{chunk-KGTD2KZJ.js.map → chunk-Q6YJW6KE.js.map} +0 -0
  428. /package/dist/{chunk-X3SQYAPP.js.map → chunk-R372P2EH.js.map} +0 -0
  429. /package/dist/{chunk-HBVOJNV4.js.map → chunk-RKXZ7P4V.js.map} +0 -0
  430. /package/dist/{chunk-RYHWZ52A.js.map → chunk-S2BBISHU.js.map} +0 -0
  431. /package/dist/{chunk-LLISELSY.js.map → chunk-TBMRQZDY.js.map} +0 -0
  432. /package/dist/{chunk-FMLKOL2Z.js.map → chunk-TC3VNKGX.js.map} +0 -0
  433. /package/dist/{chunk-7K5Q6COX.js.map → chunk-TVVEYCNW.js.map} +0 -0
  434. /package/dist/{chunk-NKDVXEFU.js.map → chunk-VFNI3RPT.js.map} +0 -0
  435. /package/dist/{chunk-PQPSZICJ.js.map → chunk-VYYNBJXH.js.map} +0 -0
  436. /package/dist/{chunk-SN3ZESWQ.js.map → chunk-WVVK2RFM.js.map} +0 -0
  437. /package/dist/{chunk-DQEMWVMT.js.map → chunk-X7Y7WX73.js.map} +0 -0
  438. /package/dist/{chunk-4KKV7W62.js.map → chunk-YOBNCD3Z.js.map} +0 -0
  439. /package/dist/{chunk-SK3EYPKC.js.map → chunk-ZN4UZWMT.js.map} +0 -0
  440. /package/dist/{first-start-migration-LEXL3XYL.js.map → first-start-migration-BKNGOFED.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { ReplayNormalizer } from '../types.js';
2
2
  import '../../message-parts/index.js';
3
- import '../../types-DHBxIF0s.js';
3
+ import '../../types-BA7W-_xy.js';
4
4
  import '../../bounded-jsonl-state.js';
5
5
  import '../../operator-doctor-types.js';
6
6
  import '../../types-continuity.js';
@@ -1,6 +1,6 @@
1
1
  import { ReplayNormalizer } from '../types.js';
2
2
  import '../../message-parts/index.js';
3
- import '../../types-DHBxIF0s.js';
3
+ import '../../types-BA7W-_xy.js';
4
4
  import '../../bounded-jsonl-state.js';
5
5
  import '../../operator-doctor-types.js';
6
6
  import '../../types-continuity.js';
@@ -1,6 +1,6 @@
1
1
  import { ReplayRole } from '../types.js';
2
2
  import '../../message-parts/index.js';
3
- import '../../types-DHBxIF0s.js';
3
+ import '../../types-BA7W-_xy.js';
4
4
  import '../../bounded-jsonl-state.js';
5
5
  import '../../operator-doctor-types.js';
6
6
  import '../../types-continuity.js';
@@ -1,6 +1,6 @@
1
1
  import { ReplaySource, ReplayWarning, ReplayNormalizer, ReplayTurn, ReplayParseOptions } from './types.js';
2
2
  import '../message-parts/index.js';
3
- import '../types-DHBxIF0s.js';
3
+ import '../types-BA7W-_xy.js';
4
4
  import '../bounded-jsonl-state.js';
5
5
  import '../operator-doctor-types.js';
6
6
  import '../types-continuity.js';
@@ -1,5 +1,5 @@
1
1
  import { LcmMessagePartInput, MessagePartSourceFormat } from '../message-parts/index.js';
2
- import { n as SourceConnectorProvenance } from '../types-DHBxIF0s.js';
2
+ import { n as SourceConnectorProvenance } from '../types-BA7W-_xy.js';
3
3
  import '../bounded-jsonl-state.js';
4
4
  import '../operator-doctor-types.js';
5
5
  import '../types-continuity.js';
@@ -0,0 +1,279 @@
1
+ import { TokenCapabilities } from './access-token-capabilities.js';
2
+ import { CorpusWatermark } from './corpus-watermark.js';
3
+ import { Y as ReplicaPeersConfig, Z as ReplicaPeerConfig } from './types-BA7W-_xy.js';
4
+ import { ResolveSecretRefFn } from './resolve-auth-token.js';
5
+ import 'node:async_hooks';
6
+ import './message-parts/index.js';
7
+ import './bounded-jsonl-state.js';
8
+ import './operator-doctor-types.js';
9
+ import './types-continuity.js';
10
+
11
+ /**
12
+ * Replica divergence detection (issue #2149).
13
+ *
14
+ * The corpus-watermark primitive (corpus-watermark.ts, PR #2156) gives each
15
+ * daemon a cheap, comparable fingerprint of its own memory corpus. This module
16
+ * is the OTHER half the issue asks for: a daemon configured with peer URLs polls
17
+ * each peer's authenticated `/health`, compares the peer's watermark set against
18
+ * the local one PER NAMESPACE, and reports drift (file-count delta, watermark
19
+ * age delta, digest mismatch) so a months-long silent split-brain becomes a
20
+ * same-day alert. Detection ONLY — reconciliation is issue #2150.
21
+ *
22
+ * Design invariants (from AGENTS.md review-prevention patterns):
23
+ * - §22 error-result conflation: a peer that times out / refuses / returns
24
+ * non-2xx / omits `corpus` is a DISTINCT `unreachable`/`unknown` state, never
25
+ * folded into `converged`. A monitor must tell "peer agrees" from "we could
26
+ * not ask". The outcome is a discriminated union, not a boolean + empty array.
27
+ * - §5 state scoping: poll state lives on a per-instance {@link
28
+ * ReplicaDivergenceMonitor}, never a bare module global.
29
+ * - §1/§17/§24/§39 input validation: {@link parseReplicaPeersConfig} rejects
30
+ * invalid input (bad url, non-array peers, fractional/non-positive intervals)
31
+ * rather than silently defaulting, and coerces string booleans/numbers.
32
+ * - Peer tokens are secrets: resolved through the SAME `resolveAgentAccessAuthToken`
33
+ * indirection as `agentAccessHttp.authToken`, NEVER logged, NEVER echoed into a
34
+ * report/health/doctor payload. Peer identity is redacted to `host:port`
35
+ * (userinfo/path/query stripped) so a credential embedded in a URL cannot leak.
36
+ * - Polling never runs inline on the health request path: it reuses the corpus
37
+ * stale-while-revalidate / single-flight idiom, serving the last result with
38
+ * its timestamp and refreshing in the background.
39
+ */
40
+
41
+ /** Per-peer verdict. `unreachable`/`unknown` are NEVER conflated with `converged` (§22). */
42
+ type ReplicaPeerState = "converged" | "diverged" | "unreachable" | "unknown";
43
+ /** Whether a namespace is present on both sides, or only one (its own divergence outcome). */
44
+ type ReplicaNamespacePresence = "both" | "local_only" | "peer_only";
45
+ interface ReplicaNamespaceDelta {
46
+ namespace: string;
47
+ presence: ReplicaNamespacePresence;
48
+ localFileCount: number | null;
49
+ peerFileCount: number | null;
50
+ /** |local - peer| when present on both sides, else null. */
51
+ fileCountDelta: number | null;
52
+ localNewestWriteAt: string | null;
53
+ peerNewestWriteAt: string | null;
54
+ /** |local.newestWriteAt - peer.newestWriteAt| in ms when both are dated, else null. */
55
+ writeAgeDeltaMs: number | null;
56
+ /** local.digest === peer.digest when present on both sides, else null. */
57
+ digestMatch: boolean | null;
58
+ diverged: boolean;
59
+ /** Concrete, token-free reasons a namespace diverged (numbers included for the operator). */
60
+ reasons: string[];
61
+ }
62
+ interface ReplicaPeerReport {
63
+ /** Redacted `host:port` — never the token, never userinfo/path/query. */
64
+ peer: string;
65
+ state: ReplicaPeerState;
66
+ polledAt: string;
67
+ /**
68
+ * Per-namespace deltas. Empty only for a fetch-level `unreachable`/`unknown`
69
+ * (no comparison ran); a comparison that resolves to `unknown` (an ambiguous
70
+ * local-only namespace) still carries its deltas.
71
+ */
72
+ namespaces: ReplicaNamespaceDelta[];
73
+ divergedNamespaceCount: number;
74
+ /** Stable reason code for a non-comparison state (e.g. "timeout", "http_500", "missing_corpus"). */
75
+ reason?: string;
76
+ }
77
+ /** Local watermark set plus whether every configured namespace was scanned. */
78
+ interface LocalCensus {
79
+ watermarks: CorpusWatermark[];
80
+ complete: boolean;
81
+ }
82
+ interface ReplicaDivergenceStatus {
83
+ enabled: boolean;
84
+ /**
85
+ * False when the local corpus census dropped namespaces (a per-namespace scan
86
+ * failed, or enumeration was still warming). A peer can only be certified
87
+ * `converged` against a COMPLETE local set — otherwise an unscanned tenant
88
+ * never enters the comparison and its divergence is invisible. Mirrors the
89
+ * doctor check's `localCensusComplete` gate (round 4, cursor).
90
+ */
91
+ censusComplete?: boolean;
92
+ /**
93
+ * True when the feature is enabled with peers configured but no poll has
94
+ * completed yet (warming, or a persistently failing local-watermark scan).
95
+ * Distinguishes that in-progress/failed state from the "enabled but no peers
96
+ * configured" case, which reports `pending: false` with an empty `peers` list
97
+ * (review round 1).
98
+ */
99
+ pending: boolean;
100
+ /** ISO timestamp of the last completed poll cycle, or null when never polled / disabled. */
101
+ polledAt: string | null;
102
+ peers: ReplicaPeerReport[];
103
+ }
104
+ /** Discriminated fetch outcome — the heart of the §22 empty-vs-failed distinction. */
105
+ type PeerFetchOutcome = {
106
+ readonly kind: "ok";
107
+ readonly corpus: CorpusWatermark[];
108
+ } | {
109
+ readonly kind: "unreachable";
110
+ readonly reason: string;
111
+ } | {
112
+ readonly kind: "unknown";
113
+ readonly reason: string;
114
+ };
115
+ /**
116
+ * Compare a local watermark set against a peer's, per namespace. A namespace on
117
+ * only one side is its own outcome (never silently skipped):
118
+ * - `peer_only` is divergence — the peer holds data we lack.
119
+ * - `local_only` is AMBIGUOUS — a namespace-restricted peer token hides
120
+ * namespaces it cannot see (not divergence), but an unrestricted peer that
121
+ * genuinely lost the namespace omits it the SAME way, so it cannot be
122
+ * certified converged either. It resolves the peer to `unknown` (codex P1).
123
+ * Digest mismatch flags divergence ONLY at EQUAL total file counts — the same
124
+ * number of files distributed differently across `<tier>:<category>/<day>`
125
+ * buckets (a distribution split-brain). The digest hashes per-bucket COUNTS, so
126
+ * it does NOT catch two replicas whose buckets hold equal counts but different
127
+ * file contents. Any nonzero count delta already perturbs the digest, so
128
+ * flagging digest there too would make `maxFileCountDelta` unreachable (codex
129
+ * P2); within tolerance the count delta is the sole signal.
130
+ */
131
+ declare function compareReplicaWatermarks(local: readonly CorpusWatermark[], peer: readonly CorpusWatermark[], thresholds: Pick<ReplicaPeersConfig, "maxFileCountDelta" | "maxWatermarkAgeDeltaMs">): {
132
+ state: "converged" | "diverged" | "unknown";
133
+ reason?: string;
134
+ namespaces: ReplicaNamespaceDelta[];
135
+ divergedNamespaceCount: number;
136
+ };
137
+ type FetchLike = (input: string, init?: {
138
+ headers?: Record<string, string>;
139
+ signal?: AbortSignal;
140
+ }) => Promise<{
141
+ ok: boolean;
142
+ status: number;
143
+ json(): Promise<unknown>;
144
+ /**
145
+ * Raw body stream when the transport exposes one (the global `fetch`
146
+ * Response does). Present so a peer payload can be size-bounded while it is
147
+ * read; a test double that omits it falls back to `json()`.
148
+ */
149
+ body?: unknown;
150
+ }>;
151
+ /**
152
+ * Cap on a peer's `/health` payload. A configured peer is a trust boundary: a
153
+ * compromised or malfunctioning one could otherwise stream an unbounded corpus
154
+ * that `json()` buffers whole, and up to `maxConcurrent` peers are polled at
155
+ * once, so the exposure multiplies (round 7, codex P2). Generous enough for a
156
+ * fleet-sized namespace census, small enough that four of them cannot exhaust
157
+ * the daemon.
158
+ */
159
+ declare const MAX_PEER_RESPONSE_BYTES: number;
160
+ interface FetchPeerOptions {
161
+ timeoutMs: number;
162
+ resolveSecretRef?: ResolveSecretRefFn | null;
163
+ /** Injectable for tests; defaults to global fetch. */
164
+ fetchImpl?: FetchLike;
165
+ /**
166
+ * Max age (ms) a peer census `computedAt` may reach before the peer is treated
167
+ * as `unknown`/`peer_census_stale` — a snapshot older than this predates
168
+ * changes it may not reflect, so it cannot certify convergence (round 6, codex
169
+ * P1). Reuses the caller's `maxWatermarkAgeDeltaMs`; when unset OR non-positive,
170
+ * no staleness gate is applied (a 0 bound is the strictest DIVERGENCE mode, not
171
+ * a 0ms freshness gate — round 6, cursor).
172
+ */
173
+ maxCensusAgeMs?: number;
174
+ /** Wall clock (ms) the staleness gate measures `computedAt` against; defaults to now. */
175
+ nowMs?: number;
176
+ }
177
+ /** Redact a peer URL to `host:port` — strips userinfo/path/query so a credential in a URL cannot leak. */
178
+ declare function redactPeerUrl(url: string): string;
179
+ /**
180
+ * Fetch a peer's authenticated `/health` corpus with a bounded timeout, trying
181
+ * the remnic prefix then the legacy engram prefix. Never throws — every failure
182
+ * mode maps to a discriminated `unreachable`/`unknown` outcome (§22).
183
+ */
184
+ declare function fetchPeerWatermarks(peer: ReplicaPeerConfig, options: FetchPeerOptions): Promise<PeerFetchOutcome>;
185
+ interface PollReplicaPeersOptions {
186
+ config: ReplicaPeersConfig;
187
+ localWatermarks: readonly CorpusWatermark[];
188
+ now?: Date;
189
+ resolveSecretRef?: ResolveSecretRefFn | null;
190
+ fetchImpl?: FetchLike;
191
+ maxConcurrent?: number;
192
+ /** Optional sink for a single deduped warn line per non-converged poll cycle (never contains tokens). */
193
+ log?: (line: string) => void;
194
+ }
195
+ /**
196
+ * Poll every configured peer once, compare each against the local watermark set,
197
+ * and assemble a report. Disabled or peerless → no network at all (returns an
198
+ * empty report). Never throws: a single peer failure degrades only that peer.
199
+ */
200
+ declare function pollReplicaPeers(options: PollReplicaPeersOptions): Promise<ReplicaDivergenceStatus>;
201
+ /**
202
+ * Filter a full report to a presenting token's namespace capabilities, exactly
203
+ * as the corpus `/health` field is filtered (issue #2156 finding B): a
204
+ * namespace-restricted token must not learn about namespaces it cannot see. A
205
+ * peer's reachability state carries no namespace data and is preserved; a
206
+ * comparison peer's visible state is recomputed from its visible deltas so
207
+ * divergence in a hidden namespace never leaks as a "diverged" verdict. The
208
+ * census gate is then re-applied to the FILTERED view: filtering can hide a real
209
+ * shared divergence and leave a peer_only delta that must not read as a false
210
+ * split-brain to a restricted caller under an incomplete census (round 6, codex).
211
+ */
212
+ declare function filterReplicaReportByCaps(report: ReplicaDivergenceStatus, caps: TokenCapabilities | null | undefined): ReplicaDivergenceStatus;
213
+ /**
214
+ * Overlay the LOCAL-census half of the certification rule onto a whole report:
215
+ * a peer is `converged` only when the local census scanned EVERY configured
216
+ * namespace — a dropped local tenant never enters the comparison, so its
217
+ * divergence would be invisible (round 4). Applied identically by the
218
+ * background monitor (/health) and `summarizeReplicaDivergence` (doctor) so the
219
+ * two surfaces cannot disagree about an incomplete census (round 6). Under an
220
+ * incomplete census every `peer_only` delta is NEUTRALIZED (an incomplete local
221
+ * scan cannot tell a namespace we genuinely lack from one we merely failed to
222
+ * read — a false split-brain), so it stops counting as divergence. A peer then
223
+ * stays `diverged` ONLY if a REAL shared-namespace divergence remains; otherwise
224
+ * (converged, or peer_only-only) it is `unknown`/`local_census_incomplete`.
225
+ * unreachable/unknown already carry a truthful state and stand.
226
+ */
227
+ declare function gateReportByCensus(report: ReplicaDivergenceStatus, censusComplete: boolean): ReplicaDivergenceStatus;
228
+ interface ReplicaDivergenceMonitorOptions {
229
+ clock?: () => number;
230
+ resolveSecretRef?: ResolveSecretRefFn | null;
231
+ fetchImpl?: FetchLike;
232
+ maxConcurrent?: number;
233
+ log?: (line: string) => void;
234
+ }
235
+ /**
236
+ * Instance-scoped (§5) stale-while-revalidate monitor of peer divergence. {@link
237
+ * getReport} NEVER awaits the poll: it returns the last completed report (stale
238
+ * allowed, or a never-polled placeholder) and single-flights a background poll
239
+ * when the entry is missing or older than `pollIntervalMs`. So a `/health` probe
240
+ * is always O(1) and polling never runs inline on the request path. Disabled or
241
+ * peerless config short-circuits with zero network work.
242
+ */
243
+ declare class ReplicaDivergenceMonitor {
244
+ private cached;
245
+ /** Earliest clock() at which a failed poll may retry — enforces backoff (round 6). */
246
+ private nextAttemptAt;
247
+ private inFlight;
248
+ private readonly clock;
249
+ private readonly resolveSecretRef;
250
+ private readonly fetchImpl;
251
+ private readonly maxConcurrent;
252
+ private readonly log;
253
+ constructor(options?: ReplicaDivergenceMonitorOptions);
254
+ getReport(input: {
255
+ /**
256
+ * Raw `replicaPeers` block. An absent/partial/loosely-typed block (a host
257
+ * adapter or an older persisted config that bypassed `parseConfig`) resolves
258
+ * to the documented default — disabled, no peers, no polling — so `/health`
259
+ * stays answerable instead of throwing (issue #2155 read-boundary pattern).
260
+ */
261
+ config: ReplicaPeersConfig | undefined;
262
+ /** Fresh local watermark set for comparison; invoked only during a background refresh. */
263
+ computeLocalWatermarks: () => Promise<LocalCensus>;
264
+ caps?: TokenCapabilities | null;
265
+ /**
266
+ * Completeness of the census THIS request is presenting alongside the
267
+ * report. A cached poll was gated by the census that existed when it ran,
268
+ * so a since-degraded scan could ship `converged` peers next to an
269
+ * incomplete corpus (round 9, cursor). Gating on the way out keeps the one
270
+ * response self-consistent without poisoning the shared cache.
271
+ */
272
+ localCensusComplete?: boolean;
273
+ }): ReplicaDivergenceStatus;
274
+ private refresh;
275
+ /** Await any in-flight background poll (deterministic tests / shutdown). */
276
+ whenIdle(): Promise<void>;
277
+ }
278
+
279
+ export { type FetchLike, type FetchPeerOptions, type LocalCensus, MAX_PEER_RESPONSE_BYTES, type PeerFetchOutcome, type PollReplicaPeersOptions, ReplicaDivergenceMonitor, type ReplicaDivergenceMonitorOptions, type ReplicaDivergenceStatus, type ReplicaNamespaceDelta, type ReplicaNamespacePresence, type ReplicaPeerReport, type ReplicaPeerState, compareReplicaWatermarks, fetchPeerWatermarks, filterReplicaReportByCaps, gateReportByCensus, pollReplicaPeers, redactPeerUrl };
@@ -0,0 +1,28 @@
1
+ import {
2
+ MAX_PEER_RESPONSE_BYTES,
3
+ ReplicaDivergenceMonitor,
4
+ compareReplicaWatermarks,
5
+ fetchPeerWatermarks,
6
+ filterReplicaReportByCaps,
7
+ gateReportByCensus,
8
+ pollReplicaPeers,
9
+ redactPeerUrl
10
+ } from "./chunk-CVILPI77.js";
11
+ import "./chunk-WNIUPHWV.js";
12
+ import "./chunk-IJ6WHMFB.js";
13
+ import "./chunk-PQVCH2AE.js";
14
+ import "./chunk-MZWSOLMT.js";
15
+ import "./chunk-2Z24E5W2.js";
16
+ import "./chunk-3WCASNQZ.js";
17
+ import "./chunk-PZ5AY32C.js";
18
+ export {
19
+ MAX_PEER_RESPONSE_BYTES,
20
+ ReplicaDivergenceMonitor,
21
+ compareReplicaWatermarks,
22
+ fetchPeerWatermarks,
23
+ filterReplicaReportByCaps,
24
+ gateReportByCensus,
25
+ pollReplicaPeers,
26
+ redactPeerUrl
27
+ };
28
+ //# sourceMappingURL=replica-divergence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,5 @@
1
+ export { Z as ReplicaPeerConfig, Y as ReplicaPeersConfig, c7 as parseReplicaPeersConfig, c8 as resolveReplicaPeersConfig } from './types-BA7W-_xy.js';
2
+ import './message-parts/index.js';
3
+ import './bounded-jsonl-state.js';
4
+ import './operator-doctor-types.js';
5
+ import './types-continuity.js';
@@ -0,0 +1,13 @@
1
+ import {
2
+ parseReplicaPeersConfig,
3
+ resolveReplicaPeersConfig
4
+ } from "./chunk-WNIUPHWV.js";
5
+ import "./chunk-IJ6WHMFB.js";
6
+ import "./chunk-PQVCH2AE.js";
7
+ import "./chunk-3WCASNQZ.js";
8
+ import "./chunk-PZ5AY32C.js";
9
+ export {
10
+ parseReplicaPeersConfig,
11
+ resolveReplicaPeersConfig
12
+ };
13
+ //# sourceMappingURL=replica-peers-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,4 @@
1
- import { a7 as SecretRef, a8 as AgentAccessAuthToken } from './types-DHBxIF0s.js';
1
+ import { s as SecretRef, t as AgentAccessAuthToken } from './types-BA7W-_xy.js';
2
2
  import './message-parts/index.js';
3
3
  import './bounded-jsonl-state.js';
4
4
  import './operator-doctor-types.js';
@@ -51,5 +51,24 @@ declare function resolveAgentAccessAuthToken(value: AgentAccessAuthToken | undef
51
51
  declare function isAgentAccessSecretRef(value: unknown): value is SecretRef;
52
52
  /** Test/operations hook: drop the cache and force resolver rediscovery. */
53
53
  declare function clearAuthTokenSecretCache(): void;
54
+ /**
55
+ * Resolve a host SecretRef resolver, preferring an explicitly supplied one over
56
+ * the lazy loader.
57
+ *
58
+ * Shared by every CLI command that authenticates with a SecretRef — `access
59
+ * serve` and `doctor` (replica peer tokens, issue #2149) — so the two cannot
60
+ * drift. Structurally typed rather than importing the CLI's options type, which
61
+ * would invert the dependency.
62
+ */
63
+ declare function loadHostSecretRefResolver(options: {
64
+ resolveSecretRef?: ResolveSecretRefFn | null;
65
+ loadResolveSecretRef?: () => Promise<ResolveSecretRefFn | null | undefined> | ResolveSecretRefFn | null | undefined;
66
+ }): Promise<ResolveSecretRefFn | null | undefined>;
67
+ /**
68
+ * Adapt a host's lazily-loaded SecretRef resolver into the eager
69
+ * `ResolveSecretRefFn` that `EngramAccessService` expects, so replica peer
70
+ * tokens resolve at poll time (issue #2149).
71
+ */
72
+ declare function hostSecretRefResolver(options: Parameters<typeof loadHostSecretRefResolver>[0]): ResolveSecretRefFn;
54
73
 
55
- export { type ResolveSecretRefFn, clearAuthTokenSecretCache, isAgentAccessSecretRef, resolveAgentAccessAuthToken };
74
+ export { type ResolveSecretRefFn, clearAuthTokenSecretCache, hostSecretRefResolver, isAgentAccessSecretRef, loadHostSecretRefResolver, resolveAgentAccessAuthToken };
@@ -1,12 +1,16 @@
1
1
  import {
2
2
  clearAuthTokenSecretCache,
3
+ hostSecretRefResolver,
3
4
  isAgentAccessSecretRef,
5
+ loadHostSecretRefResolver,
4
6
  resolveAgentAccessAuthToken
5
- } from "./chunk-TGQ2NTWH.js";
7
+ } from "./chunk-IJ6WHMFB.js";
6
8
  import "./chunk-PZ5AY32C.js";
7
9
  export {
8
10
  clearAuthTokenSecretCache,
11
+ hostSecretRefResolver,
9
12
  isAgentAccessSecretRef,
13
+ loadHostSecretRefResolver,
10
14
  resolveAgentAccessAuthToken
11
15
  };
12
16
  //# sourceMappingURL=resolve-auth-token.js.map
@@ -4,12 +4,12 @@ import {
4
4
  recordResumeBundle,
5
5
  resolveResumeBundleDir,
6
6
  validateResumeBundle
7
- } from "./chunk-LLISELSY.js";
7
+ } from "./chunk-TBMRQZDY.js";
8
8
  import "./chunk-ZRWB5D4H.js";
9
9
  import "./chunk-HYQJQGD3.js";
10
10
  import "./chunk-KFY3SGN7.js";
11
11
  import "./chunk-LMDRGRJ2.js";
12
- import "./chunk-GJJBPI6I.js";
12
+ import "./chunk-FOCEI3TN.js";
13
13
  import "./chunk-NDAH7BJ5.js";
14
14
  import "./chunk-7RAJ3GXO.js";
15
15
  import "./chunk-Z5LAYHGJ.js";
@@ -22,10 +22,12 @@ import "./chunk-KFZY2OFH.js";
22
22
  import "./chunk-S4DDLTPX.js";
23
23
  import "./chunk-6HMYUWXR.js";
24
24
  import "./chunk-P32IDSHD.js";
25
+ import "./chunk-WNIUPHWV.js";
26
+ import "./chunk-IJ6WHMFB.js";
25
27
  import "./chunk-443XCR34.js";
26
28
  import "./chunk-5I4M26Q7.js";
29
+ import "./chunk-ZIKENA2C.js";
27
30
  import "./chunk-5GKPFL3S.js";
28
- import "./chunk-4DJQYKMN.js";
29
31
  import "./chunk-PQVCH2AE.js";
30
32
  import "./chunk-EYIEWJNI.js";
31
33
  import "./chunk-JUC24CTX.js";
@@ -1,5 +1,5 @@
1
- import { Q as QmdSearchResult } from './types-DHBxIF0s.js';
2
- import { Q as QmdClient } from './qmd-3ILJkC70.js';
1
+ import { Q as QmdSearchResult } from './types-BA7W-_xy.js';
2
+ import { Q as QmdClient } from './qmd-CLWDsbYR.js';
3
3
  import './message-parts/index.js';
4
4
  import './bounded-jsonl-state.js';
5
5
  import './operator-doctor-types.js';
@@ -1,4 +1,4 @@
1
- import { au as RetrievalTier } from './types-DHBxIF0s.js';
1
+ import { aw as RetrievalTier } from './types-BA7W-_xy.js';
2
2
  import './message-parts/index.js';
3
3
  import './bounded-jsonl-state.js';
4
4
  import './operator-doctor-types.js';
@@ -1,4 +1,4 @@
1
- import { t as MemoryCategory } from '../types-DHBxIF0s.js';
1
+ import { v as MemoryCategory } from '../types-BA7W-_xy.js';
2
2
  import '../message-parts/index.js';
3
3
  import '../bounded-jsonl-state.js';
4
4
  import '../operator-doctor-types.js';
@@ -1,5 +1,5 @@
1
1
  import { RoutingEngineOptions, RouteRule } from './engine.js';
2
- import '../types-DHBxIF0s.js';
2
+ import '../types-BA7W-_xy.js';
3
3
  import '../message-parts/index.js';
4
4
  import '../bounded-jsonl-state.js';
5
5
  import '../operator-doctor-types.js';
@@ -1,5 +1,5 @@
1
1
  import { MemoryWriteInput, WriteContext, SealedMemoryEnvelope } from './write-envelope.js';
2
- import './types-DHBxIF0s.js';
2
+ import './types-BA7W-_xy.js';
3
3
  import './message-parts/index.js';
4
4
  import './bounded-jsonl-state.js';
5
5
  import './operator-doctor-types.js';