@remnic/core 9.69.35 → 9.69.37

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 (570) hide show
  1. package/dist/access-admin-ops-surface.d.ts +12 -12
  2. package/dist/access-admin-ops-surface.js +35 -35
  3. package/dist/access-authorization-probe.d.ts +12 -12
  4. package/dist/access-authorization-probe.js +36 -36
  5. package/dist/access-boundary.d.ts +12 -12
  6. package/dist/access-boundary.js +35 -35
  7. package/dist/access-cli.js +116 -111
  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 +12 -12
  11. package/dist/access-extraction-force-flush.js +35 -35
  12. package/dist/access-health-types.d.ts +1 -1
  13. package/dist/access-http-briefing.d.ts +12 -12
  14. package/dist/access-http-briefing.js +36 -36
  15. package/dist/access-http-lcm-compaction.d.ts +12 -12
  16. package/dist/access-http-lifecycle-flush.d.ts +12 -12
  17. package/dist/access-http-offline-stream.d.ts +12 -12
  18. package/dist/access-http-query.d.ts +2 -2
  19. package/dist/access-http-query.js +37 -37
  20. package/dist/access-http.d.ts +13 -13
  21. package/dist/access-http.js +55 -55
  22. package/dist/access-identity-continuity-surface.d.ts +10 -10
  23. package/dist/access-identity-continuity-surface.js +35 -35
  24. package/dist/access-lcm-surface.d.ts +12 -12
  25. package/dist/access-lcm-surface.js +35 -35
  26. package/dist/access-mcp.d.ts +12 -12
  27. package/dist/access-mcp.js +44 -44
  28. package/dist/access-memory-search-fanout.d.ts +2 -2
  29. package/dist/{access-namespace-preflight-D8qri11P.d.ts → access-namespace-preflight-CV5cHujx.d.ts} +1 -1
  30. package/dist/access-namespace-preflight.d.ts +3 -3
  31. package/dist/access-namespace-preflight.js +35 -35
  32. package/dist/access-observe-transcript.d.ts +10 -10
  33. package/dist/access-observe-write-surface.d.ts +12 -12
  34. package/dist/access-observe-write-surface.js +35 -35
  35. package/dist/access-offline-manifest.d.ts +10 -10
  36. package/dist/access-offline-manifest.js +2 -2
  37. package/dist/access-operations-batch.js +38 -38
  38. package/dist/access-operations.d.ts +16 -16
  39. package/dist/access-operations.js +43 -43
  40. package/dist/access-recall-concurrency.d.ts +12 -12
  41. package/dist/access-recall-concurrency.js +35 -35
  42. package/dist/access-recall-response.d.ts +12 -12
  43. package/dist/access-recall-response.js +35 -35
  44. package/dist/access-recall-surface.d.ts +12 -12
  45. package/dist/access-recall-surface.js +35 -35
  46. package/dist/access-schema.d.ts +94 -94
  47. package/dist/access-schema.js +3 -3
  48. package/dist/{access-service-CKu5ixg9.d.ts → access-service-DwHC7lcV.d.ts} +71 -71
  49. package/dist/access-service-helpers.d.ts +12 -12
  50. package/dist/access-service.d.ts +12 -12
  51. package/dist/access-service.js +35 -35
  52. package/dist/access-surface-catalog.d.ts +12 -12
  53. package/dist/access-surface-catalog.js +37 -37
  54. package/dist/access-wearables-meetings-surface.d.ts +3 -3
  55. package/dist/action-confidence.d.ts +1 -1
  56. package/dist/active-memory-bridge.d.ts +1 -1
  57. package/dist/active-recall.d.ts +1 -1
  58. package/dist/active-recall.js +4 -3
  59. package/dist/active-recall.js.map +1 -1
  60. package/dist/activity/digest.d.ts +1 -1
  61. package/dist/adapters/index.js +4 -4
  62. package/dist/adapters/registry.js +2 -2
  63. package/dist/ambient-provenance.d.ts +1 -1
  64. package/dist/artifact-search.d.ts +1 -1
  65. package/dist/{auto-sync-4YFATLFQ.js → auto-sync-FSRJDU63.js} +4 -4
  66. package/dist/behavior-learner.d.ts +1 -1
  67. package/dist/behavior-signals.d.ts +1 -1
  68. package/dist/bootstrap.d.ts +10 -10
  69. package/dist/briefing-window.d.ts +2 -2
  70. package/dist/briefing.d.ts +2 -2
  71. package/dist/briefing.js +9 -9
  72. package/dist/buffer-surprise-report.d.ts +1 -1
  73. package/dist/buffer-turn-helpers.d.ts +1 -1
  74. package/dist/buffer.d.ts +2 -2
  75. package/dist/bulk-import/index.d.ts +3 -3
  76. package/dist/calibration.d.ts +1 -1
  77. package/dist/calibration.js +1 -1
  78. package/dist/capabilities.d.ts +1 -1
  79. package/dist/{capsule-crypto-7FJQINUR.js → capsule-crypto-YO5QJ6L3.js} +2 -2
  80. package/dist/{catalog-Bq1AxZwF.d.ts → catalog-Cl4H8N89.d.ts} +1 -1
  81. package/dist/causal-behavior.d.ts +1 -1
  82. package/dist/causal-behavior.js +2 -2
  83. package/dist/causal-chain.js +2 -2
  84. package/dist/causal-consolidation.d.ts +1 -1
  85. package/dist/causal-consolidation.js +12 -12
  86. package/dist/causal-retrieval.js +2 -2
  87. package/dist/causal-trajectory-graph.d.ts +1 -1
  88. package/dist/causal-trajectory-graph.js +2 -2
  89. package/dist/causal-trajectory.js +1 -1
  90. package/dist/{chunk-RUXPVSML.js → chunk-2AR5JFD7.js} +2 -2
  91. package/dist/{chunk-YNN26CIZ.js → chunk-2JGGZICG.js} +2 -2
  92. package/dist/{chunk-A7GQBJP5.js → chunk-2L5FSNPC.js} +10 -10
  93. package/dist/{chunk-XPJNT6PI.js → chunk-2PUE5P7C.js} +7 -3
  94. package/dist/chunk-2PUE5P7C.js.map +1 -0
  95. package/dist/{chunk-27IOSH2W.js → chunk-375ARKRS.js} +32 -11
  96. package/dist/chunk-375ARKRS.js.map +1 -0
  97. package/dist/{chunk-ZTG4P7NZ.js → chunk-3IXB77DA.js} +67 -67
  98. package/dist/{chunk-WHHEPAO3.js → chunk-3K6UFW5B.js} +3 -3
  99. package/dist/{chunk-UBG4GAEP.js → chunk-3OHISDDW.js} +5 -1
  100. package/dist/chunk-3OHISDDW.js.map +1 -0
  101. package/dist/chunk-3SL52JKD.js +160 -0
  102. package/dist/chunk-3SL52JKD.js.map +1 -0
  103. package/dist/{chunk-EEBQFG5E.js → chunk-3YMDY3ZF.js} +10 -10
  104. package/dist/{chunk-5JG5EBVL.js → chunk-4DPDIOVA.js} +2 -2
  105. package/dist/{chunk-UDZYNIDJ.js → chunk-4WGAMREC.js} +2 -2
  106. package/dist/{chunk-HXSAWV3A.js → chunk-57GDHV2D.js} +3 -3
  107. package/dist/{chunk-Z7ACR6MJ.js → chunk-5LLQAUMI.js} +2 -2
  108. package/dist/{chunk-P3ONDDIJ.js → chunk-5SYI2F47.js} +2 -2
  109. package/dist/{chunk-DGS34QSY.js → chunk-6E5GYDIE.js} +2 -2
  110. package/dist/{chunk-J7PB5UQ4.js → chunk-6Z3WW2MW.js} +2 -2
  111. package/dist/{chunk-GLZH5VEN.js → chunk-76DRU7C4.js} +2 -2
  112. package/dist/{chunk-L2QLDZJC.js → chunk-7MJBKZPU.js} +2 -2
  113. package/dist/{chunk-Y63ZFP4X.js → chunk-7RKBPXY6.js} +2 -2
  114. package/dist/chunk-A6CXG5WI.js +51 -0
  115. package/dist/chunk-A6CXG5WI.js.map +1 -0
  116. package/dist/{chunk-JSRVXI6E.js → chunk-B2YKTE7P.js} +4 -4
  117. package/dist/{chunk-Z3O53WZR.js → chunk-BICNRVEC.js} +2 -2
  118. package/dist/{chunk-BNGHPYZU.js → chunk-BLHX5FQW.js} +2 -2
  119. package/dist/{chunk-7CBKAQIG.js → chunk-BOADKFN4.js} +28 -4
  120. package/dist/chunk-BOADKFN4.js.map +1 -0
  121. package/dist/{chunk-2NLLXCJG.js → chunk-BXLOS5AJ.js} +2 -2
  122. package/dist/{chunk-776GVKL7.js → chunk-CD3C4BJN.js} +2 -2
  123. package/dist/{chunk-LMCD5W5B.js → chunk-CIYUWSMZ.js} +2 -2
  124. package/dist/{chunk-YJ6VCDMZ.js → chunk-CQ7SSBO4.js} +2 -2
  125. package/dist/{chunk-CNV2A557.js → chunk-CYEMS2PG.js} +2 -2
  126. package/dist/{chunk-DVOBLPSQ.js → chunk-D2DIYEFW.js} +6 -6
  127. package/dist/chunk-D2DIYEFW.js.map +1 -0
  128. package/dist/{chunk-OQ7SSRXP.js → chunk-DOKKRZPH.js} +21 -17
  129. package/dist/chunk-DOKKRZPH.js.map +1 -0
  130. package/dist/{chunk-UYUCCQ46.js → chunk-DOQLHCSS.js} +2 -2
  131. package/dist/{chunk-X7Y7WX73.js → chunk-DQEMWVMT.js} +1 -1
  132. package/dist/{chunk-RRZKTSFG.js → chunk-FCFAYMTU.js} +2 -2
  133. package/dist/{chunk-R4OCGPSH.js → chunk-FJMYMJLR.js} +2 -2
  134. package/dist/{chunk-TKFSXDOB.js → chunk-FLLORID2.js} +2 -2
  135. package/dist/{chunk-QATYVTP7.js → chunk-FPQDZCUX.js} +2 -2
  136. package/dist/{chunk-L2WQVSKP.js → chunk-G5MO3VQA.js} +2 -2
  137. package/dist/{chunk-LNDLXMH6.js → chunk-GDDSXVWR.js} +2 -2
  138. package/dist/{chunk-JZ2CHRLB.js → chunk-GHX5PNXW.js} +2 -2
  139. package/dist/{chunk-2BQ4ZIWC.js → chunk-GNR6YEWZ.js} +5 -5
  140. package/dist/{chunk-5FAGCOZD.js → chunk-GWK7FEUL.js} +4 -4
  141. package/dist/{chunk-SCXURCVT.js → chunk-GWQVMKUJ.js} +3 -3
  142. package/dist/{chunk-QBLDCI6E.js → chunk-HHDTBYDJ.js} +2 -2
  143. package/dist/{chunk-2YLMUME2.js → chunk-IQZ6ISFX.js} +2 -2
  144. package/dist/chunk-JE26AUX6.js +16 -0
  145. package/dist/chunk-JE26AUX6.js.map +1 -0
  146. package/dist/{chunk-AJTG3CP7.js → chunk-JHU4EYDV.js} +11 -1
  147. package/dist/chunk-JHU4EYDV.js.map +1 -0
  148. package/dist/{chunk-JHZCXUQI.js → chunk-JLXWRQNR.js} +33 -33
  149. package/dist/{chunk-FVJ4D6L7.js → chunk-JMPYZJQN.js} +1 -1
  150. package/dist/{chunk-HC4GFLMQ.js → chunk-JO5TQAKW.js} +3 -3
  151. package/dist/{chunk-ZBEGS7OB.js → chunk-JPKZTCWZ.js} +3 -3
  152. package/dist/{chunk-AZSKROVQ.js → chunk-JYR4LH76.js} +2 -2
  153. package/dist/{chunk-ECKG5WSI.js → chunk-JZYECQWN.js} +2 -2
  154. package/dist/{chunk-NPNSKE76.js → chunk-KTRXQQFN.js} +2 -2
  155. package/dist/{chunk-LEMD7WZJ.js → chunk-KUK56OPR.js} +62 -17
  156. package/dist/chunk-KUK56OPR.js.map +1 -0
  157. package/dist/{chunk-HUT2JR6I.js → chunk-L5OXE4PX.js} +2 -2
  158. package/dist/{chunk-B3O3IRZN.js → chunk-LMMQKZK3.js} +1 -1
  159. package/dist/{chunk-QURNMKME.js → chunk-LSDEIZ76.js} +2 -2
  160. package/dist/{chunk-XCOV45MO.js → chunk-MR6LQVZ5.js} +2 -2
  161. package/dist/chunk-OEBLZZKK.js +53 -0
  162. package/dist/chunk-OEBLZZKK.js.map +1 -0
  163. package/dist/{chunk-6J6K3STG.js → chunk-OTPXEE6W.js} +6 -6
  164. package/dist/{chunk-LYDJRF45.js → chunk-PNEDMJ53.js} +2 -2
  165. package/dist/{chunk-MPAJFFP3.js → chunk-PPTOAHTZ.js} +4 -4
  166. package/dist/{chunk-MPAJFFP3.js.map → chunk-PPTOAHTZ.js.map} +1 -1
  167. package/dist/{chunk-JRWW7GM6.js → chunk-Q6D7EUSQ.js} +7 -7
  168. package/dist/{chunk-VYXDUPYE.js → chunk-Q7JK6YEB.js} +2 -2
  169. package/dist/chunk-QJ2AX6DU.js +19 -0
  170. package/dist/chunk-QJ2AX6DU.js.map +1 -0
  171. package/dist/{chunk-4MDKNUV4.js → chunk-RN3MVLW3.js} +1 -1
  172. package/dist/chunk-RN3MVLW3.js.map +1 -0
  173. package/dist/{chunk-YXLUTALO.js → chunk-SAKA6PPL.js} +2 -2
  174. package/dist/{chunk-HWLIMQE2.js → chunk-SF6RFI5Z.js} +2 -2
  175. package/dist/{chunk-OS2AT2JU.js → chunk-SROIT6QY.js} +5 -5
  176. package/dist/{chunk-S5G2LAL7.js → chunk-SV4Z2S67.js} +4 -4
  177. package/dist/{chunk-DK4X5B6I.js → chunk-TFRDUD3M.js} +2 -2
  178. package/dist/{chunk-JR6H5CYS.js → chunk-TL7NLM2L.js} +2 -2
  179. package/dist/{chunk-NN4JEFON.js → chunk-TRU6JBOI.js} +2 -2
  180. package/dist/{chunk-PHP3MUGF.js → chunk-UYVXIY6C.js} +2 -2
  181. package/dist/{chunk-KQAFEZQX.js → chunk-VDX2J7OX.js} +2 -2
  182. package/dist/{chunk-ZHXSOMYH.js → chunk-VVX5PZFS.js} +2 -2
  183. package/dist/{chunk-BJETIR53.js → chunk-WS3WNLST.js} +3 -3
  184. package/dist/{chunk-3FJKJ5UZ.js → chunk-X7BCM2NA.js} +2 -2
  185. package/dist/{chunk-Q4AUIFUA.js → chunk-XAITGGX5.js} +4 -4
  186. package/dist/{chunk-WPDKBUWX.js → chunk-XCF3SFHD.js} +2 -2
  187. package/dist/{chunk-LO4UKPKX.js → chunk-YHU5XUF4.js} +2 -2
  188. package/dist/{chunk-F6IVBYFS.js → chunk-YIZ2EUUL.js} +51 -51
  189. package/dist/{chunk-EZ25VE3G.js → chunk-YNDLCWXS.js} +4 -4
  190. package/dist/{chunk-5VAF4ID4.js → chunk-ZEPVWLCN.js} +9 -9
  191. package/dist/{cli-Bk7Ctql4.d.ts → cli-1mzd5TM4.d.ts} +5 -5
  192. package/dist/cli.d.ts +14 -14
  193. package/dist/cli.js +79 -78
  194. package/dist/coding/export-okf-codegraph.d.ts +1 -1
  195. package/dist/coding/export-okf-codegraph.js +8 -8
  196. package/dist/coding/pre-action-gate.d.ts +1 -1
  197. package/dist/coding/pre-action-gate.js +2 -2
  198. package/dist/compounding/engine.d.ts +2 -2
  199. package/dist/compounding/engine.js +9 -9
  200. package/dist/compounding/preference-consolidator.d.ts +1 -1
  201. package/dist/compression-optimizer.d.ts +1 -1
  202. package/dist/config.d.ts +1 -1
  203. package/dist/config.js +4 -3
  204. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  205. package/dist/connectors/codex-materialize-runner.js +9 -9
  206. package/dist/connectors/codex-materialize.d.ts +1 -1
  207. package/dist/connectors/index.d.ts +1 -1
  208. package/dist/connectors/index.js +9 -9
  209. package/dist/consolidation-provenance-check.d.ts +2 -2
  210. package/dist/consolidation-undo.d.ts +2 -2
  211. package/dist/contradiction/index.d.ts +3 -3
  212. package/dist/converge-config.d.ts +1 -1
  213. package/dist/convergence-refresh.d.ts +2 -2
  214. package/dist/convergence-refresh.js +11 -11
  215. package/dist/conversation-index/backend.d.ts +1 -1
  216. package/dist/conversation-index/chunker.d.ts +1 -1
  217. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  218. package/dist/conversation-index/indexer.d.ts +1 -1
  219. package/dist/conversation-index/search.d.ts +1 -1
  220. package/dist/corpus-watermark.d.ts +1 -1
  221. package/dist/corpus-watermark.js +11 -11
  222. package/dist/cross-lingual-recall.d.ts +1 -1
  223. package/dist/dashboard-runtime.js +2 -2
  224. package/dist/day-summary.d.ts +1 -1
  225. package/dist/deep-recall-http-glue.d.ts +12 -12
  226. package/dist/deep-recall-http-glue.js +4 -4
  227. package/dist/deep-recall-mcp-tools.d.ts +12 -12
  228. package/dist/deep-recall-policy-llm.d.ts +1 -1
  229. package/dist/deep-recall-seeds.d.ts +1 -1
  230. package/dist/deep-recall.js +2 -2
  231. package/dist/delinearize.d.ts +1 -1
  232. package/dist/dependency-propagation-config.d.ts +1 -1
  233. package/dist/{dependency-propagation-delivery-DLiAtj25.d.ts → dependency-propagation-delivery-Bua2ApHV.d.ts} +1 -1
  234. package/dist/direct-answer-wiring.d.ts +1 -1
  235. package/dist/direct-answer.d.ts +1 -1
  236. package/dist/embedding-fallback.d.ts +1 -1
  237. package/dist/enrichment/index.d.ts +1 -1
  238. package/dist/entity-origin-fields.d.ts +1 -1
  239. package/dist/entity-retrieval.d.ts +2 -2
  240. package/dist/entity-retrieval.js +9 -9
  241. package/dist/entity-schema.d.ts +1 -1
  242. package/dist/episodic-context.d.ts +1 -1
  243. package/dist/eval-trajectory-contracts.d.ts +1 -1
  244. package/dist/eval-trajectory-store.d.ts +1 -1
  245. package/dist/eval-trajectory.d.ts +1 -1
  246. package/dist/explicit-capture.d.ts +10 -10
  247. package/dist/external-wiki-access.d.ts +12 -12
  248. package/dist/external-wiki-access.js +36 -36
  249. package/dist/external-wiki-collection-registration.d.ts +1 -1
  250. package/dist/external-wiki-collection.d.ts +1 -1
  251. package/dist/external-wiki-mcp-tools.d.ts +12 -12
  252. package/dist/extraction-error-classification.d.ts +1 -1
  253. package/dist/extraction-faithfulness.d.ts +1 -1
  254. package/dist/extraction-judge-telemetry.d.ts +1 -1
  255. package/dist/extraction-judge-training.d.ts +1 -1
  256. package/dist/extraction-judge.d.ts +1 -1
  257. package/dist/extraction-judge.js +2 -2
  258. package/dist/extraction-liveness.d.ts +1 -1
  259. package/dist/extraction-normalization.d.ts +1 -1
  260. package/dist/extraction-normalization.js +2 -2
  261. package/dist/extraction-prompt.d.ts +11 -2
  262. package/dist/extraction-prompt.js +7 -3
  263. package/dist/extraction-source-grounding-rules.d.ts +3 -2
  264. package/dist/extraction-source-grounding-rules.js +1 -1
  265. package/dist/extraction-source-grounding.d.ts +2 -2
  266. package/dist/extraction-source-grounding.js +2 -2
  267. package/dist/extraction-span-config.d.ts +15 -0
  268. package/dist/extraction-span-config.js +15 -0
  269. package/dist/extraction-span-materialize.d.ts +105 -0
  270. package/dist/extraction-span-materialize.js +30 -0
  271. package/dist/extraction-span-materialize.js.map +1 -0
  272. package/dist/extraction-span-slice.js +3 -12
  273. package/dist/extraction-span-slice.js.map +1 -1
  274. package/dist/extraction-span-source-hash.js +4 -46
  275. package/dist/extraction-span-source-hash.js.map +1 -1
  276. package/dist/extraction-span-validate.js +3 -15
  277. package/dist/extraction-span-validate.js.map +1 -1
  278. package/dist/extraction.d.ts +7 -1
  279. package/dist/extraction.js +20 -16
  280. package/dist/fallback-llm.d.ts +1 -1
  281. package/dist/{first-start-migration-L3UFX5CU.js → first-start-migration-GZ45G5FS.js} +4 -4
  282. package/dist/{generic-recall-paths-DbitKJI5.d.ts → generic-recall-paths-DJBADojG.d.ts} +1 -1
  283. package/dist/graph-append-error.d.ts +1 -1
  284. package/dist/graph-dashboard-diff.d.ts +1 -1
  285. package/dist/graph-dashboard-key.d.ts +1 -1
  286. package/dist/graph-dashboard-parser.d.ts +1 -1
  287. package/dist/{graph-edge-decay-MKIRZ762.js → graph-edge-decay-ROSUPDX3.js} +5 -5
  288. package/dist/graph-edge-decay-ROSUPDX3.js.map +1 -0
  289. package/dist/graph-edge-reinforcement.d.ts +1 -1
  290. package/dist/graph-jsonl.d.ts +1 -1
  291. package/dist/graph-jsonl.js +3 -3
  292. package/dist/graph-path-reconstruction.d.ts +1 -1
  293. package/dist/graph-path-scoring.d.ts +1 -1
  294. package/dist/graph-snapshot.d.ts +1 -1
  295. package/dist/graph-snapshot.js +3 -3
  296. package/dist/graph.d.ts +1 -1
  297. package/dist/graph.js +2 -2
  298. package/dist/harmonic-retrieval.js +1 -1
  299. package/dist/importance.d.ts +1 -1
  300. package/dist/importers/index.d.ts +1 -1
  301. package/dist/importers/test-utils.d.ts +1 -1
  302. package/dist/in-flight-reads.d.ts +1 -1
  303. package/dist/{index-BINUgPFo.d.ts → index-Bsy8ygLL.d.ts} +2 -2
  304. package/dist/index.d.ts +700 -700
  305. package/dist/index.js +147 -142
  306. package/dist/intent.d.ts +1 -1
  307. package/dist/lcm/engine.d.ts +1 -1
  308. package/dist/lcm/engine.js +4 -4
  309. package/dist/lcm/index.d.ts +1 -1
  310. package/dist/lcm/index.js +9 -9
  311. package/dist/lcm/tools.d.ts +1 -1
  312. package/dist/lifecycle.d.ts +1 -1
  313. package/dist/live-connectors-runner.d.ts +1 -1
  314. package/dist/local-llm.d.ts +1 -1
  315. package/dist/local-model-endpoint.d.ts +1 -1
  316. package/dist/location/index.d.ts +3 -3
  317. package/dist/location/index.js +11 -11
  318. package/dist/maintenance/memory-governance.d.ts +1 -1
  319. package/dist/maintenance/memory-governance.js +9 -9
  320. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
  321. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +9 -9
  322. package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
  323. package/dist/maintenance/rebuild-memory-projection.js +10 -10
  324. package/dist/{maintenance-ag1gYztC.d.ts → maintenance-DItyBwTC.d.ts} +3 -3
  325. package/dist/mcp-memory-inspector-app.d.ts +12 -12
  326. package/dist/memory-action-policy.d.ts +1 -1
  327. package/dist/memory-cache.d.ts +1 -1
  328. package/dist/memory-controller.d.ts +1 -1
  329. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  330. package/dist/memory-projection-store.d.ts +1 -1
  331. package/dist/memory-provenance.d.ts +1 -1
  332. package/dist/memory-snapshot.d.ts +1 -1
  333. package/dist/memory-subject-cli.d.ts +12 -12
  334. package/dist/memory-subject.d.ts +12 -12
  335. package/dist/memory-worth-outcomes.d.ts +2 -2
  336. package/dist/models-json.d.ts +1 -1
  337. package/dist/namespaces/migrate.d.ts +3 -3
  338. package/dist/namespaces/migrate.js +10 -10
  339. package/dist/namespaces/principal.d.ts +1 -1
  340. package/dist/namespaces/search.d.ts +1 -1
  341. package/dist/namespaces/search.js +5 -5
  342. package/dist/namespaces/storage.d.ts +3 -3
  343. package/dist/namespaces/storage.js +9 -9
  344. package/dist/native-knowledge.d.ts +1 -1
  345. package/dist/offline-sync-impression-drain.d.ts +1 -1
  346. package/dist/operator-doctor-corpus.d.ts +1 -1
  347. package/dist/operator-doctor-corpus.js +12 -12
  348. package/dist/operator-doctor-replica.d.ts +1 -1
  349. package/dist/operator-toolkit.d.ts +3 -3
  350. package/dist/operator-toolkit.js +23 -22
  351. package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
  352. package/dist/orchestration/maintenance.d.ts +4 -4
  353. package/dist/orchestration/maintenance.js +17 -17
  354. package/dist/{orchestrator-Cf3G-3Ed.d.ts → orchestrator-DBUX-aAM.d.ts} +9 -9
  355. package/dist/orchestrator.d.ts +10 -10
  356. package/dist/orchestrator.js +117 -112
  357. package/dist/patterns-cli.d.ts +1 -1
  358. package/dist/{pipeline-AwB03fw_.d.ts → pipeline-BqgcOk1Z.d.ts} +1 -1
  359. package/dist/policy-runtime.d.ts +1 -1
  360. package/dist/proactive-contention.d.ts +1 -1
  361. package/dist/provenance.d.ts +1 -1
  362. package/dist/{public-http-BetSQn7q.d.ts → public-http-CqtZ5kv3.d.ts} +1 -1
  363. package/dist/{qmd-Bfaydrfm.d.ts → qmd-BD0ikV_Y.d.ts} +1 -1
  364. package/dist/qmd-preflight.d.ts +2 -2
  365. package/dist/qmd-recall-cache.d.ts +1 -1
  366. package/dist/qmd.d.ts +2 -2
  367. package/dist/recall-concurrency-config.d.ts +1 -1
  368. package/dist/recall-disclosure-escalation.d.ts +1 -1
  369. package/dist/recall-explain-renderer.d.ts +1 -1
  370. package/dist/recall-explain-renderer.js +3 -3
  371. package/dist/recall-memory-map.d.ts +1 -1
  372. package/dist/recall-navigate-access.d.ts +1 -1
  373. package/dist/recall-navigate-access.js +2 -2
  374. package/dist/recall-navigate-disclosure.d.ts +1 -1
  375. package/dist/recall-navigate-disclosure.js +1 -1
  376. package/dist/recall-navigate.d.ts +1 -1
  377. package/dist/recall-navigate.js +2 -2
  378. package/dist/recall-planner-llm.d.ts +1 -1
  379. package/dist/recall-state-view-admission.d.ts +2 -2
  380. package/dist/recall-state.d.ts +1 -1
  381. package/dist/recall-tag-filter.d.ts +1 -1
  382. package/dist/recall-timings.d.ts +1 -1
  383. package/dist/recall-xray-cli.d.ts +1 -1
  384. package/dist/recall-xray-cli.js +4 -4
  385. package/dist/recall-xray-renderer.d.ts +1 -1
  386. package/dist/recall-xray-renderer.js +3 -3
  387. package/dist/recall-xray.d.ts +1 -1
  388. package/dist/recall-xray.js +2 -2
  389. package/dist/reconcile/cursor.d.ts +1 -1
  390. package/dist/reconcile/manifest.d.ts +11 -2
  391. package/dist/reconcile/manifest.js +5 -3
  392. package/dist/reconcile/plan.d.ts +1 -1
  393. package/dist/replay/normalizers/chatgpt.d.ts +1 -1
  394. package/dist/replay/normalizers/claude.d.ts +1 -1
  395. package/dist/replay/normalizers/openclaw.d.ts +1 -1
  396. package/dist/replay/normalizers/shared.d.ts +1 -1
  397. package/dist/replay/runner.d.ts +1 -1
  398. package/dist/replay/types.d.ts +1 -1
  399. package/dist/replica-divergence.d.ts +1 -1
  400. package/dist/replica-peers-config.d.ts +1 -1
  401. package/dist/resolve-auth-token.d.ts +1 -1
  402. package/dist/resume-bundles.js +5 -4
  403. package/dist/retrieval-agents.d.ts +2 -2
  404. package/dist/retrieval-tiers.d.ts +1 -1
  405. package/dist/routing/engine.d.ts +1 -1
  406. package/dist/routing/store.d.ts +1 -1
  407. package/dist/salvage-envelope.d.ts +1 -1
  408. package/dist/schemas.d.ts +386 -176
  409. package/dist/schemas.js +1 -1
  410. package/dist/{scope-profiles-nxTKvjE-.d.ts → scope-profiles-BIJMsd0B.d.ts} +1 -1
  411. package/dist/search/embed-helper.d.ts +1 -1
  412. package/dist/search/factory.d.ts +1 -1
  413. package/dist/search/factory.js +4 -4
  414. package/dist/search/index.d.ts +1 -1
  415. package/dist/search/index.js +10 -10
  416. package/dist/search/lancedb-backend.d.ts +1 -1
  417. package/dist/search/meilisearch-backend.d.ts +1 -1
  418. package/dist/search/noop-backend.d.ts +1 -1
  419. package/dist/search/orama-backend.d.ts +1 -1
  420. package/dist/search/port.d.ts +1 -1
  421. package/dist/search/remote-backend.d.ts +1 -1
  422. package/dist/{semantic-consolidation-C83DVakV.d.ts → semantic-consolidation-D7sJocll.d.ts} +1 -1
  423. package/dist/semantic-consolidation.d.ts +2 -2
  424. package/dist/semantic-consolidation.js +10 -10
  425. package/dist/semantic-rule-promotion.js +9 -9
  426. package/dist/semantic-rule-verifier.d.ts +1 -1
  427. package/dist/semantic-rule-verifier.js +9 -9
  428. package/dist/{service-q-xtOoAr.d.ts → service-fwgEngUj.d.ts} +2 -2
  429. package/dist/session-observer-bands.d.ts +1 -1
  430. package/dist/session-observer-state.d.ts +1 -1
  431. package/dist/shared-context/manager.d.ts +7 -7
  432. package/dist/signal.d.ts +1 -1
  433. package/dist/source-agent-qualifier.d.ts +1 -1
  434. package/dist/source-agent-qualifier.js +12 -12
  435. package/dist/standup/build.js +9 -9
  436. package/dist/{storage-Ca0MbTfm.d.ts → storage-Cbll3-Tk.d.ts} +1 -1
  437. package/dist/storage.d.ts +2 -2
  438. package/dist/storage.js +8 -8
  439. package/dist/subject-config.d.ts +1 -1
  440. package/dist/summarizer.d.ts +1 -1
  441. package/dist/summary-snapshot.d.ts +1 -1
  442. package/dist/support-passport/index.d.ts +15 -15
  443. package/dist/support-passport/index.js +38 -38
  444. package/dist/temporal-supersession.d.ts +2 -2
  445. package/dist/temporal-timeline-recall.d.ts +1 -1
  446. package/dist/temporal-validity.d.ts +1 -1
  447. package/dist/threading.d.ts +1 -1
  448. package/dist/tier-migration.d.ts +2 -2
  449. package/dist/tier-routing.d.ts +1 -1
  450. package/dist/topics.d.ts +1 -1
  451. package/dist/transcript.d.ts +1 -1
  452. package/dist/transfer/backup.js +2 -2
  453. package/dist/transfer/capsule-export.js +2 -2
  454. package/dist/transfer/capsule-import.js +2 -2
  455. package/dist/transfer/export-okf.d.ts +1 -1
  456. package/dist/transfer/export-okf.js +9 -9
  457. package/dist/transfer/types.d.ts +98 -98
  458. package/dist/trust-score-stage.d.ts +1 -1
  459. package/dist/trust-score.d.ts +1 -1
  460. package/dist/{types-yDgWDkrJ.d.ts → types-48sPkWB0.d.ts} +49 -10
  461. package/dist/types.d.ts +1 -1
  462. package/dist/types.js +1 -1
  463. package/dist/utility-runtime.d.ts +1 -1
  464. package/dist/verified-recall.js +9 -9
  465. package/dist/who-knows-cli.d.ts +12 -12
  466. package/dist/who-knows-cli.js +10 -10
  467. package/dist/who-knows.d.ts +12 -12
  468. package/dist/who-knows.js +9 -9
  469. package/dist/write-envelope.d.ts +1 -1
  470. package/package.json +42 -2
  471. package/src/access-http.test.ts +43 -5
  472. package/src/access-http.ts +2 -0
  473. package/src/config.ts +2 -2
  474. package/src/extraction-prompt.ts +37 -3
  475. package/src/extraction-source-grounding-rules.ts +46 -9
  476. package/src/extraction-source-grounding.ts +2 -1
  477. package/src/extraction-span-config.ts +81 -0
  478. package/src/extraction-span-materialize.test.ts +376 -0
  479. package/src/extraction-span-materialize.ts +241 -0
  480. package/src/extraction.ts +70 -25
  481. package/src/reconcile/manifest.test.ts +11 -1
  482. package/src/reconcile/manifest.ts +12 -0
  483. package/src/schemas.ts +14 -0
  484. package/src/source-agent-qualifier.ts +5 -1
  485. package/src/testing/subjects/extraction-lifecycle.test.ts +27 -10
  486. package/src/types.ts +9 -9
  487. package/dist/chunk-27IOSH2W.js.map +0 -1
  488. package/dist/chunk-4MDKNUV4.js.map +0 -1
  489. package/dist/chunk-7CBKAQIG.js.map +0 -1
  490. package/dist/chunk-AJTG3CP7.js.map +0 -1
  491. package/dist/chunk-DVOBLPSQ.js.map +0 -1
  492. package/dist/chunk-LEMD7WZJ.js.map +0 -1
  493. package/dist/chunk-OQ7SSRXP.js.map +0 -1
  494. package/dist/chunk-UBG4GAEP.js.map +0 -1
  495. package/dist/chunk-XPJNT6PI.js.map +0 -1
  496. /package/dist/{auto-sync-4YFATLFQ.js.map → auto-sync-FSRJDU63.js.map} +0 -0
  497. /package/dist/{capsule-crypto-7FJQINUR.js.map → capsule-crypto-YO5QJ6L3.js.map} +0 -0
  498. /package/dist/{chunk-RUXPVSML.js.map → chunk-2AR5JFD7.js.map} +0 -0
  499. /package/dist/{chunk-YNN26CIZ.js.map → chunk-2JGGZICG.js.map} +0 -0
  500. /package/dist/{chunk-A7GQBJP5.js.map → chunk-2L5FSNPC.js.map} +0 -0
  501. /package/dist/{chunk-ZTG4P7NZ.js.map → chunk-3IXB77DA.js.map} +0 -0
  502. /package/dist/{chunk-WHHEPAO3.js.map → chunk-3K6UFW5B.js.map} +0 -0
  503. /package/dist/{chunk-EEBQFG5E.js.map → chunk-3YMDY3ZF.js.map} +0 -0
  504. /package/dist/{chunk-5JG5EBVL.js.map → chunk-4DPDIOVA.js.map} +0 -0
  505. /package/dist/{chunk-UDZYNIDJ.js.map → chunk-4WGAMREC.js.map} +0 -0
  506. /package/dist/{chunk-HXSAWV3A.js.map → chunk-57GDHV2D.js.map} +0 -0
  507. /package/dist/{chunk-Z7ACR6MJ.js.map → chunk-5LLQAUMI.js.map} +0 -0
  508. /package/dist/{chunk-P3ONDDIJ.js.map → chunk-5SYI2F47.js.map} +0 -0
  509. /package/dist/{chunk-DGS34QSY.js.map → chunk-6E5GYDIE.js.map} +0 -0
  510. /package/dist/{chunk-J7PB5UQ4.js.map → chunk-6Z3WW2MW.js.map} +0 -0
  511. /package/dist/{chunk-GLZH5VEN.js.map → chunk-76DRU7C4.js.map} +0 -0
  512. /package/dist/{chunk-L2QLDZJC.js.map → chunk-7MJBKZPU.js.map} +0 -0
  513. /package/dist/{chunk-Y63ZFP4X.js.map → chunk-7RKBPXY6.js.map} +0 -0
  514. /package/dist/{chunk-JSRVXI6E.js.map → chunk-B2YKTE7P.js.map} +0 -0
  515. /package/dist/{chunk-Z3O53WZR.js.map → chunk-BICNRVEC.js.map} +0 -0
  516. /package/dist/{chunk-BNGHPYZU.js.map → chunk-BLHX5FQW.js.map} +0 -0
  517. /package/dist/{chunk-2NLLXCJG.js.map → chunk-BXLOS5AJ.js.map} +0 -0
  518. /package/dist/{chunk-776GVKL7.js.map → chunk-CD3C4BJN.js.map} +0 -0
  519. /package/dist/{chunk-LMCD5W5B.js.map → chunk-CIYUWSMZ.js.map} +0 -0
  520. /package/dist/{chunk-YJ6VCDMZ.js.map → chunk-CQ7SSBO4.js.map} +0 -0
  521. /package/dist/{chunk-CNV2A557.js.map → chunk-CYEMS2PG.js.map} +0 -0
  522. /package/dist/{chunk-UYUCCQ46.js.map → chunk-DOQLHCSS.js.map} +0 -0
  523. /package/dist/{chunk-X7Y7WX73.js.map → chunk-DQEMWVMT.js.map} +0 -0
  524. /package/dist/{chunk-RRZKTSFG.js.map → chunk-FCFAYMTU.js.map} +0 -0
  525. /package/dist/{chunk-R4OCGPSH.js.map → chunk-FJMYMJLR.js.map} +0 -0
  526. /package/dist/{chunk-TKFSXDOB.js.map → chunk-FLLORID2.js.map} +0 -0
  527. /package/dist/{chunk-QATYVTP7.js.map → chunk-FPQDZCUX.js.map} +0 -0
  528. /package/dist/{chunk-L2WQVSKP.js.map → chunk-G5MO3VQA.js.map} +0 -0
  529. /package/dist/{chunk-LNDLXMH6.js.map → chunk-GDDSXVWR.js.map} +0 -0
  530. /package/dist/{chunk-JZ2CHRLB.js.map → chunk-GHX5PNXW.js.map} +0 -0
  531. /package/dist/{chunk-2BQ4ZIWC.js.map → chunk-GNR6YEWZ.js.map} +0 -0
  532. /package/dist/{chunk-5FAGCOZD.js.map → chunk-GWK7FEUL.js.map} +0 -0
  533. /package/dist/{chunk-SCXURCVT.js.map → chunk-GWQVMKUJ.js.map} +0 -0
  534. /package/dist/{chunk-QBLDCI6E.js.map → chunk-HHDTBYDJ.js.map} +0 -0
  535. /package/dist/{chunk-2YLMUME2.js.map → chunk-IQZ6ISFX.js.map} +0 -0
  536. /package/dist/{chunk-JHZCXUQI.js.map → chunk-JLXWRQNR.js.map} +0 -0
  537. /package/dist/{chunk-FVJ4D6L7.js.map → chunk-JMPYZJQN.js.map} +0 -0
  538. /package/dist/{chunk-HC4GFLMQ.js.map → chunk-JO5TQAKW.js.map} +0 -0
  539. /package/dist/{chunk-ZBEGS7OB.js.map → chunk-JPKZTCWZ.js.map} +0 -0
  540. /package/dist/{chunk-AZSKROVQ.js.map → chunk-JYR4LH76.js.map} +0 -0
  541. /package/dist/{chunk-ECKG5WSI.js.map → chunk-JZYECQWN.js.map} +0 -0
  542. /package/dist/{chunk-NPNSKE76.js.map → chunk-KTRXQQFN.js.map} +0 -0
  543. /package/dist/{chunk-HUT2JR6I.js.map → chunk-L5OXE4PX.js.map} +0 -0
  544. /package/dist/{chunk-B3O3IRZN.js.map → chunk-LMMQKZK3.js.map} +0 -0
  545. /package/dist/{chunk-QURNMKME.js.map → chunk-LSDEIZ76.js.map} +0 -0
  546. /package/dist/{chunk-XCOV45MO.js.map → chunk-MR6LQVZ5.js.map} +0 -0
  547. /package/dist/{chunk-6J6K3STG.js.map → chunk-OTPXEE6W.js.map} +0 -0
  548. /package/dist/{chunk-LYDJRF45.js.map → chunk-PNEDMJ53.js.map} +0 -0
  549. /package/dist/{chunk-JRWW7GM6.js.map → chunk-Q6D7EUSQ.js.map} +0 -0
  550. /package/dist/{chunk-VYXDUPYE.js.map → chunk-Q7JK6YEB.js.map} +0 -0
  551. /package/dist/{chunk-YXLUTALO.js.map → chunk-SAKA6PPL.js.map} +0 -0
  552. /package/dist/{chunk-HWLIMQE2.js.map → chunk-SF6RFI5Z.js.map} +0 -0
  553. /package/dist/{chunk-OS2AT2JU.js.map → chunk-SROIT6QY.js.map} +0 -0
  554. /package/dist/{chunk-S5G2LAL7.js.map → chunk-SV4Z2S67.js.map} +0 -0
  555. /package/dist/{chunk-DK4X5B6I.js.map → chunk-TFRDUD3M.js.map} +0 -0
  556. /package/dist/{chunk-JR6H5CYS.js.map → chunk-TL7NLM2L.js.map} +0 -0
  557. /package/dist/{chunk-NN4JEFON.js.map → chunk-TRU6JBOI.js.map} +0 -0
  558. /package/dist/{chunk-PHP3MUGF.js.map → chunk-UYVXIY6C.js.map} +0 -0
  559. /package/dist/{chunk-KQAFEZQX.js.map → chunk-VDX2J7OX.js.map} +0 -0
  560. /package/dist/{chunk-ZHXSOMYH.js.map → chunk-VVX5PZFS.js.map} +0 -0
  561. /package/dist/{chunk-BJETIR53.js.map → chunk-WS3WNLST.js.map} +0 -0
  562. /package/dist/{chunk-3FJKJ5UZ.js.map → chunk-X7BCM2NA.js.map} +0 -0
  563. /package/dist/{chunk-Q4AUIFUA.js.map → chunk-XAITGGX5.js.map} +0 -0
  564. /package/dist/{chunk-WPDKBUWX.js.map → chunk-XCF3SFHD.js.map} +0 -0
  565. /package/dist/{chunk-LO4UKPKX.js.map → chunk-YHU5XUF4.js.map} +0 -0
  566. /package/dist/{chunk-F6IVBYFS.js.map → chunk-YIZ2EUUL.js.map} +0 -0
  567. /package/dist/{chunk-EZ25VE3G.js.map → chunk-YNDLCWXS.js.map} +0 -0
  568. /package/dist/{chunk-5VAF4ID4.js.map → chunk-ZEPVWLCN.js.map} +0 -0
  569. /package/dist/{graph-edge-decay-MKIRZ762.js.map → extraction-span-config.js.map} +0 -0
  570. /package/dist/{first-start-migration-L3UFX5CU.js.map → first-start-migration-GZ45G5FS.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/extraction-span-materialize.ts"],"sourcesContent":["/**\n * Span-mode materialization for production extraction (issue #2333 Phase B).\n *\n * Runs immediately after the extraction result is parsed and BEFORE\n * sanitize/grounding/judge/dedup/persistence, so everything downstream sees\n * exactly one content form and the content-hash dedup invariant (checklist\n * §13) holds by construction. Offsets die here — nothing offset-based is\n * stored.\n *\n * Modes:\n * - \"off\": spans are never requested; a stray span is stripped untrusted.\n * - \"shadow\": spans are requested alongside full content; materialization\n * runs for comparison only, the generated content is persisted\n * unchanged (zero behavior change), agreement telemetry logged.\n * - \"on\": materialized frame+span content is persisted; per-fact fail-open\n * to the generated content (the frame) on any validation failure.\n *\n * Validation (identical to the Phase A bench contract):\n * - `0 <= charStart < charEnd <= turn.text.length`, end-exclusive, integers;\n * - slice length <= 400 chars and non-whitespace;\n * - frame 1..15 words;\n * - the turn text's stamp (sha256 + length of the exact in-memory string the\n * model saw) must verify — offset drift is rejected, never guessed around.\n */\n\nimport { log } from \"./logger.js\";\nimport { stampSpanSource, verifySpanSource, type SpanSourceStamp } from \"./extraction-span-source-hash.js\";\nimport { validateSpanOffsets } from \"./extraction-span-validate.js\";\nimport { sliceSpanText } from \"./extraction-span-slice.js\";\nimport type { ExtractionResult } from \"./types.js\";\nimport type { ExtractedFactSpanRef } from \"./extraction-span-config.js\";\n\nexport const SPAN_MAX_SLICE_CHARS = 400;\nexport const SPAN_MAX_FRAME_WORDS = 15;\n\nexport type SpanMode = \"off\" | \"shadow\" | \"on\";\n\n/** A source turn exactly as rendered into the extraction prompt. */\nexport interface SpanMaterializeTurn {\n text: string;\n stamp: SpanSourceStamp;\n}\n\nexport interface SpanMaterializeFact {\n content: string;\n span?: ExtractedFactSpanRef | null;\n quote?: string;\n}\n\nexport interface SpanMaterializeTelemetry {\n /** Facts that carried a span ref. */\n attempts: number;\n /** Spans that failed validation and fell back to generated content. */\n fallbacks: number;\n /** Shadow mode only: comparisons made / exact-or-containment agreements. */\n shadowComparisons: number;\n shadowAgreements: number;\n}\n\n/** Strip span refs from facts that were never given the span prompt\n * (e.g. the proactive second pass). Untrusted: never validated, never used.\n * The key is omitted entirely so no `span: undefined` reaches persistence. */\nexport function stripUntrustedFactSpans<T extends { span?: unknown }>(facts: readonly T[]): T[] {\n return facts.map((fact) => {\n if (fact.span === undefined || fact.span === null) return fact;\n const { span: _span, ...rest } = fact;\n return rest as T;\n });\n}\n\nexport function buildSpanMaterializeTurns(texts: readonly string[]): SpanMaterializeTurn[] {\n return texts.map((text) => ({ text, stamp: stampSpanSource(text) }));\n}\n\nexport function truncateLocalExtractionConversation(\n conversation: string,\n maxConversationChars: number,\n): string {\n return conversation.length > maxConversationChars\n ? `${conversation.slice(0, maxConversationChars)}\\n\\n[truncated]`\n : conversation;\n}\n\nexport function bindLocalExtractionPrompt(\n conversation: string,\n turns: readonly { role: string; content: string; extractionContextOnly?: boolean }[],\n maxConversationChars: number,\n renderedConversation: string = conversation,\n): { promptConversation: string; spanTurns: SpanMaterializeTurn[] } {\n const promptConversation = truncateLocalExtractionConversation(conversation, maxConversationChars);\n if (conversation.length <= maxConversationChars || !conversation.endsWith(renderedConversation)) {\n return { promptConversation, spanTurns: buildSpanMaterializeTurns(turns.map((turn) => turn.content)) };\n }\n const renderedStart = conversation.length - renderedConversation.length;\n const limit = maxConversationChars;\n const texts: string[] = [];\n let pos = 0;\n for (let index = 0; index < turns.length; index += 1) {\n const turn = turns[index];\n if (turn === undefined) {\n texts.push(\"\");\n continue;\n }\n if (index > 0) pos += 2;\n const label = turn.extractionContextOnly === true ? `context ${turn.role}` : turn.role;\n pos += `[${label}] `.length;\n const absStart = renderedStart + pos;\n const absEnd = absStart + turn.content.length;\n texts.push(absEnd > absStart && limit > absStart ? conversation.slice(absStart, Math.min(absEnd, limit)) : \"\");\n pos += turn.content.length;\n }\n return { promptConversation, spanTurns: buildSpanMaterializeTurns(texts) };\n}\n\nexport function factCarriesSpan(fact: { span?: ExtractedFactSpanRef | null }): boolean {\n return fact.span !== undefined && fact.span !== null;\n}\n\n/**\n * Materialize one fact's span. Never throws: any validation failure falls\n * open to the fact's generated content and is counted.\n */\nexport function materializeFactSpan<T extends SpanMaterializeFact>(\n fact: T,\n turns: readonly SpanMaterializeTurn[],\n mode: SpanMode,\n): { fact: T; outcome: \"span\" | \"fallback\"; materialized?: string } {\n const span = fact.span ?? null;\n if (span === null) {\n return { fact, outcome: \"fallback\" };\n }\n const { sourceMessageIndex, charStart, charEnd, frame, sourceHash, sourceLength } = span;\n const turn = turns[sourceMessageIndex];\n if (\n !Number.isInteger(sourceMessageIndex) ||\n sourceMessageIndex < 0 ||\n sourceMessageIndex >= turns.length ||\n turn === undefined\n ) {\n return { fact: stripSpan(fact), outcome: \"fallback\" };\n }\n const stampCheck = verifySpanSource(turn.text, turn.stamp);\n if (!stampCheck.ok) {\n return { fact: stripSpan(fact), outcome: \"fallback\" };\n }\n if (\n (sourceHash !== undefined && sourceHash !== turn.stamp.hash) ||\n (sourceLength !== undefined && sourceLength !== turn.stamp.length)\n ) {\n return { fact: stripSpan(fact), outcome: \"fallback\" };\n }\n const offsetCheck = validateSpanOffsets({ start: charStart, end: charEnd, textLength: turn.text.length });\n if (!offsetCheck.ok) {\n return { fact: stripSpan(fact), outcome: \"fallback\" };\n }\n const slice = sliceSpanText({ text: turn.text, start: charStart, end: charEnd });\n if (slice.length > SPAN_MAX_SLICE_CHARS || slice.trim().length === 0) {\n return { fact: stripSpan(fact), outcome: \"fallback\" };\n }\n const frameWords = frame.trim().split(/\\s+/).filter(Boolean);\n if (frameWords.length === 0 || frameWords.length > SPAN_MAX_FRAME_WORDS) {\n return { fact: stripSpan(fact), outcome: \"fallback\" };\n }\n\n const trimmedFrame = frameWords.join(\" \");\n const materialized = /[:—-]$/.test(trimmedFrame)\n ? `${trimmedFrame} ${slice}`\n : `${trimmedFrame}: ${slice}`;\n\n if (mode === \"on\") {\n return {\n fact: { ...stripSpan(fact), content: materialized, quote: slice },\n outcome: \"span\",\n materialized,\n };\n }\n // shadow: persist generated content unchanged; materialize for comparison.\n return { fact: stripSpan(fact), outcome: \"span\", materialized };\n}\n\n/** Shadow agreement: exact match or containment either way. */\nexport function spanAgreesWithContent(materialized: string, content: string): boolean {\n const left = materialized.trim();\n const right = content.trim();\n return left === right || left.includes(right) || right.includes(left);\n}\n\n/**\n * Whole-result span materialization pass (issue #2333 Phase B). Called from\n * `ExtractionEngine.applySpanMaterialization` after parse, before sanitize /\n * grounding / judge / dedup / persist. \"off\" strips stray spans untrusted.\n * Shadow logs agreement telemetry and persists generated content. \"on\"\n * persists materialized frame+span content; facts that omit the optional\n * span are dropped so a short frame cannot persist as a standalone memory.\n */\nexport function applyExtractionSpanMaterialization(\n result: ExtractionResult,\n turns: readonly SpanMaterializeTurn[],\n mode: SpanMode,\n): ExtractionResult {\n if (mode === \"off\") {\n return { ...result, facts: stripUntrustedFactSpans(result.facts) };\n }\n let attempts = 0;\n let fallbacks = 0;\n let agreements = 0;\n const facts = result.facts.flatMap((fact) => {\n if (!factCarriesSpan(fact)) {\n return mode === \"on\" ? [] : [fact];\n }\n attempts += 1;\n const { fact: materialized, outcome, materialized: text } = materializeFactSpan(\n fact,\n turns,\n mode,\n );\n if (outcome === \"fallback\") {\n fallbacks += 1;\n } else if (mode === \"shadow\" && text !== undefined) {\n if (spanAgreesWithContent(text, fact.content)) {\n agreements += 1;\n }\n }\n return [materialized];\n });\n if (mode === \"shadow\") {\n log.info(\n `extraction span-mode shadow: ${agreements}/${attempts} span facts agree with generated content (${fallbacks} span validation fallbacks)`,\n );\n } else if (fallbacks > 0) {\n log.info(\n `extraction span-mode: ${fallbacks}/${attempts} span facts fell back to generated content`,\n );\n }\n return { ...result, facts };\n}\n\nfunction stripSpan<T extends SpanMaterializeFact>(fact: T): T {\n const { span: _span, ...rest } = fact;\n return rest as T;\n}\n"],"mappings":"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","names":[]}
