@remnic/core 10.0.38 → 10.0.39

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 (416) hide show
  1. package/dist/access-admin-ops-surface.js +73 -73
  2. package/dist/access-audit.js +2 -2
  3. package/dist/access-authorization-probe.js +74 -74
  4. package/dist/access-boundary.js +73 -73
  5. package/dist/access-citation-namespace.js +2 -2
  6. package/dist/access-cli.js +161 -160
  7. package/dist/access-cli.js.map +1 -1
  8. package/dist/access-extraction-force-flush.js +73 -73
  9. package/dist/access-http-briefing.js +74 -74
  10. package/dist/access-http-query.js +75 -75
  11. package/dist/access-http.js +98 -98
  12. package/dist/access-identity-continuity-surface.js +73 -73
  13. package/dist/access-lcm-surface.js +73 -73
  14. package/dist/access-mcp.js +87 -87
  15. package/dist/access-namespace-preflight.js +73 -73
  16. package/dist/access-observe-write-category.js +15 -15
  17. package/dist/access-observe-write-surface.js +73 -73
  18. package/dist/access-offline-manifest.js +12 -12
  19. package/dist/access-operations-batch.js +77 -77
  20. package/dist/access-operations.js +84 -84
  21. package/dist/access-recall-concurrency.js +73 -73
  22. package/dist/access-recall-diagnostics.js +2 -2
  23. package/dist/access-recall-response.js +73 -73
  24. package/dist/access-recall-surface.js +73 -73
  25. package/dist/access-schema.js +10 -10
  26. package/dist/access-service.js +73 -73
  27. package/dist/access-surface-catalog.js +75 -75
  28. package/dist/active-recall.js +29 -29
  29. package/dist/adapters/index.js +4 -4
  30. package/dist/adapters/registry.js +2 -2
  31. package/dist/{auto-sync-432USQDH.js → auto-sync-BNCBMU6H.js} +7 -7
  32. package/dist/briefing.js +19 -19
  33. package/dist/buffer-types.d.ts +59 -0
  34. package/dist/buffer-types.d.ts.map +1 -0
  35. package/dist/buffer-types.js +1 -0
  36. package/dist/buffer.d.ts +14 -22
  37. package/dist/buffer.d.ts.map +1 -1
  38. package/dist/buffer.js +11 -11
  39. package/dist/calibration.js +2 -2
  40. package/dist/{capsule-crypto-7FJQINUR.js → capsule-crypto-GWVG7LGC.js} +2 -2
  41. package/dist/causal-behavior.js +2 -2
  42. package/dist/causal-chain.js +2 -2
  43. package/dist/causal-consolidation.js +22 -22
  44. package/dist/causal-retrieval.js +2 -2
  45. package/dist/causal-trajectory-graph.js +2 -2
  46. package/dist/causal-trajectory.js +1 -1
  47. package/dist/{chunk-5K23NQRI.js → chunk-22YJQTPN.js} +2 -2
  48. package/dist/{chunk-MKE5DP3S.js → chunk-23ZMQONL.js} +2 -2
  49. package/dist/{chunk-3K5IEJTK.js → chunk-2AV2U2SZ.js} +3 -3
  50. package/dist/{chunk-HJ3UTGIW.js → chunk-2JNBPOZ2.js} +3 -3
  51. package/dist/{chunk-EEOYF3IB.js → chunk-3RJDYZJE.js} +2 -2
  52. package/dist/{chunk-SZPPCEYT.js → chunk-4HJ2QK32.js} +2 -2
  53. package/dist/{chunk-OLHN4ZNT.js → chunk-4LLV2N3R.js} +3 -3
  54. package/dist/{chunk-P5CUEB2Q.js → chunk-4QLKVZH6.js} +8 -8
  55. package/dist/{chunk-4IZ6AC2U.js → chunk-4UT2NUAC.js} +2 -2
  56. package/dist/{chunk-WCBLPKG3.js → chunk-5KZNWERU.js} +155 -142
  57. package/dist/chunk-5KZNWERU.js.map +1 -0
  58. package/dist/{chunk-VC3X7XP3.js → chunk-5Q6CR65T.js} +2 -2
  59. package/dist/{chunk-XTBEXZFN.js → chunk-5SF7JOJB.js} +4 -4
  60. package/dist/{chunk-DKHX2FHI.js → chunk-64WHWIPL.js} +2 -2
  61. package/dist/{chunk-TVIGN3XZ.js → chunk-6FRFVIKC.js} +10 -10
  62. package/dist/{chunk-JIA435P3.js → chunk-6ITNEPJO.js} +2 -2
  63. package/dist/{chunk-WEK3OUGO.js → chunk-6X3J4NLZ.js} +10 -5
  64. package/dist/chunk-6X3J4NLZ.js.map +1 -0
  65. package/dist/{chunk-3AODCBKX.js → chunk-6Z2ZWBOV.js} +6 -6
  66. package/dist/{chunk-TAEJ2MRR.js → chunk-7IANFJ24.js} +56 -56
  67. package/dist/{chunk-PSQ2P2T3.js → chunk-7XZ7TOLQ.js} +3 -3
  68. package/dist/{chunk-6JEEY42N.js → chunk-AER3HD3B.js} +2 -2
  69. package/dist/{chunk-4B37KNMP.js → chunk-ANV373S5.js} +2 -2
  70. package/dist/{chunk-AYBAC2N4.js → chunk-B3I2QQU7.js} +3 -3
  71. package/dist/{chunk-TYLNWE4D.js → chunk-B7VKRCAG.js} +2 -2
  72. package/dist/{chunk-HXFIILGF.js → chunk-BFPF5N3H.js} +4 -4
  73. package/dist/{chunk-KQAFEZQX.js → chunk-BUKK5SWA.js} +2 -2
  74. package/dist/{chunk-53BLBDV6.js → chunk-BUKZ7MTN.js} +2 -2
  75. package/dist/{chunk-MCPSMWUC.js → chunk-CR72WZ3M.js} +9 -9
  76. package/dist/{chunk-YC2C67F7.js → chunk-CRXGQRNA.js} +3 -3
  77. package/dist/{chunk-WRDFYSUC.js → chunk-CZVNOTLR.js} +2 -2
  78. package/dist/{chunk-VPO53QMG.js → chunk-D6DOLQYK.js} +2 -2
  79. package/dist/{chunk-RGKXF4W3.js → chunk-E5IEI2MR.js} +2 -2
  80. package/dist/{chunk-Z2T5BPOZ.js → chunk-EIYJK7OD.js} +2 -2
  81. package/dist/{chunk-FRAL3EU4.js → chunk-EKPRLTAE.js} +2 -2
  82. package/dist/{chunk-C2KOW2UQ.js → chunk-EKR6OO4P.js} +2 -2
  83. package/dist/{chunk-TYGLV6ZG.js → chunk-EYGOM6AI.js} +2 -2
  84. package/dist/{chunk-TYGLV6ZG.js.map → chunk-EYGOM6AI.js.map} +1 -1
  85. package/dist/{chunk-SWZOAQUM.js → chunk-F2IU6A2L.js} +57 -57
  86. package/dist/{chunk-2AKIVSHP.js → chunk-FAKRTS3Y.js} +2 -2
  87. package/dist/{chunk-MZWHIAOL.js → chunk-FC3ZFEXF.js} +2 -2
  88. package/dist/{chunk-3PLAL2KP.js → chunk-FJ264QBP.js} +17 -9
  89. package/dist/chunk-FJ264QBP.js.map +1 -0
  90. package/dist/{chunk-7VFNGQ4V.js → chunk-FLDXEJFX.js} +2 -2
  91. package/dist/{chunk-JH4FCVWJ.js → chunk-G6OFEGUR.js} +2 -2
  92. package/dist/{chunk-L7PGPH4E.js → chunk-GCW7UT5I.js} +2 -2
  93. package/dist/{chunk-J7G656MY.js → chunk-GE5ZNDLE.js} +4 -4
  94. package/dist/{chunk-63YPKHAU.js → chunk-GLB6VV3J.js} +2 -2
  95. package/dist/{chunk-6F5BGIAF.js → chunk-GPVGAHXL.js} +3 -3
  96. package/dist/{chunk-XHX67LX6.js → chunk-GSBSGT43.js} +2 -2
  97. package/dist/{chunk-645WOU5I.js → chunk-H7BZBSP6.js} +4 -4
  98. package/dist/{chunk-GFYFKXWZ.js → chunk-HUDPXTXW.js} +2 -2
  99. package/dist/{chunk-L2JQSG5M.js → chunk-I7TR2OCU.js} +2 -2
  100. package/dist/{chunk-6SYS5YX3.js → chunk-IAOW2L6K.js} +2 -2
  101. package/dist/{chunk-STM4T335.js → chunk-IJH6METJ.js} +2 -2
  102. package/dist/{chunk-3XVBGGF3.js → chunk-IZRNMXZC.js} +2 -2
  103. package/dist/{chunk-XHVO3CGX.js → chunk-JGS55BAS.js} +53 -2
  104. package/dist/chunk-JGS55BAS.js.map +1 -0
  105. package/dist/{chunk-Y5ZHZKZD.js → chunk-JM6U3SAE.js} +2 -2
  106. package/dist/{chunk-74AY3S7U.js → chunk-JNLYHJG7.js} +4 -4
  107. package/dist/{chunk-QOUKZ2N3.js → chunk-JOOGPZJE.js} +2 -2
  108. package/dist/{chunk-EGNONTVT.js → chunk-JORSMFL6.js} +6 -6
  109. package/dist/{chunk-JF3MEIHO.js → chunk-JQCP5QW3.js} +4 -4
  110. package/dist/{chunk-POGPI5GR.js → chunk-JRTKYFFY.js} +2 -2
  111. package/dist/{chunk-5UPOKIFP.js → chunk-JT3IXJIL.js} +12 -12
  112. package/dist/{chunk-6DTIYAAN.js → chunk-JZFJZLJY.js} +2 -2
  113. package/dist/{chunk-6QOL4G76.js → chunk-KQXRVELF.js} +2 -2
  114. package/dist/{chunk-KOAVX2IT.js → chunk-L74NWAD4.js} +2 -2
  115. package/dist/{chunk-5DCS4C4S.js → chunk-LJXBFVI2.js} +4 -4
  116. package/dist/{chunk-OKKBOTRA.js → chunk-LPD6I2U6.js} +2 -2
  117. package/dist/{chunk-N7DVBHU3.js → chunk-LR7RW4T6.js} +3 -3
  118. package/dist/{chunk-FZVZYU5C.js → chunk-LXN737FX.js} +2 -2
  119. package/dist/{chunk-LOMSBYNS.js → chunk-MD3W2H3G.js} +298 -95
  120. package/dist/chunk-MD3W2H3G.js.map +1 -0
  121. package/dist/{chunk-7ZRRJ6RG.js → chunk-MGYZENUY.js} +2 -2
  122. package/dist/{chunk-YQ6SLFNZ.js → chunk-MPJDQC4G.js} +3 -3
  123. package/dist/{chunk-5ANUG4JZ.js → chunk-NJ2DZYEK.js} +2 -2
  124. package/dist/{chunk-OLH4XCLU.js → chunk-O2O4FDAH.js} +2 -2
  125. package/dist/{chunk-CVMAOPAH.js → chunk-ODJ2HRFW.js} +10 -10
  126. package/dist/{chunk-2NLLXCJG.js → chunk-OWHERGF2.js} +2 -2
  127. package/dist/{chunk-I73ZSORJ.js → chunk-OXSTKCYK.js} +4 -4
  128. package/dist/{chunk-RWRHGE75.js → chunk-P3YUEPSQ.js} +2 -2
  129. package/dist/{chunk-UFM3PJDT.js → chunk-PARM6OYL.js} +1 -1
  130. package/dist/chunk-PARM6OYL.js.map +1 -0
  131. package/dist/{chunk-TPKB7T6Z.js → chunk-Q6UZREJK.js} +2 -2
  132. package/dist/{chunk-UJDTXWMT.js → chunk-QIMGULGN.js} +2 -2
  133. package/dist/{chunk-E24RUQEN.js → chunk-QNIYL5SK.js} +2 -2
  134. package/dist/{chunk-KOY25HUB.js → chunk-QYAXMXOB.js} +2 -2
  135. package/dist/{chunk-X247CYL6.js → chunk-RIAKNXZB.js} +4 -4
  136. package/dist/{chunk-WCIDCJOQ.js → chunk-RO2NNWR5.js} +3 -3
  137. package/dist/{chunk-AYXRK264.js → chunk-RROFIAYI.js} +9 -9
  138. package/dist/{chunk-YYGZ4EIY.js → chunk-RUAIO5UA.js} +2 -2
  139. package/dist/{chunk-FQFMLOAC.js → chunk-RWW5KPIY.js} +18 -18
  140. package/dist/{chunk-E5PVMB3I.js → chunk-SDXBR5QO.js} +2 -2
  141. package/dist/{chunk-NH6GZEQN.js → chunk-SJHFU52W.js} +8 -8
  142. package/dist/{chunk-FGEY2AGV.js → chunk-SRPGA6WN.js} +2 -2
  143. package/dist/{chunk-CUWOSRCS.js → chunk-SUKPM6DV.js} +2 -2
  144. package/dist/{chunk-TXP7Q7T5.js → chunk-TTQYX7VU.js} +2 -2
  145. package/dist/{chunk-TDCR6PQL.js → chunk-TWRPWJJT.js} +2 -2
  146. package/dist/{chunk-I75BWXRZ.js → chunk-U66CTIF5.js} +2 -2
  147. package/dist/{chunk-DG4H56SK.js → chunk-UIK3U36O.js} +2 -2
  148. package/dist/{chunk-XLEP7SS3.js → chunk-UMSH4I3E.js} +2 -2
  149. package/dist/{chunk-X7Y7WX73.js → chunk-UVYI6VIX.js} +1 -1
  150. package/dist/{chunk-LHBOFROT.js → chunk-V2XMG7GM.js} +2 -2
  151. package/dist/chunk-VA3GNAWQ.js +58 -0
  152. package/dist/chunk-VA3GNAWQ.js.map +1 -0
  153. package/dist/{chunk-ZAP7BKTZ.js → chunk-VCOCOBUS.js} +6 -6
  154. package/dist/{chunk-4P4VLPGB.js → chunk-VECRSYQG.js} +1 -1
  155. package/dist/{chunk-GGI6FLO6.js → chunk-VHBGJAYC.js} +2 -2
  156. package/dist/{chunk-QO5KDQGG.js → chunk-VIS23B6O.js} +7 -7
  157. package/dist/{chunk-NMKETOAX.js → chunk-VSHWPOUB.js} +2 -2
  158. package/dist/{chunk-UBN5AOLT.js → chunk-W5EO4USJ.js} +2 -2
  159. package/dist/{chunk-Y7427SL7.js → chunk-WCGJK4NQ.js} +4 -4
  160. package/dist/{chunk-7HXZOWTR.js → chunk-WQYS47G4.js} +2 -2
  161. package/dist/{chunk-JH2ALMPR.js → chunk-WR5POHQ3.js} +2 -2
  162. package/dist/{chunk-VSSQIBVU.js → chunk-WT2VVYBM.js} +2 -2
  163. package/dist/{chunk-EHIKY2IA.js → chunk-WU5WTCH5.js} +2 -2
  164. package/dist/{chunk-QKXPOLQD.js → chunk-WUBGMV3G.js} +6 -6
  165. package/dist/{chunk-FKTMWDN2.js → chunk-WUL6LDJ4.js} +2 -2
  166. package/dist/{chunk-U7HJBODU.js → chunk-XKTHJHSQ.js} +5 -5
  167. package/dist/{chunk-JFI3ATK4.js → chunk-XMYWYJM2.js} +2 -2
  168. package/dist/{chunk-64S6X4IU.js → chunk-XTN54NML.js} +4 -4
  169. package/dist/{chunk-VGFNTY3Y.js → chunk-YFXRLRKP.js} +2 -2
  170. package/dist/{chunk-DAOMWGO2.js → chunk-ZX5N5D6M.js} +4 -4
  171. package/dist/{chunk-VGRM43X6.js → chunk-ZXFKG7VZ.js} +2 -2
  172. package/dist/cli.js +121 -121
  173. package/dist/coding/export-okf-codegraph.js +20 -20
  174. package/dist/coding/pre-action-gate.js +2 -2
  175. package/dist/compounding/engine.js +21 -21
  176. package/dist/config.d.ts.map +1 -1
  177. package/dist/config.js +29 -29
  178. package/dist/connectors/codex-materialize-runner.js +19 -19
  179. package/dist/connectors/index.js +19 -19
  180. package/dist/contradiction/index.js +5 -5
  181. package/dist/convergence-refresh.js +21 -21
  182. package/dist/corpus-watermark.js +21 -21
  183. package/dist/deep-recall-http-glue.js +11 -11
  184. package/dist/deep-recall.js +2 -2
  185. package/dist/entity-retrieval.js +20 -20
  186. package/dist/event-order-recall.js +2 -2
  187. package/dist/explicit-capture.js +6 -6
  188. package/dist/external-wiki-access.js +74 -74
  189. package/dist/extraction-window-drain.d.ts +48 -0
  190. package/dist/extraction-window-drain.d.ts.map +1 -0
  191. package/dist/extraction-window-drain.js +14 -0
  192. package/dist/extraction.js +27 -27
  193. package/dist/{graph-edge-decay-2BZTY2IM.js → graph-edge-decay-3HVLMT6U.js} +5 -5
  194. package/dist/graph-edge-decay-3HVLMT6U.js.map +1 -0
  195. package/dist/graph-jsonl.js +3 -3
  196. package/dist/graph-snapshot.js +3 -3
  197. package/dist/graph.js +4 -4
  198. package/dist/harmonic-retrieval.js +20 -20
  199. package/dist/harmonic-source-lookup.js +2 -2
  200. package/dist/index.js +208 -207
  201. package/dist/lcm/engine.js +2 -2
  202. package/dist/lcm/index.js +7 -7
  203. package/dist/local-llm.js +2 -2
  204. package/dist/location/index.js +22 -22
  205. package/dist/maintenance/memory-governance.js +19 -19
  206. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +19 -19
  207. package/dist/maintenance/rebuild-memory-projection-runner.js +21 -21
  208. package/dist/maintenance/rebuild-memory-projection.js +20 -20
  209. package/dist/memory-browse-operations.js +74 -74
  210. package/dist/memory-browse.js +6 -6
  211. package/dist/memory-subject.js +3 -3
  212. package/dist/namespaces/migrate.js +20 -20
  213. package/dist/namespaces/search.js +7 -7
  214. package/dist/namespaces/storage.js +19 -19
  215. package/dist/offline-sync-changeset-generations.js +3 -3
  216. package/dist/offline-sync-embedding-generation.js +2 -2
  217. package/dist/offline-sync-file-io.js +2 -2
  218. package/dist/offline-sync-impression-drain.js +3 -3
  219. package/dist/offline-sync-snapshot-stream.js +8 -8
  220. package/dist/offline-sync-upload-staging.js +3 -3
  221. package/dist/offline-sync.js +9 -9
  222. package/dist/operator-doctor-corpus.js +22 -22
  223. package/dist/operator-toolkit.js +40 -40
  224. package/dist/orchestration/extraction-drain.d.ts +90 -0
  225. package/dist/orchestration/extraction-drain.d.ts.map +1 -0
  226. package/dist/orchestration/extraction-run-helpers.d.ts +3 -0
  227. package/dist/orchestration/extraction-run-helpers.d.ts.map +1 -1
  228. package/dist/orchestration/extraction-run.d.ts +4 -1
  229. package/dist/orchestration/extraction-run.d.ts.map +1 -1
  230. package/dist/orchestration/maintenance.js +33 -33
  231. package/dist/orchestration/turn-ingestion.d.ts +3 -0
  232. package/dist/orchestration/turn-ingestion.d.ts.map +1 -1
  233. package/dist/orchestrator.d.ts +8 -0
  234. package/dist/orchestrator.d.ts.map +1 -1
  235. package/dist/orchestrator.js +161 -160
  236. package/dist/qmd.js +5 -5
  237. package/dist/recall-explain-renderer.js +3 -3
  238. package/dist/recall-navigate-access.js +2 -2
  239. package/dist/recall-navigate-disclosure.js +2 -2
  240. package/dist/recall-navigate.js +2 -2
  241. package/dist/recall-navigation-operations.js +74 -74
  242. package/dist/recall-navigation.js +73 -73
  243. package/dist/recall-state-view-admission.js +6 -6
  244. package/dist/recall-why-service.js +6 -6
  245. package/dist/recall-xray-cli.js +4 -4
  246. package/dist/recall-xray-renderer.js +3 -3
  247. package/dist/recall-xray.js +2 -2
  248. package/dist/reconcile/manifest.js +3 -3
  249. package/dist/{resolution-4ZEQPXUZ.js → resolution-NNYG37YB.js} +6 -6
  250. package/dist/resolution-NNYG37YB.js.map +1 -0
  251. package/dist/resume-bundles.js +30 -30
  252. package/dist/retrieval-agents.js +2 -2
  253. package/dist/salvage-envelope.js +5 -5
  254. package/dist/search/factory.js +6 -6
  255. package/dist/search/index.js +10 -10
  256. package/dist/secure-store/index.js +2 -2
  257. package/dist/semantic-consolidation.js +20 -20
  258. package/dist/semantic-rule-promotion.js +19 -19
  259. package/dist/semantic-rule-verifier.js +19 -19
  260. package/dist/source-agent-qualifier.js +23 -23
  261. package/dist/standup/build.js +19 -19
  262. package/dist/storage/dropped-extraction-chunk.d.ts +8 -0
  263. package/dist/storage/dropped-extraction-chunk.d.ts.map +1 -0
  264. package/dist/storage.d.ts +1 -0
  265. package/dist/storage.d.ts.map +1 -1
  266. package/dist/storage.js +18 -18
  267. package/dist/subject-config.js +4 -4
  268. package/dist/summarizer.js +3 -3
  269. package/dist/support-passport/index.js +76 -76
  270. package/dist/transfer/backup.js +2 -2
  271. package/dist/transfer/capsule-export.js +2 -2
  272. package/dist/transfer/capsule-import.js +2 -2
  273. package/dist/transfer/export-okf.js +20 -20
  274. package/dist/types.d.ts +7 -0
  275. package/dist/types.d.ts.map +1 -1
  276. package/dist/types.js +1 -1
  277. package/dist/verified-recall.js +19 -19
  278. package/dist/who-knows-cli.js +20 -20
  279. package/dist/who-knows.js +19 -19
  280. package/dist/write-envelope.js +4 -4
  281. package/package.json +2 -2
  282. package/src/buffer-drop-extraction-chunk.test.ts +196 -0
  283. package/src/buffer-types.ts +65 -0
  284. package/src/buffer.ts +60 -62
  285. package/src/config.ts +8 -0
  286. package/src/extraction-window-drain.test.ts +123 -0
  287. package/src/extraction-window-drain.ts +110 -0
  288. package/src/orchestration/extraction-drain.ts +261 -0
  289. package/src/orchestration/extraction-run-helpers.ts +8 -0
  290. package/src/orchestration/extraction-run.ts +5 -4
  291. package/src/orchestration/turn-ingestion.ts +9 -5
  292. package/src/orchestrator.ts +21 -0
  293. package/src/secure-store/secure-fs.ts +3 -1
  294. package/src/storage/dropped-extraction-chunk.ts +27 -0
  295. package/src/storage-dropped-chunk-filenames.test.ts +30 -0
  296. package/src/storage.ts +6 -7
  297. package/src/types.ts +7 -0
  298. package/dist/chunk-3PLAL2KP.js.map +0 -1
  299. package/dist/chunk-LOMSBYNS.js.map +0 -1
  300. package/dist/chunk-UFM3PJDT.js.map +0 -1
  301. package/dist/chunk-WCBLPKG3.js.map +0 -1
  302. package/dist/chunk-WEK3OUGO.js.map +0 -1
  303. package/dist/chunk-XHVO3CGX.js.map +0 -1
  304. /package/dist/{auto-sync-432USQDH.js.map → auto-sync-BNCBMU6H.js.map} +0 -0
  305. /package/dist/{capsule-crypto-7FJQINUR.js.map → buffer-types.js.map} +0 -0
  306. /package/dist/{graph-edge-decay-2BZTY2IM.js.map → capsule-crypto-GWVG7LGC.js.map} +0 -0
  307. /package/dist/{chunk-5K23NQRI.js.map → chunk-22YJQTPN.js.map} +0 -0
  308. /package/dist/{chunk-MKE5DP3S.js.map → chunk-23ZMQONL.js.map} +0 -0
  309. /package/dist/{chunk-3K5IEJTK.js.map → chunk-2AV2U2SZ.js.map} +0 -0
  310. /package/dist/{chunk-HJ3UTGIW.js.map → chunk-2JNBPOZ2.js.map} +0 -0
  311. /package/dist/{chunk-EEOYF3IB.js.map → chunk-3RJDYZJE.js.map} +0 -0
  312. /package/dist/{chunk-SZPPCEYT.js.map → chunk-4HJ2QK32.js.map} +0 -0
  313. /package/dist/{chunk-OLHN4ZNT.js.map → chunk-4LLV2N3R.js.map} +0 -0
  314. /package/dist/{chunk-P5CUEB2Q.js.map → chunk-4QLKVZH6.js.map} +0 -0
  315. /package/dist/{chunk-4IZ6AC2U.js.map → chunk-4UT2NUAC.js.map} +0 -0
  316. /package/dist/{chunk-VC3X7XP3.js.map → chunk-5Q6CR65T.js.map} +0 -0
  317. /package/dist/{chunk-XTBEXZFN.js.map → chunk-5SF7JOJB.js.map} +0 -0
  318. /package/dist/{chunk-DKHX2FHI.js.map → chunk-64WHWIPL.js.map} +0 -0
  319. /package/dist/{chunk-TVIGN3XZ.js.map → chunk-6FRFVIKC.js.map} +0 -0
  320. /package/dist/{chunk-JIA435P3.js.map → chunk-6ITNEPJO.js.map} +0 -0
  321. /package/dist/{chunk-3AODCBKX.js.map → chunk-6Z2ZWBOV.js.map} +0 -0
  322. /package/dist/{chunk-TAEJ2MRR.js.map → chunk-7IANFJ24.js.map} +0 -0
  323. /package/dist/{chunk-PSQ2P2T3.js.map → chunk-7XZ7TOLQ.js.map} +0 -0
  324. /package/dist/{chunk-6JEEY42N.js.map → chunk-AER3HD3B.js.map} +0 -0
  325. /package/dist/{chunk-4B37KNMP.js.map → chunk-ANV373S5.js.map} +0 -0
  326. /package/dist/{chunk-AYBAC2N4.js.map → chunk-B3I2QQU7.js.map} +0 -0
  327. /package/dist/{chunk-TYLNWE4D.js.map → chunk-B7VKRCAG.js.map} +0 -0
  328. /package/dist/{chunk-HXFIILGF.js.map → chunk-BFPF5N3H.js.map} +0 -0
  329. /package/dist/{chunk-KQAFEZQX.js.map → chunk-BUKK5SWA.js.map} +0 -0
  330. /package/dist/{chunk-53BLBDV6.js.map → chunk-BUKZ7MTN.js.map} +0 -0
  331. /package/dist/{chunk-MCPSMWUC.js.map → chunk-CR72WZ3M.js.map} +0 -0
  332. /package/dist/{chunk-YC2C67F7.js.map → chunk-CRXGQRNA.js.map} +0 -0
  333. /package/dist/{chunk-WRDFYSUC.js.map → chunk-CZVNOTLR.js.map} +0 -0
  334. /package/dist/{chunk-VPO53QMG.js.map → chunk-D6DOLQYK.js.map} +0 -0
  335. /package/dist/{chunk-RGKXF4W3.js.map → chunk-E5IEI2MR.js.map} +0 -0
  336. /package/dist/{chunk-Z2T5BPOZ.js.map → chunk-EIYJK7OD.js.map} +0 -0
  337. /package/dist/{chunk-FRAL3EU4.js.map → chunk-EKPRLTAE.js.map} +0 -0
  338. /package/dist/{chunk-C2KOW2UQ.js.map → chunk-EKR6OO4P.js.map} +0 -0
  339. /package/dist/{chunk-SWZOAQUM.js.map → chunk-F2IU6A2L.js.map} +0 -0
  340. /package/dist/{chunk-2AKIVSHP.js.map → chunk-FAKRTS3Y.js.map} +0 -0
  341. /package/dist/{chunk-MZWHIAOL.js.map → chunk-FC3ZFEXF.js.map} +0 -0
  342. /package/dist/{chunk-7VFNGQ4V.js.map → chunk-FLDXEJFX.js.map} +0 -0
  343. /package/dist/{chunk-JH4FCVWJ.js.map → chunk-G6OFEGUR.js.map} +0 -0
  344. /package/dist/{chunk-L7PGPH4E.js.map → chunk-GCW7UT5I.js.map} +0 -0
  345. /package/dist/{chunk-J7G656MY.js.map → chunk-GE5ZNDLE.js.map} +0 -0
  346. /package/dist/{chunk-63YPKHAU.js.map → chunk-GLB6VV3J.js.map} +0 -0
  347. /package/dist/{chunk-6F5BGIAF.js.map → chunk-GPVGAHXL.js.map} +0 -0
  348. /package/dist/{chunk-XHX67LX6.js.map → chunk-GSBSGT43.js.map} +0 -0
  349. /package/dist/{chunk-645WOU5I.js.map → chunk-H7BZBSP6.js.map} +0 -0
  350. /package/dist/{chunk-GFYFKXWZ.js.map → chunk-HUDPXTXW.js.map} +0 -0
  351. /package/dist/{chunk-L2JQSG5M.js.map → chunk-I7TR2OCU.js.map} +0 -0
  352. /package/dist/{chunk-6SYS5YX3.js.map → chunk-IAOW2L6K.js.map} +0 -0
  353. /package/dist/{chunk-STM4T335.js.map → chunk-IJH6METJ.js.map} +0 -0
  354. /package/dist/{chunk-3XVBGGF3.js.map → chunk-IZRNMXZC.js.map} +0 -0
  355. /package/dist/{chunk-Y5ZHZKZD.js.map → chunk-JM6U3SAE.js.map} +0 -0
  356. /package/dist/{chunk-74AY3S7U.js.map → chunk-JNLYHJG7.js.map} +0 -0
  357. /package/dist/{chunk-QOUKZ2N3.js.map → chunk-JOOGPZJE.js.map} +0 -0
  358. /package/dist/{chunk-EGNONTVT.js.map → chunk-JORSMFL6.js.map} +0 -0
  359. /package/dist/{chunk-JF3MEIHO.js.map → chunk-JQCP5QW3.js.map} +0 -0
  360. /package/dist/{chunk-POGPI5GR.js.map → chunk-JRTKYFFY.js.map} +0 -0
  361. /package/dist/{chunk-5UPOKIFP.js.map → chunk-JT3IXJIL.js.map} +0 -0
  362. /package/dist/{chunk-6DTIYAAN.js.map → chunk-JZFJZLJY.js.map} +0 -0
  363. /package/dist/{chunk-6QOL4G76.js.map → chunk-KQXRVELF.js.map} +0 -0
  364. /package/dist/{chunk-KOAVX2IT.js.map → chunk-L74NWAD4.js.map} +0 -0
  365. /package/dist/{chunk-5DCS4C4S.js.map → chunk-LJXBFVI2.js.map} +0 -0
  366. /package/dist/{chunk-OKKBOTRA.js.map → chunk-LPD6I2U6.js.map} +0 -0
  367. /package/dist/{chunk-N7DVBHU3.js.map → chunk-LR7RW4T6.js.map} +0 -0
  368. /package/dist/{chunk-FZVZYU5C.js.map → chunk-LXN737FX.js.map} +0 -0
  369. /package/dist/{chunk-7ZRRJ6RG.js.map → chunk-MGYZENUY.js.map} +0 -0
  370. /package/dist/{chunk-YQ6SLFNZ.js.map → chunk-MPJDQC4G.js.map} +0 -0
  371. /package/dist/{chunk-5ANUG4JZ.js.map → chunk-NJ2DZYEK.js.map} +0 -0
  372. /package/dist/{chunk-OLH4XCLU.js.map → chunk-O2O4FDAH.js.map} +0 -0
  373. /package/dist/{chunk-CVMAOPAH.js.map → chunk-ODJ2HRFW.js.map} +0 -0
  374. /package/dist/{chunk-2NLLXCJG.js.map → chunk-OWHERGF2.js.map} +0 -0
  375. /package/dist/{chunk-I73ZSORJ.js.map → chunk-OXSTKCYK.js.map} +0 -0
  376. /package/dist/{chunk-RWRHGE75.js.map → chunk-P3YUEPSQ.js.map} +0 -0
  377. /package/dist/{chunk-TPKB7T6Z.js.map → chunk-Q6UZREJK.js.map} +0 -0
  378. /package/dist/{chunk-UJDTXWMT.js.map → chunk-QIMGULGN.js.map} +0 -0
  379. /package/dist/{chunk-E24RUQEN.js.map → chunk-QNIYL5SK.js.map} +0 -0
  380. /package/dist/{chunk-KOY25HUB.js.map → chunk-QYAXMXOB.js.map} +0 -0
  381. /package/dist/{chunk-X247CYL6.js.map → chunk-RIAKNXZB.js.map} +0 -0
  382. /package/dist/{chunk-WCIDCJOQ.js.map → chunk-RO2NNWR5.js.map} +0 -0
  383. /package/dist/{chunk-AYXRK264.js.map → chunk-RROFIAYI.js.map} +0 -0
  384. /package/dist/{chunk-YYGZ4EIY.js.map → chunk-RUAIO5UA.js.map} +0 -0
  385. /package/dist/{chunk-FQFMLOAC.js.map → chunk-RWW5KPIY.js.map} +0 -0
  386. /package/dist/{chunk-E5PVMB3I.js.map → chunk-SDXBR5QO.js.map} +0 -0
  387. /package/dist/{chunk-NH6GZEQN.js.map → chunk-SJHFU52W.js.map} +0 -0
  388. /package/dist/{chunk-FGEY2AGV.js.map → chunk-SRPGA6WN.js.map} +0 -0
  389. /package/dist/{chunk-CUWOSRCS.js.map → chunk-SUKPM6DV.js.map} +0 -0
  390. /package/dist/{chunk-TXP7Q7T5.js.map → chunk-TTQYX7VU.js.map} +0 -0
  391. /package/dist/{chunk-TDCR6PQL.js.map → chunk-TWRPWJJT.js.map} +0 -0
  392. /package/dist/{chunk-I75BWXRZ.js.map → chunk-U66CTIF5.js.map} +0 -0
  393. /package/dist/{chunk-DG4H56SK.js.map → chunk-UIK3U36O.js.map} +0 -0
  394. /package/dist/{chunk-XLEP7SS3.js.map → chunk-UMSH4I3E.js.map} +0 -0
  395. /package/dist/{chunk-X7Y7WX73.js.map → chunk-UVYI6VIX.js.map} +0 -0
  396. /package/dist/{chunk-LHBOFROT.js.map → chunk-V2XMG7GM.js.map} +0 -0
  397. /package/dist/{chunk-ZAP7BKTZ.js.map → chunk-VCOCOBUS.js.map} +0 -0
  398. /package/dist/{chunk-4P4VLPGB.js.map → chunk-VECRSYQG.js.map} +0 -0
  399. /package/dist/{chunk-GGI6FLO6.js.map → chunk-VHBGJAYC.js.map} +0 -0
  400. /package/dist/{chunk-QO5KDQGG.js.map → chunk-VIS23B6O.js.map} +0 -0
  401. /package/dist/{chunk-NMKETOAX.js.map → chunk-VSHWPOUB.js.map} +0 -0
  402. /package/dist/{chunk-UBN5AOLT.js.map → chunk-W5EO4USJ.js.map} +0 -0
  403. /package/dist/{chunk-Y7427SL7.js.map → chunk-WCGJK4NQ.js.map} +0 -0
  404. /package/dist/{chunk-7HXZOWTR.js.map → chunk-WQYS47G4.js.map} +0 -0
  405. /package/dist/{chunk-JH2ALMPR.js.map → chunk-WR5POHQ3.js.map} +0 -0
  406. /package/dist/{chunk-VSSQIBVU.js.map → chunk-WT2VVYBM.js.map} +0 -0
  407. /package/dist/{chunk-EHIKY2IA.js.map → chunk-WU5WTCH5.js.map} +0 -0
  408. /package/dist/{chunk-QKXPOLQD.js.map → chunk-WUBGMV3G.js.map} +0 -0
  409. /package/dist/{chunk-FKTMWDN2.js.map → chunk-WUL6LDJ4.js.map} +0 -0
  410. /package/dist/{chunk-U7HJBODU.js.map → chunk-XKTHJHSQ.js.map} +0 -0
  411. /package/dist/{chunk-JFI3ATK4.js.map → chunk-XMYWYJM2.js.map} +0 -0
  412. /package/dist/{chunk-64S6X4IU.js.map → chunk-XTN54NML.js.map} +0 -0
  413. /package/dist/{chunk-VGFNTY3Y.js.map → chunk-YFXRLRKP.js.map} +0 -0
  414. /package/dist/{chunk-DAOMWGO2.js.map → chunk-ZX5N5D6M.js.map} +0 -0
  415. /package/dist/{chunk-VGRM43X6.js.map → chunk-ZXFKG7VZ.js.map} +0 -0
  416. /package/dist/{resolution-4ZEQPXUZ.js.map → extraction-window-drain.js.map} +0 -0
