@remnic/core 10.0.168 → 10.0.170

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 (492) hide show
  1. package/dist/access-admin-ops-surface.js +181 -179
  2. package/dist/access-cli.js +181 -179
  3. package/dist/access-cli.js.map +1 -1
  4. package/dist/access-coding-context-resolution.js +11 -11
  5. package/dist/access-extraction-force-flush-preempt.js +181 -179
  6. package/dist/access-extraction-force-flush.js +181 -179
  7. package/dist/access-http-briefing.js +181 -179
  8. package/dist/access-http-query.js +181 -179
  9. package/dist/access-http.js +181 -179
  10. package/dist/access-identity-continuity-surface.js +181 -179
  11. package/dist/access-lcm-surface.js +181 -179
  12. package/dist/access-mcp.js +181 -179
  13. package/dist/access-observe-write-category.js +11 -11
  14. package/dist/access-observe-write-surface.js +181 -179
  15. package/dist/access-offline-manifest.js +9 -9
  16. package/dist/access-operations-batch.js +181 -179
  17. package/dist/access-operations.js +181 -179
  18. package/dist/access-recall-concurrency.js +181 -179
  19. package/dist/access-recall-diagnostics.js +2 -2
  20. package/dist/access-recall-excerpt-attribution.d.ts +19 -0
  21. package/dist/access-recall-excerpt-attribution.d.ts.map +1 -0
  22. package/dist/access-recall-excerpt-attribution.js +8 -0
  23. package/dist/access-recall-response.js +181 -179
  24. package/dist/access-recall-surface.d.ts.map +1 -1
  25. package/dist/access-recall-surface.js +181 -179
  26. package/dist/access-schema.js +10 -10
  27. package/dist/access-service.js +181 -179
  28. package/dist/active-recall.js +30 -29
  29. package/dist/active-recall.js.map +1 -1
  30. package/dist/adapters/index.js +7 -7
  31. package/dist/adapters/registry.js +3 -3
  32. package/dist/{auto-sync-L3M4RKJD.js → auto-sync-ACP5U5A3.js} +3 -3
  33. package/dist/behavior-learner.js +1 -1
  34. package/dist/binary-lifecycle/scanner.d.ts +2 -4
  35. package/dist/binary-lifecycle/scanner.d.ts.map +1 -1
  36. package/dist/briefing.js +19 -19
  37. package/dist/buffer-add-turns-bounded.d.ts +11 -1
  38. package/dist/buffer-add-turns-bounded.d.ts.map +1 -1
  39. package/dist/buffer-add-turns-bounded.js +3 -3
  40. package/dist/buffer-session-cap.d.ts +2 -2
  41. package/dist/buffer-session-cap.d.ts.map +1 -1
  42. package/dist/buffer-session-cap.js +1 -1
  43. package/dist/buffer.d.ts +3 -2
  44. package/dist/buffer.d.ts.map +1 -1
  45. package/dist/buffer.js +13 -13
  46. package/dist/calibration.d.ts +19 -2
  47. package/dist/calibration.d.ts.map +1 -1
  48. package/dist/calibration.js +28 -5
  49. package/dist/calibration.js.map +1 -1
  50. package/dist/{capsule-crypto-GWVG7LGC.js → capsule-crypto-7FJQINUR.js} +2 -2
  51. package/dist/{capsule-merge-VHBRF65A.js → capsule-merge-BADOICNP.js} +2 -2
  52. package/dist/causal-behavior.js +2 -2
  53. package/dist/causal-chain.js +2 -2
  54. package/dist/causal-consolidation.js +23 -23
  55. package/dist/causal-retrieval.js +2 -2
  56. package/dist/causal-trajectory-graph.js +3 -3
  57. package/dist/causal-trajectory.js +1 -1
  58. package/dist/{chunk-OWHERGF2.js → chunk-2NLLXCJG.js} +2 -2
  59. package/dist/{chunk-CKELO7Q6.js → chunk-2OAFPBQB.js} +2 -2
  60. package/dist/{chunk-2DL3OFLD.js → chunk-45GEJRIG.js} +2 -2
  61. package/dist/{chunk-5IZL4DCV.js → chunk-4DF5LMBJ.js} +2 -2
  62. package/dist/{chunk-A5UOREWD.js → chunk-4DLGKTM6.js} +2 -2
  63. package/dist/{chunk-WEFFO2MJ.js → chunk-4E2Z44CV.js} +2 -2
  64. package/dist/{chunk-X67XNZ64.js → chunk-4LVQSHHN.js} +14 -14
  65. package/dist/{chunk-RB7NXZ2E.js → chunk-4X7HQKAG.js} +2 -2
  66. package/dist/{chunk-I74SUMNI.js → chunk-5ACIRCBO.js} +65 -3
  67. package/dist/chunk-5ACIRCBO.js.map +1 -0
  68. package/dist/{chunk-LPUEBFX2.js → chunk-5JCYPBY5.js} +2 -2
  69. package/dist/{chunk-IMULTENA.js → chunk-5SOSQTVE.js} +2 -2
  70. package/dist/{chunk-D6BOOYNJ.js → chunk-5YIOUS5T.js} +384 -345
  71. package/dist/chunk-5YIOUS5T.js.map +1 -0
  72. package/dist/{chunk-5PUZV73Z.js → chunk-6VFMEBXY.js} +12 -12
  73. package/dist/{chunk-333SBFXB.js → chunk-7AAMJQFW.js} +2 -2
  74. package/dist/{chunk-BKTCVXMK.js → chunk-7SNEJNA3.js} +96 -23
  75. package/dist/chunk-7SNEJNA3.js.map +1 -0
  76. package/dist/{chunk-PFLN6TTW.js → chunk-A2XFG462.js} +2 -2
  77. package/dist/{chunk-WEHSQBFR.js → chunk-AIF6V2OX.js} +9 -4
  78. package/dist/chunk-AIF6V2OX.js.map +1 -0
  79. package/dist/{chunk-HXFIILGF.js → chunk-BFPF5N3H.js} +4 -4
  80. package/dist/{chunk-QFTK6EDM.js → chunk-BFZFNXOC.js} +13 -13
  81. package/dist/{chunk-7OCKK5M5.js → chunk-BJOQQCYC.js} +9 -9
  82. package/dist/{chunk-ZX546Y3Y.js → chunk-CY2C5LM4.js} +3 -3
  83. package/dist/{chunk-73TPOGS4.js → chunk-DC55RIEZ.js} +9 -9
  84. package/dist/{chunk-ZDZJNXL6.js → chunk-DK2VBJ6Q.js} +4 -4
  85. package/dist/{chunk-CLVILSBR.js → chunk-DNXQVCIC.js} +22 -22
  86. package/dist/{chunk-7VIJUZYW.js → chunk-E53NLIAP.js} +3 -3
  87. package/dist/{chunk-2LA3H54D.js → chunk-E5IZTY4W.js} +2 -2
  88. package/dist/{chunk-J74YOBB3.js → chunk-EBI6FI5U.js} +12 -12
  89. package/dist/{chunk-YYXYZM2I.js → chunk-ETTV5F53.js} +2 -2
  90. package/dist/{chunk-FRYCXXTB.js → chunk-FSORYJRP.js} +3 -3
  91. package/dist/{chunk-TH6OYP6I.js → chunk-GOZXQNIM.js} +3 -3
  92. package/dist/{chunk-TNRGWJYT.js → chunk-GUF2JKG5.js} +2 -2
  93. package/dist/{chunk-AL3TCNSJ.js → chunk-H3MLOQ7F.js} +24 -53
  94. package/dist/chunk-H3MLOQ7F.js.map +1 -0
  95. package/dist/{chunk-SIONKXLU.js → chunk-H6TCS5XX.js} +18 -15
  96. package/dist/chunk-H6TCS5XX.js.map +1 -0
  97. package/dist/{chunk-FEUWI5QH.js → chunk-HHPY5SSE.js} +2 -2
  98. package/dist/{chunk-QPFM6DHY.js → chunk-HHVK2JRE.js} +2 -2
  99. package/dist/{chunk-YY57TRKN.js → chunk-HR3DKJCU.js} +2 -2
  100. package/dist/{chunk-FMFCQRDM.js → chunk-IJKO5RVJ.js} +3 -3
  101. package/dist/{chunk-UMEUU66X.js → chunk-IK7NPYYU.js} +2 -2
  102. package/dist/{chunk-ILNPU5W5.js → chunk-IMA4DJ7K.js} +5 -45
  103. package/dist/chunk-IMA4DJ7K.js.map +1 -0
  104. package/dist/chunk-IUGOGDCP.js +39 -0
  105. package/dist/chunk-IUGOGDCP.js.map +1 -0
  106. package/dist/{chunk-CKZWLAHN.js → chunk-JDH2BA2P.js} +2 -2
  107. package/dist/{chunk-QVXEXGIM.js → chunk-JNBSTHVT.js} +2 -2
  108. package/dist/chunk-JVVWCZ2P.js +18 -0
  109. package/dist/chunk-JVVWCZ2P.js.map +1 -0
  110. package/dist/{chunk-OBPOIZNR.js → chunk-KBHUGMUW.js} +2 -2
  111. package/dist/{chunk-OZKVVUJB.js → chunk-KIM5VNZN.js} +2 -2
  112. package/dist/{chunk-ZWDDY4WF.js → chunk-KW4XA7GM.js} +3 -3
  113. package/dist/{chunk-OAQRZ4SV.js → chunk-L5EE2CXU.js} +2 -2
  114. package/dist/{chunk-QNUNAXBE.js → chunk-L7LZDISF.js} +1 -9
  115. package/dist/{chunk-QNUNAXBE.js.map → chunk-L7LZDISF.js.map} +1 -1
  116. package/dist/{chunk-RO5EGRAI.js → chunk-LAOJHOTG.js} +2 -2
  117. package/dist/{chunk-FOTFLHBN.js → chunk-LH57QATU.js} +3 -2
  118. package/dist/chunk-LH57QATU.js.map +1 -0
  119. package/dist/{chunk-BFPQJNFZ.js → chunk-LXSDEPEK.js} +60 -11
  120. package/dist/{chunk-BFPQJNFZ.js.map → chunk-LXSDEPEK.js.map} +1 -1
  121. package/dist/{chunk-3PNJZTDV.js → chunk-NDPS6OU2.js} +2 -2
  122. package/dist/{chunk-N7AIFTSH.js → chunk-NJG63FY2.js} +1 -1
  123. package/dist/{chunk-N7AIFTSH.js.map → chunk-NJG63FY2.js.map} +1 -1
  124. package/dist/{chunk-BUKK5SWA.js → chunk-NKAGGDSL.js} +3 -3
  125. package/dist/{chunk-BUKK5SWA.js.map → chunk-NKAGGDSL.js.map} +1 -1
  126. package/dist/{chunk-U3BCW7GX.js → chunk-OGQL7QC7.js} +3 -3
  127. package/dist/{chunk-K3FH3LAQ.js → chunk-OJXK5C6Z.js} +4 -4
  128. package/dist/{chunk-HDLNSDLK.js → chunk-P3XO7HE3.js} +2 -2
  129. package/dist/{chunk-RFLC6PKQ.js → chunk-PQIFYBUX.js} +2 -2
  130. package/dist/{chunk-WLT6LTQP.js → chunk-PRRWKTK6.js} +2 -2
  131. package/dist/{chunk-LWZNSQN3.js → chunk-PUQQPLVV.js} +3 -3
  132. package/dist/{chunk-LWZNSQN3.js.map → chunk-PUQQPLVV.js.map} +1 -1
  133. package/dist/{chunk-4L25GAYL.js → chunk-Q7OKGBZY.js} +2 -2
  134. package/dist/{chunk-ZQUOUPP3.js → chunk-QJBULLKG.js} +4 -4
  135. package/dist/{chunk-W7N7NWG5.js → chunk-QKAFFVSO.js} +2 -2
  136. package/dist/{chunk-EZG54YDS.js → chunk-QKBFVLDH.js} +2 -2
  137. package/dist/{chunk-MOUSHJAR.js → chunk-QMFHKWHN.js} +5 -5
  138. package/dist/{chunk-QLQUAVVP.js → chunk-QRCE77YX.js} +16 -16
  139. package/dist/chunk-QRCE77YX.js.map +1 -0
  140. package/dist/{chunk-4D2EY4WM.js → chunk-R2AJAAHJ.js} +6 -6
  141. package/dist/{chunk-5BE3FLKL.js → chunk-R3UQIS3F.js} +8 -8
  142. package/dist/{chunk-B3M56D2A.js → chunk-RDHEBINJ.js} +2 -2
  143. package/dist/{chunk-L7SEYUHS.js → chunk-RHQL2RIM.js} +3 -3
  144. package/dist/{chunk-2MWKUVHT.js → chunk-RK7SE3BL.js} +5 -5
  145. package/dist/{chunk-CUPILBIP.js → chunk-SA2YALFU.js} +2 -2
  146. package/dist/{chunk-VRHY7Y5A.js → chunk-SAPC7N43.js} +3 -3
  147. package/dist/{chunk-6QWFZ3X5.js → chunk-SOQOUZ2Y.js} +2 -2
  148. package/dist/{chunk-VHXRLD6S.js → chunk-T2JZF45K.js} +2 -2
  149. package/dist/{chunk-HLWXCDUQ.js → chunk-T4MKFTJF.js} +5 -5
  150. package/dist/{chunk-WQUGCOKF.js → chunk-TFA6HPOA.js} +4 -4
  151. package/dist/{chunk-YZYAYUJQ.js → chunk-TLRIRISJ.js} +4 -4
  152. package/dist/{chunk-LVGTH6IQ.js → chunk-UFX24WNJ.js} +14 -14
  153. package/dist/{chunk-OM5ESBES.js → chunk-UH3FPX3L.js} +2 -2
  154. package/dist/{chunk-4NBUHYUV.js → chunk-V5W67PQV.js} +3 -3
  155. package/dist/{chunk-TAD6QMMD.js → chunk-VAQIBC2L.js} +2 -2
  156. package/dist/{chunk-3Q3XD3NO.js → chunk-W2E2WFXL.js} +3 -3
  157. package/dist/{chunk-UYIBNDQE.js → chunk-W2UV6VE3.js} +2 -2
  158. package/dist/{chunk-AVWOULJH.js → chunk-W35ICLYZ.js} +2 -2
  159. package/dist/{chunk-HDDRVXX4.js → chunk-W5LJ3SJ7.js} +2 -2
  160. package/dist/{chunk-FGT7CUYZ.js → chunk-WF2LYKOB.js} +2 -2
  161. package/dist/{chunk-JIF22AXI.js → chunk-WGKIXNLY.js} +5 -2
  162. package/dist/{chunk-JIF22AXI.js.map → chunk-WGKIXNLY.js.map} +1 -1
  163. package/dist/{chunk-FFWFFAP3.js → chunk-WI2WTIMY.js} +14 -8
  164. package/dist/chunk-WI2WTIMY.js.map +1 -0
  165. package/dist/{chunk-OWM2VWNX.js → chunk-X5MFCZDL.js} +82 -44
  166. package/dist/chunk-X5MFCZDL.js.map +1 -0
  167. package/dist/{chunk-UVYI6VIX.js → chunk-X7Y7WX73.js} +1 -1
  168. package/dist/{chunk-22V3CMIW.js → chunk-XJTRIHTH.js} +8 -8
  169. package/dist/{chunk-3SL52JKD.js → chunk-XVZA6VXC.js} +4 -4
  170. package/dist/{chunk-WWQMZBDI.js → chunk-XYNUEXLC.js} +7 -7
  171. package/dist/{chunk-HDWISXFH.js → chunk-Y65XX5PC.js} +2 -2
  172. package/dist/{chunk-3YOX2BQD.js → chunk-YE77U5HZ.js} +3 -3
  173. package/dist/{chunk-U2PSE7MB.js → chunk-YLTU2DC4.js} +2 -2
  174. package/dist/{chunk-BPCR5DZP.js → chunk-YRD525ZO.js} +6 -6
  175. package/dist/chunk-YRD525ZO.js.map +1 -0
  176. package/dist/{chunk-SBRUTD5O.js → chunk-YSATDEBY.js} +5 -5
  177. package/dist/{chunk-TBBDFYXW.js → chunk-YVUNHNB6.js} +2 -3
  178. package/dist/chunk-YVUNHNB6.js.map +1 -0
  179. package/dist/{chunk-GBSXTTLP.js → chunk-YY5UXARJ.js} +24 -12
  180. package/dist/chunk-YY5UXARJ.js.map +1 -0
  181. package/dist/{chunk-L272A5QW.js → chunk-YYDUBGUF.js} +30 -22
  182. package/dist/chunk-YYDUBGUF.js.map +1 -0
  183. package/dist/{chunk-5QDTZIGH.js → chunk-ZJ3CEAJD.js} +2 -2
  184. package/dist/{chunk-GMO3BGOF.js → chunk-ZOJUWVAU.js} +1 -1
  185. package/dist/{chunk-T4BT4FQN.js → chunk-ZYP4YEEI.js} +3 -3
  186. package/dist/cli.js +181 -179
  187. package/dist/coding/export-okf-codegraph.js +30 -30
  188. package/dist/coding/pre-action-gate.js +2 -2
  189. package/dist/compounding/engine.js +20 -20
  190. package/dist/config-deprecations.d.ts +3 -0
  191. package/dist/config-deprecations.d.ts.map +1 -0
  192. package/dist/config-deprecations.js +9 -0
  193. package/dist/config.d.ts.map +1 -1
  194. package/dist/config.js +30 -29
  195. package/dist/connectors/codex-marketplace.d.ts.map +1 -1
  196. package/dist/connectors/codex-materialize-runner.js +20 -20
  197. package/dist/connectors/codex-materialize.d.ts.map +1 -1
  198. package/dist/connectors/codex-materialize.js +1 -1
  199. package/dist/connectors/index.js +21 -21
  200. package/dist/consolidation-provenance-check.js +2 -2
  201. package/dist/convergence-refresh.js +22 -22
  202. package/dist/conversation-index/backend.js +2 -2
  203. package/dist/corpus-watermark.js +21 -21
  204. package/dist/deep-recall-http-glue.js +11 -11
  205. package/dist/deep-recall.js +2 -2
  206. package/dist/embedding-fallback.js +2 -2
  207. package/dist/entity-retrieval.js +21 -21
  208. package/dist/event-order-recall.js +3 -3
  209. package/dist/explicit-capture.js +181 -179
  210. package/dist/extraction-judge.js +1 -1
  211. package/dist/extraction-normalization.js +1 -1
  212. package/dist/extraction-span-materialize.js +2 -2
  213. package/dist/extraction.js +35 -35
  214. package/dist/{first-start-migration-BPVJ4HJQ.js → first-start-migration-PPPP54X6.js} +5 -5
  215. package/dist/{graph-edge-decay-BC3IO2J4.js → graph-edge-decay-EKWXRBWF.js} +6 -6
  216. package/dist/graph-edge-decay-EKWXRBWF.js.map +1 -0
  217. package/dist/graph-jsonl.js +4 -4
  218. package/dist/graph-snapshot.js +4 -4
  219. package/dist/graph.js +5 -5
  220. package/dist/harmonic-retrieval.js +19 -19
  221. package/dist/index.js +272 -269
  222. package/dist/lcm/engine.js +2 -2
  223. package/dist/lcm/index.js +7 -7
  224. package/dist/lifecycle.d.ts +0 -6
  225. package/dist/lifecycle.d.ts.map +1 -1
  226. package/dist/lifecycle.js +1 -1
  227. package/dist/local-llm.js +2 -2
  228. package/dist/location/index.js +31 -21
  229. package/dist/location/provider-setup.d.ts +26 -1
  230. package/dist/location/provider-setup.d.ts.map +1 -1
  231. package/dist/maintenance/memory-governance.js +20 -20
  232. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +19 -19
  233. package/dist/maintenance/rebuild-memory-projection-runner.js +22 -22
  234. package/dist/maintenance/rebuild-memory-projection.js +21 -21
  235. package/dist/memory-browse.js +6 -6
  236. package/dist/memory-controller.d.ts.map +1 -1
  237. package/dist/memory-controller.js +1 -1
  238. package/dist/{migrate-from-identity-anchor-MJYB6NNN.js → migrate-from-identity-anchor-TZSZXJ6L.js} +2 -2
  239. package/dist/migrate-from-identity-anchor-TZSZXJ6L.js.map +1 -0
  240. package/dist/model-registry.d.ts +0 -5
  241. package/dist/model-registry.d.ts.map +1 -1
  242. package/dist/model-registry.js +1 -1
  243. package/dist/namespaces/migrate.js +20 -20
  244. package/dist/namespaces/search.js +9 -9
  245. package/dist/namespaces/storage.d.ts.map +1 -1
  246. package/dist/namespaces/storage.js +19 -19
  247. package/dist/offline-sync-changeset-generations.js +4 -4
  248. package/dist/offline-sync-embedding-generation.js +3 -3
  249. package/dist/offline-sync-snapshot-stream.js +7 -7
  250. package/dist/offline-sync.js +6 -6
  251. package/dist/operator-doctor-corpus.js +22 -22
  252. package/dist/operator-toolkit.js +42 -41
  253. package/dist/orchestration/backlog-scheduler.d.ts +4 -0
  254. package/dist/orchestration/backlog-scheduler.d.ts.map +1 -1
  255. package/dist/orchestration/backlog-scheduler.js +192 -184
  256. package/dist/orchestration/backlog-scheduler.js.map +1 -1
  257. package/dist/orchestration/buffer-drain-runner.js +182 -180
  258. package/dist/orchestration/extraction-persist-citation.d.ts +2 -2
  259. package/dist/orchestration/extraction-persist-citation.d.ts.map +1 -1
  260. package/dist/orchestration/extraction-persist.d.ts.map +1 -1
  261. package/dist/orchestration/maintenance.js +30 -30
  262. package/dist/orchestration/recall-internal.d.ts.map +1 -1
  263. package/dist/orchestration/semantic-consolidation-coordinator.d.ts.map +1 -1
  264. package/dist/orchestration/turn-ingestion-buffered.d.ts.map +1 -1
  265. package/dist/orchestration/workspace-ops.d.ts.map +1 -1
  266. package/dist/orchestrator.d.ts.map +1 -1
  267. package/dist/orchestrator.js +183 -181
  268. package/dist/peers/index.d.ts +2 -1
  269. package/dist/peers/index.d.ts.map +1 -1
  270. package/dist/peers/index.js +3 -3
  271. package/dist/peers/interaction-log-append.d.ts +8 -0
  272. package/dist/peers/interaction-log-append.d.ts.map +1 -0
  273. package/dist/peers/storage.d.ts +22 -8
  274. package/dist/peers/storage.d.ts.map +1 -1
  275. package/dist/policy-runtime.js +2 -2
  276. package/dist/qmd.js +4 -4
  277. package/dist/recall-explain-renderer.js +3 -3
  278. package/dist/recall-navigate-access.js +2 -2
  279. package/dist/recall-navigate-disclosure.js +2 -2
  280. package/dist/recall-navigate.js +2 -2
  281. package/dist/recall-navigation.js +181 -179
  282. package/dist/recall-state-view-admission.js +6 -6
  283. package/dist/recall-state-view-packet.d.ts.map +1 -1
  284. package/dist/recall-state-view-packet.js +30 -8
  285. package/dist/recall-state-view-packet.js.map +1 -1
  286. package/dist/recall-why-service.js +6 -6
  287. package/dist/recall-xray-cli.js +4 -4
  288. package/dist/recall-xray-renderer.js +3 -3
  289. package/dist/recall-xray.js +2 -2
  290. package/dist/reconcile/manifest.js +2 -2
  291. package/dist/resume-bundles.js +31 -30
  292. package/dist/retrieval.js +2 -2
  293. package/dist/search/factory.js +8 -8
  294. package/dist/search/index.js +14 -14
  295. package/dist/semantic-consolidation.d.ts +10 -16
  296. package/dist/semantic-consolidation.d.ts.map +1 -1
  297. package/dist/semantic-consolidation.js +24 -24
  298. package/dist/semantic-rule-promotion.js +19 -19
  299. package/dist/semantic-rule-verifier.js +19 -19
  300. package/dist/source-agent-qualifier.js +25 -25
  301. package/dist/source-attribution.d.ts +3 -3
  302. package/dist/source-attribution.d.ts.map +1 -1
  303. package/dist/source-attribution.js +1 -1
  304. package/dist/standup/build.js +19 -19
  305. package/dist/storage/links-frontmatter.d.ts +3 -0
  306. package/dist/storage/links-frontmatter.d.ts.map +1 -0
  307. package/dist/storage.d.ts +1 -0
  308. package/dist/storage.d.ts.map +1 -1
  309. package/dist/storage.js +18 -18
  310. package/dist/summarizer.d.ts +7 -1
  311. package/dist/summarizer.d.ts.map +1 -1
  312. package/dist/summarizer.js +4 -4
  313. package/dist/support-passport/index.js +16 -16
  314. package/dist/tier-routing.js +2 -2
  315. package/dist/{tier-stats-FLFKN7Y6.js → tier-stats-XWJSVEHC.js} +5 -5
  316. package/dist/transfer/autodetect.js +3 -3
  317. package/dist/transfer/backup.js +2 -2
  318. package/dist/transfer/capsule-export.js +3 -3
  319. package/dist/transfer/capsule-import.js +3 -3
  320. package/dist/transfer/export-okf.js +19 -19
  321. package/dist/transfer/import-json.js +2 -2
  322. package/dist/transfer/import-md.js +2 -2
  323. package/dist/transfer/types.d.ts +15 -3
  324. package/dist/transfer/types.d.ts.map +1 -1
  325. package/dist/transfer/types.js +3 -1
  326. package/dist/types.d.ts +1 -0
  327. package/dist/types.d.ts.map +1 -1
  328. package/dist/types.js +1 -1
  329. package/dist/utility-learner.js +2 -2
  330. package/dist/utility-runtime.js +3 -3
  331. package/dist/verified-recall.js +19 -19
  332. package/dist/who-knows-cli.js +20 -20
  333. package/dist/who-knows.js +19 -19
  334. package/package.json +2 -2
  335. package/src/access-cli.test.ts +9 -9
  336. package/src/access-recall-excerpt-attribution.ts +69 -0
  337. package/src/access-recall-surface.ts +23 -23
  338. package/src/access-service-raw-excerpt-read-gate.test.ts +192 -11
  339. package/src/backlog-scheduler.test.ts +31 -0
  340. package/src/binary-lifecycle/scanner.ts +35 -14
  341. package/src/buffer-add-turns-bounded.ts +16 -2
  342. package/src/buffer-session-cap.ts +4 -4
  343. package/src/buffer.ts +5 -5
  344. package/src/calibration.ts +56 -4
  345. package/src/config-deprecations.ts +14 -0
  346. package/src/config.ts +2 -1
  347. package/src/connectors/codex-marketplace-git.test.ts +267 -0
  348. package/src/connectors/codex-marketplace.ts +76 -13
  349. package/src/connectors/codex-materialize.ts +29 -55
  350. package/src/lifecycle.ts +0 -8
  351. package/src/location/provider-setup.test.ts +273 -2
  352. package/src/location/provider-setup.ts +138 -32
  353. package/src/memory-controller.test.ts +11 -0
  354. package/src/memory-controller.ts +5 -1
  355. package/src/model-registry.ts +0 -11
  356. package/src/namespaces/storage.ts +1 -0
  357. package/src/orchestration/backlog-scheduler.ts +12 -3
  358. package/src/orchestration/extraction-persist-citation.ts +5 -3
  359. package/src/orchestration/extraction-persist.ts +15 -14
  360. package/src/orchestration/recall-internal.ts +2 -3
  361. package/src/orchestration/semantic-consolidation-coordinator.ts +40 -33
  362. package/src/orchestration/semantic-consolidation-split.test.ts +72 -0
  363. package/src/orchestration/turn-ingestion-buffered.test.ts +52 -1
  364. package/src/orchestration/turn-ingestion-buffered.ts +26 -8
  365. package/src/orchestration/workspace-ops.test.ts +23 -0
  366. package/src/orchestration/workspace-ops.ts +6 -5
  367. package/src/orchestrator.ts +1 -0
  368. package/src/peers/index.ts +1 -1
  369. package/src/peers/interaction-log-append.ts +132 -0
  370. package/src/peers/peers.test.ts +30 -0
  371. package/src/peers/profile-reasoner.ts +1 -1
  372. package/src/peers/storage.ts +4 -105
  373. package/src/recall-state-view-packet.test.ts +40 -0
  374. package/src/recall-state-view-packet.ts +46 -9
  375. package/src/semantic-consolidation.ts +35 -27
  376. package/src/source-attribution.test.ts +57 -0
  377. package/src/source-attribution.ts +46 -43
  378. package/src/storage/links-frontmatter.ts +69 -0
  379. package/src/storage-links-parse.test.ts +153 -0
  380. package/src/storage.ts +8 -21
  381. package/src/summarizer-shutdown.test.ts +49 -16
  382. package/src/summarizer.ts +13 -5
  383. package/src/testing/subjects/dependency-propagation.test.ts +5 -4
  384. package/src/testing/subjects/memory-maintenance.test.ts +293 -0
  385. package/src/transfer/capsule-export.ts +2 -1
  386. package/src/transfer/capsule-taxonomy-version.test.ts +70 -0
  387. package/src/transfer/types.ts +13 -3
  388. package/src/types.ts +1 -0
  389. package/dist/chunk-AL3TCNSJ.js.map +0 -1
  390. package/dist/chunk-BKTCVXMK.js.map +0 -1
  391. package/dist/chunk-BPCR5DZP.js.map +0 -1
  392. package/dist/chunk-D6BOOYNJ.js.map +0 -1
  393. package/dist/chunk-FFWFFAP3.js.map +0 -1
  394. package/dist/chunk-FOTFLHBN.js.map +0 -1
  395. package/dist/chunk-GBSXTTLP.js.map +0 -1
  396. package/dist/chunk-I74SUMNI.js.map +0 -1
  397. package/dist/chunk-ILNPU5W5.js.map +0 -1
  398. package/dist/chunk-L272A5QW.js.map +0 -1
  399. package/dist/chunk-OWM2VWNX.js.map +0 -1
  400. package/dist/chunk-QLQUAVVP.js.map +0 -1
  401. package/dist/chunk-SIONKXLU.js.map +0 -1
  402. package/dist/chunk-TBBDFYXW.js.map +0 -1
  403. package/dist/chunk-WEHSQBFR.js.map +0 -1
  404. /package/dist/{capsule-crypto-GWVG7LGC.js.map → access-recall-excerpt-attribution.js.map} +0 -0
  405. /package/dist/{auto-sync-L3M4RKJD.js.map → auto-sync-ACP5U5A3.js.map} +0 -0
  406. /package/dist/{graph-edge-decay-BC3IO2J4.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
  407. /package/dist/{capsule-merge-VHBRF65A.js.map → capsule-merge-BADOICNP.js.map} +0 -0
  408. /package/dist/{chunk-OWHERGF2.js.map → chunk-2NLLXCJG.js.map} +0 -0
  409. /package/dist/{chunk-CKELO7Q6.js.map → chunk-2OAFPBQB.js.map} +0 -0
  410. /package/dist/{chunk-2DL3OFLD.js.map → chunk-45GEJRIG.js.map} +0 -0
  411. /package/dist/{chunk-5IZL4DCV.js.map → chunk-4DF5LMBJ.js.map} +0 -0
  412. /package/dist/{chunk-A5UOREWD.js.map → chunk-4DLGKTM6.js.map} +0 -0
  413. /package/dist/{chunk-WEFFO2MJ.js.map → chunk-4E2Z44CV.js.map} +0 -0
  414. /package/dist/{chunk-X67XNZ64.js.map → chunk-4LVQSHHN.js.map} +0 -0
  415. /package/dist/{chunk-RB7NXZ2E.js.map → chunk-4X7HQKAG.js.map} +0 -0
  416. /package/dist/{chunk-LPUEBFX2.js.map → chunk-5JCYPBY5.js.map} +0 -0
  417. /package/dist/{chunk-IMULTENA.js.map → chunk-5SOSQTVE.js.map} +0 -0
  418. /package/dist/{chunk-5PUZV73Z.js.map → chunk-6VFMEBXY.js.map} +0 -0
  419. /package/dist/{chunk-333SBFXB.js.map → chunk-7AAMJQFW.js.map} +0 -0
  420. /package/dist/{chunk-PFLN6TTW.js.map → chunk-A2XFG462.js.map} +0 -0
  421. /package/dist/{chunk-HXFIILGF.js.map → chunk-BFPF5N3H.js.map} +0 -0
  422. /package/dist/{chunk-QFTK6EDM.js.map → chunk-BFZFNXOC.js.map} +0 -0
  423. /package/dist/{chunk-7OCKK5M5.js.map → chunk-BJOQQCYC.js.map} +0 -0
  424. /package/dist/{chunk-ZX546Y3Y.js.map → chunk-CY2C5LM4.js.map} +0 -0
  425. /package/dist/{chunk-73TPOGS4.js.map → chunk-DC55RIEZ.js.map} +0 -0
  426. /package/dist/{chunk-ZDZJNXL6.js.map → chunk-DK2VBJ6Q.js.map} +0 -0
  427. /package/dist/{chunk-CLVILSBR.js.map → chunk-DNXQVCIC.js.map} +0 -0
  428. /package/dist/{chunk-7VIJUZYW.js.map → chunk-E53NLIAP.js.map} +0 -0
  429. /package/dist/{chunk-2LA3H54D.js.map → chunk-E5IZTY4W.js.map} +0 -0
  430. /package/dist/{chunk-J74YOBB3.js.map → chunk-EBI6FI5U.js.map} +0 -0
  431. /package/dist/{chunk-YYXYZM2I.js.map → chunk-ETTV5F53.js.map} +0 -0
  432. /package/dist/{chunk-FRYCXXTB.js.map → chunk-FSORYJRP.js.map} +0 -0
  433. /package/dist/{chunk-TH6OYP6I.js.map → chunk-GOZXQNIM.js.map} +0 -0
  434. /package/dist/{chunk-TNRGWJYT.js.map → chunk-GUF2JKG5.js.map} +0 -0
  435. /package/dist/{chunk-FEUWI5QH.js.map → chunk-HHPY5SSE.js.map} +0 -0
  436. /package/dist/{chunk-QPFM6DHY.js.map → chunk-HHVK2JRE.js.map} +0 -0
  437. /package/dist/{chunk-YY57TRKN.js.map → chunk-HR3DKJCU.js.map} +0 -0
  438. /package/dist/{chunk-FMFCQRDM.js.map → chunk-IJKO5RVJ.js.map} +0 -0
  439. /package/dist/{chunk-UMEUU66X.js.map → chunk-IK7NPYYU.js.map} +0 -0
  440. /package/dist/{chunk-CKZWLAHN.js.map → chunk-JDH2BA2P.js.map} +0 -0
  441. /package/dist/{chunk-QVXEXGIM.js.map → chunk-JNBSTHVT.js.map} +0 -0
  442. /package/dist/{chunk-OBPOIZNR.js.map → chunk-KBHUGMUW.js.map} +0 -0
  443. /package/dist/{chunk-OZKVVUJB.js.map → chunk-KIM5VNZN.js.map} +0 -0
  444. /package/dist/{chunk-ZWDDY4WF.js.map → chunk-KW4XA7GM.js.map} +0 -0
  445. /package/dist/{chunk-OAQRZ4SV.js.map → chunk-L5EE2CXU.js.map} +0 -0
  446. /package/dist/{chunk-RO5EGRAI.js.map → chunk-LAOJHOTG.js.map} +0 -0
  447. /package/dist/{chunk-3PNJZTDV.js.map → chunk-NDPS6OU2.js.map} +0 -0
  448. /package/dist/{chunk-U3BCW7GX.js.map → chunk-OGQL7QC7.js.map} +0 -0
  449. /package/dist/{chunk-K3FH3LAQ.js.map → chunk-OJXK5C6Z.js.map} +0 -0
  450. /package/dist/{chunk-HDLNSDLK.js.map → chunk-P3XO7HE3.js.map} +0 -0
  451. /package/dist/{chunk-RFLC6PKQ.js.map → chunk-PQIFYBUX.js.map} +0 -0
  452. /package/dist/{chunk-WLT6LTQP.js.map → chunk-PRRWKTK6.js.map} +0 -0
  453. /package/dist/{chunk-4L25GAYL.js.map → chunk-Q7OKGBZY.js.map} +0 -0
  454. /package/dist/{chunk-ZQUOUPP3.js.map → chunk-QJBULLKG.js.map} +0 -0
  455. /package/dist/{chunk-W7N7NWG5.js.map → chunk-QKAFFVSO.js.map} +0 -0
  456. /package/dist/{chunk-EZG54YDS.js.map → chunk-QKBFVLDH.js.map} +0 -0
  457. /package/dist/{chunk-MOUSHJAR.js.map → chunk-QMFHKWHN.js.map} +0 -0
  458. /package/dist/{chunk-4D2EY4WM.js.map → chunk-R2AJAAHJ.js.map} +0 -0
  459. /package/dist/{chunk-5BE3FLKL.js.map → chunk-R3UQIS3F.js.map} +0 -0
  460. /package/dist/{chunk-B3M56D2A.js.map → chunk-RDHEBINJ.js.map} +0 -0
  461. /package/dist/{chunk-L7SEYUHS.js.map → chunk-RHQL2RIM.js.map} +0 -0
  462. /package/dist/{chunk-2MWKUVHT.js.map → chunk-RK7SE3BL.js.map} +0 -0
  463. /package/dist/{chunk-CUPILBIP.js.map → chunk-SA2YALFU.js.map} +0 -0
  464. /package/dist/{chunk-VRHY7Y5A.js.map → chunk-SAPC7N43.js.map} +0 -0
  465. /package/dist/{chunk-6QWFZ3X5.js.map → chunk-SOQOUZ2Y.js.map} +0 -0
  466. /package/dist/{chunk-VHXRLD6S.js.map → chunk-T2JZF45K.js.map} +0 -0
  467. /package/dist/{chunk-HLWXCDUQ.js.map → chunk-T4MKFTJF.js.map} +0 -0
  468. /package/dist/{chunk-WQUGCOKF.js.map → chunk-TFA6HPOA.js.map} +0 -0
  469. /package/dist/{chunk-YZYAYUJQ.js.map → chunk-TLRIRISJ.js.map} +0 -0
  470. /package/dist/{chunk-LVGTH6IQ.js.map → chunk-UFX24WNJ.js.map} +0 -0
  471. /package/dist/{chunk-OM5ESBES.js.map → chunk-UH3FPX3L.js.map} +0 -0
  472. /package/dist/{chunk-4NBUHYUV.js.map → chunk-V5W67PQV.js.map} +0 -0
  473. /package/dist/{chunk-TAD6QMMD.js.map → chunk-VAQIBC2L.js.map} +0 -0
  474. /package/dist/{chunk-3Q3XD3NO.js.map → chunk-W2E2WFXL.js.map} +0 -0
  475. /package/dist/{chunk-UYIBNDQE.js.map → chunk-W2UV6VE3.js.map} +0 -0
  476. /package/dist/{chunk-AVWOULJH.js.map → chunk-W35ICLYZ.js.map} +0 -0
  477. /package/dist/{chunk-HDDRVXX4.js.map → chunk-W5LJ3SJ7.js.map} +0 -0
  478. /package/dist/{chunk-FGT7CUYZ.js.map → chunk-WF2LYKOB.js.map} +0 -0
  479. /package/dist/{chunk-UVYI6VIX.js.map → chunk-X7Y7WX73.js.map} +0 -0
  480. /package/dist/{chunk-22V3CMIW.js.map → chunk-XJTRIHTH.js.map} +0 -0
  481. /package/dist/{chunk-3SL52JKD.js.map → chunk-XVZA6VXC.js.map} +0 -0
  482. /package/dist/{chunk-WWQMZBDI.js.map → chunk-XYNUEXLC.js.map} +0 -0
  483. /package/dist/{chunk-HDWISXFH.js.map → chunk-Y65XX5PC.js.map} +0 -0
  484. /package/dist/{chunk-3YOX2BQD.js.map → chunk-YE77U5HZ.js.map} +0 -0
  485. /package/dist/{chunk-U2PSE7MB.js.map → chunk-YLTU2DC4.js.map} +0 -0
  486. /package/dist/{chunk-SBRUTD5O.js.map → chunk-YSATDEBY.js.map} +0 -0
  487. /package/dist/{chunk-5QDTZIGH.js.map → chunk-ZJ3CEAJD.js.map} +0 -0
  488. /package/dist/{chunk-GMO3BGOF.js.map → chunk-ZOJUWVAU.js.map} +0 -0
  489. /package/dist/{chunk-T4BT4FQN.js.map → chunk-ZYP4YEEI.js.map} +0 -0
  490. /package/dist/{migrate-from-identity-anchor-MJYB6NNN.js.map → config-deprecations.js.map} +0 -0
  491. /package/dist/{first-start-migration-BPVJ4HJQ.js.map → first-start-migration-PPPP54X6.js.map} +0 -0
  492. /package/dist/{tier-stats-FLFKN7Y6.js.map → tier-stats-XWJSVEHC.js.map} +0 -0
@@ -611,50 +611,30 @@ export function renderMemoryMd(ctx: RenderContext): string {
611
611
  lines.push(`applies_to: cwd=*; reuse_rule=namespace-match`);
612
612
  lines.push("");
613
613
 
614
- // One "task" per top-level topic cluster. For the first cut we group by
615
- // memory category so the schema validator always sees at least one task.
616
- const byCategory = groupMemoriesByCategory(ctx.memories);
617
- let taskIndex = 1;
618
- if (byCategory.size === 0) {
619
- lines.push(`## Task ${taskIndex}: baseline — no memories yet`);
620
- lines.push("");
621
- lines.push("### rollout_summary_files");
622
- for (const r of ctx.rolloutSummaries) {
614
+ // One task per namespace: there is no topic clustering yet, so a task per
615
+ // memory category would emit identical rollout lists under every task and
616
+ // claim per-task scoping that does not exist. The documented contract is a
617
+ // single task carrying all rollouts until real clustering lands (#3614).
618
+ const activeMemories = ctx.memories.filter(
619
+ (m) => !m.frontmatter.status || m.frontmatter.status === "active",
620
+ );
621
+ lines.push(`## Task 1: ${ctx.namespace} memories, outcome=surface-to-codex`);
622
+ lines.push("");
623
+ lines.push("### rollout_summary_files");
624
+ const rollouts = ctx.rolloutSummaries.slice(0, 5);
625
+ if (rollouts.length === 0) {
626
+ lines.push("- (none)");
627
+ } else {
628
+ for (const r of rollouts) {
623
629
  lines.push(
624
630
  `- rollout_summaries/${sanitizeSlug(r.slug)}.md (cwd=${r.cwd ?? "*"}, rollout_path=${r.rolloutPath ?? ""}, updated_at=${r.updatedAt ?? ""}, thread_id=${r.threadId ?? ""})`,
625
631
  );
626
632
  }
627
- if (ctx.rolloutSummaries.length === 0) {
628
- lines.push("- (none)");
629
- }
630
- lines.push("");
631
- lines.push("### keywords");
632
- lines.push(`- ${ctx.namespace}`);
633
- lines.push("");
634
- taskIndex += 1;
635
- } else {
636
- for (const [category, mems] of byCategory) {
637
- lines.push(`## Task ${taskIndex}: ${category} memories, outcome=surface-to-codex`);
638
- lines.push("");
639
- lines.push("### rollout_summary_files");
640
- const relevantRollouts = ctx.rolloutSummaries.slice(0, 5);
641
- if (relevantRollouts.length === 0) {
642
- lines.push("- (none)");
643
- } else {
644
- for (const r of relevantRollouts) {
645
- lines.push(
646
- `- rollout_summaries/${sanitizeSlug(r.slug)}.md (cwd=${r.cwd ?? "*"}, rollout_path=${r.rolloutPath ?? ""}, updated_at=${r.updatedAt ?? ""}, thread_id=${r.threadId ?? ""})`,
647
- );
648
- }
649
- }
650
- lines.push("");
651
- lines.push("### keywords");
652
- const keywords = collectKeywords(mems, category, ctx.namespace);
653
- lines.push(`- ${keywords.join(", ")}`);
654
- lines.push("");
655
- taskIndex += 1;
656
- }
657
633
  }
634
+ lines.push("");
635
+ lines.push("### keywords");
636
+ lines.push(`- ${collectKeywords(activeMemories, ctx.namespace).join(", ")}`);
637
+ lines.push("");
658
638
 
659
639
  lines.push("## User preferences");
660
640
  const prefs = pickCategory(ctx.memories, ["preference"]);
@@ -932,18 +912,6 @@ function oneLineSummary(memory: MemoryFile): string {
932
912
  return `${raw.slice(0, 157)}...`;
933
913
  }
934
914
 
935
- function groupMemoriesByCategory(memories: MemoryFile[]): Map<string, MemoryFile[]> {
936
- const map = new Map<string, MemoryFile[]>();
937
- for (const memory of memories) {
938
- if (memory.frontmatter.status && memory.frontmatter.status !== "active") continue;
939
- const category = memory.frontmatter.category ?? "unknown";
940
- const list = map.get(category) ?? [];
941
- list.push(memory);
942
- map.set(category, list);
943
- }
944
- return map;
945
- }
946
-
947
915
  function pickCategory(memories: MemoryFile[], categories: string[]): MemoryFile[] {
948
916
  const allowed = new Set(categories);
949
917
  return memories.filter(
@@ -953,13 +921,19 @@ function pickCategory(memories: MemoryFile[], categories: string[]): MemoryFile[
953
921
  );
954
922
  }
955
923
 
956
- function collectKeywords(memories: MemoryFile[], category: string, namespace: string): string[] {
924
+ function collectKeywords(memories: MemoryFile[], namespace: string): string[] {
957
925
  const keywords = new Set<string>();
958
- keywords.add(category);
959
926
  keywords.add(namespace);
960
- for (const mem of memories.slice(0, 10)) {
927
+ // Two passes so the tag flood cannot crowd out a category: every active
928
+ // memory's category is guaranteed a slot, then tags fill what remains.
929
+ for (const mem of memories) {
930
+ const category = (mem.frontmatter.category ?? "").trim();
931
+ if (category.length > 0) keywords.add(category);
932
+ }
933
+ for (const mem of memories) {
961
934
  for (const tag of mem.frontmatter.tags ?? []) {
962
- if (typeof tag === "string" && tag.trim().length > 0) keywords.add(tag.trim());
935
+ const trimmed = tag.trim();
936
+ if (trimmed.length > 0) keywords.add(trimmed);
963
937
  }
964
938
  }
965
939
  return [...keywords].slice(0, 16);
package/src/lifecycle.ts CHANGED
@@ -24,12 +24,6 @@ export interface LifecycleSignals {
24
24
  * This is intentionally low-impact to avoid circular amplification.
25
25
  */
26
26
  actionPriorScore?: number;
27
- /**
28
- * Optional causal impact score from CMC chain analysis in [0, 0.3].
29
- * Computed as 0.1 * incomingEdges + 0.15 * outgoingEdges, clamped.
30
- * Weight in heat/decay is intentionally low (0.05) to avoid circular amplification.
31
- */
32
- causalImpactScore?: number;
33
27
  }
34
28
 
35
29
  export interface LifecycleDecision {
@@ -141,13 +135,11 @@ export function computeHeat(
141
135
  if (frontmatter.status === "archived") return 0;
142
136
 
143
137
  const inputs = computeLifecycleValueInputs(memory, now, signals);
144
- const causalBoost = clamp01(signals?.causalImpactScore ?? 0) * 0.05;
145
138
  const score = (inputs.confidence * 0.25)
146
139
  + (inputs.access * 0.3)
147
140
  + (inputs.recency * 0.2)
148
141
  + (inputs.importance * 0.15)
149
142
  + (inputs.feedback * 0.1)
150
- + causalBoost
151
143
  - inputs.disputedPenalty;
152
144
  return clamp01(score);
153
145
  }
@@ -9,7 +9,16 @@ import test from "node:test";
9
9
 
10
10
  import { parseLocationConfig } from "./config.js";
11
11
  import { clearLocationProviders, getLocationProvider, registerLocationProvider } from "./registry.js";
12
- import { ensureConfiguredLocationProviders, type LocationProviderEnv } from "./provider-setup.js";
12
+ import {
13
+ ensureConfiguredLocationProviders,
14
+ getLocationProviderSetup,
15
+ listLocationProviderSetups,
16
+ registerLocationProviderSetup,
17
+ resetLocationProviderSetups,
18
+ unregisterLocationProviderSetup,
19
+ type LocationProviderEnv,
20
+ type LocationProviderSetupEntry,
21
+ } from "./provider-setup.js";
13
22
  import type { LocationProvider } from "./types.js";
14
23
 
15
24
  const ENV: LocationProviderEnv = {
@@ -43,7 +52,10 @@ function importModuleDouble(options: { registered: boolean; failWith?: Error })
43
52
  };
44
53
  }
45
54
 
46
- test.afterEach(() => clearLocationProviders());
55
+ test.afterEach(() => {
56
+ clearLocationProviders();
57
+ resetLocationProviderSetups();
58
+ });
47
59
 
48
60
  test("registers reitti from env credentials with timezone threaded through", async () => {
49
61
  const config = parseLocationConfig({ enabled: true, timezone: "Europe/Berlin", sources: [{ id: "reitti" }] });
@@ -104,3 +116,262 @@ test("invalid authMode falls back to the connector default (single header form)"
104
116
  });
105
117
  assert.equal("authMode" in (loader.calls[0] ?? {}), false, "invalid mode must not be forwarded");
106
118
  });
119
+
120
+ interface OwntracksModule {
121
+ ensureOwntracksRegistered(opts: { baseUrl: string; token: string; timezone: string }): boolean;
122
+ }
123
+
124
+ function stubLocationProvider(id: string, displayName: string): LocationProvider {
125
+ return {
126
+ id,
127
+ displayName,
128
+ verify: async () => ({ ok: true }),
129
+ fetchObservations: async () => ({ observations: [], nextCursor: null }),
130
+ };
131
+ }
132
+
133
+ function makeOwntracksSetupEntry(calls: Array<{ baseUrl: string; token: string; timezone: string }>): LocationProviderSetupEntry {
134
+ return {
135
+ id: "owntracks",
136
+ packageSpecifier: "@remnic/connector-owntracks",
137
+ setup: async (context) => {
138
+ const baseUrl = context.env?.baseUrl?.trim();
139
+ const token = context.env?.token?.trim();
140
+ if (!baseUrl || !token) return false;
141
+ const mod = await context.loadPackage<OwntracksModule>();
142
+ const opts = { baseUrl, token, timezone: context.config.timezone };
143
+ calls.push(opts);
144
+ return mod.ensureOwntracksRegistered(opts);
145
+ },
146
+ };
147
+ }
148
+
149
+ test("registers non-reitti provider registered in setup table with idempotency", async () => {
150
+ const setupCalls: Array<{ baseUrl: string; token: string; timezone: string }> = [];
151
+ const requestedSpecifiers: string[] = [];
152
+ registerLocationProviderSetup(makeOwntracksSetupEntry(setupCalls));
153
+
154
+ assert.equal(getLocationProviderSetup("owntracks")?.packageSpecifier, "@remnic/connector-owntracks");
155
+ assert.ok(listLocationProviderSetups().includes("owntracks"));
156
+
157
+ const importModule = async (specifier: string) => {
158
+ requestedSpecifiers.push(specifier);
159
+ const mod: OwntracksModule = {
160
+ ensureOwntracksRegistered: () => {
161
+ registerLocationProvider(stubLocationProvider("owntracks", "OwnTracks"));
162
+ return true;
163
+ },
164
+ };
165
+ return mod;
166
+ };
167
+
168
+ const config = parseLocationConfig({
169
+ enabled: true,
170
+ timezone: "America/Chicago",
171
+ sources: [{ id: "owntracks" }],
172
+ });
173
+ const registered = await ensureConfiguredLocationProviders(config, {
174
+ env: { baseUrl: "https://owntracks.example.invalid", token: "ot-secret" },
175
+ importModule,
176
+ });
177
+
178
+ assert.deepEqual(registered, ["owntracks"]);
179
+ assert.deepEqual(requestedSpecifiers, ["@remnic/connector-owntracks"]);
180
+ assert.deepEqual(setupCalls, [
181
+ { baseUrl: "https://owntracks.example.invalid", token: "ot-secret", timezone: "America/Chicago" },
182
+ ]);
183
+ assert.equal(getLocationProvider("owntracks")?.displayName, "OwnTracks");
184
+
185
+ const registeredAgain = await ensureConfiguredLocationProviders(config, {
186
+ env: { baseUrl: "https://owntracks.example.invalid", token: "ot-secret" },
187
+ importModule,
188
+ });
189
+ assert.deepEqual(registeredAgain, []);
190
+ assert.equal(requestedSpecifiers.length, 1);
191
+ });
192
+
193
+ test("bootstraps multiple configured sources independently using envBySource", async () => {
194
+ const owntracksCalls: Array<{ baseUrl: string; token: string; timezone: string }> = [];
195
+ registerLocationProviderSetup(makeOwntracksSetupEntry(owntracksCalls));
196
+
197
+ const reittiLoader = importModuleDouble({ registered: true });
198
+ const requestedSpecifiers: string[] = [];
199
+ const importModule = async (specifier: string) => {
200
+ requestedSpecifiers.push(specifier);
201
+ if (specifier === "@remnic/connector-owntracks") {
202
+ const mod: OwntracksModule = {
203
+ ensureOwntracksRegistered: () => {
204
+ registerLocationProvider(stubLocationProvider("owntracks", "OwnTracks"));
205
+ return true;
206
+ },
207
+ };
208
+ return mod;
209
+ }
210
+ return reittiLoader.importModule();
211
+ };
212
+
213
+ const config = parseLocationConfig({
214
+ enabled: true,
215
+ timezone: "UTC",
216
+ sources: [{ id: "reitti" }, { id: "owntracks" }],
217
+ });
218
+ const envBySource = new Map<string, LocationProviderEnv>([
219
+ ["reitti", ENV],
220
+ ["owntracks", { baseUrl: "https://owntracks.example.invalid", token: "ot-token" }],
221
+ ]);
222
+
223
+ const registered = await ensureConfiguredLocationProviders(config, { envBySource, importModule });
224
+ assert.deepEqual(registered, ["reitti", "owntracks"]);
225
+ assert.deepEqual(requestedSpecifiers, ["@remnic/connector-reitti", "@remnic/connector-owntracks"]);
226
+ assert.ok(getLocationProvider("reitti"));
227
+ assert.ok(getLocationProvider("owntracks"));
228
+
229
+ clearLocationProviders();
230
+ const partialEnvBySource = new Map<string, LocationProviderEnv>([
231
+ ["reitti", { baseUrl: ENV.baseUrl }],
232
+ ["owntracks", { baseUrl: "https://owntracks.example.invalid", token: "ot-token" }],
233
+ ]);
234
+ const partialRegistered = await ensureConfiguredLocationProviders(config, {
235
+ envBySource: partialEnvBySource,
236
+ importModule,
237
+ });
238
+ assert.deepEqual(partialRegistered, ["owntracks"]);
239
+ });
240
+
241
+ test("setup registry validates ids, rejects duplicates, unregisters, and resets to defaults", async () => {
242
+ assert.equal(getLocationProviderSetup("reitti")?.packageSpecifier, "@remnic/connector-reitti");
243
+ assert.deepEqual(listLocationProviderSetups(), ["reitti"]);
244
+
245
+ const dummySetup: LocationProviderSetupEntry["setup"] = async () => false;
246
+ assert.throws(
247
+ () => registerLocationProviderSetup({ id: "", packageSpecifier: "@remnic/x", setup: dummySetup }),
248
+ RangeError,
249
+ );
250
+ assert.throws(
251
+ () => registerLocationProviderSetup({ id: "UpperCase", packageSpecifier: "@remnic/x", setup: dummySetup }),
252
+ RangeError,
253
+ );
254
+ assert.throws(
255
+ () => registerLocationProviderSetup({ id: "../traversal", packageSpecifier: "@remnic/x", setup: dummySetup }),
256
+ RangeError,
257
+ );
258
+ assert.throws(
259
+ () => registerLocationProviderSetup({ id: "valid-id", packageSpecifier: " ", setup: dummySetup }),
260
+ TypeError,
261
+ );
262
+ assert.throws(
263
+ () => registerLocationProviderSetup({ id: "reitti", packageSpecifier: "@remnic/other", setup: dummySetup }),
264
+ /already registered/,
265
+ );
266
+
267
+ registerLocationProviderSetup({
268
+ id: "custom-gps",
269
+ packageSpecifier: "@remnic/connector-custom-gps",
270
+ setup: async (context) => {
271
+ await context.loadPackage<OwntracksModule>();
272
+ registerLocationProvider(stubLocationProvider("custom-gps", "Custom GPS"));
273
+ return true;
274
+ },
275
+ });
276
+ assert.deepEqual(listLocationProviderSetups(), ["custom-gps", "reitti"]);
277
+ assert.equal(unregisterLocationProviderSetup("custom-gps"), true);
278
+ assert.equal(unregisterLocationProviderSetup("custom-gps"), false);
279
+
280
+ let loaded = false;
281
+ const skipped = await ensureConfiguredLocationProviders(
282
+ parseLocationConfig({ enabled: true, sources: [{ id: "custom-gps" }] }),
283
+ {
284
+ env: ENV,
285
+ importModule: async () => {
286
+ loaded = true;
287
+ return {};
288
+ },
289
+ },
290
+ );
291
+ assert.deepEqual(skipped, []);
292
+ assert.equal(loaded, false);
293
+
294
+ registerLocationProviderSetup({
295
+ id: "custom-gps",
296
+ packageSpecifier: "@remnic/connector-custom-gps",
297
+ setup: dummySetup,
298
+ });
299
+ resetLocationProviderSetups();
300
+ assert.deepEqual(listLocationProviderSetups(), ["reitti"]);
301
+ });
302
+
303
+ test("absent optional package and load failures on registered custom setup do not throw", async () => {
304
+ const setupCalls: Array<{ baseUrl: string; token: string; timezone: string }> = [];
305
+ registerLocationProviderSetup(makeOwntracksSetupEntry(setupCalls));
306
+ registerLocationProviderSetup({
307
+ id: "second-provider",
308
+ packageSpecifier: "@remnic/connector-second",
309
+ setup: async (context) => {
310
+ const mod = await context.loadPackage<OwntracksModule>();
311
+ return mod.ensureOwntracksRegistered({
312
+ baseUrl: context.env?.baseUrl ?? "",
313
+ token: context.env?.token ?? "",
314
+ timezone: context.config.timezone,
315
+ });
316
+ },
317
+ });
318
+
319
+ const configOne = parseLocationConfig({ enabled: true, sources: [{ id: "owntracks" }] });
320
+ const absent = await ensureConfiguredLocationProviders(configOne, {
321
+ env: ENV,
322
+ importModule: async () => {
323
+ throw Object.assign(new Error("Cannot find module '@remnic/connector-owntracks'"), {
324
+ code: "ERR_MODULE_NOT_FOUND",
325
+ });
326
+ },
327
+ });
328
+ assert.deepEqual(absent, []);
329
+
330
+ const configBoth = parseLocationConfig({
331
+ enabled: true,
332
+ sources: [{ id: "owntracks" }, { id: "second-provider" }],
333
+ });
334
+ const partialAfterFailure = await ensureConfiguredLocationProviders(configBoth, {
335
+ env: ENV,
336
+ importModule: async (specifier: string) => {
337
+ if (specifier === "@remnic/connector-owntracks") {
338
+ throw new Error("syntax error in broken optional package");
339
+ }
340
+ const mod: OwntracksModule = {
341
+ ensureOwntracksRegistered: () => {
342
+ registerLocationProvider(stubLocationProvider("second-provider", "Second"));
343
+ return true;
344
+ },
345
+ };
346
+ return mod;
347
+ },
348
+ });
349
+ assert.deepEqual(partialAfterFailure, ["second-provider"]);
350
+ });
351
+
352
+ test("getSetup dependency overrides global setup lookup", async () => {
353
+ let calledSpecifier = "";
354
+ const injectedEntry: LocationProviderSetupEntry = {
355
+ id: "custom-seam",
356
+ packageSpecifier: "@remnic/connector-seam",
357
+ setup: async (context) => {
358
+ await context.loadPackage<OwntracksModule>();
359
+ registerLocationProvider(stubLocationProvider("custom-seam", "Custom Seam"));
360
+ return true;
361
+ },
362
+ };
363
+
364
+ const registered = await ensureConfiguredLocationProviders(
365
+ parseLocationConfig({ enabled: true, sources: [{ id: "custom-seam" }] }),
366
+ {
367
+ importModule: async (specifier: string) => {
368
+ calledSpecifier = specifier;
369
+ return {};
370
+ },
371
+ getSetup: (id: string) => (id === "custom-seam" ? injectedEntry : undefined),
372
+ },
373
+ );
374
+ assert.deepEqual(registered, ["custom-seam"]);
375
+ assert.equal(calledSpecifier, "@remnic/connector-seam");
376
+ assert.equal(getLocationProviderSetup("custom-seam"), undefined);
377
+ });
@@ -24,21 +24,45 @@ export interface LocationProviderEnv {
24
24
  }
25
25
 
26
26
  export interface LocationProviderSetupDeps {
27
- /** Injectable env (tests); defaults to REITTI_* process variables. */
27
+ /** Injectable env (tests); defaults to provider-specific process variables. */
28
28
  env?: LocationProviderEnv;
29
+ /** Per-source env overrides keyed by provider id. */
30
+ envBySource?: ReadonlyMap<string, LocationProviderEnv>;
29
31
  /** Injectable module loader (tests); defaults to a dynamic import. */
30
32
  importModule?: (specifier: string) => Promise<unknown>;
33
+ /** Injectable setup lookup (tests); defaults to the global setup registry. */
34
+ getSetup?: (id: string) => LocationProviderSetupEntry | undefined;
35
+ }
36
+
37
+ export type LocationProviderPackageLoader = <TModule>() => Promise<TModule>;
38
+
39
+ export interface LocationProviderSetupContext {
40
+ readonly config: LocationConfig;
41
+ readonly env?: LocationProviderEnv;
42
+ readonly loadPackage: LocationProviderPackageLoader;
43
+ }
44
+
45
+ export interface LocationProviderSetupEntry {
46
+ readonly id: string;
47
+ readonly packageSpecifier: string;
48
+ readonly setup: (context: LocationProviderSetupContext) => Promise<boolean>;
49
+ }
50
+
51
+ interface ReittiProviderRegistrationOptions {
52
+ baseUrl: string;
53
+ token: string;
54
+ timezone: string;
55
+ authMode?: "x-api-token" | "bearer";
31
56
  }
32
57
 
33
58
  interface ReittiProviderModule {
34
- ensureReittiProviderRegistered(options: {
35
- baseUrl: string;
36
- token: string;
37
- timezone: string;
38
- authMode?: "x-api-token" | "bearer";
39
- }): boolean;
59
+ ensureReittiProviderRegistered(options: ReittiProviderRegistrationOptions): boolean;
40
60
  }
41
61
 
62
+ const PROVIDER_ID_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
63
+ // Computed scope prefix prevents bundlers from statically resolving optional connectors.
64
+ const OPTIONAL_PACKAGE_SCOPE = "@remnic/";
65
+
42
66
  const loadFailuresWarned = new Set<string>();
43
67
 
44
68
  function readReittiEnv(): LocationProviderEnv {
@@ -49,6 +73,95 @@ function readReittiEnv(): LocationProviderEnv {
49
73
  };
50
74
  }
51
75
 
76
+ const BUILT_IN_LOCATION_PROVIDER_SETUPS: readonly LocationProviderSetupEntry[] = [
77
+ {
78
+ id: "reitti",
79
+ packageSpecifier: `${OPTIONAL_PACKAGE_SCOPE}connector-reitti`,
80
+ async setup(context) {
81
+ const env = context.env ?? readReittiEnv();
82
+ const baseUrl = env.baseUrl?.trim();
83
+ const token = env.token?.trim();
84
+ if (!baseUrl || !token) return false;
85
+ const mod = await context.loadPackage<ReittiProviderModule>();
86
+ const options: ReittiProviderRegistrationOptions = {
87
+ baseUrl,
88
+ token,
89
+ timezone: context.config.timezone,
90
+ };
91
+ if (env.authMode === "x-api-token" || env.authMode === "bearer") {
92
+ options.authMode = env.authMode;
93
+ }
94
+ return mod.ensureReittiProviderRegistered(options);
95
+ },
96
+ },
97
+ ];
98
+
99
+ const providerSetups = new Map<string, LocationProviderSetupEntry>();
100
+
101
+ function seedBuiltInProviderSetups(): void {
102
+ for (const entry of BUILT_IN_LOCATION_PROVIDER_SETUPS) {
103
+ providerSetups.set(entry.id, entry);
104
+ }
105
+ }
106
+
107
+ seedBuiltInProviderSetups();
108
+
109
+ function assertValidProviderSetup(entry: LocationProviderSetupEntry): void {
110
+ if (!entry || !(entry instanceof Object)) {
111
+ throw new TypeError("location provider setup must be an object");
112
+ }
113
+ if (!entry.id || entry.id.constructor !== String || !PROVIDER_ID_PATTERN.test(entry.id)) {
114
+ throw new RangeError(
115
+ "location provider setup id must be a non-empty lowercase kebab string (a-z, 0-9, hyphens)",
116
+ );
117
+ }
118
+ if (
119
+ !entry.packageSpecifier ||
120
+ entry.packageSpecifier.constructor !== String ||
121
+ entry.packageSpecifier.trim().length === 0
122
+ ) {
123
+ throw new TypeError(`location provider setup '${entry.id}' must declare a non-empty packageSpecifier`);
124
+ }
125
+ if (!(entry.setup instanceof Function)) {
126
+ throw new TypeError(`location provider setup '${entry.id}' must implement setup()`);
127
+ }
128
+ }
129
+
130
+ /** Register an optional location provider bootstrap entry for a source id. */
131
+ export function registerLocationProviderSetup(entry: LocationProviderSetupEntry): void {
132
+ assertValidProviderSetup(entry);
133
+ if (providerSetups.has(entry.id)) {
134
+ throw new Error(`location provider setup '${entry.id}' is already registered`);
135
+ }
136
+ providerSetups.set(entry.id, {
137
+ id: entry.id,
138
+ packageSpecifier: entry.packageSpecifier.trim(),
139
+ setup: entry.setup,
140
+ });
141
+ }
142
+
143
+ /** Remove a registered provider setup entry by id. Returns `true` if removed. */
144
+ export function unregisterLocationProviderSetup(id: string): boolean {
145
+ return Boolean(id && id.constructor === String && providerSetups.delete(id));
146
+ }
147
+
148
+ /** Look up a registered provider setup entry by source id. */
149
+ export function getLocationProviderSetup(id: string): LocationProviderSetupEntry | undefined {
150
+ return !id || id.constructor !== String ? undefined : providerSetups.get(id);
151
+ }
152
+
153
+ /** List registered provider setup source ids in sorted order. */
154
+ export function listLocationProviderSetups(): string[] {
155
+ return [...providerSetups.keys()].sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
156
+ }
157
+
158
+ /** Test-only: reset provider setups to built-in defaults and clear warned specifiers. */
159
+ export function resetLocationProviderSetups(): void {
160
+ providerSetups.clear();
161
+ loadFailuresWarned.clear();
162
+ seedBuiltInProviderSetups();
163
+ }
164
+
52
165
  /**
53
166
  * Register every configured+enabled source's provider when its optional
54
167
  * package and credentials are available. Idempotent; returns the ids this
@@ -61,40 +174,33 @@ export async function ensureConfiguredLocationProviders(
61
174
  ): Promise<string[]> {
62
175
  const registered: string[] = [];
63
176
  if (!config.enabled) return registered;
177
+ const load = deps.importModule ?? ((s: string) => import(s));
178
+ const resolveSetup = deps.getSetup ?? getLocationProviderSetup;
64
179
  for (const source of config.sources) {
65
180
  if (!source.enabled) continue;
66
181
  if (getLocationProvider(source.id) !== undefined) continue;
67
- // ponytail: only the `reitti` built-in exists today; add cases here as
68
- // provider packages land — a registry table when there is more than one.
69
- if (source.id !== "reitti") continue;
70
- const env = deps.env ?? readReittiEnv();
71
- const baseUrl = env.baseUrl?.trim();
72
- const token = env.token?.trim();
73
- if (!baseUrl || !token) continue;
74
- const authMode =
75
- env.authMode === "x-api-token" || env.authMode === "bearer" ? env.authMode : undefined;
76
- const specifier = "@remnic/" + "connector-reitti";
77
- const load = deps.importModule ?? ((s: string) => import(s));
182
+ const entry = resolveSetup(source.id);
183
+ if (entry === undefined) continue;
184
+ const env = deps.envBySource?.get(source.id) ?? deps.env;
185
+ const loadPackage: LocationProviderPackageLoader = async <TModule>(): Promise<TModule> => {
186
+ // SAFETY: Dynamic ESM import returns an opaque module namespace; each
187
+ // registered setup entry declares its optional package's export contract.
188
+ return (await load(entry.packageSpecifier)) as TModule;
189
+ };
78
190
  try {
79
- const mod = (await load(specifier)) as ReittiProviderModule;
80
- if (
81
- mod.ensureReittiProviderRegistered({
82
- baseUrl,
83
- token,
84
- timezone: config.timezone,
85
- ...(authMode !== undefined ? { authMode } : {}),
86
- })
87
- ) {
88
- registered.push("reitti");
191
+ if (await entry.setup({ config, env, loadPackage })) {
192
+ registered.push(source.id);
89
193
  }
90
194
  } catch (err) {
91
195
  // Absent optional package is the common case (skip silently); a real
92
196
  // load failure is worth one warn line, never credentials.
93
197
  const message = err instanceof Error ? err.message : String(err);
94
- if (!message.includes(specifier)) {
95
- if (!loadFailuresWarned.has(specifier)) {
96
- loadFailuresWarned.add(specifier);
97
- log.warn(`location: failed to load optional provider package ${specifier}: ${message}`);
198
+ if (!message.includes(entry.packageSpecifier)) {
199
+ if (!loadFailuresWarned.has(entry.packageSpecifier)) {
200
+ loadFailuresWarned.add(entry.packageSpecifier);
201
+ log.warn(
202
+ `location: failed to load optional provider package ${entry.packageSpecifier}: ${message}`,
203
+ );
98
204
  }
99
205
  }
100
206
  }
@@ -283,6 +283,17 @@ test("an unreadable receipt-failure history keeps the gate closed", async () =>
283
283
  assert.ok(result.demotionReasons.includes("recent_receipt_failures"));
284
284
  });
285
285
 
286
+ test("a non-finite receipt-failure count keeps the gate closed", async () => {
287
+ const h = harness();
288
+ h.deps.recorder = {
289
+ ...h.deps.recorder!,
290
+ trailingReceiptFailures: async () => Number.NaN,
291
+ };
292
+ const result = await new MemoryControllerCoordinator(h.deps).run({ prompt: RECALL_PROMPT });
293
+ assert.equal(result.effectiveMode, "shadow");
294
+ assert.ok(result.demotionReasons.includes("recent_receipt_failures"));
295
+ });
296
+
286
297
  test("executor error or missing executor records a failure class and demotes next run", async () => {
287
298
  const h = harness({
288
299
  executors: {
@@ -547,7 +547,11 @@ export class MemoryControllerCoordinator {
547
547
  // Unknown receipt health keeps the gate closed.
548
548
  recorded = 1;
549
549
  }
550
- if (Number.isFinite(recorded) && recorded > this.consecutiveReceiptFailures) {
550
+ if (!Number.isFinite(recorded)) {
551
+ // A count that is not a real number is unreadable history too.
552
+ recorded = 1;
553
+ }
554
+ if (recorded > this.consecutiveReceiptFailures) {
551
555
  this.consecutiveReceiptFailures = recorded;
552
556
  }
553
557
  }