@@ -3,7 +3,7 @@ import {
3
3
  readNamespaceMaintenanceLastRanStatuses,
4
4
  readNamespaceMaintenanceStatuses,
5
5
  runNamespaceMaintenancePlan
6
- } from "./chunk-ZBEGS7OB.js";
6
+ } from "./chunk-JPKZTCWZ.js";
7
7
  import {
8
8
  analyzeSessionIntegrity,
9
9
  applySessionRepair,
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-CMTINOFS.js";
15
15
  import {
16
16
  summarizeCorpusAndReplica
17
- } from "./chunk-L2WQVSKP.js";
17
+ } from "./chunk-G5MO3VQA.js";
18
18
  import {
19
19
  readJudgeVerdictStats
20
20
  } from "./chunk-OZKOPQCM.js";
@@ -38,23 +38,23 @@ import {
38
38
  } from "./chunk-YBPYIAA5.js";
39
39
  import {
40
40
  parseConfig
41
- } from "./chunk-DVOBLPSQ.js";
41
+ } from "./chunk-D2DIYEFW.js";
42
42
  import {
43
43
  readAggregateExtractionWatermark
44
- } from "./chunk-UDZYNIDJ.js";
44
+ } from "./chunk-4WGAMREC.js";
45
45
  import {
46
46
  listMemoryGovernanceRuns,
47
47
  readMemoryGovernanceRunArtifact
48
- } from "./chunk-HUT2JR6I.js";
48
+ } from "./chunk-L5OXE4PX.js";
49
49
  import {
50
50
  listNamespaces
51
- } from "./chunk-BJETIR53.js";
51
+ } from "./chunk-WS3WNLST.js";
52
52
  import {
53
53
  analyzeGraphHealth
54
- } from "./chunk-5FAGCOZD.js";
54
+ } from "./chunk-GWK7FEUL.js";
55
55
  import {
56
56
  StorageManager
57
- } from "./chunk-5VAF4ID4.js";
57
+ } from "./chunk-ZEPVWLCN.js";
58
58
  import {
59
59
  lintWorkspaceFiles
60
60
  } from "./chunk-DM2T26WE.js";