@@ -22,7 +22,7 @@ import {
22
22
  } from "./chunk-VY6BD5KB.js";
23
23
  import {
24
24
  normalizeQmdResultPath
25
- } from "./chunk-LHBOFROT.js";
25
+ } from "./chunk-V2XMG7GM.js";
26
26
  import {
27
27
  withholdToolScopedFromSharedNamespace
28
28
  } from "./chunk-S2V7RUCL.js";
@@ -40,9 +40,6 @@ import {
40
40
  import {
41
41
  createMemorySnapshot
42
42
  } from "./chunk-S2HLHAZ4.js";
43
- import {
44
- rotateMarkdownFileToArchive
45
- } from "./chunk-DM2T26WE.js";
46
43
  import {
47
44
  closeContinuityIncidentRecord,
48
45
  createContinuityIncidentRecord,
@@ -52,6 +49,9 @@ import {
52
49
  serializeContinuityIncident,
53
50
  upsertContinuityLoopInMarkdown
54
51
  } from "./chunk-LDXUBPMO.js";
52
+ import {
53
+ rotateMarkdownFileToArchive
54
+ } from "./chunk-DM2T26WE.js";
55
55
  import {
56
56
  parseProvenanceSources,
57
57
  parseProvenanceTag,
@@ -69,7 +69,7 @@ import {
69
69
  invalidationCommitFingerprint,
70
70
  parseTombstoneBlockedOfflineSyncMemory,
71
71
  withCasCommitReceipt
72
- } from "./chunk-YQ6SLFNZ.js";
72
+ } from "./chunk-MPJDQC4G.js";
73
73
  import {
74
74
  matchEntitySchemaSection,
75
75
  normalizeEntityStructuredSection,
@@ -163,12 +163,12 @@ import {
163
163
  import {
164
164
  SPECULATIVE_TTL_DAYS,
165
165
  confidenceTier
166
- } from "./chunk-UFM3PJDT.js";
166
+ } from "./chunk-PARM6OYL.js";
167
167
  import {
168
168
  composeMemoryEnvelope,
169
169
  isSealedMemoryEnvelope,
170
170
  sealedWriteToLegacyArgs
171
- } from "./chunk-TDCR6PQL.js";
171
+ } from "./chunk-TWRPWJJT.js";
172
172
  import {
173
173
  DEFAULT_CITATION_FORMAT,
174
174
  hasCitationForTemplate,
@@ -189,7 +189,7 @@ import {
189
189
  readMemoryActionEventRowsFromLines,
190
190
  readProjectionRebuiltAt,
191
191
  serializeLifecycleAppendPayload
192
- } from "./chunk-UJDTXWMT.js";
192
+ } from "./chunk-QIMGULGN.js";
193
193
  import {
194
194
  assertMemoryFrontmatterId,
195
195
  warnProjectionFallback
@@ -214,7 +214,7 @@ import {
214
214
  CONTENT_HASH_INDEX_RETRY_MAX_DELAY_MS,
215
215
  ContentHashIndex,
216
216
  FactHashIndexNotAuthoritativeError
217
- } from "./chunk-UBN5AOLT.js";
217
+ } from "./chunk-W5EO4USJ.js";
218
218
  import {
219
219
  computeLegacyContentHash
220
220
  } from "./chunk-5FVVY2EB.js";
@@ -257,7 +257,7 @@ import {
257
257
  readMaybeEncryptedFile,
258
258
  readMaybeEncryptedFileBuffer,
259
259
  writeMaybeEncryptedFile
260
- } from "./chunk-TYGLV6ZG.js";
260
+ } from "./chunk-EYGOM6AI.js";
261
261
  import {
262
262
  assertPathInsideRoot,
263
263
  pathIsInside
@@ -283,7 +283,7 @@ import {
283
283
  realpath as realpath3,
284
284
  stat as stat3,
285
285
  writeFile,
286
- mkdir,
286
+ mkdir as mkdir2,
287
287
  unlink as unlink4,
288
288
  appendFile,
289
289
  open
@@ -313,7 +313,7 @@ function parseDriftProvenance(fm) {
313
313
  }
314
314
 
315
315
  // src/storage.ts
316
- import path13 from "path";
316
+ import path14 from "path";
317
317
 
318
318
  // src/storage/tombstone-migration-sources.ts
319
319
  import { statSync } from "fs";
@@ -5118,6 +5118,20 @@ Reason: ${reason}`;
5118
5118
  }
5119
5119
  }
5120
5120
 
5121
+ // src/storage/dropped-extraction-chunk.ts
5122
+ import { randomUUID } from "crypto";
5123
+ import { mkdir } from "fs/promises";
5124
+ import path13 from "path";
5125
+ async function saveDroppedExtractionChunk(stateDir, writeSecureFile, bufferKey, reason, turns) {
5126
+ const droppedDir = path13.join(stateDir, "dropped");
5127
+ await mkdir(droppedDir, { recursive: true });
5128
+ const safeKey = bufferKey.replace(/[^a-zA-Z0-9._-]/g, "-").slice(0, 80) || "default";
5129
+ const filePath = path13.join(droppedDir, `${Date.now()}-${randomUUID().slice(0, 8)}-${safeKey}.json`);
5130
+ const payload = { bufferKey, reason, droppedAt: (/* @__PURE__ */ new Date()).toISOString(), turns };
5131
+ await writeSecureFile(filePath, JSON.stringify(payload, null, 2));
5132
+ return filePath;
5133
+ }
5134
+
5121
5135
  // src/storage/entity-timeline.ts
5122
5136
  import { createHash as createHash5 } from "crypto";
5123
5137
  var ENTITY_TIMELINE_METADATA_MARKER = "remnic-meta-v1";
@@ -6118,17 +6132,17 @@ function inferEntityTypeFromContent(content) {
6118
6132
  }
6119
6133
  var KNOWN_ENTITY_FILENAME_PREFIXES = /* @__PURE__ */ new Set(["company", "other", "person", "place", "project", "tool", "topic"]);
6120
6134
  function inferEntityTypeFromFilename(pathRel) {
6121
- const basename = path13.basename(pathRel, ".md").toLowerCase();
6135
+ const basename = path14.basename(pathRel, ".md").toLowerCase();
6122
6136
  const separator = basename.indexOf("-");
6123
6137
  if (separator <= 0) return void 0;
6124
6138
  const candidate = basename.slice(0, separator);
6125
6139
  return KNOWN_ENTITY_FILENAME_PREFIXES.has(candidate) ? candidate : void 0;
6126
6140
  }
6127
6141
  function normalizeFrontmatterForPath(frontmatter, pathRel, content = "") {
6128
- const normalizedPath = pathRel.split(path13.sep).join("/");
6142
+ const normalizedPath = pathRel.split(path14.sep).join("/");
6129
6143
  let normalizedFrontmatter = frontmatter;
6130
6144
  if (normalizedPath === "entities" || normalizedPath.startsWith("entities/") || normalizedPath.includes("/entities/")) {
6131
- const basename = path13.basename(pathRel, ".md");
6145
+ const basename = path14.basename(pathRel, ".md");
6132
6146
  const inferredType = inferEntityTypeFromContent(content) || inferEntityTypeFromFilename(pathRel) || "entity";
6133
6147
  const existingTags = Array.isArray(frontmatter.tags) ? frontmatter.tags : [];
6134
6148
  normalizedFrontmatter = {
@@ -6601,9 +6615,9 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
6601
6615
  this.entitySchemas = entitySchemas;
6602
6616
  this.deletionRevisionStore = new DeletionRevisionStore({
6603
6617
  baseDir,
6604
- deletionRevisionMetadataPath: path13.join(baseDir, ".offline-sync", "deletion-revisions.v1.json"),
6605
- invalidationCommitMetadataPath: path13.join(baseDir, ".offline-sync", "invalidation-commits.v1.json"),
6606
- deletionRevisionLockPath: path13.join(baseDir, ".offline-sync", "deletion-revisions.v1.json.lock"),
6618
+ deletionRevisionMetadataPath: path14.join(baseDir, ".offline-sync", "deletion-revisions.v1.json"),
6619
+ invalidationCommitMetadataPath: path14.join(baseDir, ".offline-sync", "invalidation-commits.v1.json"),
6620
+ deletionRevisionLockPath: path14.join(baseDir, ".offline-sync", "deletion-revisions.v1.json.lock"),
6607
6621
  assertManagedStoragePath: (filePath, method) => this.assertManagedStoragePath(filePath, method)
6608
6622
  });
6609
6623
  this.casRevisions = new CasRevisionHost(baseDir);
@@ -6789,8 +6803,8 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
6789
6803
  }
6790
6804
  /** Whether `filePath` resolves to `stateDir` itself or a path contained in it. */
6791
6805
  isStateFilePath(filePath) {
6792
- const rel = path13.relative(this.stateDir, path13.resolve(filePath));
6793
- return rel === "" || !rel.startsWith("..") && !path13.isAbsolute(rel);
6806
+ const rel = path14.relative(this.stateDir, path14.resolve(filePath));
6807
+ return rel === "" || !rel.startsWith("..") && !path14.isAbsolute(rel);
6794
6808
  }
6795
6809
  // ── Tombstone store (issue #1579) ───────────────────────────────────────
6796
6810
  // Instance-scoped (rule 11) + namespace-scoped (rule 42) tombstone index.
@@ -6905,8 +6919,8 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
6905
6919
  * /srv/cold/remnic), skipping the patch and stranding a stale hot entry.
6906
6920
  */
6907
6921
  isColdOrArchiveTierPath(p) {
6908
- const rel = path13.relative(this.baseDir, p);
6909
- return rel === "cold" || rel === "archive" || rel.startsWith(`cold${path13.sep}`) || rel.startsWith(`archive${path13.sep}`);
6922
+ const rel = path14.relative(this.baseDir, p);
6923
+ return rel === "cold" || rel === "archive" || rel.startsWith(`cold${path14.sep}`) || rel.startsWith(`archive${path14.sep}`);
6910
6924
  }
6911
6925
  /**
6912
6926
  * Mark the secure-store as required for this storage instance.
@@ -6993,7 +7007,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
6993
7007
  void 0,
6994
7008
  this.baseDir
6995
7009
  );
6996
- const rel = path13.relative(this.baseDir, filePath).split(path13.sep).join("/");
7010
+ const rel = path14.relative(this.baseDir, filePath).split(path14.sep).join("/");
6997
7011
  return `${rel}:${version.versionId}`;
6998
7012
  } catch (err) {
6999
7013
  log.warn(
@@ -7038,10 +7052,10 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7038
7052
  _StorageManager.okfConformanceByDir.set(memoryDir, enabled !== false);
7039
7053
  }
7040
7054
  okfConformanceEnabled() {
7041
- for (let dir = this.baseDir; ; dir = path13.dirname(dir)) {
7055
+ for (let dir = this.baseDir; ; dir = path14.dirname(dir)) {
7042
7056
  const registered = _StorageManager.okfConformanceByDir.get(dir);
7043
7057
  if (registered !== void 0) return registered;
7044
- if (dir === path13.dirname(dir)) return true;
7058
+ if (dir === path14.dirname(dir)) return true;
7045
7059
  }
7046
7060
  }
7047
7061
  /**
@@ -7085,12 +7099,12 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7085
7099
  }
7086
7100
  identityFilePath(workspaceDir, namespace) {
7087
7101
  const rawNamespace = typeof namespace === "string" ? namespace.trim() : "";
7088
- if (!rawNamespace) return path13.join(workspaceDir, "IDENTITY.md");
7102
+ if (!rawNamespace) return path14.join(workspaceDir, "IDENTITY.md");
7089
7103
  const safeNamespace = rawNamespace.replace(/[^a-zA-Z0-9._-]/g, "-");
7090
- return path13.join(workspaceDir, `IDENTITY.${safeNamespace}.md`);
7104
+ return path14.join(workspaceDir, `IDENTITY.${safeNamespace}.md`);
7091
7105
  }
7092
7106
  versionFilePath(kind) {
7093
- return path13.join(this.stateDir, `.${kind}-version.log`);
7107
+ return path14.join(this.stateDir, `.${kind}-version.log`);
7094
7108
  }
7095
7109
  bumpSharedVersion(kind, fallbackMap) {
7096
7110
  const filePath = this.versionFilePath(kind);
@@ -7197,7 +7211,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7197
7211
  // memories.
7198
7212
  // -------------------------------------------------------------------------
7199
7213
  get wearablesDir() {
7200
- return path13.join(this.baseDir, WEARABLES_DIR_NAME);
7214
+ return path14.join(this.baseDir, WEARABLES_DIR_NAME);
7201
7215
  }
7202
7216
  /**
7203
7217
  * Resolve the on-disk path for a source/day transcript. Throws on
@@ -7213,7 +7227,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7213
7227
  if (!isValidTranscriptDate(date)) {
7214
7228
  throw new Error(`invalid wearable transcript date '${String(date)}' \u2014 expected YYYY-MM-DD`);
7215
7229
  }
7216
- return path13.join(this.wearablesDir, sourceId, `${date}.md`);
7230
+ return path14.join(this.wearablesDir, sourceId, `${date}.md`);
7217
7231
  }
7218
7232
  async writeWearableDayTranscript(sourceId, date, serialized) {
7219
7233
  const targetPath = this.wearableTranscriptPath(sourceId, date);
@@ -7327,25 +7341,25 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7327
7341
  });
7328
7342
  }
7329
7343
  get factsDir() {
7330
- return path13.join(this.baseDir, "facts");
7344
+ return path14.join(this.baseDir, "facts");
7331
7345
  }
7332
7346
  get correctionsDir() {
7333
- return path13.join(this.baseDir, "corrections");
7347
+ return path14.join(this.baseDir, "corrections");
7334
7348
  }
7335
7349
  get proceduresDir() {
7336
- return path13.join(this.baseDir, "procedures");
7350
+ return path14.join(this.baseDir, "procedures");
7337
7351
  }
7338
7352
  get reasoningTracesDir() {
7339
- return path13.join(this.baseDir, "reasoning-traces");
7353
+ return path14.join(this.baseDir, "reasoning-traces");
7340
7354
  }
7341
7355
  get entitiesDir() {
7342
- return path13.join(this.baseDir, "entities");
7356
+ return path14.join(this.baseDir, "entities");
7343
7357
  }
7344
7358
  resolveEntityFilePath(name) {
7345
7359
  if (typeof name !== "string") return null;
7346
- const filePath = path13.resolve(this.entitiesDir, `${name}.md`);
7347
- const relative2 = path13.relative(this.entitiesDir, filePath);
7348
- if (relative2 === "" || relative2.startsWith("..") || path13.isAbsolute(relative2)) {
7360
+ const filePath = path14.resolve(this.entitiesDir, `${name}.md`);
7361
+ const relative2 = path14.relative(this.entitiesDir, filePath);
7362
+ if (relative2 === "" || relative2.startsWith("..") || path14.isAbsolute(relative2)) {
7349
7363
  return null;
7350
7364
  }
7351
7365
  return filePath;
@@ -7356,7 +7370,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7356
7370
  async readDependencyPropagationQueueFile(filePath) {
7357
7371
  const target = await resolveSafeStoragePath(
7358
7372
  this.baseDir,
7359
- path13.relative(
7373
+ path14.relative(
7360
7374
  this.baseDir,
7361
7375
  this.assertManagedStoragePath(filePath, "storage.readDependencyPropagationQueueFile")
7362
7376
  )
@@ -7366,7 +7380,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7366
7380
  async writeDependencyPropagationQueueFile(filePath, content) {
7367
7381
  const target = await resolveSafeStoragePath(
7368
7382
  this.baseDir,
7369
- path13.relative(
7383
+ path14.relative(
7370
7384
  this.baseDir,
7371
7385
  this.assertManagedStoragePath(filePath, "storage.writeDependencyPropagationQueueFile")
7372
7386
  )
@@ -7381,10 +7395,10 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7381
7395
  });
7382
7396
  }
7383
7397
  assertManagedStoragePath(filePath, method) {
7384
- const resolved = path13.resolve(filePath);
7385
- const base = path13.resolve(this.baseDir);
7386
- const rel = path13.relative(base, resolved);
7387
- if (rel === "" || rel === ".." || rel.startsWith(`..${path13.sep}`) || path13.isAbsolute(rel)) {
7398
+ const resolved = path14.resolve(filePath);
7399
+ const base = path14.resolve(this.baseDir);
7400
+ const rel = path14.relative(base, resolved);
7401
+ if (rel === "" || rel === ".." || rel.startsWith(`..${path14.sep}`) || path14.isAbsolute(rel)) {
7388
7402
  throw new Error(`${method}: file path escapes memory dir`);
7389
7403
  }
7390
7404
  return resolved;
@@ -7421,7 +7435,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7421
7435
  async digestOfflineSyncFile(filePath) {
7422
7436
  const target = this.assertManagedStoragePath(filePath, "storage.digestOfflineSyncFile");
7423
7437
  const st = await stat3(target);
7424
- const relPath = path13.relative(this.baseDir, target).split(path13.sep).join("/");
7438
+ const relPath = path14.relative(this.baseDir, target).split(path14.sep).join("/");
7425
7439
  const cache = await this.loadOfflineSyncDigestCache();
7426
7440
  const cached = cache.get(relPath);
7427
7441
  if (cached && cached.statBytes === st.size && cached.mtimeMs === st.mtimeMs && cached.ctimeMs === st.ctimeMs && !cached.encrypted) {
@@ -7506,7 +7520,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7506
7520
  const cache = this.offlineSyncDigestCache;
7507
7521
  if (!cache) return;
7508
7522
  const entries = [...cache.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([entryPath, entry]) => ({ path: entryPath, ...entry }));
7509
- await mkdir(path13.dirname(this.offlineSyncDigestCachePath), { recursive: true });
7523
+ await mkdir2(path14.dirname(this.offlineSyncDigestCachePath), { recursive: true });
7510
7524
  await writeFile(this.offlineSyncDigestCachePath, `${JSON.stringify({ version: 1, entries })}
7511
7525
  `, "utf-8");
7512
7526
  }).catch((err) => {
@@ -7607,7 +7621,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7607
7621
  }
7608
7622
  async appendStorageSecureFileUnlocked(filePath, content) {
7609
7623
  const writeKey = this.resolveWriteKey();
7610
- await mkdir(path13.dirname(filePath), { recursive: true });
7624
+ await mkdir2(path14.dirname(filePath), { recursive: true });
7611
7625
  if (writeKey === null) {
7612
7626
  try {
7613
7627
  if (await this.isEncryptedFileHeader(filePath)) {
@@ -7633,13 +7647,13 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7633
7647
  this.notifyCatalogWriteForPath(filePath);
7634
7648
  }
7635
7649
  get stateDir() {
7636
- return path13.join(this.baseDir, "state");
7650
+ return path14.join(this.baseDir, "state");
7637
7651
  }
7638
7652
  get offlineSyncDigestCachePath() {
7639
- return path13.join(this.baseDir, ".offline-sync", "digest-cache.v1.json");
7653
+ return path14.join(this.baseDir, ".offline-sync", "digest-cache.v1.json");
7640
7654
  }
7641
7655
  get entitySynthesisQueuePath() {
7642
- return path13.join(this.stateDir, "entity-synthesis-queue.json");
7656
+ return path14.join(this.stateDir, "entity-synthesis-queue.json");
7643
7657
  }
7644
7658
  // ── Tombstone store access (issue #1579) ─────────────────────────────────
7645
7659
  /**
@@ -7649,7 +7663,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7649
7663
  * helpers are injected into the store).
7650
7664
  */
7651
7665
  get tombstonesPath() {
7652
- return path13.join(this.stateDir, "tombstones.jsonl");
7666
+ return path14.join(this.stateDir, "tombstones.jsonl");
7653
7667
  }
7654
7668
  /**
7655
7669
  * Configure the tombstone invariant for this storage instance. Installed
@@ -7962,55 +7976,55 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
7962
7976
  return legacyMatches.length > 0 ? [...new Set(legacyMatches.map((content) => ContentHashIndex.computeHash(content)))] : [persistedHash];
7963
7977
  }
7964
7978
  get questionsDir() {
7965
- return path13.join(this.baseDir, "questions");
7979
+ return path14.join(this.baseDir, "questions");
7966
7980
  }
7967
7981
  get artifactsDir() {
7968
- return path13.join(this.baseDir, "artifacts");
7982
+ return path14.join(this.baseDir, "artifacts");
7969
7983
  }
7970
7984
  get identityDir() {
7971
- return path13.join(this.baseDir, "identity");
7985
+ return path14.join(this.baseDir, "identity");
7972
7986
  }
7973
7987
  get identityAnchorPath() {
7974
- return path13.join(this.identityDir, "identity-anchor.md");
7988
+ return path14.join(this.identityDir, "identity-anchor.md");
7975
7989
  }
7976
7990
  get identityIncidentsDir() {
7977
- return path13.join(this.identityDir, "incidents");
7991
+ return path14.join(this.identityDir, "incidents");
7978
7992
  }
7979
7993
  get identityAuditsWeeklyDir() {
7980
- return path13.join(this.identityDir, "audits", "weekly");
7994
+ return path14.join(this.identityDir, "audits", "weekly");
7981
7995
  }
7982
7996
  get identityAuditsMonthlyDir() {
7983
- return path13.join(this.identityDir, "audits", "monthly");
7997
+ return path14.join(this.identityDir, "audits", "monthly");
7984
7998
  }
7985
7999
  get identityImprovementLoopsPath() {
7986
- return path13.join(this.identityDir, "improvement-loops.md");
8000
+ return path14.join(this.identityDir, "improvement-loops.md");
7987
8001
  }
7988
8002
  get identityReflectionsPath() {
7989
- return path13.join(this.identityDir, "reflections.md");
8003
+ return path14.join(this.identityDir, "reflections.md");
7990
8004
  }
7991
8005
  get profilePath() {
7992
- return path13.join(this.baseDir, "profile.md");
8006
+ return path14.join(this.baseDir, "profile.md");
7993
8007
  }
7994
8008
  get memoryActionsPath() {
7995
- return path13.join(this.stateDir, "memory-actions.jsonl");
8009
+ return path14.join(this.stateDir, "memory-actions.jsonl");
7996
8010
  }
7997
8011
  get memoryLifecycleLedgerPath() {
7998
- return path13.join(this.stateDir, "memory-lifecycle-ledger.jsonl");
8012
+ return path14.join(this.stateDir, "memory-lifecycle-ledger.jsonl");
7999
8013
  }
8000
8014
  get compressionGuidelinesPath() {
8001
- return path13.join(this.stateDir, "compression-guidelines.md");
8015
+ return path14.join(this.stateDir, "compression-guidelines.md");
8002
8016
  }
8003
8017
  get compressionGuidelineDraftPath() {
8004
- return path13.join(this.stateDir, "compression-guidelines.draft.md");
8018
+ return path14.join(this.stateDir, "compression-guidelines.draft.md");
8005
8019
  }
8006
8020
  get compressionGuidelineStatePath() {
8007
- return path13.join(this.stateDir, "compression-guideline-state.json");
8021
+ return path14.join(this.stateDir, "compression-guideline-state.json");
8008
8022
  }
8009
8023
  get compressionGuidelineDraftStatePath() {
8010
- return path13.join(this.stateDir, "compression-guideline-draft-state.json");
8024
+ return path14.join(this.stateDir, "compression-guideline-draft-state.json");
8011
8025
  }
8012
8026
  get behaviorSignalsPath() {
8013
- return path13.join(this.stateDir, "behavior-signals.jsonl");
8027
+ return path14.join(this.stateDir, "behavior-signals.jsonl");
8014
8028
  }
8015
8029
  /**
8016
8030
  * In-memory dedup key set for behavior-signals appends (issue #1909),
@@ -8042,7 +8056,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
8042
8056
  * governance sweeps can treat it uniformly.
8043
8057
  */
8044
8058
  get bufferSurpriseLedgerPath() {
8045
- return path13.join(this.stateDir, "buffer-surprise-ledger.jsonl");
8059
+ return path14.join(this.stateDir, "buffer-surprise-ledger.jsonl");
8046
8060
  }
8047
8061
  /**
8048
8062
  * Entity alias table loaded from THIS store's config/aliases.json.
@@ -8105,7 +8119,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
8105
8119
  this.loadAliasesSync();
8106
8120
  }
8107
8121
  loadAliasesSync() {
8108
- const aliasPath = path13.join(this.baseDir, "config", "aliases.json");
8122
+ const aliasPath = path14.join(this.baseDir, "config", "aliases.json");
8109
8123
  this.userAliases = {};
8110
8124
  const raw = readEntityAliasConfigSync(this.baseDir);
8111
8125
  if (raw === void 0) return;
@@ -8140,22 +8154,22 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
8140
8154
  return completionFingerprint;
8141
8155
  }
8142
8156
  async ensureDirectories(options = {}) {
8143
- await mkdir(this.baseDir, { recursive: true });
8157
+ await mkdir2(this.baseDir, { recursive: true });
8144
8158
  await validateRoots(this.baseDir, this.entitiesDir, this.stateDir, this.archiveDir);
8145
8159
  const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
8146
- await mkdir(path13.join(this.factsDir, today), { recursive: true });
8147
- await mkdir(path13.join(this.proceduresDir, today), { recursive: true });
8148
- await mkdir(path13.join(this.reasoningTracesDir, today), { recursive: true });
8149
- await mkdir(this.correctionsDir, { recursive: true });
8150
- await mkdir(this.entitiesDir, { recursive: true });
8151
- await mkdir(this.stateDir, { recursive: true });
8152
- await mkdir(this.questionsDir, { recursive: true });
8153
- await mkdir(this.artifactsDir, { recursive: true });
8154
- await mkdir(this.identityDir, { recursive: true });
8155
- await mkdir(this.identityIncidentsDir, { recursive: true });
8156
- await mkdir(this.identityAuditsWeeklyDir, { recursive: true });
8157
- await mkdir(this.identityAuditsMonthlyDir, { recursive: true });
8158
- await mkdir(path13.join(this.baseDir, "config"), { recursive: true });
8160
+ await mkdir2(path14.join(this.factsDir, today), { recursive: true });
8161
+ await mkdir2(path14.join(this.proceduresDir, today), { recursive: true });
8162
+ await mkdir2(path14.join(this.reasoningTracesDir, today), { recursive: true });
8163
+ await mkdir2(this.correctionsDir, { recursive: true });
8164
+ await mkdir2(this.entitiesDir, { recursive: true });
8165
+ await mkdir2(this.stateDir, { recursive: true });
8166
+ await mkdir2(this.questionsDir, { recursive: true });
8167
+ await mkdir2(this.artifactsDir, { recursive: true });
8168
+ await mkdir2(this.identityDir, { recursive: true });
8169
+ await mkdir2(this.identityIncidentsDir, { recursive: true });
8170
+ await mkdir2(this.identityAuditsWeeklyDir, { recursive: true });
8171
+ await mkdir2(this.identityAuditsMonthlyDir, { recursive: true });
8172
+ await mkdir2(path14.join(this.baseDir, "config"), { recursive: true });
8159
8173
  await this.entityCanonicalIdMigration.begin(options.waitForEntityMigration !== false, this.entitiesDir);
8160
8174
  if (this.hotMemoriesCacheEnabled && this.getMemoryCorpusVersion() === 0) {
8161
8175
  this.bumpMemoryCorpusVersion();
@@ -8177,12 +8191,12 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
8177
8191
  */
8178
8192
  async resolveCategoryWritePath(category, id, today) {
8179
8193
  if (category === "correction") {
8180
- await mkdir(this.correctionsDir, { recursive: true });
8181
- return path13.join(this.correctionsDir, `${id}.md`);
8194
+ await mkdir2(this.correctionsDir, { recursive: true });
8195
+ return path14.join(this.correctionsDir, `${id}.md`);
8182
8196
  }
8183
- const datedDir = path13.join(getCategoryDir(this.baseDir, category), today);
8184
- await mkdir(datedDir, { recursive: true });
8185
- return path13.join(datedDir, `${id}.md`);
8197
+ const datedDir = path14.join(getCategoryDir(this.baseDir, category), today);
8198
+ await mkdir2(datedDir, { recursive: true });
8199
+ return path14.join(datedDir, `${id}.md`);
8186
8200
  }
8187
8201
  async findExistingTombstoneBlockedMemory(content, category, sourceConnector) {
8188
8202
  const identity = buildExplicitCaptureDedupKey(content, category, sourceConnector);
@@ -8561,8 +8575,8 @@ ${sanitized.text}
8561
8575
  await this.ensureDirectories();
8562
8576
  const now = /* @__PURE__ */ new Date();
8563
8577
  const day = now.toISOString().slice(0, 10);
8564
- const dir = path13.join(this.artifactsDir, day);
8565
- await mkdir(dir, { recursive: true });
8578
+ const dir = path14.join(this.artifactsDir, day);
8579
+ await mkdir2(dir, { recursive: true });
8566
8580
  const id = `artifact-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`;
8567
8581
  const fm = {
8568
8582
  id,
@@ -8588,7 +8602,7 @@ ${sanitized.text}
8588
8602
  log.warn(`artifact content rejected for ${id}; violations=${sanitized.violations.join(", ")}`);
8589
8603
  return "";
8590
8604
  }
8591
- const filePath = path13.join(dir, `${id}.md`);
8605
+ const filePath = path14.join(dir, `${id}.md`);
8592
8606
  await this.writeStorageSecureFile(filePath, `${serializeFrontmatter(this.withOkfType(fm))}
8593
8607
 
8594
8608
  ${sanitized.text}
@@ -8882,7 +8896,7 @@ ${sanitized.text}
8882
8896
  * per-process in-memory cache safe across process boundaries.
8883
8897
  */
8884
8898
  invalidateColdMemoriesCache() {
8885
- const coldRoot = path13.join(this.baseDir, "cold");
8899
+ const coldRoot = path14.join(this.baseDir, "cold");
8886
8900
  _StorageManager.coldMemoriesCache.delete(coldRoot);
8887
8901
  this.bumpColdWriteVersion();
8888
8902
  invalidateAllForDir(this.baseDir);
@@ -9000,7 +9014,7 @@ ${sanitized.text}
9000
9014
  const correctionPaths = [];
9001
9015
  const factPaths = [];
9002
9016
  for (const filePath of filePaths) {
9003
- if (filePath === this.correctionsDir || filePath.startsWith(`${this.correctionsDir}${path13.sep}`)) {
9017
+ if (filePath === this.correctionsDir || filePath.startsWith(`${this.correctionsDir}${path14.sep}`)) {
9004
9018
  correctionPaths.push(filePath);
9005
9019
  } else {
9006
9020
  factPaths.push(filePath);
@@ -9066,7 +9080,7 @@ ${sanitized.text}
9066
9080
  const entries = (await readdir6(dir, { withFileTypes: true })).filter((e) => !isMacOsReplicationJunkBasename(e.name));
9067
9081
  for (const entry of entries) {
9068
9082
  checkCorpusReadAbort(options);
9069
- const fullPath = path13.join(dir, entry.name);
9083
+ const fullPath = path14.join(dir, entry.name);
9070
9084
  if (entry.isDirectory()) {
9071
9085
  await readDir(fullPath);
9072
9086
  } else if (entry.name.endsWith(".md")) {
@@ -9106,7 +9120,7 @@ ${sanitized.text}
9106
9120
  return this.rememberMemorySnapshot(await this.memoryReadStore.readMemoryByPath(filePath));
9107
9121
  }
9108
9122
  resolveTierRootDir(tier) {
9109
- return tier === "cold" ? path13.join(this.baseDir, "cold") : this.baseDir;
9123
+ return tier === "cold" ? path14.join(this.baseDir, "cold") : this.baseDir;
9110
9124
  }
9111
9125
  resolveMemoryDateDir(memory) {
9112
9126
  const preferred = memory.frontmatter.created || memory.frontmatter.updated;
@@ -9121,13 +9135,13 @@ ${sanitized.text}
9121
9135
  buildTierMemoryPath(memory, tier) {
9122
9136
  const root = this.resolveTierRootDir(tier);
9123
9137
  if (this.isArtifactMemory(memory)) {
9124
- return path13.join(root, "artifacts", this.resolveMemoryDateDir(memory), `${memory.frontmatter.id}.md`);
9138
+ return path14.join(root, "artifacts", this.resolveMemoryDateDir(memory), `${memory.frontmatter.id}.md`);
9125
9139
  }
9126
9140
  if (memory.frontmatter.category === "correction") {
9127
- return path13.join(root, "corrections", `${memory.frontmatter.id}.md`);
9141
+ return path14.join(root, "corrections", `${memory.frontmatter.id}.md`);
9128
9142
  }
9129
9143
  const dir = categoryDirName(memory.frontmatter.category);
9130
- return path13.join(root, dir, this.resolveMemoryDateDir(memory), `${memory.frontmatter.id}.md`);
9144
+ return path14.join(root, dir, this.resolveMemoryDateDir(memory), `${memory.frontmatter.id}.md`);
9131
9145
  }
9132
9146
  async writeMemoryFileAtomic(targetPath, memory) {
9133
9147
  assertNotOkfReservedBasename(targetPath);
@@ -9206,8 +9220,8 @@ ${memory.content}
9206
9220
  memory.frontmatter.entityRef = current.frontmatter.entityRef;
9207
9221
  }
9208
9222
  durable = true;
9209
- const sourcePath = path13.resolve(current.path);
9210
- const destPath = path13.resolve(targetPath);
9223
+ const sourcePath = path14.resolve(current.path);
9224
+ const destPath = path14.resolve(targetPath);
9211
9225
  if (sourcePath !== destPath) {
9212
9226
  await recordArchiveDelete2(this.baseDir, current.path, () => this.deleteManagedStorageFile(current.path));
9213
9227
  this.invalidateAllMemoriesCache();
@@ -9231,8 +9245,8 @@ ${memory.content}
9231
9245
  }
9232
9246
  async migrateMemoryToTier(memory, targetTier) {
9233
9247
  const targetPath = this.buildTierMemoryPath(memory, targetTier);
9234
- const sourcePath = path13.resolve(memory.path);
9235
- const destPath = path13.resolve(targetPath);
9248
+ const sourcePath = path14.resolve(memory.path);
9249
+ const destPath = path14.resolve(targetPath);
9236
9250
  if (sourcePath === destPath) {
9237
9251
  return { changed: false, targetPath };
9238
9252
  }
@@ -9242,7 +9256,7 @@ ${memory.content}
9242
9256
  return { changed, targetPath };
9243
9257
  }
9244
9258
  get archiveDir() {
9245
- return path13.join(this.baseDir, "archive");
9259
+ return path14.join(this.baseDir, "archive");
9246
9260
  }
9247
9261
  /**
9248
9262
  * Archive a memory by moving it from facts/ to archive/YYYY-MM-DD/.
@@ -9255,8 +9269,8 @@ ${memory.content}
9255
9269
  try {
9256
9270
  const now = lifecycle?.at ?? /* @__PURE__ */ new Date();
9257
9271
  const today = now.toISOString().slice(0, 10);
9258
- const destDir = path13.join(this.archiveDir, today);
9259
- await mkdir(destDir, { recursive: true });
9272
+ const destDir = path14.join(this.archiveDir, today);
9273
+ await mkdir2(destDir, { recursive: true });
9260
9274
  const refIdsAtWrite = this.currentHistoricalIds();
9261
9275
  const updatedFm = canonicalizeEntityRefOption(
9262
9276
  {
@@ -9271,7 +9285,7 @@ ${memory.content}
9271
9285
 
9272
9286
  ${current.content}
9273
9287
  `;
9274
- const destPath = path13.join(destDir, path13.basename(current.path));
9288
+ const destPath = path14.join(destDir, path14.basename(current.path));
9275
9289
  const priorDest = await this.readStorageSecureFile(destPath).catch(() => null);
9276
9290
  await recordArchiveWrite(this.baseDir, destPath, () => this.writeStorageSecureFile(destPath, fileContent));
9277
9291
  if (typeof current.frontmatter.entityRef === "string") {
@@ -9505,7 +9519,7 @@ ${memory.content}
9505
9519
  `;
9506
9520
  await this.writeTombstoneBlockedFrontmatter(memory, fileContent, updated, async () => {
9507
9521
  this.invalidateAllMemoriesCache();
9508
- if (memory.path.includes(`${path13.sep}cold${path13.sep}`)) {
9522
+ if (memory.path.includes(`${path14.sep}cold${path14.sep}`)) {
9509
9523
  this.invalidateColdMemoriesCache();
9510
9524
  }
9511
9525
  });
@@ -9517,7 +9531,7 @@ ${memory.content}
9517
9531
  }
9518
9532
  if (mentionReentry && !entityMentionEpoch.neutral(memory.frontmatter, updated)) entityMentionEpoch.bump(this.baseDir);
9519
9533
  await this.patchHotMemoriesCache({ addedPath: memory.path });
9520
- if (memory.path.includes(`${path13.sep}cold${path13.sep}`)) {
9534
+ if (memory.path.includes(`${path14.sep}cold${path14.sep}`)) {
9521
9535
  this.invalidateColdMemoriesCache();
9522
9536
  }
9523
9537
  try {
@@ -9615,8 +9629,11 @@ ${memory.content}
9615
9629
  async deleteBufferSession(key) {
9616
9630
  await this.bufferSessionFiles().remove(key);
9617
9631
  }
9632
+ saveDroppedExtractionChunk(bufferKey, reason, turns) {
9633
+ return saveDroppedExtractionChunk(this.stateDir, (file, content) => this.writeStorageSecureFile(file, content), bufferKey, reason, turns);
9634
+ }
9618
9635
  async loadMeta() {
9619
- const metaPath = path13.join(this.stateDir, "meta.json");
9636
+ const metaPath = path14.join(this.stateDir, "meta.json");
9620
9637
  try {
9621
9638
  const raw = await this.readStorageSecureFile(metaPath);
9622
9639
  const parsed = JSON.parse(raw);
@@ -9649,8 +9666,7 @@ ${memory.content}
9649
9666
  }
9650
9667
  async saveMeta(state) {
9651
9668
  await this.ensureDirectories();
9652
- const metaPath = path13.join(this.stateDir, "meta.json");
9653
- await this.writeStorageSecureFile(metaPath, JSON.stringify(state, null, 2));
9669
+ await this.writeStorageSecureFile(path14.join(this.stateDir, "meta.json"), JSON.stringify(state, null, 2));
9654
9670
  }
9655
9671
  async appendMemoryActionEvents(events) {
9656
9672
  if (events.length === 0) return 0;
@@ -9719,7 +9735,7 @@ ${memory.content}
9719
9735
  },
9720
9736
  (payload) => this.appendStorageSecureFile(target, payload),
9721
9737
  async () => {
9722
- await mkdir(path13.dirname(target), { recursive: true });
9738
+ await mkdir2(path14.dirname(target), { recursive: true });
9723
9739
  }
9724
9740
  );
9725
9741
  }
@@ -9817,7 +9833,7 @@ ${memory.content}
9817
9833
  async appendReextractJobs(events) {
9818
9834
  if (events.length === 0) return 0;
9819
9835
  await this.ensureDirectories();
9820
- const filePath = path13.join(this.stateDir, "reextract-jobs.jsonl");
9836
+ const filePath = path14.join(this.stateDir, "reextract-jobs.jsonl");
9821
9837
  const lines = events.map((event) => JSON.stringify(event)).join("\n") + "\n";
9822
9838
  try {
9823
9839
  await this.appendStorageSecureFile(filePath, lines);
@@ -9830,7 +9846,7 @@ ${memory.content}
9830
9846
  }
9831
9847
  async readReextractJobs(limit = 200) {
9832
9848
  const safeLimit = Number.isFinite(limit) ? Math.max(1, Math.min(1e3, Math.floor(limit))) : 200;
9833
- const filePath = path13.join(this.stateDir, "reextract-jobs.jsonl");
9849
+ const filePath = path14.join(this.stateDir, "reextract-jobs.jsonl");
9834
9850
  try {
9835
9851
  const raw = await this.readStorageSecureFile(filePath);
9836
9852
  const lines = raw.split("\n").filter((line) => line.trim().length > 0);
@@ -10048,7 +10064,7 @@ ${memory.content}
10048
10064
  return `${prefix}-${ts}-${rand}`;
10049
10065
  }
10050
10066
  async writeQuestion(question, context, priority) {
10051
- await mkdir(this.questionsDir, { recursive: true });
10067
+ await mkdir2(this.questionsDir, { recursive: true });
10052
10068
  const id = this.generateId("q");
10053
10069
  const frontmatter = {
10054
10070
  id,
@@ -10065,7 +10081,7 @@ ${question}
10065
10081
 
10066
10082
  **Context:** ${context}
10067
10083
  `;
10068
- const filePath = path13.join(this.questionsDir, `${id}.md`);
10084
+ const filePath = path14.join(this.questionsDir, `${id}.md`);
10069
10085
  await this.writeStorageSecureFile(filePath, content);
10070
10086
  log.debug(`wrote question ${id} to ${filePath}`);
10071
10087
  this.invalidateQuestionsCache();
@@ -10124,11 +10140,11 @@ ${question}
10124
10140
  } catch {
10125
10141
  }
10126
10142
  const hygiene = opts?.hygiene;
10127
- const rotateEnabled = hygiene?.enabled === true && hygiene.rotateEnabled === true && Array.isArray(hygiene.rotatePaths) && hygiene.rotatePaths.includes(path13.basename(identityPath));
10143
+ const rotateEnabled = hygiene?.enabled === true && hygiene.rotateEnabled === true && Array.isArray(hygiene.rotatePaths) && hygiene.rotatePaths.includes(path14.basename(identityPath));
10128
10144
  if (rotateEnabled) {
10129
10145
  const maxBytes = hygiene.rotateMaxBytes;
10130
10146
  if (existing.length > maxBytes) {
10131
- const archiveDir = path13.join(workspaceDir, hygiene.archiveDir);
10147
+ const archiveDir = path14.join(workspaceDir, hygiene.archiveDir);
10132
10148
  const { newContent } = await rotateMarkdownFileToArchive({
10133
10149
  filePath: identityPath,
10134
10150
  archiveDir,
@@ -10180,7 +10196,7 @@ ${reflection}
10180
10196
  }
10181
10197
  }
10182
10198
  async writeIdentityReflections(content) {
10183
- await mkdir(this.identityDir, { recursive: true });
10199
+ await mkdir2(this.identityDir, { recursive: true });
10184
10200
  await this.writeStorageSecureFile(this.identityReflectionsPath, content);
10185
10201
  }
10186
10202
  async appendIdentityReflection(reflection) {
@@ -10212,7 +10228,7 @@ ${reflection}
10212
10228
 
10213
10229
  ${reflection}
10214
10230
  `;
10215
- await mkdir(this.identityDir, { recursive: true });
10231
+ await mkdir2(this.identityDir, { recursive: true });
10216
10232
  await this.writeStorageSecureFile(this.identityReflectionsPath, `${existing.trimEnd()}${section}`);
10217
10233
  log.debug(`appended namespace-local reflection to ${this.identityReflectionsPath}`);
10218
10234
  }
@@ -10268,7 +10284,7 @@ ${reflection}
10268
10284
  const rightTs = latestEntityTimelineTimestamp(right.entity) ?? "";
10269
10285
  return compareEntityTimestamps(rightTs, leftTs);
10270
10286
  }).map(({ entityName }) => entityName);
10271
- await mkdir(this.stateDir, { recursive: true });
10287
+ await mkdir2(this.stateDir, { recursive: true });
10272
10288
  await this.writeStorageSecureFile(
10273
10289
  this.entitySynthesisQueuePath,
10274
10290
  JSON.stringify(
@@ -10288,7 +10304,7 @@ ${reflection}
10288
10304
  if (queue.length === 0) return;
10289
10305
  const removals = new Set(entityNames);
10290
10306
  const nextQueue = queue.filter((name) => !removals.has(name));
10291
- await mkdir(this.stateDir, { recursive: true });
10307
+ await mkdir2(this.stateDir, { recursive: true });
10292
10308
  await this.writeStorageSecureFile(
10293
10309
  this.entitySynthesisQueuePath,
10294
10310
  JSON.stringify(
@@ -10388,7 +10404,7 @@ ${reflection}
10388
10404
  if (entries.length === 0) return 0;
10389
10405
  const memories = await this.readAllMemories();
10390
10406
  const memoryMap = new Map(memories.map((m) => [m.frontmatter.id, m]));
10391
- const memoryPathMap = new Map(memories.map((m) => [path13.resolve(m.path), m]));
10407
+ const memoryPathMap = new Map(memories.map((m) => [path14.resolve(m.path), m]));
10392
10408
  let updated = 0;
10393
10409
  const prevVersion = this.getMemoryCorpusVersion();
10394
10410
  let entityRefMoved = false;
@@ -10396,7 +10412,7 @@ ${reflection}
10396
10412
  const warm = this.hotMemoriesCacheEnabled && getCachedMemories(this.baseDir, prevVersion, keyId, this.hotCacheTtlMs()) !== null;
10397
10413
  const appliedPatches = /* @__PURE__ */ new Map();
10398
10414
  for (const entry of entries) {
10399
- const memory = entry.memoryPath ? memoryPathMap.get(path13.resolve(entry.memoryPath)) : memoryMap.get(entry.memoryId);
10415
+ const memory = entry.memoryPath ? memoryPathMap.get(path14.resolve(entry.memoryPath)) : memoryMap.get(entry.memoryId);
10400
10416
  if (!memory) continue;
10401
10417
  try {
10402
10418
  const applied = await this.withTombstoneBlockedMemoryPathLock(memory.path, async (current) => {
@@ -10428,7 +10444,7 @@ ${current.content}
10428
10444
  if (warm) {
10429
10445
  updateCacheOnWrite(this.baseDir, { ...applied.current, frontmatter: applied.newFm }, keyId);
10430
10446
  }
10431
- appliedPatches.set(path13.resolve(memory.path), {
10447
+ appliedPatches.set(path14.resolve(memory.path), {
10432
10448
  accessCount: entry.newCount,
10433
10449
  lastAccessed: entry.lastAccessed
10434
10450
  });
@@ -10446,7 +10462,7 @@ ${current.content}
10446
10462
  const cur = getCachedMemories(this.baseDir, prevVersion, keyId);
10447
10463
  if (cur) {
10448
10464
  const reapplied = cur.map((m) => {
10449
- const patch = appliedPatches.get(path13.resolve(m.path));
10465
+ const patch = appliedPatches.get(path14.resolve(m.path));
10450
10466
  return patch ? {
10451
10467
  ...m,
10452
10468
  frontmatter: { ...m.frontmatter, accessCount: patch.accessCount, lastAccessed: patch.lastAccessed }
@@ -10476,7 +10492,7 @@ ${current.content}
10476
10492
  const pathsById = /* @__PURE__ */ new Map();
10477
10493
  const filePathsById = /* @__PURE__ */ new Map();
10478
10494
  for (const filePath of filePaths) {
10479
- const memoryId = path13.basename(filePath, ".md");
10495
+ const memoryId = path14.basename(filePath, ".md");
10480
10496
  if (!wantedIds.has(memoryId)) continue;
10481
10497
  const paths = filePathsById.get(memoryId) ?? [];
10482
10498
  paths.push(filePath);
@@ -10488,7 +10504,7 @@ ${current.content}
10488
10504
  const preferredMatches = [];
10489
10505
  for (const preferredPath of preferred) {
10490
10506
  const directCandidates = new Set(qmdResultPathCandidates(this.baseDir, preferredPath));
10491
- const directMatch = existingPaths.find((filePath) => directCandidates.has(path13.resolve(filePath)));
10507
+ const directMatch = existingPaths.find((filePath) => directCandidates.has(path14.resolve(filePath)));
10492
10508
  if (directMatch) {
10493
10509
  preferredMatches.push(directMatch);
10494
10510
  continue;
@@ -10500,7 +10516,7 @@ ${current.content}
10500
10516
  candidates.add(candidate);
10501
10517
  }
10502
10518
  }
10503
- const match = existingPaths.find((filePath) => candidates.has(path13.resolve(filePath)));
10519
+ const match = existingPaths.find((filePath) => candidates.has(path14.resolve(filePath)));
10504
10520
  if (match) preferredMatches.push(match);
10505
10521
  }
10506
10522
  if (preferredMatches.length > 0) {
@@ -10822,11 +10838,11 @@ ${current.content}
10822
10838
  }
10823
10839
  }
10824
10840
  get summariesDir() {
10825
- return path13.join(this.baseDir, "summaries");
10841
+ return path14.join(this.baseDir, "summaries");
10826
10842
  }
10827
10843
  async writeSummary(summary) {
10828
- await mkdir(this.summariesDir, { recursive: true });
10829
- const filePath = path13.join(this.summariesDir, `${summary.id}.json`);
10844
+ await mkdir2(this.summariesDir, { recursive: true });
10845
+ const filePath = path14.join(this.summariesDir, `${summary.id}.json`);
10830
10846
  await this.writeStorageSecureFile(filePath, JSON.stringify(summary, null, 2));
10831
10847
  log.debug(`wrote summary ${summary.id}`);
10832
10848
  }
@@ -10836,7 +10852,7 @@ ${current.content}
10836
10852
  const summaries = [];
10837
10853
  for (const file of files) {
10838
10854
  if (isMacOsReplicationJunkBasename(file) || !file.endsWith(".json")) continue;
10839
- const filePath = path13.join(this.summariesDir, file);
10855
+ const filePath = path14.join(this.summariesDir, file);
10840
10856
  const raw = await this.readStorageSecureFile(filePath);
10841
10857
  summaries.push(JSON.parse(raw));
10842
10858
  }
@@ -10906,16 +10922,13 @@ ${current.content}
10906
10922
  return archived;
10907
10923
  }
10908
10924
  async saveTopics(topics) {
10909
- const metaPath = path13.join(this.stateDir, "topics.json");
10910
- await mkdir(this.stateDir, { recursive: true });
10911
- await this.writeStorageSecureFile(
10912
- metaPath,
10913
- JSON.stringify({ topics, updatedAt: (/* @__PURE__ */ new Date()).toISOString() }, null, 2)
10914
- );
10925
+ const metaPath = path14.join(this.stateDir, "topics.json");
10926
+ await mkdir2(this.stateDir, { recursive: true });
10927
+ await this.writeStorageSecureFile(metaPath, JSON.stringify({ topics, updatedAt: (/* @__PURE__ */ new Date()).toISOString() }, null, 2));
10915
10928
  log.debug(`saved ${topics.length} topic scores`);
10916
10929
  }
10917
10930
  async loadTopics() {
10918
- const metaPath = path13.join(this.stateDir, "topics.json");
10931
+ const metaPath = path14.join(this.stateDir, "topics.json");
10919
10932
  try {
10920
10933
  const raw = await this.readStorageSecureFile(metaPath);
10921
10934
  return JSON.parse(raw);
@@ -11034,4 +11047,4 @@ export {
11034
11047
  isValidBufferSurpriseEvent,
11035
11048
  StorageManager3 as StorageManager
11036
11049
  };
11037
- //# sourceMappingURL=chunk-WCBLPKG3.js.map
11050
+ //# sourceMappingURL=chunk-5KZNWERU.js.map