@remnic/core 9.66.8 → 9.66.10

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 (481) hide show
  1. package/dist/access-admin-ops-surface.d.ts +11 -11
  2. package/dist/access-admin-ops-surface.js +23 -23
  3. package/dist/access-authorization-probe.d.ts +11 -11
  4. package/dist/access-authorization-probe.js +24 -24
  5. package/dist/access-boundary.d.ts +11 -11
  6. package/dist/access-boundary.js +23 -23
  7. package/dist/access-cli.js +98 -97
  8. package/dist/access-cli.js.map +1 -1
  9. package/dist/access-coding-context-resolution.d.ts +1 -1
  10. package/dist/access-extraction-force-flush.d.ts +11 -11
  11. package/dist/access-extraction-force-flush.js +23 -23
  12. package/dist/access-health-types.d.ts +1 -1
  13. package/dist/access-http-lcm-compaction.d.ts +11 -11
  14. package/dist/access-http-lifecycle-flush.d.ts +11 -11
  15. package/dist/access-http-offline-stream.d.ts +11 -11
  16. package/dist/access-http-query.d.ts +2 -2
  17. package/dist/access-http-query.js +25 -25
  18. package/dist/access-http.d.ts +12 -12
  19. package/dist/access-http.js +41 -41
  20. package/dist/access-identity-continuity-surface.d.ts +9 -9
  21. package/dist/access-identity-continuity-surface.js +23 -23
  22. package/dist/access-lcm-surface.d.ts +11 -11
  23. package/dist/access-lcm-surface.js +23 -23
  24. package/dist/access-mcp-output-schemas.js +1 -1
  25. package/dist/access-mcp.d.ts +11 -11
  26. package/dist/access-mcp.js +33 -33
  27. package/dist/access-memory-search-fanout.d.ts +2 -2
  28. package/dist/{access-namespace-preflight-50VIkPhB.d.ts → access-namespace-preflight-S8fhQcCo.d.ts} +1 -1
  29. package/dist/access-namespace-preflight.d.ts +3 -3
  30. package/dist/access-namespace-preflight.js +23 -23
  31. package/dist/access-observe-write-surface.d.ts +11 -11
  32. package/dist/access-observe-write-surface.js +23 -23
  33. package/dist/access-offline-manifest.d.ts +9 -9
  34. package/dist/access-operations-batch.js +26 -26
  35. package/dist/access-operations.d.ts +16 -16
  36. package/dist/access-operations.js +31 -31
  37. package/dist/access-recall-concurrency.d.ts +11 -11
  38. package/dist/access-recall-concurrency.js +23 -23
  39. package/dist/access-recall-response.d.ts +11 -11
  40. package/dist/access-recall-response.js +23 -23
  41. package/dist/access-recall-surface.d.ts +11 -11
  42. package/dist/access-recall-surface.js +23 -23
  43. package/dist/access-schema.d.ts +89 -89
  44. package/dist/access-schema.js +3 -3
  45. package/dist/{access-service-C2tV2-uL.d.ts → access-service-DcfM0Vf0.d.ts} +71 -71
  46. package/dist/access-service-helpers.d.ts +11 -11
  47. package/dist/access-service.d.ts +11 -11
  48. package/dist/access-service.js +23 -23
  49. package/dist/access-surface-catalog.d.ts +11 -11
  50. package/dist/access-surface-catalog.js +25 -25
  51. package/dist/access-wearables-meetings-surface.d.ts +3 -3
  52. package/dist/action-confidence.d.ts +1 -1
  53. package/dist/active-memory-bridge.d.ts +1 -1
  54. package/dist/active-recall.d.ts +1 -1
  55. package/dist/active-recall.js +2 -2
  56. package/dist/adapters/index.js +4 -4
  57. package/dist/adapters/registry.js +2 -2
  58. package/dist/ambient-provenance.d.ts +1 -1
  59. package/dist/artifact-search.d.ts +1 -1
  60. package/dist/behavior-learner.d.ts +1 -1
  61. package/dist/behavior-signals.d.ts +1 -1
  62. package/dist/bootstrap.d.ts +9 -9
  63. package/dist/briefing-window.d.ts +2 -2
  64. package/dist/briefing.d.ts +2 -2
  65. package/dist/briefing.js +10 -10
  66. package/dist/buffer-surprise-report.d.ts +1 -1
  67. package/dist/buffer-turn-helpers.d.ts +1 -1
  68. package/dist/buffer.d.ts +2 -2
  69. package/dist/buffer.js +4 -4
  70. package/dist/bulk-import/index.d.ts +3 -3
  71. package/dist/calibration.d.ts +1 -1
  72. package/dist/capabilities.d.ts +1 -1
  73. package/dist/{catalog-C2jA-gLm.d.ts → catalog-BmBXTtOs.d.ts} +1 -1
  74. package/dist/causal-behavior.d.ts +1 -1
  75. package/dist/causal-consolidation.d.ts +1 -1
  76. package/dist/causal-consolidation.js +11 -11
  77. package/dist/causal-trajectory-graph.d.ts +1 -1
  78. package/dist/{chunk-EKUABFXQ.js → chunk-245QROHZ.js} +6 -6
  79. package/dist/{chunk-UMZUKOJU.js → chunk-2L5FSNPC.js} +16 -11
  80. package/dist/chunk-2L5FSNPC.js.map +1 -0
  81. package/dist/{chunk-KH2LZMD5.js → chunk-2OXBS2LV.js} +2 -2
  82. package/dist/{chunk-K7NUAY36.js → chunk-4PHT7KE2.js} +5 -5
  83. package/dist/{chunk-AZLSFKGU.js → chunk-4PWANX5V.js} +6 -6
  84. package/dist/{chunk-5S6TQ36T.js → chunk-4QKWBVEE.js} +12 -12
  85. package/dist/{chunk-5S6TQ36T.js.map → chunk-4QKWBVEE.js.map} +1 -1
  86. package/dist/{chunk-GO657WPH.js → chunk-52I6AHO6.js} +2 -2
  87. package/dist/{chunk-MBXTGOFR.js → chunk-54BRW3BL.js} +2 -2
  88. package/dist/{chunk-LWI43S46.js → chunk-5E7KXID5.js} +1 -1
  89. package/dist/{chunk-MWLBRFLY.js → chunk-5KVMT25I.js} +2 -2
  90. package/dist/{chunk-KKGWB2LG.js → chunk-7BS5UVXA.js} +3 -3
  91. package/dist/{chunk-O2RJZR6J.js → chunk-7FLINMUE.js} +2 -2
  92. package/dist/{chunk-XORZMKVF.js → chunk-7MOYAT4Y.js} +3 -3
  93. package/dist/{chunk-AVYNKPFS.js → chunk-C6TMLF3A.js} +5 -5
  94. package/dist/{chunk-C24UZSFW.js → chunk-CEH2AFXG.js} +6 -6
  95. package/dist/{chunk-IE7N2YK6.js → chunk-CNZVEU4X.js} +2 -2
  96. package/dist/{chunk-FNK4KIYR.js → chunk-D3AUQXTJ.js} +2 -2
  97. package/dist/{chunk-BDGWA5GK.js → chunk-DJLH3XWM.js} +2 -2
  98. package/dist/{chunk-2V4YPDIX.js → chunk-E2PORO7O.js} +2 -2
  99. package/dist/{chunk-5IYJWCLC.js → chunk-E62M4H4M.js} +2 -2
  100. package/dist/{chunk-NEWY74GS.js → chunk-EG4FHU5C.js} +2 -2
  101. package/dist/{chunk-KMPEBHH5.js → chunk-EMAEDM2J.js} +2 -2
  102. package/dist/{chunk-2YDU4VR7.js → chunk-G3B3LP6A.js} +21 -21
  103. package/dist/{chunk-D6Q5EPOV.js → chunk-HCERYDRI.js} +2 -2
  104. package/dist/{chunk-6BYJQ3L2.js → chunk-HJQZQUPC.js} +11 -11
  105. package/dist/{chunk-S63O62DN.js → chunk-HPGXB56F.js} +2 -2
  106. package/dist/{chunk-KQAFEZQX.js → chunk-IPLYGWQF.js} +5 -5
  107. package/dist/{chunk-QK375NXZ.js → chunk-ISX7JODR.js} +2 -2
  108. package/dist/{chunk-RKNJBZ55.js → chunk-JBPKEARU.js} +4 -4
  109. package/dist/{chunk-RI4CMRTZ.js → chunk-JNZSNJ43.js} +2 -2
  110. package/dist/{chunk-IGOINKTD.js → chunk-K4E3Y3ZX.js} +2 -2
  111. package/dist/chunk-K4E3Y3ZX.js.map +1 -0
  112. package/dist/{chunk-GUG4LW4I.js → chunk-KIJCXLW7.js} +2 -2
  113. package/dist/{chunk-XDUQR5R7.js → chunk-KT3ERTF6.js} +2 -2
  114. package/dist/{chunk-2MYBDWUY.js → chunk-KWLDB64F.js} +2 -2
  115. package/dist/{chunk-UOQZOV2J.js → chunk-KWVXCRFZ.js} +225 -55
  116. package/dist/chunk-KWVXCRFZ.js.map +1 -0
  117. package/dist/chunk-LD72P4YS.js +29 -0
  118. package/dist/chunk-LD72P4YS.js.map +1 -0
  119. package/dist/{chunk-UMSTKKMV.js → chunk-LPSTQR26.js} +2 -2
  120. package/dist/{chunk-MFIFCXS3.js → chunk-LTWFU6VJ.js} +2 -2
  121. package/dist/{chunk-X32ALJQB.js → chunk-M2BY5IZL.js} +2 -2
  122. package/dist/{chunk-UJICQ77Y.js → chunk-MK7EJLB4.js} +2 -2
  123. package/dist/{chunk-7X63THIR.js → chunk-NR36NW24.js} +39 -39
  124. package/dist/{chunk-VYIPVLRX.js → chunk-QB66LBXA.js} +2 -2
  125. package/dist/{chunk-RPHCLGQ7.js → chunk-QKTGCL6M.js} +2 -2
  126. package/dist/{chunk-OMA2B7GY.js → chunk-RLEJULGN.js} +2 -2
  127. package/dist/chunk-S47XNAWD.js +202 -0
  128. package/dist/chunk-S47XNAWD.js.map +1 -0
  129. package/dist/{chunk-I2TIUGLC.js → chunk-SQEIPTDV.js} +2 -2
  130. package/dist/{chunk-NEDBOZ7G.js → chunk-TGKLVAML.js} +2 -2
  131. package/dist/{chunk-FY62KW6Q.js → chunk-TS37MXC7.js} +2 -2
  132. package/dist/{chunk-XUKS57W7.js → chunk-TXCLDIXJ.js} +2 -2
  133. package/dist/{chunk-YSYHSZWD.js → chunk-VSQG4AXL.js} +2 -2
  134. package/dist/{chunk-46XR5FNZ.js → chunk-VSWRJQQW.js} +31 -5
  135. package/dist/chunk-VSWRJQQW.js.map +1 -0
  136. package/dist/{chunk-ULTK4NZY.js → chunk-WD424KYT.js} +2 -2
  137. package/dist/{chunk-OERZXNSK.js → chunk-X5SDZMO7.js} +2 -2
  138. package/dist/{chunk-XSPVSEAN.js → chunk-XN33JLRF.js} +3 -3
  139. package/dist/{chunk-6ULLVM2V.js → chunk-Y2ECPAJI.js} +8 -8
  140. package/dist/{chunk-5UP5R37C.js → chunk-Y6KDJQLK.js} +7 -7
  141. package/dist/{chunk-EZ25VE3G.js → chunk-YNDLCWXS.js} +4 -4
  142. package/dist/{chunk-6ZRLH4VS.js → chunk-YYDOUOYM.js} +3 -3
  143. package/dist/{chunk-XVCYV7WQ.js → chunk-ZIGSNLYI.js} +3 -3
  144. package/dist/{chunk-FI6FT6YX.js → chunk-ZPZLGN4Y.js} +2 -2
  145. package/dist/{chunk-SVATDJNY.js → chunk-ZRQPX2DW.js} +2 -2
  146. package/dist/{cli-CsfFMe6n.d.ts → cli-CFpMhqz5.d.ts} +5 -5
  147. package/dist/cli.d.ts +13 -13
  148. package/dist/cli.js +67 -67
  149. package/dist/coding/export-okf-codegraph.d.ts +1 -1
  150. package/dist/coding/export-okf-codegraph.js +10 -10
  151. package/dist/coding/pre-action-gate.d.ts +1 -1
  152. package/dist/compounding/engine.d.ts +2 -2
  153. package/dist/compounding/engine.js +10 -10
  154. package/dist/compounding/preference-consolidator.d.ts +1 -1
  155. package/dist/compression-optimizer.d.ts +1 -1
  156. package/dist/config.d.ts +1 -1
  157. package/dist/config.js +2 -2
  158. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  159. package/dist/connectors/codex-materialize-runner.js +10 -10
  160. package/dist/connectors/codex-materialize.d.ts +1 -1
  161. package/dist/connectors/index.d.ts +1 -1
  162. package/dist/connectors/index.js +10 -10
  163. package/dist/consolidation-provenance-check.d.ts +2 -2
  164. package/dist/consolidation-undo.d.ts +2 -2
  165. package/dist/contradiction/index.d.ts +3 -3
  166. package/dist/converge-config.d.ts +1 -1
  167. package/dist/convergence-refresh.d.ts +2 -2
  168. package/dist/convergence-refresh.js +12 -12
  169. package/dist/conversation-index/backend.d.ts +1 -1
  170. package/dist/conversation-index/chunker.d.ts +1 -1
  171. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  172. package/dist/conversation-index/indexer.d.ts +1 -1
  173. package/dist/conversation-index/search.d.ts +1 -1
  174. package/dist/corpus-watermark.d.ts +1 -1
  175. package/dist/corpus-watermark.js +12 -12
  176. package/dist/cross-lingual-recall.d.ts +1 -1
  177. package/dist/dashboard-runtime.js +2 -2
  178. package/dist/day-summary.d.ts +1 -1
  179. package/dist/delinearize.d.ts +1 -1
  180. package/dist/dependency-propagation-config.d.ts +1 -1
  181. package/dist/{dependency-propagation-delivery-D4WMbOwA.d.ts → dependency-propagation-delivery-BC3bCEet.d.ts} +1 -1
  182. package/dist/direct-answer-wiring.d.ts +1 -1
  183. package/dist/direct-answer.d.ts +1 -1
  184. package/dist/embedding-fallback.d.ts +1 -1
  185. package/dist/enrichment/index.d.ts +1 -1
  186. package/dist/entity-origin-fields.d.ts +1 -1
  187. package/dist/entity-retrieval.d.ts +2 -2
  188. package/dist/entity-retrieval.js +10 -10
  189. package/dist/entity-schema.d.ts +1 -1
  190. package/dist/episodic-context.d.ts +1 -1
  191. package/dist/eval-trajectory-contracts.d.ts +1 -1
  192. package/dist/eval-trajectory-store.d.ts +1 -1
  193. package/dist/eval-trajectory.d.ts +1 -1
  194. package/dist/explicit-capture.d.ts +9 -9
  195. package/dist/external-wiki-access.d.ts +11 -11
  196. package/dist/external-wiki-access.js +24 -24
  197. package/dist/external-wiki-collection-registration.d.ts +1 -1
  198. package/dist/external-wiki-collection.d.ts +1 -1
  199. package/dist/external-wiki-mcp-tools.d.ts +11 -11
  200. package/dist/extraction-error-classification.d.ts +1 -1
  201. package/dist/extraction-faithfulness.d.ts +1 -1
  202. package/dist/extraction-judge-telemetry.d.ts +1 -1
  203. package/dist/extraction-judge-training.d.ts +1 -1
  204. package/dist/extraction-judge.d.ts +1 -1
  205. package/dist/extraction-liveness.d.ts +1 -1
  206. package/dist/extraction-normalization.d.ts +1 -1
  207. package/dist/extraction-prompt.d.ts +1 -1
  208. package/dist/extraction-source-grounding-rules.d.ts +1 -1
  209. package/dist/extraction-source-grounding.d.ts +1 -1
  210. package/dist/extraction-span-tokens.d.ts +16 -0
  211. package/dist/extraction-span-tokens.js +34 -0
  212. package/dist/extraction-span-tokens.js.map +1 -0
  213. package/dist/extraction.d.ts +1 -1
  214. package/dist/extraction.js +13 -13
  215. package/dist/fallback-llm.d.ts +1 -1
  216. package/dist/graph-dashboard-diff.d.ts +1 -1
  217. package/dist/graph-dashboard-key.d.ts +1 -1
  218. package/dist/graph-dashboard-parser.d.ts +1 -1
  219. package/dist/graph-edge-reinforcement.d.ts +1 -1
  220. package/dist/graph-path-reconstruction.d.ts +1 -1
  221. package/dist/graph-path-scoring.d.ts +1 -1
  222. package/dist/graph-snapshot.d.ts +1 -1
  223. package/dist/graph.d.ts +1 -1
  224. package/dist/harmonic-retrieval.js +1 -1
  225. package/dist/importance.d.ts +1 -1
  226. package/dist/importers/index.d.ts +1 -1
  227. package/dist/in-flight-reads.d.ts +1 -1
  228. package/dist/{index-DuJnzwHv.d.ts → index-D4hS9uxK.d.ts} +2 -2
  229. package/dist/index.d.ts +820 -700
  230. package/dist/index.js +144 -133
  231. package/dist/intent.d.ts +1 -1
  232. package/dist/lcm/engine.d.ts +1 -1
  233. package/dist/lcm/engine.js +5 -4
  234. package/dist/lcm/index.d.ts +1 -1
  235. package/dist/lcm/index.js +13 -12
  236. package/dist/lcm/tools.d.ts +1 -1
  237. package/dist/lifecycle.d.ts +1 -1
  238. package/dist/live-connectors-runner.d.ts +1 -1
  239. package/dist/local-llm.d.ts +1 -1
  240. package/dist/local-model-endpoint.d.ts +1 -1
  241. package/dist/location/index.d.ts +3 -3
  242. package/dist/location/index.js +12 -12
  243. package/dist/maintenance/memory-governance.d.ts +1 -1
  244. package/dist/maintenance/memory-governance.js +10 -10
  245. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
  246. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +10 -10
  247. package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
  248. package/dist/maintenance/rebuild-memory-projection.js +11 -11
  249. package/dist/{maintenance-BBeaeYRR.d.ts → maintenance-BRcc3Hx8.d.ts} +3 -3
  250. package/dist/mcp-memory-inspector-app.d.ts +11 -11
  251. package/dist/memory-action-policy.d.ts +1 -1
  252. package/dist/memory-cache.d.ts +1 -1
  253. package/dist/memory-controller.d.ts +1 -1
  254. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  255. package/dist/memory-projection-store.d.ts +1 -1
  256. package/dist/memory-provenance.d.ts +1 -1
  257. package/dist/memory-snapshot.d.ts +1 -1
  258. package/dist/memory-subject-cli.d.ts +11 -11
  259. package/dist/memory-subject.d.ts +11 -11
  260. package/dist/memory-worth-outcomes.d.ts +2 -2
  261. package/dist/models-json.d.ts +1 -1
  262. package/dist/namespaces/migrate.d.ts +3 -3
  263. package/dist/namespaces/migrate.js +11 -11
  264. package/dist/namespaces/principal.d.ts +1 -1
  265. package/dist/namespaces/search.d.ts +1 -1
  266. package/dist/namespaces/search.js +7 -7
  267. package/dist/namespaces/storage.d.ts +3 -3
  268. package/dist/namespaces/storage.js +10 -10
  269. package/dist/native-binding-hint.d.ts +24 -0
  270. package/dist/native-binding-hint.js +10 -0
  271. package/dist/native-binding-hint.js.map +1 -0
  272. package/dist/native-knowledge.d.ts +1 -1
  273. package/dist/offline-sync-impression-drain.d.ts +1 -1
  274. package/dist/operator-doctor-corpus.d.ts +1 -1
  275. package/dist/operator-doctor-corpus.js +13 -13
  276. package/dist/operator-doctor-replica.d.ts +1 -1
  277. package/dist/operator-toolkit.d.ts +3 -3
  278. package/dist/operator-toolkit.js +20 -20
  279. package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
  280. package/dist/orchestration/maintenance.d.ts +4 -4
  281. package/dist/orchestration/maintenance.js +19 -19
  282. package/dist/{orchestrator-CaqnwNwM.d.ts → orchestrator-Btq9lzAN.d.ts} +8 -8
  283. package/dist/orchestrator.d.ts +9 -9
  284. package/dist/orchestrator.js +99 -98
  285. package/dist/patterns-cli.d.ts +1 -1
  286. package/dist/{pipeline-CrxVjlJr.d.ts → pipeline-CZoNdFb5.d.ts} +1 -1
  287. package/dist/policy-runtime.d.ts +1 -1
  288. package/dist/proactive-contention.d.ts +1 -1
  289. package/dist/provenance.d.ts +1 -1
  290. package/dist/{public-http-Cwvl4QZr.d.ts → public-http-C9-CHc40.d.ts} +1 -1
  291. package/dist/{qmd-BZgbJm0g.d.ts → qmd-VIjSCKIE.d.ts} +1 -1
  292. package/dist/qmd-preflight.d.ts +2 -2
  293. package/dist/qmd-recall-cache.d.ts +1 -1
  294. package/dist/qmd.d.ts +2 -2
  295. package/dist/qmd.js +4 -4
  296. package/dist/recall-concurrency-config.d.ts +1 -1
  297. package/dist/recall-deep-frontier.d.ts +15 -0
  298. package/dist/recall-deep-frontier.js +29 -0
  299. package/dist/recall-deep-frontier.js.map +1 -0
  300. package/dist/recall-disclosure-escalation.d.ts +1 -1
  301. package/dist/recall-explain-renderer.d.ts +1 -1
  302. package/dist/recall-memory-map.d.ts +1 -1
  303. package/dist/recall-navigate-access.d.ts +1 -1
  304. package/dist/recall-navigate.d.ts +1 -1
  305. package/dist/recall-planner-llm.d.ts +1 -1
  306. package/dist/recall-state.d.ts +1 -1
  307. package/dist/recall-tag-filter.d.ts +1 -1
  308. package/dist/recall-timings.d.ts +1 -1
  309. package/dist/recall-xray-cli.d.ts +1 -1
  310. package/dist/recall-xray-renderer.d.ts +1 -1
  311. package/dist/recall-xray.d.ts +1 -1
  312. package/dist/reconcile/cursor.d.ts +1 -1
  313. package/dist/reconcile/manifest.d.ts +1 -1
  314. package/dist/reconcile/plan.d.ts +1 -1
  315. package/dist/replay/normalizers/chatgpt.d.ts +1 -1
  316. package/dist/replay/normalizers/claude.d.ts +1 -1
  317. package/dist/replay/normalizers/openclaw.d.ts +1 -1
  318. package/dist/replay/normalizers/shared.d.ts +1 -1
  319. package/dist/replay/runner.d.ts +1 -1
  320. package/dist/replay/types.d.ts +1 -1
  321. package/dist/replica-divergence.d.ts +1 -1
  322. package/dist/replica-peers-config.d.ts +1 -1
  323. package/dist/resolve-auth-token.d.ts +1 -1
  324. package/dist/resume-bundles.js +3 -3
  325. package/dist/retrieval-agents.d.ts +2 -2
  326. package/dist/retrieval-tiers.d.ts +1 -1
  327. package/dist/routing/engine.d.ts +1 -1
  328. package/dist/routing/store.d.ts +1 -1
  329. package/dist/salvage-envelope.d.ts +1 -1
  330. package/dist/schemas.d.ts +176 -176
  331. package/dist/{scope-profiles-DFaojvoP.d.ts → scope-profiles-DqbxQXIS.d.ts} +1 -1
  332. package/dist/search/embed-helper.d.ts +1 -1
  333. package/dist/search/factory.d.ts +1 -1
  334. package/dist/search/factory.js +6 -6
  335. package/dist/search/index.d.ts +1 -1
  336. package/dist/search/index.js +12 -12
  337. package/dist/search/lancedb-backend.d.ts +1 -1
  338. package/dist/search/meilisearch-backend.d.ts +1 -1
  339. package/dist/search/noop-backend.d.ts +1 -1
  340. package/dist/search/orama-backend.d.ts +1 -1
  341. package/dist/search/port.d.ts +1 -1
  342. package/dist/search/remote-backend.d.ts +1 -1
  343. package/dist/{semantic-consolidation-BiX68wZA.d.ts → semantic-consolidation-DW3rEUoW.d.ts} +1 -1
  344. package/dist/semantic-consolidation.d.ts +2 -2
  345. package/dist/semantic-consolidation.js +11 -11
  346. package/dist/semantic-rule-promotion.js +10 -10
  347. package/dist/semantic-rule-verifier.d.ts +1 -1
  348. package/dist/semantic-rule-verifier.js +10 -10
  349. package/dist/{service-D5h2zZ0M.d.ts → service-B2vJU_Bx.d.ts} +2 -2
  350. package/dist/session-observer-bands.d.ts +1 -1
  351. package/dist/session-observer-state.d.ts +1 -1
  352. package/dist/shared-context/manager.d.ts +7 -7
  353. package/dist/signal.d.ts +1 -1
  354. package/dist/source-agent-qualifier.d.ts +1 -1
  355. package/dist/source-agent-qualifier.js +12 -12
  356. package/dist/standup/build.d.ts +9 -3
  357. package/dist/standup/build.js +99 -7
  358. package/dist/{storage-CtsaojWD.d.ts → storage-6fn7BPmb.d.ts} +1 -1
  359. package/dist/storage.d.ts +2 -2
  360. package/dist/storage.js +9 -9
  361. package/dist/subject-config.d.ts +1 -1
  362. package/dist/summarizer.d.ts +1 -1
  363. package/dist/summary-snapshot.d.ts +1 -1
  364. package/dist/support-passport/index.d.ts +14 -14
  365. package/dist/support-passport/index.js +26 -26
  366. package/dist/temporal-supersession.d.ts +2 -2
  367. package/dist/temporal-timeline-recall.d.ts +1 -1
  368. package/dist/temporal-validity.d.ts +1 -1
  369. package/dist/threading.d.ts +1 -1
  370. package/dist/tier-migration.d.ts +2 -2
  371. package/dist/tier-routing.d.ts +1 -1
  372. package/dist/topics.d.ts +1 -1
  373. package/dist/transcript.d.ts +1 -1
  374. package/dist/transfer/autodetect.js +1 -1
  375. package/dist/transfer/backup.js +1 -1
  376. package/dist/transfer/capsule-export.js +2 -2
  377. package/dist/transfer/export-okf.d.ts +1 -1
  378. package/dist/transfer/export-okf.js +11 -11
  379. package/dist/transfer/types.d.ts +78 -78
  380. package/dist/trust-score-stage.d.ts +1 -1
  381. package/dist/trust-score.d.ts +1 -1
  382. package/dist/{types-CIpfYz1I.d.ts → types-eM7QIcX2.d.ts} +4 -0
  383. package/dist/types.d.ts +1 -1
  384. package/dist/utility-runtime.d.ts +1 -1
  385. package/dist/verified-recall.js +10 -10
  386. package/dist/who-knows-cli.d.ts +11 -11
  387. package/dist/who-knows-cli.js +11 -11
  388. package/dist/who-knows.d.ts +11 -11
  389. package/dist/who-knows.js +10 -10
  390. package/dist/write-envelope.d.ts +1 -1
  391. package/package.json +2 -2
  392. package/scripts/ensure-better-sqlite3.mjs +10 -0
  393. package/src/access-mcp-output-schemas.ts +1 -1
  394. package/src/activity/config.test.ts +1 -1
  395. package/src/activity/config.ts +20 -4
  396. package/src/activity/index.ts +2 -0
  397. package/src/activity/journal.test.ts +40 -0
  398. package/src/activity/privacy-status.test.ts +117 -0
  399. package/src/activity/privacy-status.ts +65 -0
  400. package/src/activity/timeline/index.ts +2 -0
  401. package/src/activity/timeline/recap-window.test.ts +129 -0
  402. package/src/activity/timeline/recap-window.ts +55 -0
  403. package/src/activity/timeline/week-previous.test.ts +119 -0
  404. package/src/activity/timeline/week-previous.ts +83 -0
  405. package/src/activity/types.ts +4 -0
  406. package/src/activity/vault-insert.test.ts +105 -0
  407. package/src/activity/vault-insert.ts +86 -0
  408. package/src/config.test.ts +1 -1
  409. package/src/dedup/index.ts +7 -0
  410. package/src/dedup/merge-decision.test.ts +157 -0
  411. package/src/dedup/merge-decision.ts +78 -0
  412. package/src/extraction-span-tokens.test.ts +69 -0
  413. package/src/extraction-span-tokens.ts +44 -0
  414. package/src/lcm/engine.ts +4 -1
  415. package/src/native-binding-hint.test.ts +38 -0
  416. package/src/native-binding-hint.ts +51 -0
  417. package/src/recall-deep-frontier.test.ts +85 -0
  418. package/src/recall-deep-frontier.ts +39 -0
  419. package/src/standup/build.test.ts +138 -12
  420. package/src/standup/build.ts +172 -23
  421. package/src/standup/http-glue.ts +1 -1
  422. package/dist/chunk-46XR5FNZ.js.map +0 -1
  423. package/dist/chunk-IGOINKTD.js.map +0 -1
  424. package/dist/chunk-UMZUKOJU.js.map +0 -1
  425. package/dist/chunk-UOQZOV2J.js.map +0 -1
  426. package/dist/chunk-VOSWUO3K.js +0 -100
  427. package/dist/chunk-VOSWUO3K.js.map +0 -1
  428. /package/dist/{chunk-EKUABFXQ.js.map → chunk-245QROHZ.js.map} +0 -0
  429. /package/dist/{chunk-KH2LZMD5.js.map → chunk-2OXBS2LV.js.map} +0 -0
  430. /package/dist/{chunk-K7NUAY36.js.map → chunk-4PHT7KE2.js.map} +0 -0
  431. /package/dist/{chunk-AZLSFKGU.js.map → chunk-4PWANX5V.js.map} +0 -0
  432. /package/dist/{chunk-GO657WPH.js.map → chunk-52I6AHO6.js.map} +0 -0
  433. /package/dist/{chunk-MBXTGOFR.js.map → chunk-54BRW3BL.js.map} +0 -0
  434. /package/dist/{chunk-LWI43S46.js.map → chunk-5E7KXID5.js.map} +0 -0
  435. /package/dist/{chunk-MWLBRFLY.js.map → chunk-5KVMT25I.js.map} +0 -0
  436. /package/dist/{chunk-KKGWB2LG.js.map → chunk-7BS5UVXA.js.map} +0 -0
  437. /package/dist/{chunk-O2RJZR6J.js.map → chunk-7FLINMUE.js.map} +0 -0
  438. /package/dist/{chunk-XORZMKVF.js.map → chunk-7MOYAT4Y.js.map} +0 -0
  439. /package/dist/{chunk-AVYNKPFS.js.map → chunk-C6TMLF3A.js.map} +0 -0
  440. /package/dist/{chunk-C24UZSFW.js.map → chunk-CEH2AFXG.js.map} +0 -0
  441. /package/dist/{chunk-IE7N2YK6.js.map → chunk-CNZVEU4X.js.map} +0 -0
  442. /package/dist/{chunk-FNK4KIYR.js.map → chunk-D3AUQXTJ.js.map} +0 -0
  443. /package/dist/{chunk-BDGWA5GK.js.map → chunk-DJLH3XWM.js.map} +0 -0
  444. /package/dist/{chunk-2V4YPDIX.js.map → chunk-E2PORO7O.js.map} +0 -0
  445. /package/dist/{chunk-5IYJWCLC.js.map → chunk-E62M4H4M.js.map} +0 -0
  446. /package/dist/{chunk-NEWY74GS.js.map → chunk-EG4FHU5C.js.map} +0 -0
  447. /package/dist/{chunk-KMPEBHH5.js.map → chunk-EMAEDM2J.js.map} +0 -0
  448. /package/dist/{chunk-2YDU4VR7.js.map → chunk-G3B3LP6A.js.map} +0 -0
  449. /package/dist/{chunk-D6Q5EPOV.js.map → chunk-HCERYDRI.js.map} +0 -0
  450. /package/dist/{chunk-6BYJQ3L2.js.map → chunk-HJQZQUPC.js.map} +0 -0
  451. /package/dist/{chunk-S63O62DN.js.map → chunk-HPGXB56F.js.map} +0 -0
  452. /package/dist/{chunk-KQAFEZQX.js.map → chunk-IPLYGWQF.js.map} +0 -0
  453. /package/dist/{chunk-QK375NXZ.js.map → chunk-ISX7JODR.js.map} +0 -0
  454. /package/dist/{chunk-RKNJBZ55.js.map → chunk-JBPKEARU.js.map} +0 -0
  455. /package/dist/{chunk-RI4CMRTZ.js.map → chunk-JNZSNJ43.js.map} +0 -0
  456. /package/dist/{chunk-GUG4LW4I.js.map → chunk-KIJCXLW7.js.map} +0 -0
  457. /package/dist/{chunk-XDUQR5R7.js.map → chunk-KT3ERTF6.js.map} +0 -0
  458. /package/dist/{chunk-2MYBDWUY.js.map → chunk-KWLDB64F.js.map} +0 -0
  459. /package/dist/{chunk-UMSTKKMV.js.map → chunk-LPSTQR26.js.map} +0 -0
  460. /package/dist/{chunk-MFIFCXS3.js.map → chunk-LTWFU6VJ.js.map} +0 -0
  461. /package/dist/{chunk-X32ALJQB.js.map → chunk-M2BY5IZL.js.map} +0 -0
  462. /package/dist/{chunk-UJICQ77Y.js.map → chunk-MK7EJLB4.js.map} +0 -0
  463. /package/dist/{chunk-7X63THIR.js.map → chunk-NR36NW24.js.map} +0 -0
  464. /package/dist/{chunk-VYIPVLRX.js.map → chunk-QB66LBXA.js.map} +0 -0
  465. /package/dist/{chunk-RPHCLGQ7.js.map → chunk-QKTGCL6M.js.map} +0 -0
  466. /package/dist/{chunk-OMA2B7GY.js.map → chunk-RLEJULGN.js.map} +0 -0
  467. /package/dist/{chunk-I2TIUGLC.js.map → chunk-SQEIPTDV.js.map} +0 -0
  468. /package/dist/{chunk-NEDBOZ7G.js.map → chunk-TGKLVAML.js.map} +0 -0
  469. /package/dist/{chunk-FY62KW6Q.js.map → chunk-TS37MXC7.js.map} +0 -0
  470. /package/dist/{chunk-XUKS57W7.js.map → chunk-TXCLDIXJ.js.map} +0 -0
  471. /package/dist/{chunk-YSYHSZWD.js.map → chunk-VSQG4AXL.js.map} +0 -0
  472. /package/dist/{chunk-ULTK4NZY.js.map → chunk-WD424KYT.js.map} +0 -0
  473. /package/dist/{chunk-OERZXNSK.js.map → chunk-X5SDZMO7.js.map} +0 -0
  474. /package/dist/{chunk-XSPVSEAN.js.map → chunk-XN33JLRF.js.map} +0 -0
  475. /package/dist/{chunk-6ULLVM2V.js.map → chunk-Y2ECPAJI.js.map} +0 -0
  476. /package/dist/{chunk-5UP5R37C.js.map → chunk-Y6KDJQLK.js.map} +0 -0
  477. /package/dist/{chunk-EZ25VE3G.js.map → chunk-YNDLCWXS.js.map} +0 -0
  478. /package/dist/{chunk-6ZRLH4VS.js.map → chunk-YYDOUOYM.js.map} +0 -0
  479. /package/dist/{chunk-XVCYV7WQ.js.map → chunk-ZIGSNLYI.js.map} +0 -0
  480. /package/dist/{chunk-FI6FT6YX.js.map → chunk-ZPZLGN4Y.js.map} +0 -0
  481. /package/dist/{chunk-SVATDJNY.js.map → chunk-ZRQPX2DW.js.map} +0 -0
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Pure create/update/skip decision for merge-on-write (issue #2330 slice).
3
+ *
4
+ * No I/O, no LLM. Invalid thresholds throw RangeError; bad candidates are
5
+ * ignored, never thrown on. `below_threshold` is reserved for a later slice.
6
+ */
7
+
8
+ export type MergeDecision =
9
+ | { action: "create" }
10
+ | { action: "update"; targetId: string }
11
+ | { action: "skip"; reason: "duplicate" | "below_threshold" };
12
+
13
+ export interface MergeCandidate {
14
+ id: string;
15
+ similarity: number; // 0..1
16
+ updatedAt: string; // ISO
17
+ }
18
+
19
+ export interface MergeDecisionOptions {
20
+ updateThreshold: number; // >= this similarity -> update
21
+ duplicateThreshold: number; // >= this similarity -> skip as duplicate
22
+ }
23
+
24
+ function assertThreshold(value: number, name: string): void {
25
+ if (!Number.isFinite(value) || value < 0 || value > 1) {
26
+ throw new RangeError(`invalid ${name}: ${value}`);
27
+ }
28
+ }
29
+
30
+ /** Total order: similarity desc, then updatedAt desc, then id asc. NaN times sort last. */
31
+ function compareCandidates(a: MergeCandidate, b: MergeCandidate): number {
32
+ if (a.similarity !== b.similarity) return b.similarity - a.similarity;
33
+ // Date.parse never throws; unparseable timestamps yield NaN and sort last.
34
+ // NaN !== NaN, so the two sides must be classified as a pair: testing each
35
+ // independently returned 1 for BOTH orderings when both were unparseable,
36
+ // which breaks antisymmetry and made the winner depend on array order.
37
+ const aTime = Date.parse(a.updatedAt);
38
+ const bTime = Date.parse(b.updatedAt);
39
+ const aUnparseable = Number.isNaN(aTime);
40
+ const bUnparseable = Number.isNaN(bTime);
41
+ if (aUnparseable !== bUnparseable) return aUnparseable ? 1 : -1;
42
+ if (!aUnparseable && aTime !== bTime) return bTime - aTime;
43
+ return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
44
+ }
45
+
46
+ export function decideMergeOnWrite(
47
+ candidates: readonly MergeCandidate[],
48
+ options: MergeDecisionOptions,
49
+ ): MergeDecision {
50
+ assertThreshold(options.updateThreshold, "updateThreshold");
51
+ assertThreshold(options.duplicateThreshold, "duplicateThreshold");
52
+ if (options.duplicateThreshold < options.updateThreshold) {
53
+ throw new RangeError(
54
+ `duplicateThreshold ${options.duplicateThreshold} < updateThreshold ${options.updateThreshold}`,
55
+ );
56
+ }
57
+
58
+ const valid = candidates.filter(
59
+ (c) =>
60
+ typeof c.id === "string" &&
61
+ c.id.trim() !== "" &&
62
+ typeof c.similarity === "number" &&
63
+ Number.isFinite(c.similarity) &&
64
+ c.similarity >= 0 &&
65
+ c.similarity <= 1,
66
+ );
67
+ if (valid.length === 0) return { action: "create" };
68
+
69
+ const best = valid.reduce((acc, c) => (compareCandidates(c, acc) < 0 ? c : acc));
70
+
71
+ if (best.similarity >= options.duplicateThreshold) {
72
+ return { action: "skip", reason: "duplicate" };
73
+ }
74
+ if (best.similarity >= options.updateThreshold) {
75
+ return { action: "update", targetId: best.id };
76
+ }
77
+ return { action: "create" };
78
+ }
@@ -0,0 +1,69 @@
1
+ import assert from "node:assert/strict";
2
+ import { test } from "node:test";
3
+ import {
4
+ estimateGeneratedTokens,
5
+ estimateOffsetTokens,
6
+ spanModeSavesTokens,
7
+ } from "./extraction-span-tokens.js";
8
+
9
+ test("estimateGeneratedTokens: 0 chars -> 0 tokens", () => {
10
+ assert.equal(estimateGeneratedTokens(0), 0);
11
+ });
12
+
13
+ test("estimateGeneratedTokens: 1..4 chars -> 1 token", () => {
14
+ for (const chars of [1, 2, 3, 4]) {
15
+ assert.equal(estimateGeneratedTokens(chars), 1);
16
+ }
17
+ });
18
+
19
+ test("estimateGeneratedTokens: 5 chars -> 2 tokens", () => {
20
+ assert.equal(estimateGeneratedTokens(5), 2);
21
+ });
22
+
23
+ test("estimateGeneratedTokens: invalid charCount throws", () => {
24
+ assert.throws(() => estimateGeneratedTokens(-1), /charCount/);
25
+ assert.throws(() => estimateGeneratedTokens(Number.NaN), /charCount/);
26
+ assert.throws(() => estimateGeneratedTokens(3.7), /charCount/);
27
+ assert.throws(() => estimateGeneratedTokens(-1), RangeError);
28
+ assert.throws(() => estimateGeneratedTokens(Number.NaN), RangeError);
29
+ });
30
+
31
+ test("estimateOffsetTokens: (0, 12) cost is a positive integer", () => {
32
+ const cost = estimateOffsetTokens(0, 12);
33
+ assert.equal(Number.isInteger(cost), true);
34
+ assert.ok(cost > 0);
35
+ });
36
+
37
+ test("estimateOffsetTokens: offset 0 costs one character (one token)", () => {
38
+ assert.equal(estimateOffsetTokens(0, 0), 2);
39
+ });
40
+
41
+ test("estimateOffsetTokens: reversed span throws", () => {
42
+ assert.throws(() => estimateOffsetTokens(13, 12), RangeError);
43
+ assert.throws(() => estimateOffsetTokens(13, 12), /reversed/);
44
+ });
45
+
46
+ test("estimateOffsetTokens: non-finite or non-integer offsets throw", () => {
47
+ assert.throws(() => estimateOffsetTokens(Number.NaN, 12), RangeError);
48
+ assert.throws(() => estimateOffsetTokens(0, Number.POSITIVE_INFINITY), RangeError);
49
+ assert.throws(() => estimateOffsetTokens(0.5, 12), RangeError);
50
+ });
51
+
52
+ test("spanModeSavesTokens: long generated value beats small offsets", () => {
53
+ assert.equal(
54
+ spanModeSavesTokens({ generatedCharCount: 1000, start: 0, end: 12 }),
55
+ true,
56
+ );
57
+ });
58
+
59
+ test("spanModeSavesTokens: equal costs return false", () => {
60
+ // (0, 12) costs 2 tokens; 5..8 generated chars also cost 2 tokens.
61
+ assert.equal(
62
+ spanModeSavesTokens({ generatedCharCount: 8, start: 0, end: 12 }),
63
+ false,
64
+ );
65
+ assert.equal(
66
+ spanModeSavesTokens({ generatedCharCount: 5, start: 0, end: 0 }),
67
+ false,
68
+ );
69
+ });
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Isolated span token-cost estimator (issue #2333, Phase A).
3
+ *
4
+ * Pure. Estimates the output-token cost of emitting span offsets versus
5
+ * generating the memory value, so the Phase A bench can compare both sides
6
+ * without touching the extraction engine.
7
+ */
8
+
9
+ const CHARS_PER_TOKEN = 4;
10
+
11
+ export function estimateGeneratedTokens(charCount: number): number {
12
+ if (!Number.isInteger(charCount) || charCount < 0) {
13
+ throw new RangeError(`charCount must be a non-negative integer, got ${charCount}`);
14
+ }
15
+ return Math.ceil(charCount / CHARS_PER_TOKEN);
16
+ }
17
+
18
+ export function estimateOffsetTokens(start: number, end: number): number {
19
+ if (!Number.isInteger(start)) {
20
+ throw new RangeError(`start must be a finite integer, got ${start}`);
21
+ }
22
+ if (!Number.isInteger(end)) {
23
+ throw new RangeError(`end must be a finite integer, got ${end}`);
24
+ }
25
+ if (start > end) {
26
+ throw new RangeError(`reversed span: start ${start} > end ${end}`);
27
+ }
28
+ return offsetTokens(start) + offsetTokens(end);
29
+ }
30
+
31
+ export function spanModeSavesTokens(input: {
32
+ generatedCharCount: number;
33
+ start: number;
34
+ end: number;
35
+ }): boolean {
36
+ return (
37
+ estimateOffsetTokens(input.start, input.end) <
38
+ estimateGeneratedTokens(input.generatedCharCount)
39
+ );
40
+ }
41
+
42
+ function offsetTokens(offset: number): number {
43
+ return Math.ceil(String(offset).length / CHARS_PER_TOKEN);
44
+ }
package/src/lcm/engine.ts CHANGED
@@ -12,6 +12,7 @@ import { LcmWorkQueue, type LcmObserveMessage } from "./queue.js";
12
12
  import type { PluginConfig } from "../types.js";
13
13
  import { estimateTokenCount } from "../token-estimate.js";
14
14
  import { log } from "../logger.js";
15
+ import { nativeBindingRecoveryHint } from "../native-binding-hint.js";
15
16
  export interface LcmEngineConfig {
16
17
  enabled: boolean;
17
18
  leafBatchSize: number;
@@ -225,7 +226,9 @@ export class LcmEngine {
225
226
  })
226
227
  .catch((err) => {
227
228
  if (this.closed) return;
228
- log.error(`LCM observe enqueue initialization error: ${err}`);
229
+ log.error(
230
+ `LCM observe enqueue initialization error: ${err}${nativeBindingRecoveryHint(err)}`,
231
+ );
229
232
  })
230
233
  .finally(() => {
231
234
  this.releasePendingObserveInit(normalizedSessionId);
@@ -0,0 +1,38 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+
4
+ import { isNativeBindingError, nativeBindingRecoveryHint } from "./native-binding-hint.js";
5
+
6
+ test("recognizes the bindings-resolution failure operators actually see", () => {
7
+ const error = new Error(
8
+ "Could not locate the bindings file. Tried:\n → .../better-sqlite3/build/Release/better_sqlite3.node",
9
+ );
10
+ assert.equal(isNativeBindingError(error), true);
11
+ const hint = nativeBindingRecoveryHint(error);
12
+ assert.match(hint, /npm rebuild better-sqlite3 --build-from-source/);
13
+ assert.match(hint, new RegExp(`ABI ${process.versions.modules}\\b`));
14
+ assert.match(hint, new RegExp(`Node ${process.versions.node.split(".")[0]}\\b`));
15
+ });
16
+
17
+ test("recognizes an ABI mismatch reported as NODE_MODULE_VERSION", () => {
18
+ const error = new Error(
19
+ "The module was compiled against a different Node.js version using NODE_MODULE_VERSION 127. " +
20
+ "This version of Node.js requires NODE_MODULE_VERSION 141.",
21
+ );
22
+ assert.equal(isNativeBindingError(error), true);
23
+ assert.match(nativeBindingRecoveryHint(error), /--build-from-source/);
24
+ });
25
+
26
+ test("an unrelated error yields no hint so its message reads unchanged", () => {
27
+ const error = new Error("SQLITE_BUSY: database is locked");
28
+ assert.equal(isNativeBindingError(error), false);
29
+ assert.equal(nativeBindingRecoveryHint(error), "");
30
+ });
31
+
32
+ test("non-Error inputs are handled without throwing", () => {
33
+ assert.equal(isNativeBindingError(undefined), false);
34
+ assert.equal(isNativeBindingError(null), false);
35
+ assert.equal(nativeBindingRecoveryHint({}), "");
36
+ assert.equal(isNativeBindingError("could not locate the bindings file"), true);
37
+ assert.match(nativeBindingRecoveryHint("invalid ELF header"), /--build-from-source/);
38
+ });
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Actionable recovery hint for a missing or ABI-mismatched better-sqlite3
3
+ * native binding (issue #2719).
4
+ *
5
+ * `better-sqlite3` publishes prebuilds for LTS Node only, so a newer runtime
6
+ * installs the package with no loadable binding and every SQLite-backed path
7
+ * fails with a bindings-resolution error. The raw error names neither the
8
+ * running ABI nor the command that fixes it, so operators saw only
9
+ * "Could not locate the bindings file" at first use.
10
+ *
11
+ * The repair itself lives in the `@remnic/core` postinstall script — an
12
+ * OpenClaw plugin package may not ship a child-process-spawning file, so the
13
+ * host-facing packages surface this hint instead of re-implementing a rebuild.
14
+ */
15
+
16
+ /** Substrings that identify a native-binding load failure, lowercased. */
17
+ const BINDING_ERROR_MARKERS = [
18
+ "could not locate the bindings file",
19
+ "was compiled against a different node.js version",
20
+ "node_module_version",
21
+ "invalid elf header",
22
+ "better_sqlite3.node",
23
+ ];
24
+
25
+ function messageOf(error: unknown): string {
26
+ if (error instanceof Error) return error.message;
27
+ if (typeof error === "string") return error;
28
+ return "";
29
+ }
30
+
31
+ /** True when the error is a better-sqlite3 native-binding load failure. */
32
+ export function isNativeBindingError(error: unknown): boolean {
33
+ const message = messageOf(error).toLowerCase();
34
+ if (message.length === 0) return false;
35
+ return BINDING_ERROR_MARKERS.some((marker) => message.includes(marker));
36
+ }
37
+
38
+ /**
39
+ * Suffix naming the running Node ABI and the exact rebuild command, or an
40
+ * empty string when the error is unrelated. Callers append it to their own
41
+ * message so an unrelated failure reads exactly as before.
42
+ */
43
+ export function nativeBindingRecoveryHint(error: unknown): string {
44
+ if (!isNativeBindingError(error)) return "";
45
+ const major = process.versions.node.split(".")[0] ?? process.versions.node;
46
+ return (
47
+ ` — better-sqlite3 has no loadable native binding for Node ${major}` +
48
+ ` (ABI ${process.versions.modules}); rebuild it with` +
49
+ " `npm rebuild better-sqlite3 --build-from-source`"
50
+ );
51
+ }
@@ -0,0 +1,85 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+
4
+ import { DEEP_RECALL_FRONTIER_CAP, rankDeepRecallFrontier } from "./recall-deep-frontier.js";
5
+
6
+ test("empty input returns empty", () => {
7
+ assert.deepEqual(rankDeepRecallFrontier([]), []);
8
+ });
9
+
10
+ test("blank nodeIds and counts below 1 are dropped", () => {
11
+ const result = rankDeepRecallFrontier([
12
+ { nodeId: "", sharedAnchorCount: 3 },
13
+ { nodeId: " ", sharedAnchorCount: 3 },
14
+ { nodeId: "a", sharedAnchorCount: 0 },
15
+ { nodeId: "b", sharedAnchorCount: -2 },
16
+ { nodeId: "c", sharedAnchorCount: 1 },
17
+ ]);
18
+ assert.deepEqual(result, [{ nodeId: "c", sharedAnchorCount: 1 }]);
19
+ });
20
+
21
+ test("NaN and infinite counts are dropped", () => {
22
+ const result = rankDeepRecallFrontier([
23
+ { nodeId: "a", sharedAnchorCount: Number.NaN },
24
+ { nodeId: "b", sharedAnchorCount: Number.POSITIVE_INFINITY },
25
+ { nodeId: "c", sharedAnchorCount: 2 },
26
+ ]);
27
+ assert.deepEqual(result, [{ nodeId: "c", sharedAnchorCount: 2 }]);
28
+ });
29
+
30
+ test("dedup by nodeId keeps the higher count, first on tie", () => {
31
+ const result = rankDeepRecallFrontier([
32
+ { nodeId: "a", sharedAnchorCount: 2 },
33
+ { nodeId: "a", sharedAnchorCount: 5 },
34
+ { nodeId: "b", sharedAnchorCount: 4 },
35
+ { nodeId: "b", sharedAnchorCount: 4 },
36
+ ]);
37
+ assert.deepEqual(result, [
38
+ { nodeId: "a", sharedAnchorCount: 5 },
39
+ { nodeId: "b", sharedAnchorCount: 4 },
40
+ ]);
41
+ });
42
+
43
+ test("sorts by count desc then nodeId asc", () => {
44
+ const result = rankDeepRecallFrontier([
45
+ { nodeId: "c", sharedAnchorCount: 3 },
46
+ { nodeId: "a", sharedAnchorCount: 3 },
47
+ { nodeId: "b", sharedAnchorCount: 9 },
48
+ { nodeId: "d", sharedAnchorCount: 1 },
49
+ ]);
50
+ assert.deepEqual(
51
+ result.map((candidate) => candidate.nodeId),
52
+ ["b", "a", "c", "d"],
53
+ );
54
+ });
55
+
56
+ test("caps at 20 keeping the top 20 of 21", () => {
57
+ const candidates = Array.from({ length: 21 }, (_, i) => ({
58
+ nodeId: `n${String(i).padStart(2, "0")}`,
59
+ sharedAnchorCount: i + 1,
60
+ }));
61
+ const result = rankDeepRecallFrontier(candidates);
62
+ assert.equal(result.length, DEEP_RECALL_FRONTIER_CAP);
63
+ assert.equal(result[0]?.nodeId, "n20");
64
+ assert.equal(result.at(-1)?.nodeId, "n01");
65
+ assert.ok(!result.some((candidate) => candidate.nodeId === "n00"));
66
+ });
67
+
68
+ test("does not mutate the input array or its objects", () => {
69
+ const input = [
70
+ { nodeId: " b ", sharedAnchorCount: 2 },
71
+ { nodeId: "a", sharedAnchorCount: 1 },
72
+ ];
73
+ const snapshot = structuredClone(input);
74
+ rankDeepRecallFrontier(input);
75
+ assert.deepEqual(input, snapshot);
76
+ });
77
+
78
+ test("two calls on the same input are deep-equal", () => {
79
+ const input = [
80
+ { nodeId: "a", sharedAnchorCount: 2 },
81
+ { nodeId: "b", sharedAnchorCount: 2 },
82
+ { nodeId: "a", sharedAnchorCount: 7 },
83
+ ];
84
+ assert.deepEqual(rankDeepRecallFrontier(input), rankDeepRecallFrontier(input));
85
+ });
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Deep-recall frontier ranker (issue #2332).
3
+ *
4
+ * Pure. After every working-set change the frontier is capped at
5
+ * DEEP_RECALL_FRONTIER_CAP items ordered by shared-anchor count
6
+ * descending, then nodeId ascending — a total comparator.
7
+ */
8
+
9
+ export const DEEP_RECALL_FRONTIER_CAP = 20;
10
+
11
+ export interface DeepRecallFrontierCandidate {
12
+ nodeId: string;
13
+ sharedAnchorCount: number;
14
+ }
15
+
16
+ export function rankDeepRecallFrontier(
17
+ candidates: readonly DeepRecallFrontierCandidate[],
18
+ ): DeepRecallFrontierCandidate[] {
19
+ const byNodeId = new Map<string, DeepRecallFrontierCandidate>();
20
+ for (const candidate of candidates) {
21
+ const nodeId = typeof candidate.nodeId === "string" ? candidate.nodeId.trim() : "";
22
+ if (nodeId === "") continue;
23
+ const count = candidate.sharedAnchorCount;
24
+ if (typeof count !== "number" || !Number.isFinite(count) || count < 1) continue;
25
+ const kept = byNodeId.get(nodeId);
26
+ if (kept === undefined || count > kept.sharedAnchorCount) {
27
+ byNodeId.set(nodeId, { nodeId, sharedAnchorCount: count });
28
+ }
29
+ }
30
+ return [...byNodeId.values()]
31
+ .sort((a, b) => {
32
+ if (a.sharedAnchorCount !== b.sharedAnchorCount) {
33
+ return b.sharedAnchorCount - a.sharedAnchorCount;
34
+ }
35
+ if (a.nodeId !== b.nodeId) return a.nodeId < b.nodeId ? -1 : 1;
36
+ return 0;
37
+ })
38
+ .slice(0, DEEP_RECALL_FRONTIER_CAP);
39
+ }
@@ -4,30 +4,156 @@ import os from "node:os";
4
4
  import path from "node:path";
5
5
  import test from "node:test";
6
6
 
7
- import { buildStandup, parseStandupDate, previousDate } from "./build.js";
7
+ import { buildStandup, parseStandupDate, previousActiveDate } from "./build.js";
8
8
 
9
- test("parseStandupDate rejects garbage and defaults to UTC today", () => {
9
+ const FRONTMATTER = (date: string): string => `---\nid: digest-${date}\ncategory: fact\nstatus: active\n---\n`;
10
+
11
+ test("parseStandupDate defaults only on absence, rejects garbage and empty", () => {
10
12
  assert.equal(parseStandupDate(undefined, new Date("2026-08-18T12:00:00Z")), "2026-08-18");
13
+ assert.equal(parseStandupDate(null, new Date("2026-08-18T12:00:00Z")), "2026-08-18");
11
14
  assert.throws(() => parseStandupDate("nope"), /YYYY-MM-DD/);
12
- assert.equal(previousDate("2026-08-18"), "2026-08-17");
15
+ // An explicitly empty date is user input, not absence (§39: reject, never
16
+ // silently default).
17
+ assert.throws(() => parseStandupDate(""), /YYYY-MM-DD/);
18
+ });
19
+
20
+ test("previousActiveDate falls back to calendar-previous when no digests exist", async () => {
21
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-standup-"));
22
+ try {
23
+ assert.equal(previousActiveDate(memoryDir, "2026-08-18"), "2026-08-17");
24
+ } finally {
25
+ await rm(memoryDir, { recursive: true, force: true });
26
+ }
27
+ });
28
+
29
+ test("previousActiveDate skips idle weekend days (Monday resolves to Friday)", async () => {
30
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-standup-"));
31
+ try {
32
+ await mkdir(path.join(memoryDir, "activity"), { recursive: true });
33
+ // 2026-08-17 is a Monday; 2026-08-14 is the prior Friday (derived from
34
+ // `date -d`, not memory). Weekend has no digest files.
35
+ await writeFile(path.join(memoryDir, "activity", "2026-08-14.md"), "x\n", "utf8");
36
+ assert.equal(previousActiveDate(memoryDir, "2026-08-17"), "2026-08-14");
37
+ } finally {
38
+ await rm(memoryDir, { recursive: true, force: true });
39
+ }
40
+ });
41
+
42
+ test("previousActiveDate picks the most recent active day, not a fixed weekday", async () => {
43
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-standup-"));
44
+ try {
45
+ await mkdir(path.join(memoryDir, "activity"), { recursive: true });
46
+ // Sunday activity counts: prior day is the latest day WITH data.
47
+ await writeFile(path.join(memoryDir, "activity", "2026-08-16.md"), "x\n", "utf8");
48
+ assert.equal(previousActiveDate(memoryDir, "2026-08-17"), "2026-08-16");
49
+ } finally {
50
+ await rm(memoryDir, { recursive: true, force: true });
51
+ }
13
52
  });
14
53
 
15
- test("buildStandup is deterministic and marks missing days", async () => {
54
+ function digestBody(spans: string[]): string {
55
+ return ["## Timeline", "", ...spans].join("\n");
56
+ }
57
+
58
+ test("buildStandup derives every section from the prior active day and stays deterministic", async () => {
16
59
  const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-standup-"));
17
60
  try {
18
61
  await mkdir(path.join(memoryDir, "activity"), { recursive: true });
62
+ // Friday 2026-08-14 has the activity; Monday 2026-08-17 is the standup day.
19
63
  await writeFile(
20
- path.join(memoryDir, "activity", "2026-08-18.md"),
21
- "---\ndate: 2026-08-18\n---\n# Today\n- shipped standup\n- blocker: waiting on review\n",
64
+ path.join(memoryDir, "activity", "2026-08-14.md"),
65
+ FRONTMATTER("2026-08-14") +
66
+ digestBody([
67
+ "- [09:00] Editor — refactor",
68
+ "- [09:30] Editor — refactor",
69
+ "- [10:15] Terminal — build",
70
+ "- [11:40] Editor — review",
71
+ "- [14:05] Browser — docs",
72
+ "- [15:20] Editor — blocker: waiting on review",
73
+ ]),
22
74
  "utf8",
23
75
  );
24
- const a = buildStandup(memoryDir, "2026-08-18");
25
- const b = buildStandup(memoryDir, "2026-08-18");
76
+ const a = buildStandup(memoryDir, "2026-08-17");
77
+ const b = buildStandup(memoryDir, "2026-08-17");
26
78
  assert.equal(a.markdown, b.markdown);
27
- assert.equal(a.yesterday, "2026-08-17");
28
- assert.match(a.markdown, /blocker: waiting on review/);
29
- assert.match(a.activityGrid, /yesterday \| \./);
30
- assert.match(a.activityGrid, /today \| x/);
79
+
80
+ assert.equal(a.yesterday, "2026-08-14");
81
+ // Highlights come from the PRIOR day (issue #1981), and frontmatter
82
+ // fields never leak into rendered sections.
83
+ assert.ok(a.highlights.length > 0);
84
+ for (const line of a.highlights) {
85
+ assert.doesNotMatch(line, /^id: |^category: |^status: |^---$/);
86
+ }
87
+ assert.match(a.markdown, /## Highlights\n- \[09:00\] Editor — refactor/);
88
+ // Blockers strip list markers (no doubled bullets) and come from P.
89
+ assert.ok(a.blockers.some((line) => line === "[15:20] Editor — blocker: waiting on review"));
90
+ assert.doesNotMatch(a.markdown, /- - /);
91
+ // Grid: exactly hours 9, 10, 11, 14, 15 non-empty; Monday empty.
92
+ assert.match(a.activityGrid, /^prior day 2026-08-14 — 24 hour buckets/);
93
+ assert.match(a.activityGrid, /^non-empty hours: 9, 10, 11, 14, 15$/m);
94
+ assert.match(a.markdown, /## Today \(2026-08-17\)\n_No activity digest._/);
95
+ // Zero commitments → explicit empty-priorities message, never invented.
96
+ assert.match(a.markdown, /## Today's priorities\n- \(no tracked commitments — add priorities manually\)/);
97
+ } finally {
98
+ await rm(memoryDir, { recursive: true, force: true });
99
+ }
100
+ });
101
+
102
+ test("buildStandup renders an empty grid row when the prior day has no digest", async () => {
103
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-standup-"));
104
+ try {
105
+ const brief = buildStandup(memoryDir, "2026-08-18");
106
+ assert.match(brief.activityGrid, /^prior day 2026-08-17: no activity digest \(empty\)$/);
107
+ } finally {
108
+ await rm(memoryDir, { recursive: true, force: true });
109
+ }
110
+ });
111
+
112
+ test("buildStandup lists open commitments as priorities and overdue ones as blocker candidates", async () => {
113
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-standup-"));
114
+ try {
115
+ await mkdir(path.join(memoryDir, "facts", "2026-08-10"), { recursive: true });
116
+ const commitment = (id: string, extra: string): string =>
117
+ `---\nid: ${id}\ncategory: commitment\nstatus: active\ncreated: 2026-08-10T00:00:00Z\nupdated: 2026-08-10T00:00:00Z\nsource: test\nconfidence: 0.8\nconfidenceTier: reported\ntags: []\n${extra}---\n${id} says: ship the thing\n`;
118
+ await writeFile(path.join(memoryDir, "facts", "2026-08-10", "open.md"), commitment("open-1", ""), "utf8");
119
+ await writeFile(
120
+ path.join(memoryDir, "facts", "2026-08-10", "due-soon.md"),
121
+ commitment("due-soon", "expiresAt: 2026-08-19T00:00:00Z\n"),
122
+ "utf8",
123
+ );
124
+ await writeFile(
125
+ path.join(memoryDir, "facts", "2026-08-10", "overdue.md"),
126
+ commitment("overdue-1", "expiresAt: 2026-08-15T00:00:00Z\n"),
127
+ "utf8",
128
+ );
129
+ await writeFile(
130
+ path.join(memoryDir, "facts", "2026-08-10", "fulfilled.md"),
131
+ commitment("done-1", "tags: [fulfilled]\n"),
132
+ "utf8",
133
+ );
134
+ await writeFile(
135
+ path.join(memoryDir, "facts", "2026-08-10", "review.md"),
136
+ commitment("pending-1", "status: pending_review\n"),
137
+ "utf8",
138
+ );
139
+ await writeFile(
140
+ path.join(memoryDir, "facts", "2026-08-10", "plain-fact.md"),
141
+ `---\nid: fact-1\ncategory: fact\nstatus: active\ncreated: 2026-08-10T00:00:00Z\nupdated: 2026-08-10T00:00:00Z\nsource: test\nconfidence: 0.8\nconfidenceTier: reported\ntags: []\n---\nnot a commitment\n`,
142
+ "utf8",
143
+ );
144
+
145
+ const brief = buildStandup(memoryDir, "2026-08-17");
146
+ // Overdue commitment is a blocker candidate, not a priority.
147
+ assert.ok(brief.blockers.some((line) => line.startsWith("commitment past due: overdue-1 says: ship the thing")));
148
+ // Fulfiled, pending-review, and non-commitment facts never appear.
149
+ const priorities = brief.priorities.join("\n");
150
+ assert.ok(priorities.includes("due-soon says: ship the thing (due 2026-08-19)"));
151
+ assert.ok(priorities.includes("open-1 says: ship the thing"));
152
+ assert.ok(!priorities.includes("done-1"));
153
+ assert.ok(!priorities.includes("pending-1"));
154
+ assert.ok(!priorities.includes("not a commitment"));
155
+ // Due-first ordering: expiresAt before bare created.
156
+ assert.ok(priorities.indexOf("due-soon") < priorities.indexOf("open-1"));
31
157
  } finally {
32
158
  await rm(memoryDir, { recursive: true, force: true });
33
159
  }