@@ -1069,7 +1069,7 @@ async function summarizeBufferSurpriseDistribution(storage, config) {
1069
1069
  }
1070
1070
  }
1071
1071
  async function summarizeGraphEdgeDecayStatus(config) {
1072
- const { readGraphEdgeDecayStatus } = await import("./graph-edge-decay-MKIRZ762.js");
1072
+ const { readGraphEdgeDecayStatus } = await import("./graph-edge-decay-ROSUPDX3.js");
1073
1073
  const { graphEdgeDecayEnabled } = config;
1074
1074
  const enabled = graphEdgeDecayEnabled === true;
1075
1075
  if (!enabled) {
@@ -1683,4 +1683,4 @@ export {
1683
1683
  runBenchmarkRecall,
1684
1684
  runOperatorRepair
1685
1685
  };
1686
- //# sourceMappingURL=chunk-EEBQFG5E.js.map
1686
+ //# sourceMappingURL=chunk-3YMDY3ZF.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isRecallDisclosure
3
- } from "./chunk-4MDKNUV4.js";
3
+ } from "./chunk-RN3MVLW3.js";
4
4
  import {
5
5
  estimateTokenCount
6
6
  } from "./chunk-TOTT6S2V.js";
@@ -306,4 +306,4 @@ export {
306
306
  RecallXrayBuilder,
307
307
  summarizeDisclosureTokens
308
308
  };
309
- //# sourceMappingURL=chunk-5JG5EBVL.js.map
309
+ //# sourceMappingURL=chunk-4DPDIOVA.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveCorpusNamespaceRoots
3
- } from "./chunk-ECKG5WSI.js";
3
+ } from "./chunk-JZYECQWN.js";
4
4
  import {
5
5
  capabilityAllowsNamespace
6
6
  } from "./chunk-MZWSOLMT.js";
@@ -200,4 +200,4 @@ async function readAggregateExtractionWatermark(options) {
200
200
  export {
201
201
  readAggregateExtractionWatermark
202
202
  };
203
- //# sourceMappingURL=chunk-UDZYNIDJ.js.map
203
+ //# sourceMappingURL=chunk-4WGAMREC.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  resolveDefaultNamespaceRoot
3
- } from "./chunk-RUXPVSML.js";
3
+ } from "./chunk-2AR5JFD7.js";
4
4
  import {
5
5
  StorageManager
6
- } from "./chunk-5VAF4ID4.js";
6
+ } from "./chunk-ZEPVWLCN.js";
7
7
  import {
8
8
  composeLocationDayBody,
9
9
  composeLocationDayMeta,
@@ -728,4 +728,4 @@ export {
728
728
  runLocationBackfill,
729
729
  runLocationCliCommand
730
730
  };
731
- //# sourceMappingURL=chunk-HXSAWV3A.js.map
731
+ //# sourceMappingURL=chunk-57GDHV2D.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SUPPORT_PASSPORT_DRAFT_MAX_CONTENT_CHARACTERS,
3
3
  SUPPORT_PASSPORT_DRAFT_MAX_MEMORIES
4
- } from "./chunk-JHZCXUQI.js";
4
+ } from "./chunk-JLXWRQNR.js";
5
5
  import {
6
6
  SUPPORT_PASSPORT_SOURCE_MEMORY_ID_MAX_LENGTH
7
7
  } from "./chunk-PWPIERBM.js";
@@ -343,4 +343,4 @@ export {
343
343
  parseSupportPassportModelJob,
344
344
  SupportPassportModelBridge
345
345
  };
346
- //# sourceMappingURL=chunk-Z7ACR6MJ.js.map
346
+ //# sourceMappingURL=chunk-5LLQAUMI.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isNamespaceKind
3
- } from "./chunk-VYXDUPYE.js";
3
+ } from "./chunk-Q7JK6YEB.js";
4
4
  import {
5
5
  EngramAccessInputError
6
6
  } from "./chunk-2Z24E5W2.js";
@@ -40,4 +40,4 @@ export {
40
40
  positiveIntQueryParam,
41
41
  optionalNamespaceKindQueryParam
42
42
  };
43
- //# sourceMappingURL=chunk-P3ONDDIJ.js.map
43
+ //# sourceMappingURL=chunk-5SYI2F47.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  graphFilePath,
3
3
  readEdgesStrict
4
- } from "./chunk-5FAGCOZD.js";
4
+ } from "./chunk-GWK7FEUL.js";
5
5
  import {
6
6
  assertGraphLockHeld,
7
7
  withGraphWriteLock,
@@ -138,4 +138,4 @@ export {
138
138
  restoreRemovedNodeEdges,
139
139
  rollbackNodeEdgeRewrite
140
140
  };
141
- //# sourceMappingURL=chunk-DGS34QSY.js.map
141
+ //# sourceMappingURL=chunk-6E5GYDIE.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  StorageManager
3
- } from "./chunk-5VAF4ID4.js";
3
+ } from "./chunk-ZEPVWLCN.js";
4
4
  import {
5
5
  composeMemoryEnvelope
6
6
  } from "./chunk-LSLCFCCQ.js";
@@ -546,4 +546,4 @@ export {
546
546
  setSemanticRulePromotionTestHooks,
547
547
  promoteSemanticRuleFromMemory
548
548
  };
549
- //# sourceMappingURL=chunk-J7PB5UQ4.js.map
549
+ //# sourceMappingURL=chunk-6Z3WW2MW.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  StorageManager
3
- } from "./chunk-5VAF4ID4.js";
3
+ } from "./chunk-ZEPVWLCN.js";
4
4
  import {
5
5
  getCachedRuleMemories,
6
6
  setCachedRuleMemories
@@ -119,4 +119,4 @@ export {
119
119
  compareVerifiedSemanticRuleResults,
120
120
  searchVerifiedSemanticRules
121
121
  };
122
- //# sourceMappingURL=chunk-GLZH5VEN.js.map
122
+ //# sourceMappingURL=chunk-76DRU7C4.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isValidCapsuleSince
3
- } from "./chunk-KQAFEZQX.js";
3
+ } from "./chunk-VDX2J7OX.js";
4
4
  import {
5
5
  CAPSULE_ID_PATTERN
6
6
  } from "./chunk-WEHSQBFR.js";
@@ -521,4 +521,4 @@ export {
521
521
  actionConfidenceRequestSchema,
522
522
  validateRequest
523
523
  };
524
- //# sourceMappingURL=chunk-L2QLDZJC.js.map
524
+ //# sourceMappingURL=chunk-7MJBKZPU.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createSearchBackend
3
- } from "./chunk-JRWW7GM6.js";
3
+ } from "./chunk-Q6D7EUSQ.js";
4
4
  import {
5
5
  namespaceIdentityToken,
6
6
  normalizeNamespaceIdentity
@@ -470,4 +470,4 @@ export {
470
470
  NamespaceSearchRouter,
471
471
  normalizeQmdResultPath
472
472
  };
473
- //# sourceMappingURL=chunk-Y63ZFP4X.js.map
473
+ //# sourceMappingURL=chunk-7RKBPXY6.js.map
@@ -0,0 +1,51 @@
1
+ // src/extraction-span-source-hash.ts
2
+ import { createHash } from "crypto";
3
+ var HASH_PATTERN = /^[0-9a-f]{64}$/;
4
+ function requireText(text) {
5
+ if (typeof text !== "string") {
6
+ throw new TypeError(`text must be a string, got ${typeof text}`);
7
+ }
8
+ }
9
+ function requireStamp(expected) {
10
+ if (!Object.hasOwn(expected, "hash")) {
11
+ throw new RangeError("expected stamp is missing field hash");
12
+ }
13
+ if (!Object.hasOwn(expected, "length")) {
14
+ throw new RangeError("expected stamp is missing field length");
15
+ }
16
+ const { hash, length } = expected;
17
+ if (typeof hash !== "string" || !HASH_PATTERN.test(hash)) {
18
+ throw new RangeError(
19
+ "expected stamp field hash must be 64 lowercase hex characters"
20
+ );
21
+ }
22
+ if (!Number.isInteger(length) || length < 0) {
23
+ throw new RangeError(
24
+ "expected stamp field length must be a non-negative integer"
25
+ );
26
+ }
27
+ }
28
+ function stampSpanSource(text) {
29
+ requireText(text);
30
+ const hash = createHash("sha256").update(Buffer.from(text, "utf16le")).digest("hex");
31
+ return { hash, length: text.length };
32
+ }
33
+ function verifySpanSource(text, expected) {
34
+ requireText(text);
35
+ requireStamp(expected);
36
+ const actual = stampSpanSource(text);
37
+ const safeExpected = { hash: expected.hash, length: expected.length };
38
+ if (actual.length !== safeExpected.length) {
39
+ return { ok: false, error: "length_mismatch", expected: safeExpected, actual };
40
+ }
41
+ if (actual.hash !== safeExpected.hash) {
42
+ return { ok: false, error: "hash_mismatch", expected: safeExpected, actual };
43
+ }
44
+ return { ok: true };
45
+ }
46
+
47
+ export {
48
+ stampSpanSource,
49
+ verifySpanSource
50
+ };
51
+ //# sourceMappingURL=chunk-A6CXG5WI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/extraction-span-source-hash.ts"],"sourcesContent":["/**\n * Span source stamp/verify (issue #2333).\n *\n * Offsets index the exact normalized string sent to the model. If that string\n * drifts before materialization, the offsets point at different characters and\n * a wrong quote is persisted as verbatim source. The stamp lets materialization\n * detect the drift without carrying the source text alongside it.\n *\n * Pure apart from hashing: no I/O, no clock, no randomness. The input text is\n * never mutated and never appears in a result or error message.\n */\n\nimport { createHash } from \"node:crypto\";\n\nexport interface SpanSourceStamp {\n /** Hex digest of the exact string the model was shown. */\n hash: string;\n /** Length of that string, so a mismatch reports which dimension drifted. */\n length: number;\n}\n\nexport type SpanSourceCheck =\n | { ok: true }\n | {\n ok: false;\n error: \"length_mismatch\" | \"hash_mismatch\";\n expected: SpanSourceStamp;\n actual: SpanSourceStamp;\n };\n\nconst HASH_PATTERN = /^[0-9a-f]{64}$/;\n\nfunction requireText(text: string): void {\n if (typeof text !== \"string\") {\n throw new TypeError(`text must be a string, got ${typeof text}`);\n }\n}\n\nfunction requireStamp(expected: SpanSourceStamp): void {\n if (!Object.hasOwn(expected, \"hash\")) {\n throw new RangeError(\"expected stamp is missing field hash\");\n }\n if (!Object.hasOwn(expected, \"length\")) {\n throw new RangeError(\"expected stamp is missing field length\");\n }\n const { hash, length } = expected;\n if (typeof hash !== \"string\" || !HASH_PATTERN.test(hash)) {\n throw new RangeError(\n \"expected stamp field hash must be 64 lowercase hex characters\",\n );\n }\n if (!Number.isInteger(length) || length < 0) {\n throw new RangeError(\n \"expected stamp field length must be a non-negative integer\",\n );\n }\n}\n\n/**\n * Hash the exact string. No trimming, no newline normalization.\n *\n * The digest covers UTF-16LE code units, not UTF-8 bytes: Node's UTF-8\n * encoder replaces an unpaired surrogate with U+FFFD before hashing, so\n * \"\\ud800\", \"\\ud801\", and \"\\ufffd\" all produce ONE digest under utf8 and\n * drift between them would verify as unchanged. Unpaired surrogates reach\n * real memory text through JSON escapes, and this stamp exists to catch\n * exactly that class of silent substitution, so it hashes a lossless\n * representation of the string instead.\n */\nexport function stampSpanSource(text: string): SpanSourceStamp {\n requireText(text);\n const hash = createHash(\"sha256\").update(Buffer.from(text, \"utf16le\")).digest(\"hex\");\n return { hash, length: text.length };\n}\n\n/**\n * Verify the materialized string against its stamp. Length is compared first:\n * it is the cheaper, more diagnostic dimension. Mismatch results carry both\n * stamps and never the text itself.\n */\nexport function verifySpanSource(\n text: string,\n expected: SpanSourceStamp,\n): SpanSourceCheck {\n requireText(text);\n requireStamp(expected);\n const actual = stampSpanSource(text);\n // Project the caller's stamp down to exactly the two stamp fields. Echoing\n // the original object would re-export any extra property it carries — a\n // `source` field holding the text defeats the whole point of a stamp, which\n // exists so the content does not have to travel.\n const safeExpected: SpanSourceStamp = { hash: expected.hash, length: expected.length };\n if (actual.length !== safeExpected.length) {\n return { ok: false, error: \"length_mismatch\", expected: safeExpected, actual };\n }\n if (actual.hash !== safeExpected.hash) {\n return { ok: false, error: \"hash_mismatch\", expected: safeExpected, actual };\n }\n return { ok: true };\n}\n"],"mappings":";AAYA,SAAS,kBAAkB;AAkB3B,IAAM,eAAe;AAErB,SAAS,YAAY,MAAoB;AACvC,MAAI,OAAO,SAAS,UAAU;AAC5B,UAAM,IAAI,UAAU,8BAA8B,OAAO,IAAI,EAAE;AAAA,EACjE;AACF;AAEA,SAAS,aAAa,UAAiC;AACrD,MAAI,CAAC,OAAO,OAAO,UAAU,MAAM,GAAG;AACpC,UAAM,IAAI,WAAW,sCAAsC;AAAA,EAC7D;AACA,MAAI,CAAC,OAAO,OAAO,UAAU,QAAQ,GAAG;AACtC,UAAM,IAAI,WAAW,wCAAwC;AAAA,EAC/D;AACA,QAAM,EAAE,MAAM,OAAO,IAAI;AACzB,MAAI,OAAO,SAAS,YAAY,CAAC,aAAa,KAAK,IAAI,GAAG;AACxD,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,MAAI,CAAC,OAAO,UAAU,MAAM,KAAK,SAAS,GAAG;AAC3C,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;AAaO,SAAS,gBAAgB,MAA+B;AAC7D,cAAY,IAAI;AAChB,QAAM,OAAO,WAAW,QAAQ,EAAE,OAAO,OAAO,KAAK,MAAM,SAAS,CAAC,EAAE,OAAO,KAAK;AACnF,SAAO,EAAE,MAAM,QAAQ,KAAK,OAAO;AACrC;AAOO,SAAS,iBACd,MACA,UACiB;AACjB,cAAY,IAAI;AAChB,eAAa,QAAQ;AACrB,QAAM,SAAS,gBAAgB,IAAI;AAKnC,QAAM,eAAgC,EAAE,MAAM,SAAS,MAAM,QAAQ,SAAS,OAAO;AACrF,MAAI,OAAO,WAAW,aAAa,QAAQ;AACzC,WAAO,EAAE,IAAI,OAAO,OAAO,mBAAmB,UAAU,cAAc,OAAO;AAAA,EAC/E;AACA,MAAI,OAAO,SAAS,aAAa,MAAM;AACrC,WAAO,EAAE,IAAI,OAAO,OAAO,iBAAiB,UAAU,cAAc,OAAO;AAAA,EAC7E;AACA,SAAO,EAAE,IAAI,KAAK;AACpB;","names":[]}
@@ -34,10 +34,10 @@ import {
34
34
  } from "./chunk-QVSRE355.js";
35
35
  import {
36
36
  getOperation
37
- } from "./chunk-JHZCXUQI.js";
37
+ } from "./chunk-JLXWRQNR.js";
38
38
  import {
39
39
  WHO_KNOWS_MCP_TOOLS
40
- } from "./chunk-3FJKJ5UZ.js";
40
+ } from "./chunk-X7BCM2NA.js";
41
41
  import {
42
42
  assertOperationAllowed,
43
43
  capabilityAllowsOp,
@@ -49,7 +49,7 @@ import {
49
49
  } from "./chunk-PWPIERBM.js";
50
50
  import {
51
51
  validateRequest
52
- } from "./chunk-L2QLDZJC.js";
52
+ } from "./chunk-7MJBKZPU.js";
53
53
  import {
54
54
  PROMOTION_CANDIDATES_MCP_TOOLS
55
55
  } from "./chunk-VYCOJKSX.js";
@@ -4051,4 +4051,4 @@ export {
4051
4051
  MCP_MIGRATED_OPERATIONS,
4052
4052
  EngramMcpServer
4053
4053
  };
4054
- //# sourceMappingURL=chunk-JSRVXI6E.js.map
4054
+ //# sourceMappingURL=chunk-B2YKTE7P.js.map
@@ -2,7 +2,7 @@ import {
2
2
  readCausalTrajectoryRecordsStrict,
3
3
  readCausalTrajectoryRevisionToken,
4
4
  resolveCausalTrajectoryStoreDir
5
- } from "./chunk-B3O3IRZN.js";
5
+ } from "./chunk-LMMQKZK3.js";
6
6
 
7
7
  // src/coding/pre-action-gate.ts
8
8
  import { createHash } from "crypto";
@@ -221,4 +221,4 @@ export {
221
221
  normalizeActionIntent,
222
222
  PreActionFailureGate
223
223
  };
224
- //# sourceMappingURL=chunk-Z3O53WZR.js.map
224
+ //# sourceMappingURL=chunk-BICNRVEC.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  OUTPUT_LANGUAGE_POLICY
3
- } from "./chunk-7CBKAQIG.js";
3
+ } from "./chunk-BOADKFN4.js";
4
4
  import {
5
5
  gatewayTaskChainOptions
6
6
  } from "./chunk-YEN4TREG.js";
@@ -491,4 +491,4 @@ export {
491
491
  createVerdictCache,
492
492
  createDeferCountMap
493
493
  };
494
- //# sourceMappingURL=chunk-BNGHPYZU.js.map
494
+ //# sourceMappingURL=chunk-BLHX5FQW.js.map
@@ -42,9 +42,19 @@ var EXTRACTION_RESPONSE_SHAPE = `{
42
42
  "episodeTitle": "<six-to-eight word conversation segment title>",
43
43
  "relationships": [{"source": "<normalized-name>", "target": "<normalized-name>", "label": "<source-grounded relationship>"}]
44
44
  }`;
45
+ function extractionResponseShape(spanMode = "off") {
46
+ if (spanMode === "off") return EXTRACTION_RESPONSE_SHAPE;
47
+ return EXTRACTION_RESPONSE_SHAPE.replace(
48
+ `"eventTime": "<optional source temporal expression>"`,
49
+ `"eventTime": "<optional source temporal expression>",
50
+ "span": {"sourceMessageIndex": <message number>, "charStart": <number>, "charEnd": <number>, "frame": "<at most 15 words>"}`
51
+ );
52
+ }
45
53
  var EXTRACTION_RESPONSE_PLACEHOLDERS = {};
46
- for (const placeholder of EXTRACTION_RESPONSE_SHAPE.match(/<[^<>\r\n]+>/g) ?? []) {
47
- EXTRACTION_RESPONSE_PLACEHOLDERS[placeholder] = true;
54
+ for (const shape of [EXTRACTION_RESPONSE_SHAPE, extractionResponseShape("on")]) {
55
+ for (const placeholder of shape.match(/<[^<>\r\n]+>/g) ?? []) {
56
+ EXTRACTION_RESPONSE_PLACEHOLDERS[placeholder] = true;
57
+ }
48
58
  }
49
59
  var CUE_ANCHOR_PROMPT_INSTRUCTION = `- For each fact, emit at most 3 "cueAnchors".
50
60
  - Each cue anchor value must be a source-grounded search hook of at most 120 characters, in the form "<main entity or topic> <key aspect>".
@@ -57,6 +67,18 @@ function eventTimePromptInstruction(config) {
57
67
  return `
58
68
  When a fact states when it became or stopped being true, copy that explicit temporal expression verbatim into "eventTime". Omit "eventTime" when no such expression appears; never infer dates.`;
59
69
  }
70
+ function spanModePromptSection(spanMode) {
71
+ if (spanMode === "off") return "";
72
+ const requestBoth = spanMode === "shadow";
73
+ return `
74
+ Span mode (numbered-message offsets):
75
+ - Conversation messages are numbered in order starting at 0 (the "[role] text" blocks).
76
+ - For each fact, return "span": {"sourceMessageIndex": <message number>, "charStart": <number>, "charEnd": <number>, "frame": "<at most 15 words>"} pointing at the verbatim supporting words in that message's text (the text after the "] "). Offsets are [charStart, charEnd), end-exclusive, counting from the first character of the message text.
77
+ - "frame" is at most 15 generated words that make the span self-contained: resolve pronouns to names, name the subject (e.g., frame "Maya's relocation:" + span "moved to Seattle last spring\u2026").${requestBoth ? `
78
+ - This run is in SHADOW mode: ALSO include the full standalone "content" restatement exactly as you would normally write it, in addition to "span".` : `
79
+ - Set "content" to the frame text (the short \u226415-word frame) \u2014 do not restate the full fact; the span plus frame carry it.`}
80
+ - Invalid spans fall back to the frame, so keep the frame informative.`;
81
+ }
60
82
  function buildExtractionInstructions(config, existingEntities, ambientCapture = false) {
61
83
  const lifecycleCaps = resolveMemoryLifecycleCapabilities(config);
62
84
  return `You are a memory extraction system. Analyze the following conversation and extract durable, reusable memories.
@@ -121,7 +143,7 @@ ${existingEntities.join(", ")}
121
143
 
122
144
  When you see something that matches a known entity, use THAT name exactly. Only create a NEW entity if nothing in this list represents it.
123
145
  ` : ""}
124
- ${eventTimePromptInstruction(config)}
146
+ ${eventTimePromptInstruction(config)}${spanModePromptSection(config.extraction?.spanMode ?? "off")}
125
147
  Also extract relationships between entities mentioned in the conversation.
126
148
  - Format: {source: "entity-name", target: "entity-name", label: "relationship description"}
127
149
  - Max 5 relationships per extraction
@@ -185,14 +207,16 @@ The output should be the COMPLETE consolidated profile as valid markdown, starti
185
207
 
186
208
  export {
187
209
  EXTRACTION_RESPONSE_SHAPE,
210
+ extractionResponseShape,
188
211
  EXTRACTION_RESPONSE_PLACEHOLDERS,
189
212
  CUE_ANCHOR_PROMPT_INSTRUCTION,
190
213
  OUTPUT_LANGUAGE_POLICY,
191
214
  eventTimePromptInstruction,
215
+ spanModePromptSection,
192
216
  buildExtractionInstructions,
193
217
  CONSOLIDATION_RESPONSE_SCHEMA,
194
218
  PROFILE_CONSOLIDATION_RESPONSE_SCHEMA,
195
219
  buildConsolidationSystemPrompt,
196
220
  buildProfileConsolidationSystemPrompt
197
221
  };
198
- //# sourceMappingURL=chunk-7CBKAQIG.js.map
222
+ //# sourceMappingURL=chunk-BOADKFN4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/extraction-prompt.ts"],"sourcesContent":["/**\n * Extraction prompt construction (issue #1995 sibling extraction).\n *\n * The system prompt, its JSON response shape, and the placeholder table\n * derived from that shape are prompt DATA, not engine behavior. They live here\n * so `extraction.ts` holds the pipeline and one module owns the text every\n * extraction path — local LLM, direct client, gateway fallback — sends.\n */\n\nimport { AMBIENT_CAPTURE_PROMPT_SECTION, AMBIENT_SPECULATIVE_TIER_CLAUSE } from \"./ambient-provenance.js\";\nimport { resolveMemoryLifecycleCapabilities, resolveRecallAuxiliaryCapabilities } from \"./capabilities.js\";\nimport type { PluginConfig } from \"./types.js\";\n\nexport const EXTRACTION_RESPONSE_SHAPE = `{\n \"facts\": [{\n \"category\": \"<category>\",\n \"content\": \"<source-grounded statement>\",\n \"confidence\": 0.0,\n \"tags\": [\"<tag>\"],\n \"entityRef\": \"<optional normalized-name>\",\n \"cueAnchors\": [{\"type\": \"<anchor-type>\", \"value\": \"<entity-or-topic plus key aspect>\"}],\n \"promptedByQuestion\": \"<optional source-grounded question>\",\n \"quote\": \"<optional exact contiguous source span>\",\n \"scope\": \"<optional project-or-global>\",\n \"subject\": \"<optional user-or-agent>\",\n \"structuredAttributes\": {\"<key>\": \"<value>\"},\n \"procedureSteps\": [{\"order\": 1, \"intent\": \"<step>\"}, {\"order\": 2, \"intent\": \"<step>\"}],\n \"reasoningTrace\": {\n \"steps\": [{\"order\": 1, \"description\": \"<step>\"}, {\"order\": 2, \"description\": \"<step>\"}],\n \"finalAnswer\": \"<answer>\",\n \"observedOutcome\": \"<optional outcome>\"\n },\n \"eventTime\": \"<optional source temporal expression>\"\n }],\n \"entities\": [{\n \"name\": \"<normalized-name>\",\n \"type\": \"<entity-type>\",\n \"facts\": [\"<source-grounded statement>\"],\n \"promptedByQuestion\": \"<optional source-grounded question>\",\n \"structuredSections\": [{\"key\": \"<section-key>\", \"title\": \"<section-title>\", \"facts\": [\"<source-grounded statement>\"]}]\n }],\n \"profileUpdates\": [\"<source-grounded profile update>\"],\n \"questions\": [{\"question\": \"<source-grounded unresolved question>\", \"context\": \"<source-grounded context>\", \"priority\": 0.0}],\n \"identityReflection\": \"<conversation-grounded agent reflection>\",\n \"episodeTitle\": \"<six-to-eight word conversation segment title>\",\n \"relationships\": [{\"source\": \"<normalized-name>\", \"target\": \"<normalized-name>\", \"label\": \"<source-grounded relationship>\"}]\n}`;\nexport function extractionResponseShape(spanMode: \"off\" | \"shadow\" | \"on\" = \"off\"): string {\n if (spanMode === \"off\") return EXTRACTION_RESPONSE_SHAPE;\n return EXTRACTION_RESPONSE_SHAPE.replace(\n `\"eventTime\": \"<optional source temporal expression>\"`,\n `\"eventTime\": \"<optional source temporal expression>\",\n \"span\": {\"sourceMessageIndex\": <message number>, \"charStart\": <number>, \"charEnd\": <number>, \"frame\": \"<at most 15 words>\"}`,\n );\n}\nexport const EXTRACTION_RESPONSE_PLACEHOLDERS: Record<string, true> = {};\nfor (const shape of [EXTRACTION_RESPONSE_SHAPE, extractionResponseShape(\"on\")]) {\n for (const placeholder of shape.match(/<[^<>\\r\\n]+>/g) ?? []) {\n EXTRACTION_RESPONSE_PLACEHOLDERS[placeholder] = true;\n }\n}\nexport const CUE_ANCHOR_PROMPT_INSTRUCTION = `- For each fact, emit at most 3 \"cueAnchors\".\n- Each cue anchor value must be a source-grounded search hook of at most 120 characters, in the form \"<main entity or topic> <key aspect>\".\n- Set each cue anchor type to entity, file, tool, outcome, constraint, or date.\n- Omit cue anchors when the conversation does not support a useful search hook.\n- Example: \"Alice booked Bistro Max for Mike's surprise party\" can use {\"type\":\"entity\",\"value\":\"Mike surprise party\"} and {\"type\":\"entity\",\"value\":\"Alice restaurant booking\"}.`;\n\n/**\n * Output-language policy (issue #2190). Every prompt that produces memory\n * content embeds this verbatim so non-English conversations are not silently\n * translated to English — translated memories fail later lexical recall.\n */\nexport const OUTPUT_LANGUAGE_POLICY = `Output language: write facts, profile updates, entity names and aliases, tags, questions, and any rewritten or merged memory content in the source language of the conversation or input memories. Never translate into English or another language unless the user explicitly asked for a translation.`;\n\n/**\n * Bi-temporal event-time extraction instruction (#1578 PR2). Emitted on\n * every extraction entry path when `temporal.biTemporal` is on so the LLM\n * emits an optional per-fact `eventTime` expression. The expression is\n * resolved against the source turn timestamp at write time — never\n * wall-clock — so replay/import of old transcripts anchors correctly.\n * Returns an empty string when the gate is off (byte-identical prompt).\n */\nexport function eventTimePromptInstruction(config: PluginConfig): string {\n if (!config.temporalBiTemporal) return \"\";\n return `\nWhen a fact states when it became or stopped being true, copy that explicit temporal expression verbatim into \"eventTime\". Omit \"eventTime\" when no such expression appears; never infer dates.`;\n}\n\n/**\n * Span-mode extraction instructions (issue #2333 Phase B). Empty when the\n * mode is off (byte-identical prompt). The offset convention mirrors the\n * Phase A bench: messages numbered in order from 0, offsets index the\n * message's own text (after the `[role] ` tag), [charStart, charEnd)\n * end-exclusive.\n */\nexport function spanModePromptSection(spanMode: \"off\" | \"shadow\" | \"on\"): string {\n if (spanMode === \"off\") return \"\";\n const requestBoth = spanMode === \"shadow\";\n return `\nSpan mode (numbered-message offsets):\n- Conversation messages are numbered in order starting at 0 (the \"[role] text\" blocks).\n- For each fact, return \"span\": {\"sourceMessageIndex\": <message number>, \"charStart\": <number>, \"charEnd\": <number>, \"frame\": \"<at most 15 words>\"} pointing at the verbatim supporting words in that message's text (the text after the \"] \"). Offsets are [charStart, charEnd), end-exclusive, counting from the first character of the message text.\n- \"frame\" is at most 15 generated words that make the span self-contained: resolve pronouns to names, name the subject (e.g., frame \"Maya's relocation:\" + span \"moved to Seattle last spring…\").${\n requestBoth\n ? `\n- This run is in SHADOW mode: ALSO include the full standalone \"content\" restatement exactly as you would normally write it, in addition to \"span\".`\n : `\n- Set \"content\" to the frame text (the short ≤15-word frame) — do not restate the full fact; the span plus frame carry it.`\n }\n- Invalid spans fall back to the frame, so keep the frame informative.`;\n}\n\n/**\n * Build extraction instructions shared between local and cloud LLM.\n *\n * `ambientCapture` marks input from an always-on recorder, which may carry\n * speech the user never authored (issue #2294).\n */\nexport function buildExtractionInstructions(\n config: PluginConfig,\n existingEntities?: string[],\n ambientCapture = false\n): string {\n const lifecycleCaps = resolveMemoryLifecycleCapabilities(config);\n return `You are a memory extraction system. Analyze the following conversation and extract durable, reusable memories.\n\nMemory categories:\n- fact: Objective information about the world\n- preference: User likes, dislikes, or stylistic choices\n- correction: User correcting a mistake or misconception (highest priority)\n- entity: Information about a specific person, project, tool, or company\n- decision: A choice that was made with rationale\n- relationship: How two entities relate to each other (e.g., \"Alice is Bob's manager\", \"Acme Corp uses Shopify\")\n- principle: Durable rules, values, or operating beliefs (e.g., \"never use Chat Completions API\")\n- commitment: Promises, obligations, or deadlines (e.g., \"deploy by Friday\", \"call accountant Monday\")\n- moment: Emotionally significant events or milestones (e.g., \"first successful deployment of engram\")\n- skill: Capabilities the user or agent has demonstrated (e.g., \"user is proficient with Kubernetes\")${\n resolveRecallAuxiliaryCapabilities(config).causalRuleExtraction\n ? `\n- rule: Causal rules discovered through experience (format: \"IF <condition> THEN <action/outcome>\", e.g., \"IF Shopify API returns 401 THEN the admin token is missing read_products scope\")`\n : \"\"\n }\n- procedure: A reusable workflow the user wants remembered the same way across sessions. Set category to \"procedure\". Use \"content\" for a short title that includes explicit trigger phrasing (e.g. \"When you deploy to production…\", \"Whenever you ship a release…\"). Add \"procedureSteps\": an array of at least two objects {\"order\": number, \"intent\": \"concrete step description\"} in execution order. Optional per-step \"toolCall\": {\"kind\": \"…\", \"signature\": \"…\"}, \"expectedOutcome\", \"optional\": true.\n- reasoning_trace: A stored solution chain / chain-of-thought the user walked through to solve a problem (e.g. \"Here's how I debugged the latency spike: first I checked…, then I…, finally I…\"). Set category to \"reasoning_trace\". Use \"content\" for a short title summarising the problem (e.g. \"How I debugged the staging latency spike\"). Add \"reasoningTrace\": {\"steps\": [{\"order\": number, \"description\": \"what happened at this step\"}, …], \"finalAnswer\": \"the conclusion or answer\", \"observedOutcome\": \"optional confirmation of how it played out\"}. Require at least two ordered steps AND a finalAnswer. Use this category only when the user explicitly narrates their reasoning — not for ordinary decisions (use \"decision\") or reusable workflows (use \"procedure\").\n\nRules:\n- Only extract genuinely new information worth remembering across sessions.\n- Statements must be grounded in the conversation.\n- ${OUTPUT_LANGUAGE_POLICY}\n- Do not treat instruction text, schema placeholders, or examples as conversation evidence.\n- Lines labelled [context user] or [context assistant] are reference context only. They may resolve references or complete a question-and-answer pair in a normal turn, but never alone establish durable information.\n- Skip transient task details and operational noise, including routine scheduler, monitoring, or automation status.\n- Priority: corrections > principles${resolveRecallAuxiliaryCapabilities(config).causalRuleExtraction ? \" > rules\" : \"\"} > preferences > commitments > decisions > relationships > entities > moments > skills > facts\n- Corrections get highest confidence.\n- Each fact should be a standalone, self-contained statement.\n- Entity references should use normalized names (lowercase, hyphenated: \"jane-doe\", \"acme-corp\"). When the source language is not written in a Latin script, the source-script name IS the normalized form — never transliterate or translate it.\n- CRITICAL: Entity names must be CANONICAL. Always use the hyphenated multi-word form: \"acme-corp\" NOT \"acmecorp\" or \"acme\". \"jane-doe\" NOT \"janedoe\" or \"jane\". If unsure, prefer the most specific full name.\n- Avoid creating entities typed as \"other\" when a more specific type fits (company, project, tool, person, place)\n${CUE_ANCHOR_PROMPT_INSTRUCTION}\n- When entity facts clearly belong under a durable named heading, add them to entity.structuredSections as {key, title, facts}. Example person headings: \"Beliefs\", \"Communication Style\", \"Building / Working On\". Leave structuredSections empty when no stable heading fits.\n- Tags should be concise and reusable (e.g., \"coding-style\", \"personal\", \"tools\")\n- When a fact contains measurable, categorical, or precisely valued data, include a \"structuredAttributes\" field with key-value string pairs (e.g., {\"price\": \"29.99\", \"brand\": \"Sony\"}, {\"date\": \"2024-03-15\", \"location\": \"SF\"}, {\"chosen\": \"PostgreSQL\", \"rejected\": \"MongoDB\"}). Only for concrete values, not narrative content.\n- Set confidence using these tiers:\n * Explicit (0.95-1.0): Direct user statements — \"I prefer X\", \"my name is Y\"\n * Implied (0.70-0.94): Strong contextual inference — user consistently does X, clear from conversation flow\n * Inferred (0.40-0.69): Pattern recognition — reasonable guess from limited evidence\n * Speculative (0.00-0.39): Tentative hypothesis — weak signal, needs future confirmation. Speculative memories auto-expire after 30 days if not confirmed.${ambientCapture ? AMBIENT_SPECULATIVE_TIER_CLAUSE : \"\"}${\n config.provenance?.enabled\n ? `\n- Source quotes: For each fact, include a \"quote\" field containing the EXACT verbatim words from the conversation that support the fact. Copy a contiguous span from a single speaker turn (not a paraphrase, not a summary). Cap at ~300 characters. This grounds every memory in the literal utterance that created it.`\n : \"\"\n }\n- For commitments: include any deadline or timeframe mentioned${\n lifecycleCaps.extractionScopeClassification\n ? `\n\nScope classification:\nFor each fact, set \"scope\" to one of:\n- \"global\" — knowledge that applies across projects: core framework/library bugs, API behavior patterns, user preferences (editor, language, style), general coding patterns, infrastructure knowledge, technology facts not tied to one codebase\n- \"project\" — knowledge specific to one codebase: file paths, environment configs, deployment details, project-specific workarounds, team/stakeholder info tied to one project, repo-specific conventions. Tool, command, or CLI-flag instructions TIED TO ONE AGENT are also \"project\", because the same tool name means different things in different agent integrations (a \"search\" tool may search repository code in one agent and the web in another); when keeping such an agent-tied instruction, the fact text MUST name the originating agent as a leading \"In <agent>,\" clause (e.g. \"In Pi, use the search tool with a repository path.\"). A tool/command fact that holds in every agent and every repo is NOT agent-tied — leave it \"global\" and do not add a qualifier (e.g. \"\\`git status --short\\` emits compact output\"). Examples: \"In Pi, the search tool takes a repository path\" -> \"project\"; \"\\`git status --short\\` emits compact output\" -> \"global\".\nWhen in doubt, prefer \"project\" — it is safer to keep knowledge scoped narrowly.`\n : \"\"\n }\n${\n ambientCapture\n ? `${AMBIENT_CAPTURE_PROMPT_SECTION}\n`\n : \"\"\n}\nEntity creation rules (STRICT):\n- Only create entities for DURABLE things: real people, companies, products, tools, ongoing projects\n- NEVER create entities for transient items: individual PRs, branches, Jira tickets, meetings, agent task IDs, log files, database tables, cron job runs, sessions\n- When you learn something about a transient item (e.g., PR #58 fixed a bug), store it as a FACT with an entityRef to the parent project — do NOT create an entity for the PR itself\n- Prefer attaching facts to broad parent entities rather than creating sub-entities. E.g., \"acme-store uses Algolia for search\" is a fact on entity \"acme-store\", NOT a new entity \"acme-store-algolia-connector\"\n- The entity list should be SHORT — think \"things that would have their own Wikipedia page\" not \"things mentioned in passing\"\n\n${\n existingEntities && existingEntities.length > 0\n ? `\nKNOWN ENTITIES (use these exact names when referencing existing things):\n${existingEntities.join(\", \")}\n\nWhen you see something that matches a known entity, use THAT name exactly. Only create a NEW entity if nothing in this list represents it.\n`\n : \"\"\n}\n${eventTimePromptInstruction(config)}${spanModePromptSection(config.extraction?.spanMode ?? \"off\")}\nAlso extract relationships between entities mentioned in the conversation.\n- Format: {source: \"entity-name\", target: \"entity-name\", label: \"relationship description\"}\n- Max 5 relationships per extraction\n- Only include clear, durable relationships (e.g., \"works at\", \"created\", \"manages\", \"uses\")\n- Use normalized entity names (e.g., \"person-jane-doe\", \"company-acme-corp\")\n\n\nAlso emit \"episodeTitle\" as a six-to-eight word title for this conversation segment.\nQuestions are optional. Include only source-grounded unresolved questions that would be useful in future sessions; otherwise return an empty array.\n\nFinally, write a brief identity reflection about the agent who had this conversation, based only on the conversation. Do not write about the extraction process.`;\n}\n\nexport const CONSOLIDATION_RESPONSE_SCHEMA = `{\n \"items\": [\n {\n \"existingId\": \"id\",\n \"action\": \"ADD\",\n \"mergeWith\": \"optional-existing-id\",\n \"updatedContent\": \"optional replacement content\",\n \"reason\": \"brief reason for this action\"\n }\n ],\n \"profileUpdates\": [\"optional profile update\"],\n \"entityUpdates\": [{\"name\": \"person-jane-doe\", \"type\": \"person\", \"facts\": [\"Now leads the backend team\", \"Recently migrated the user service to TypeScript\"]}]\n}`;\n\nexport const PROFILE_CONSOLIDATION_RESPONSE_SCHEMA = `{\n \"consolidatedProfile\": \"# Behavioral Profile\\\\n\\\\n... (complete markdown)\",\n \"removedCount\": 42,\n \"summary\": \"brief summary of what was consolidated\"\n}`;\n\n/**\n * System prompt shared by every consolidation path (gateway, direct client,\n * local LLM). Owns the causal-rule clause and the output-language policy so\n * the three paths cannot drift (issue #2190).\n */\nexport function buildConsolidationSystemPrompt(config: PluginConfig): string {\n return `You are a memory consolidation system. Compare new memories against existing ones and decide what to do with each.\n\nActions:\n- ADD: Keep the new memory as-is (no duplicate exists)\n- MERGE: Combine with an existing memory (provide mergeWith ID and updated content)\n- UPDATE: Replace existing memory content (provide updated content)\n- INVALIDATE: Remove existing memory (it's been superseded or is wrong)\n- SKIP: This new memory is redundant (exact duplicate or subset of existing)\n\nAlso:\n- Suggest profile updates based on patterns across memories\n- Identify entity updates for entity tracking${resolveRecallAuxiliaryCapabilities(config).causalRuleExtraction ? `\n- When merging or updating memories, look for IF→THEN causal patterns. If a memory describes \"X failed/succeeded because Y\" or \"doing X led to Y\", rewrite its content to make the causal rule explicit in the form \"IF <condition> THEN <action/outcome>\".` : \"\"}\n- ${OUTPUT_LANGUAGE_POLICY}`;\n}\n\n/**\n * System prompt shared by every profile-consolidation path (gateway, direct\n * client, local LLM). Owns the output-language policy (issue #2190).\n */\nexport function buildProfileConsolidationSystemPrompt(targetLines: number): string {\n return `You are a profile consolidation system. You are given a behavioral profile (markdown) that has grown too large. Your job is to produce a CONSOLIDATED version that:\n\n1. PRESERVES all ## section headers and their structure\n2. MERGES duplicate or near-duplicate bullet points into single, clear statements\n3. REMOVES stale information that has been superseded by newer bullets\n4. REMOVES trivial or overly specific operational details that won't be useful across sessions\n5. KEEPS the most important, durable observations about the user's preferences, habits, identity, and working style\n6. Target roughly ${targetLines} lines — this is a soft target, prioritize quality over length\n7. Write in the same style as the existing profile — concise bullets, no fluff\n8. ${OUTPUT_LANGUAGE_POLICY}\n\nThe output should be the COMPLETE consolidated profile as valid markdown, starting with \"# Behavioral Profile\".`;\n}\n"],"mappings":";;;;;;;;;;AAaO,IAAM,4BAA4B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkClC,SAAS,wBAAwB,WAAoC,OAAe;AACzF,MAAI,aAAa,MAAO,QAAO;AAC/B,SAAO,0BAA0B;AAAA,IAC/B;AAAA,IACA;AAAA;AAAA,EAEF;AACF;AACO,IAAM,mCAAyD,CAAC;AACvE,WAAW,SAAS,CAAC,2BAA2B,wBAAwB,IAAI,CAAC,GAAG;AAC9E,aAAW,eAAe,MAAM,MAAM,eAAe,KAAK,CAAC,GAAG;AAC5D,qCAAiC,WAAW,IAAI;AAAA,EAClD;AACF;AACO,IAAM,gCAAgC;AAAA;AAAA;AAAA;AAAA;AAWtC,IAAM,yBAAyB;AAU/B,SAAS,2BAA2B,QAA8B;AACvE,MAAI,CAAC,OAAO,mBAAoB,QAAO;AACvC,SAAO;AAAA;AAET;AASO,SAAS,sBAAsB,UAA2C;AAC/E,MAAI,aAAa,MAAO,QAAO;AAC/B,QAAM,cAAc,aAAa;AACjC,SAAO;AAAA;AAAA;AAAA;AAAA,wMAKL,cACI;AAAA,uJAEA;AAAA,qIAEN;AAAA;AAEF;AAQO,SAAS,4BACd,QACA,kBACA,iBAAiB,OACT;AACR,QAAM,gBAAgB,mCAAmC,MAAM;AAC/D,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uGAaL,mCAAmC,MAAM,EAAE,uBACvC;AAAA,+LAEA,EACN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOE,sBAAsB;AAAA;AAAA;AAAA;AAAA,sCAIY,mCAAmC,MAAM,EAAE,uBAAuB,aAAa,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMrH,6BAA6B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mKAQ+H,iBAAiB,kCAAkC,EAAE,GAC/M,OAAO,YAAY,UACf;AAAA,6TAEA,EACN;AAAA,gEAEE,cAAc,gCACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yFAOA,EACN;AAAA,EAEA,iBACI,GAAG,8BAA8B;AAAA,IAEjC,EACN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASE,oBAAoB,iBAAiB,SAAS,IAC1C;AAAA;AAAA,EAEJ,iBAAiB,KAAK,IAAI,CAAC;AAAA;AAAA;AAAA,IAIvB,EACN;AAAA,EACE,2BAA2B,MAAM,CAAC,GAAG,sBAAsB,OAAO,YAAY,YAAY,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYlG;AAEO,IAAM,gCAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AActC,IAAM,wCAAwC;AAAA;AAAA;AAAA;AAAA;AAW9C,SAAS,+BAA+B,QAA8B;AAC3E,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+CAWsC,mCAAmC,MAAM,EAAE,uBAAuB;AAAA,oQAC8I,EAAE;AAAA,IAC7P,sBAAsB;AAC1B;AAMO,SAAS,sCAAsC,aAA6B;AACjF,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAOW,WAAW;AAAA;AAAA,KAE1B,sBAAsB;AAAA;AAAA;AAG3B;","names":[]}
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-765K3SAT.js";
4
4
  import {
5
5
  encryptCapsuleFile
6
- } from "./chunk-X7Y7WX73.js";
6
+ } from "./chunk-DQEMWVMT.js";
7
7
  import {
8
8
  computeTransferOutputRel,
9
9
  isTransferPathExcluded
@@ -109,4 +109,4 @@ async function enforceRetention(outDirAbs, retentionDays) {
109
109
  export {
110
110
  backupMemoryDir
111
111
  };
112
- //# sourceMappingURL=chunk-2NLLXCJG.js.map
112
+ //# sourceMappingURL=chunk-BXLOS5AJ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runLocationSync
3
- } from "./chunk-HXSAWV3A.js";
3
+ } from "./chunk-57GDHV2D.js";
4
4
  import {
5
5
  log
6
6
  } from "./chunk-3WCASNQZ.js";
@@ -58,4 +58,4 @@ export {
58
58
  LOCATION_SYNC_DEFAULT_INTERVAL_MS,
59
59
  startLocationAutoSync
60
60
  };
61
- //# sourceMappingURL=chunk-776GVKL7.js.map
61
+ //# sourceMappingURL=chunk-CD3C4BJN.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  deepRecallRequestSchema
3
- } from "./chunk-L2QLDZJC.js";
3
+ } from "./chunk-7MJBKZPU.js";
4
4
  import {
5
5
  EngramAccessInputError
6
6
  } from "./chunk-2Z24E5W2.js";
@@ -39,4 +39,4 @@ async function respondDeepRecall(req, res, respondJson, readJsonBody, service, s
39
39
  export {
40
40
  respondDeepRecall
41
41
  };
42
- //# sourceMappingURL=chunk-LMCD5W5B.js.map
42
+ //# sourceMappingURL=chunk-CIYUWSMZ.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-SOBJ6NEY.js";
4
4
  import {
5
5
  summarizeDisclosureTokens
6
- } from "./chunk-5JG5EBVL.js";
6
+ } from "./chunk-4DPDIOVA.js";
7
7
  import {
8
8
  summarizeRetrievedMemoryProvenance
9
9
  } from "./chunk-I4WBNM3M.js";
@@ -610,4 +610,4 @@ export {
610
610
  renderRecallExplain,
611
611
  parseRecallExplainFormat
612
612
  };
613
- //# sourceMappingURL=chunk-YJ6VCDMZ.js.map
613
+ //# sourceMappingURL=chunk-CQ7SSBO4.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  StorageManager
3
- } from "./chunk-5VAF4ID4.js";
3
+ } from "./chunk-ZEPVWLCN.js";
4
4
  import {
5
5
  normalizeEntityName
6
6
  } from "./chunk-YXZG5TVN.js";
@@ -957,4 +957,4 @@ export {
957
957
  resolveBriefingSaveDir,
958
958
  briefingFilename
959
959
  };
960
- //# sourceMappingURL=chunk-CNV2A557.js.map
960
+ //# sourceMappingURL=chunk-CYEMS2PG.js.map
@@ -15,7 +15,7 @@ import {
15
15
  PRE_ACTION_GATE_DEFAULT_TIMEOUT_MS,
16
16
  normalizeActionIntent,
17
17
  sanitizePayloadString
18
- } from "./chunk-Z3O53WZR.js";
18
+ } from "./chunk-BICNRVEC.js";
19
19
  import {
20
20
  parseSubjectRuntimeConfig
21
21
  } from "./chunk-WIKO4SCR.js";
@@ -32,6 +32,9 @@ import {
32
32
  parseCorrectionIntentConfig,
33
33
  parseFaithfulnessGateConfig
34
34
  } from "./chunk-H4WG3UQZ.js";
35
+ import {
36
+ parseExtractionFields
37
+ } from "./chunk-OEBLZZKK.js";
35
38
  import {
36
39
  parseExternalWikiRoots
37
40
  } from "./chunk-NDNTNE3S.js";
@@ -78,9 +81,6 @@ import {
78
81
  import {
79
82
  parseReplicaPeersConfig
80
83
  } from "./chunk-WNIUPHWV.js";
81
- import {
82
- parseExtractionLivenessConfig
83
- } from "./chunk-3SG4FGDV.js";
84
84
  import {
85
85
  parseExternalWikiRecallGuard
86
86
  } from "./chunk-JV3C2MNQ.js";
@@ -3368,7 +3368,7 @@ function parseConfig(raw, rawOperatorConfig, runtimeSet) {
3368
3368
  dreaming,
3369
3369
  dreamsPhases,
3370
3370
  procedural,
3371
- extractionLiveness: parseExtractionLivenessConfig(cfg),
3371
+ ...parseExtractionFields(cfg),
3372
3372
  replicaPeers: parseReplicaPeersConfig(cfg),
3373
3373
  converge: parseConvergeConfig(cfg.converge),
3374
3374
  wearables,
@@ -4807,4 +4807,4 @@ export {
4807
4807
  VALID_MEMORY_CATEGORIES,
4808
4808
  parseConfig
4809
4809
  };
4810
- //# sourceMappingURL=chunk-DVOBLPSQ.js.map
4810
+ //# sourceMappingURL=chunk-D2DIYEFW.js.map