@remnic/core 10.0.27 → 10.0.29

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 (372) hide show
  1. package/dist/access-admin-ops-surface.js +54 -53
  2. package/dist/access-authorization-probe.js +55 -54
  3. package/dist/access-boundary.js +54 -53
  4. package/dist/access-citation-namespace.js +3 -2
  5. package/dist/access-cli.js +106 -105
  6. package/dist/access-cli.js.map +1 -1
  7. package/dist/access-extraction-force-flush.js +54 -53
  8. package/dist/access-http-briefing.js +55 -54
  9. package/dist/access-http-query.js +56 -55
  10. package/dist/access-http.js +73 -72
  11. package/dist/access-identity-continuity-surface.js +54 -53
  12. package/dist/access-lcm-surface.js +54 -53
  13. package/dist/access-mcp.js +65 -64
  14. package/dist/access-namespace-preflight.js +54 -53
  15. package/dist/access-observe-write-category.js +11 -11
  16. package/dist/access-observe-write-surface.js +54 -53
  17. package/dist/access-offline-manifest.js +10 -10
  18. package/dist/access-operations-batch.js +56 -55
  19. package/dist/access-operations.js +63 -62
  20. package/dist/access-recall-concurrency.js +54 -53
  21. package/dist/access-recall-diagnostics.js +2 -2
  22. package/dist/access-recall-response.js +54 -53
  23. package/dist/access-recall-surface.js +54 -53
  24. package/dist/access-schema.js +6 -5
  25. package/dist/access-service.js +54 -53
  26. package/dist/access-surface-catalog.js +56 -55
  27. package/dist/access-surface-catalog.js.map +1 -1
  28. package/dist/active-recall.js +24 -23
  29. package/dist/active-recall.js.map +1 -1
  30. package/dist/{auto-sync-UQESPLCB.js → auto-sync-MX2AHVPQ.js} +8 -8
  31. package/dist/briefing.js +20 -19
  32. package/dist/buffer.js +8 -8
  33. package/dist/calibration.js +2 -2
  34. package/dist/{capsule-merge-LGYURS3C.js → capsule-merge-LGYZAMO4.js} +3 -3
  35. package/dist/causal-consolidation.js +22 -21
  36. package/dist/causal-consolidation.js.map +1 -1
  37. package/dist/{chunk-G6XEYFCO.js → chunk-27OJ5G3D.js} +14 -14
  38. package/dist/{chunk-5LRV557D.js → chunk-2FIJQNL7.js} +2 -2
  39. package/dist/{chunk-ETPIYK4J.js → chunk-2VBDSZ7U.js} +2 -2
  40. package/dist/{chunk-QNKEMFZY.js → chunk-2WDMUQOH.js} +2 -2
  41. package/dist/{chunk-W6MOLW5S.js → chunk-2XVLY424.js} +4 -4
  42. package/dist/{chunk-P55FACBG.js → chunk-3BOQPLCF.js} +6 -6
  43. package/dist/{chunk-27SAUQ5R.js → chunk-3CHHQXAR.js} +2 -2
  44. package/dist/{chunk-3GYSZHMT.js → chunk-3CZRBTJK.js} +2 -2
  45. package/dist/{chunk-FJJWA7NL.js → chunk-3EJQXF3B.js} +2 -2
  46. package/dist/{chunk-HFSPY26A.js → chunk-3IXNL6SK.js} +2 -2
  47. package/dist/{chunk-PLD6SOU7.js → chunk-3SN2D43X.js} +2 -2
  48. package/dist/{chunk-COGLFRXT.js → chunk-4HNINU7Q.js} +31 -31
  49. package/dist/{chunk-CCDHRDQ3.js → chunk-4HYP4OKH.js} +2 -2
  50. package/dist/{chunk-GKJJNO7C.js → chunk-4OE4UE2Y.js} +6 -6
  51. package/dist/{chunk-7RTNJ6M2.js → chunk-4QPW6JVI.js} +2 -2
  52. package/dist/{chunk-5SMR542T.js → chunk-5GT4ESLR.js} +2 -2
  53. package/dist/{chunk-DWL6YIZH.js → chunk-5JI3XWI2.js} +2 -2
  54. package/dist/{chunk-27LPB4NS.js → chunk-5NPZFXQH.js} +2 -2
  55. package/dist/{chunk-Y6IF6H2U.js → chunk-5SMHQW45.js} +2 -2
  56. package/dist/{chunk-VN3GHPBU.js → chunk-654GT5UP.js} +2 -2
  57. package/dist/{chunk-3E6DGSGZ.js → chunk-6MC7UQ6D.js} +2 -2
  58. package/dist/{chunk-655FVTCD.js → chunk-74IN6PV5.js} +2 -2
  59. package/dist/{chunk-WFUO7NWX.js → chunk-7FZ4YVOH.js} +2 -2
  60. package/dist/{chunk-MWWAQXZ6.js → chunk-7HFTCBCZ.js} +2 -2
  61. package/dist/{chunk-7IOB5F7Y.js → chunk-7VB3Y5OL.js} +3 -3
  62. package/dist/{chunk-YEF5AAWN.js → chunk-A54E2ZTD.js} +2 -2
  63. package/dist/{chunk-DEY7B77Y.js → chunk-AHCELJMH.js} +2 -2
  64. package/dist/{chunk-PIWFNPQT.js → chunk-AL3TCNSJ.js} +4 -4
  65. package/dist/{chunk-EET24NSB.js → chunk-AUYFUBBE.js} +6 -6
  66. package/dist/{chunk-L3IP56F4.js → chunk-BIE3ZH3N.js} +33 -33
  67. package/dist/{chunk-A3IURDU2.js → chunk-C2AOL6MK.js} +3 -3
  68. package/dist/{chunk-BDQMMX3M.js → chunk-C2QVDLQV.js} +2 -2
  69. package/dist/{chunk-H75L4ZOH.js → chunk-CKR7LXEK.js} +71 -49
  70. package/dist/chunk-CKR7LXEK.js.map +1 -0
  71. package/dist/{chunk-AWLQNLTM.js → chunk-CSGFGQBI.js} +2 -2
  72. package/dist/{chunk-JHQAXATW.js → chunk-D4RV54HH.js} +2 -2
  73. package/dist/{chunk-33UAWCBN.js → chunk-DDLRKPR2.js} +6 -6
  74. package/dist/{chunk-3X3PNU3T.js → chunk-DLH3ECZP.js} +5 -5
  75. package/dist/chunk-DNIG3JME.js +892 -0
  76. package/dist/chunk-DNIG3JME.js.map +1 -0
  77. package/dist/{chunk-SA6GMZJY.js → chunk-DP3TSAYT.js} +2 -2
  78. package/dist/{chunk-H2X22KZW.js → chunk-FN6OFDBZ.js} +2 -2
  79. package/dist/{chunk-SU5V2LWR.js → chunk-G6DAE2LT.js} +2 -2
  80. package/dist/{chunk-V7KGDLBC.js → chunk-GQ7VWY6N.js} +2 -2
  81. package/dist/{chunk-SYUNCM26.js → chunk-GSKW64NB.js} +2 -2
  82. package/dist/{chunk-4WT6I4VG.js → chunk-GWB7ZD2A.js} +2 -2
  83. package/dist/{chunk-JYZLDZ2R.js → chunk-HG2VVIKI.js} +9 -9
  84. package/dist/{chunk-3VRMUNWL.js → chunk-HJ444KNS.js} +15 -7
  85. package/dist/chunk-HJ444KNS.js.map +1 -0
  86. package/dist/{chunk-23ZQPP2G.js → chunk-HOSJESKO.js} +3 -3
  87. package/dist/{chunk-EU6IRUCY.js → chunk-IDPZCHET.js} +2 -2
  88. package/dist/{chunk-VMHCC7LO.js → chunk-IO2UQVR2.js} +2 -2
  89. package/dist/{chunk-BWXKJDDH.js → chunk-ISMZ5UNE.js} +3 -3
  90. package/dist/{chunk-SX4QDWXK.js → chunk-IWUFKS4J.js} +2 -2
  91. package/dist/{chunk-I27WOMJ7.js → chunk-IY7DGT2Z.js} +2 -2
  92. package/dist/{chunk-STBX5X6B.js → chunk-JAYNUYSJ.js} +2 -2
  93. package/dist/{chunk-N34ZW6E4.js → chunk-K2REHR42.js} +2 -2
  94. package/dist/{chunk-UJPGQCXD.js → chunk-KFKFK6G6.js} +10 -10
  95. package/dist/{chunk-2HLMFRZ7.js → chunk-LDEKVBVO.js} +4 -4
  96. package/dist/{chunk-42KSEX6C.js → chunk-LDXNKEYB.js} +1 -1
  97. package/dist/chunk-LDXNKEYB.js.map +1 -0
  98. package/dist/{chunk-MPZYCRC6.js → chunk-M236YHUH.js} +5 -5
  99. package/dist/{chunk-L5VCT7LU.js → chunk-MCLZM5G7.js} +2 -2
  100. package/dist/{chunk-7Z3DLNSD.js → chunk-MGKH5KO3.js} +2 -2
  101. package/dist/{chunk-PUDYANAX.js → chunk-MMBLOJJB.js} +2 -2
  102. package/dist/{chunk-EFHNFTWB.js → chunk-MND4YJSX.js} +2 -2
  103. package/dist/{chunk-HJQXHLQQ.js → chunk-MROA6OFU.js} +2 -2
  104. package/dist/{chunk-BQOGQULP.js → chunk-MZZEMPCI.js} +2 -2
  105. package/dist/{chunk-ERAVI25Z.js → chunk-NAPHQ2MG.js} +2 -2
  106. package/dist/{chunk-L5TJWQEF.js → chunk-NB2YX6X2.js} +6 -6
  107. package/dist/{chunk-IHGLQJW6.js → chunk-NCPR2FOJ.js} +3 -3
  108. package/dist/{chunk-UKWRCQWT.js → chunk-NOMHXZD7.js} +2 -2
  109. package/dist/{chunk-DF2G4IXN.js → chunk-NPO4ZQFY.js} +3 -3
  110. package/dist/{chunk-LWFWZTWX.js → chunk-NQV6G6MU.js} +2 -2
  111. package/dist/{chunk-5HT35H4L.js → chunk-NRLWHZVS.js} +2 -2
  112. package/dist/{chunk-GCZHKBY2.js → chunk-OANSZGAG.js} +2 -2
  113. package/dist/{chunk-BHQPOCQE.js → chunk-OIIAIY7J.js} +3 -3
  114. package/dist/{chunk-FFGHFU7A.js → chunk-OXX4ORRL.js} +17 -17
  115. package/dist/{chunk-RTTPBBAN.js → chunk-OXYXMGRH.js} +4 -4
  116. package/dist/{chunk-K7BN34IA.js → chunk-PL26BCRN.js} +5 -5
  117. package/dist/{chunk-PM72NSEW.js → chunk-PYCTZ2HX.js} +2 -2
  118. package/dist/{chunk-AQ52ZFBC.js → chunk-PZEADMX4.js} +2 -2
  119. package/dist/{chunk-QPH52AZB.js → chunk-QNDOTDJK.js} +2 -2
  120. package/dist/{chunk-LZACDIM2.js → chunk-RBGRQEW3.js} +4 -4
  121. package/dist/{chunk-H3AW6QZF.js → chunk-RRJ462HP.js} +2 -2
  122. package/dist/{chunk-V4JZCTMK.js → chunk-TKBW4YLS.js} +2 -2
  123. package/dist/{chunk-4D2YH47Z.js → chunk-TRW7N4FS.js} +2 -2
  124. package/dist/{chunk-IHS2UGYM.js → chunk-TTIEXXL3.js} +366 -1109
  125. package/dist/chunk-TTIEXXL3.js.map +1 -0
  126. package/dist/{chunk-OQJKY3Z5.js → chunk-UAAAXSKQ.js} +2 -2
  127. package/dist/{chunk-S36KJNQH.js → chunk-UM73Q46J.js} +2 -2
  128. package/dist/{chunk-7EJCAFMS.js → chunk-UTXYOWDR.js} +2 -2
  129. package/dist/{chunk-AYHPSYZI.js → chunk-UUYAW3JH.js} +2 -2
  130. package/dist/{chunk-MSMGQDVW.js → chunk-UVUBLLM3.js} +3 -3
  131. package/dist/{chunk-JZIZBJCW.js → chunk-V4FI2TG6.js} +3 -3
  132. package/dist/{chunk-MO6N4QYY.js → chunk-VARNSLUW.js} +4 -4
  133. package/dist/{chunk-WJAGO5LL.js → chunk-VEB7NEON.js} +4 -4
  134. package/dist/{chunk-GMZNJZRP.js → chunk-VLBFSD7B.js} +2 -2
  135. package/dist/{chunk-NZFFGO5O.js → chunk-VXWOJPSY.js} +36 -3
  136. package/dist/chunk-VXWOJPSY.js.map +1 -0
  137. package/dist/{chunk-JNIVZNIB.js → chunk-WKVL2G7X.js} +4 -4
  138. package/dist/{chunk-KJXP6RUG.js → chunk-WNEVEMJ3.js} +4 -4
  139. package/dist/{chunk-HNEOLXRF.js → chunk-WQIYGYY6.js} +2 -2
  140. package/dist/{chunk-GQJKVQJR.js → chunk-WYLBEJQI.js} +2 -2
  141. package/dist/{chunk-36DZ242S.js → chunk-XNROYP5E.js} +2 -2
  142. package/dist/{chunk-XNAOCY67.js → chunk-XVZIBMSY.js} +3 -3
  143. package/dist/{chunk-PXTLPC3P.js → chunk-YGVZ4QOZ.js} +4 -4
  144. package/dist/{chunk-JX32ROLZ.js → chunk-YZTFQBYY.js} +4 -4
  145. package/dist/{chunk-XSXM5LYZ.js → chunk-ZCRDYQL6.js} +2 -2
  146. package/dist/{chunk-MAAL6OZV.js → chunk-ZG3HZZ6K.js} +90 -36
  147. package/dist/chunk-ZG3HZZ6K.js.map +1 -0
  148. package/dist/{chunk-Z3XVYXQ3.js → chunk-ZXTAHSQU.js} +2 -2
  149. package/dist/cli.js +89 -88
  150. package/dist/coding/export-okf-codegraph.js +21 -20
  151. package/dist/coding/export-okf-codegraph.js.map +1 -1
  152. package/dist/compounding/engine.js +23 -22
  153. package/dist/config.js +24 -23
  154. package/dist/connectors/codex-materialize-runner.js +21 -20
  155. package/dist/connectors/codex-materialize.js +2 -2
  156. package/dist/connectors/index.js +21 -20
  157. package/dist/consolidation-provenance-check.js +3 -3
  158. package/dist/consolidation-undo.js +2 -2
  159. package/dist/contradiction/index.js +6 -5
  160. package/dist/convergence-refresh.js +22 -21
  161. package/dist/corpus-watermark.js +22 -21
  162. package/dist/deep-recall-http-glue.js +7 -6
  163. package/dist/entity-canonical-id-migration-GD5MPFUF.js +28 -0
  164. package/dist/entity-retrieval.js +20 -19
  165. package/dist/explicit-capture.js +8 -7
  166. package/dist/external-wiki-access.js +55 -54
  167. package/dist/extraction.js +27 -26
  168. package/dist/harmonic-retrieval.js +21 -20
  169. package/dist/harmonic-source-lookup.js +3 -2
  170. package/dist/index.js +106 -105
  171. package/dist/local-llm-rate-limit.d.ts +3 -1
  172. package/dist/local-llm-rate-limit.d.ts.map +1 -1
  173. package/dist/local-llm-rate-limit.js +1 -1
  174. package/dist/local-llm.js +2 -2
  175. package/dist/location/index.js +23 -22
  176. package/dist/maintenance/memory-governance.js +20 -19
  177. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +20 -19
  178. package/dist/maintenance/rebuild-memory-projection-runner.js +22 -21
  179. package/dist/maintenance/rebuild-memory-projection.js +21 -20
  180. package/dist/memory-browse-operations.js +55 -54
  181. package/dist/memory-subject.js +4 -3
  182. package/dist/namespaces/migrate.js +21 -20
  183. package/dist/namespaces/search.js +7 -7
  184. package/dist/namespaces/storage.js +20 -19
  185. package/dist/offline-sync-file-io.js +3 -2
  186. package/dist/offline-sync-impression-drain.js +4 -4
  187. package/dist/offline-sync-snapshot-stream.js +6 -5
  188. package/dist/offline-sync-upload-staging.js +4 -3
  189. package/dist/offline-sync.js +5 -4
  190. package/dist/operator-doctor-corpus.js +23 -22
  191. package/dist/operator-toolkit.js +34 -33
  192. package/dist/orchestration/maintenance.js +35 -34
  193. package/dist/orchestration/orchestrator-init.d.ts +3 -0
  194. package/dist/orchestration/orchestrator-init.d.ts.map +1 -1
  195. package/dist/orchestrator.d.ts.map +1 -1
  196. package/dist/orchestrator.js +106 -105
  197. package/dist/page-versioning.js +2 -2
  198. package/dist/recall-explain-renderer.js +3 -3
  199. package/dist/recall-navigate-access.js +2 -2
  200. package/dist/recall-navigate-disclosure.js +2 -2
  201. package/dist/recall-navigate.js +2 -2
  202. package/dist/recall-navigation-operations.js +55 -54
  203. package/dist/recall-navigation.js +54 -53
  204. package/dist/recall-state.js +2 -2
  205. package/dist/recall-xray-cli.js +4 -4
  206. package/dist/recall-xray-renderer.js +3 -3
  207. package/dist/recall-xray.js +2 -2
  208. package/dist/reconcile/manifest.js +4 -3
  209. package/dist/{resolution-ZU5BIAJA.js → resolution-AMYTPT5X.js} +7 -6
  210. package/dist/resolution-AMYTPT5X.js.map +1 -0
  211. package/dist/resume-bundles.js +25 -24
  212. package/dist/retrieval-agents.js +3 -2
  213. package/dist/salvage-envelope.js +6 -5
  214. package/dist/search/document-scanner.js +2 -2
  215. package/dist/search/factory.js +6 -6
  216. package/dist/search/index.js +6 -6
  217. package/dist/search/lancedb-backend.js +3 -3
  218. package/dist/search/meilisearch-backend.js +3 -3
  219. package/dist/search/orama-backend.js +3 -3
  220. package/dist/secure-store/entity-file-read.d.ts +9 -0
  221. package/dist/secure-store/entity-file-read.d.ts.map +1 -0
  222. package/dist/secure-store/index.js +3 -2
  223. package/dist/secure-store/secure-fs.d.ts.map +1 -1
  224. package/dist/semantic-consolidation.js +22 -21
  225. package/dist/semantic-rule-promotion.js +20 -19
  226. package/dist/semantic-rule-verifier.js +20 -19
  227. package/dist/shared-context/manager.js +2 -2
  228. package/dist/source-agent-qualifier.js +24 -23
  229. package/dist/standup/build.js +20 -19
  230. package/dist/storage/entity-canonical-id-migration-runner.d.ts +12 -0
  231. package/dist/storage/entity-canonical-id-migration-runner.d.ts.map +1 -1
  232. package/dist/storage/entity-canonical-id-migration.d.ts +1 -0
  233. package/dist/storage/entity-canonical-id-migration.d.ts.map +1 -1
  234. package/dist/storage/entity-canonical-id-references.d.ts +14 -0
  235. package/dist/storage/entity-canonical-id-references.d.ts.map +1 -1
  236. package/dist/storage/entity-store.d.ts +4 -0
  237. package/dist/storage/entity-store.d.ts.map +1 -1
  238. package/dist/storage.d.ts +7 -2
  239. package/dist/storage.d.ts.map +1 -1
  240. package/dist/storage.js +19 -18
  241. package/dist/subject-config.js +5 -4
  242. package/dist/summarizer.js +3 -3
  243. package/dist/support-passport/index.js +57 -56
  244. package/dist/transfer/capsule-import.js +3 -3
  245. package/dist/transfer/export-okf.js +21 -20
  246. package/dist/types.d.ts +1 -1
  247. package/dist/types.d.ts.map +1 -1
  248. package/dist/types.js +1 -1
  249. package/dist/verified-recall.js +20 -19
  250. package/dist/who-knows-cli.js +21 -20
  251. package/dist/who-knows.js +20 -19
  252. package/dist/write-envelope.js +5 -4
  253. package/package.json +2 -2
  254. package/src/local-llm-rate-limit.test.ts +59 -1
  255. package/src/local-llm-rate-limit.ts +22 -7
  256. package/src/orchestration/orchestrator-init.ts +26 -3
  257. package/src/orchestrator.ts +1 -0
  258. package/src/secure-store/entity-file-read.ts +55 -0
  259. package/src/secure-store/secure-fs.ts +2 -1
  260. package/src/storage/entity-canonical-id-migration-runner.ts +36 -0
  261. package/src/storage/entity-canonical-id-migration.ts +1 -1
  262. package/src/storage/entity-canonical-id-references.ts +57 -2
  263. package/src/storage/entity-store.ts +138 -25
  264. package/src/storage.ts +15 -15
  265. package/src/types.ts +1 -1
  266. package/dist/chunk-3VRMUNWL.js.map +0 -1
  267. package/dist/chunk-42KSEX6C.js.map +0 -1
  268. package/dist/chunk-H75L4ZOH.js.map +0 -1
  269. package/dist/chunk-IHS2UGYM.js.map +0 -1
  270. package/dist/chunk-MAAL6OZV.js.map +0 -1
  271. package/dist/chunk-NZFFGO5O.js.map +0 -1
  272. /package/dist/{auto-sync-UQESPLCB.js.map → auto-sync-MX2AHVPQ.js.map} +0 -0
  273. /package/dist/{capsule-merge-LGYURS3C.js.map → capsule-merge-LGYZAMO4.js.map} +0 -0
  274. /package/dist/{chunk-G6XEYFCO.js.map → chunk-27OJ5G3D.js.map} +0 -0
  275. /package/dist/{chunk-5LRV557D.js.map → chunk-2FIJQNL7.js.map} +0 -0
  276. /package/dist/{chunk-ETPIYK4J.js.map → chunk-2VBDSZ7U.js.map} +0 -0
  277. /package/dist/{chunk-QNKEMFZY.js.map → chunk-2WDMUQOH.js.map} +0 -0
  278. /package/dist/{chunk-W6MOLW5S.js.map → chunk-2XVLY424.js.map} +0 -0
  279. /package/dist/{chunk-P55FACBG.js.map → chunk-3BOQPLCF.js.map} +0 -0
  280. /package/dist/{chunk-27SAUQ5R.js.map → chunk-3CHHQXAR.js.map} +0 -0
  281. /package/dist/{chunk-3GYSZHMT.js.map → chunk-3CZRBTJK.js.map} +0 -0
  282. /package/dist/{chunk-FJJWA7NL.js.map → chunk-3EJQXF3B.js.map} +0 -0
  283. /package/dist/{chunk-HFSPY26A.js.map → chunk-3IXNL6SK.js.map} +0 -0
  284. /package/dist/{chunk-PLD6SOU7.js.map → chunk-3SN2D43X.js.map} +0 -0
  285. /package/dist/{chunk-COGLFRXT.js.map → chunk-4HNINU7Q.js.map} +0 -0
  286. /package/dist/{chunk-CCDHRDQ3.js.map → chunk-4HYP4OKH.js.map} +0 -0
  287. /package/dist/{chunk-GKJJNO7C.js.map → chunk-4OE4UE2Y.js.map} +0 -0
  288. /package/dist/{chunk-7RTNJ6M2.js.map → chunk-4QPW6JVI.js.map} +0 -0
  289. /package/dist/{chunk-5SMR542T.js.map → chunk-5GT4ESLR.js.map} +0 -0
  290. /package/dist/{chunk-DWL6YIZH.js.map → chunk-5JI3XWI2.js.map} +0 -0
  291. /package/dist/{chunk-27LPB4NS.js.map → chunk-5NPZFXQH.js.map} +0 -0
  292. /package/dist/{chunk-Y6IF6H2U.js.map → chunk-5SMHQW45.js.map} +0 -0
  293. /package/dist/{chunk-VN3GHPBU.js.map → chunk-654GT5UP.js.map} +0 -0
  294. /package/dist/{chunk-3E6DGSGZ.js.map → chunk-6MC7UQ6D.js.map} +0 -0
  295. /package/dist/{chunk-655FVTCD.js.map → chunk-74IN6PV5.js.map} +0 -0
  296. /package/dist/{chunk-WFUO7NWX.js.map → chunk-7FZ4YVOH.js.map} +0 -0
  297. /package/dist/{chunk-MWWAQXZ6.js.map → chunk-7HFTCBCZ.js.map} +0 -0
  298. /package/dist/{chunk-7IOB5F7Y.js.map → chunk-7VB3Y5OL.js.map} +0 -0
  299. /package/dist/{chunk-YEF5AAWN.js.map → chunk-A54E2ZTD.js.map} +0 -0
  300. /package/dist/{chunk-DEY7B77Y.js.map → chunk-AHCELJMH.js.map} +0 -0
  301. /package/dist/{chunk-PIWFNPQT.js.map → chunk-AL3TCNSJ.js.map} +0 -0
  302. /package/dist/{chunk-EET24NSB.js.map → chunk-AUYFUBBE.js.map} +0 -0
  303. /package/dist/{chunk-L3IP56F4.js.map → chunk-BIE3ZH3N.js.map} +0 -0
  304. /package/dist/{chunk-A3IURDU2.js.map → chunk-C2AOL6MK.js.map} +0 -0
  305. /package/dist/{chunk-BDQMMX3M.js.map → chunk-C2QVDLQV.js.map} +0 -0
  306. /package/dist/{chunk-AWLQNLTM.js.map → chunk-CSGFGQBI.js.map} +0 -0
  307. /package/dist/{chunk-JHQAXATW.js.map → chunk-D4RV54HH.js.map} +0 -0
  308. /package/dist/{chunk-33UAWCBN.js.map → chunk-DDLRKPR2.js.map} +0 -0
  309. /package/dist/{chunk-3X3PNU3T.js.map → chunk-DLH3ECZP.js.map} +0 -0
  310. /package/dist/{chunk-SA6GMZJY.js.map → chunk-DP3TSAYT.js.map} +0 -0
  311. /package/dist/{chunk-H2X22KZW.js.map → chunk-FN6OFDBZ.js.map} +0 -0
  312. /package/dist/{chunk-SU5V2LWR.js.map → chunk-G6DAE2LT.js.map} +0 -0
  313. /package/dist/{chunk-V7KGDLBC.js.map → chunk-GQ7VWY6N.js.map} +0 -0
  314. /package/dist/{chunk-SYUNCM26.js.map → chunk-GSKW64NB.js.map} +0 -0
  315. /package/dist/{chunk-4WT6I4VG.js.map → chunk-GWB7ZD2A.js.map} +0 -0
  316. /package/dist/{chunk-JYZLDZ2R.js.map → chunk-HG2VVIKI.js.map} +0 -0
  317. /package/dist/{chunk-23ZQPP2G.js.map → chunk-HOSJESKO.js.map} +0 -0
  318. /package/dist/{chunk-EU6IRUCY.js.map → chunk-IDPZCHET.js.map} +0 -0
  319. /package/dist/{chunk-VMHCC7LO.js.map → chunk-IO2UQVR2.js.map} +0 -0
  320. /package/dist/{chunk-BWXKJDDH.js.map → chunk-ISMZ5UNE.js.map} +0 -0
  321. /package/dist/{chunk-SX4QDWXK.js.map → chunk-IWUFKS4J.js.map} +0 -0
  322. /package/dist/{chunk-I27WOMJ7.js.map → chunk-IY7DGT2Z.js.map} +0 -0
  323. /package/dist/{chunk-STBX5X6B.js.map → chunk-JAYNUYSJ.js.map} +0 -0
  324. /package/dist/{chunk-N34ZW6E4.js.map → chunk-K2REHR42.js.map} +0 -0
  325. /package/dist/{chunk-UJPGQCXD.js.map → chunk-KFKFK6G6.js.map} +0 -0
  326. /package/dist/{chunk-2HLMFRZ7.js.map → chunk-LDEKVBVO.js.map} +0 -0
  327. /package/dist/{chunk-MPZYCRC6.js.map → chunk-M236YHUH.js.map} +0 -0
  328. /package/dist/{chunk-L5VCT7LU.js.map → chunk-MCLZM5G7.js.map} +0 -0
  329. /package/dist/{chunk-7Z3DLNSD.js.map → chunk-MGKH5KO3.js.map} +0 -0
  330. /package/dist/{chunk-PUDYANAX.js.map → chunk-MMBLOJJB.js.map} +0 -0
  331. /package/dist/{chunk-EFHNFTWB.js.map → chunk-MND4YJSX.js.map} +0 -0
  332. /package/dist/{chunk-HJQXHLQQ.js.map → chunk-MROA6OFU.js.map} +0 -0
  333. /package/dist/{chunk-BQOGQULP.js.map → chunk-MZZEMPCI.js.map} +0 -0
  334. /package/dist/{chunk-ERAVI25Z.js.map → chunk-NAPHQ2MG.js.map} +0 -0
  335. /package/dist/{chunk-L5TJWQEF.js.map → chunk-NB2YX6X2.js.map} +0 -0
  336. /package/dist/{chunk-IHGLQJW6.js.map → chunk-NCPR2FOJ.js.map} +0 -0
  337. /package/dist/{chunk-UKWRCQWT.js.map → chunk-NOMHXZD7.js.map} +0 -0
  338. /package/dist/{chunk-DF2G4IXN.js.map → chunk-NPO4ZQFY.js.map} +0 -0
  339. /package/dist/{chunk-LWFWZTWX.js.map → chunk-NQV6G6MU.js.map} +0 -0
  340. /package/dist/{chunk-5HT35H4L.js.map → chunk-NRLWHZVS.js.map} +0 -0
  341. /package/dist/{chunk-GCZHKBY2.js.map → chunk-OANSZGAG.js.map} +0 -0
  342. /package/dist/{chunk-BHQPOCQE.js.map → chunk-OIIAIY7J.js.map} +0 -0
  343. /package/dist/{chunk-FFGHFU7A.js.map → chunk-OXX4ORRL.js.map} +0 -0
  344. /package/dist/{chunk-RTTPBBAN.js.map → chunk-OXYXMGRH.js.map} +0 -0
  345. /package/dist/{chunk-K7BN34IA.js.map → chunk-PL26BCRN.js.map} +0 -0
  346. /package/dist/{chunk-PM72NSEW.js.map → chunk-PYCTZ2HX.js.map} +0 -0
  347. /package/dist/{chunk-AQ52ZFBC.js.map → chunk-PZEADMX4.js.map} +0 -0
  348. /package/dist/{chunk-QPH52AZB.js.map → chunk-QNDOTDJK.js.map} +0 -0
  349. /package/dist/{chunk-LZACDIM2.js.map → chunk-RBGRQEW3.js.map} +0 -0
  350. /package/dist/{chunk-H3AW6QZF.js.map → chunk-RRJ462HP.js.map} +0 -0
  351. /package/dist/{chunk-V4JZCTMK.js.map → chunk-TKBW4YLS.js.map} +0 -0
  352. /package/dist/{chunk-4D2YH47Z.js.map → chunk-TRW7N4FS.js.map} +0 -0
  353. /package/dist/{chunk-OQJKY3Z5.js.map → chunk-UAAAXSKQ.js.map} +0 -0
  354. /package/dist/{chunk-S36KJNQH.js.map → chunk-UM73Q46J.js.map} +0 -0
  355. /package/dist/{chunk-7EJCAFMS.js.map → chunk-UTXYOWDR.js.map} +0 -0
  356. /package/dist/{chunk-AYHPSYZI.js.map → chunk-UUYAW3JH.js.map} +0 -0
  357. /package/dist/{chunk-MSMGQDVW.js.map → chunk-UVUBLLM3.js.map} +0 -0
  358. /package/dist/{chunk-JZIZBJCW.js.map → chunk-V4FI2TG6.js.map} +0 -0
  359. /package/dist/{chunk-MO6N4QYY.js.map → chunk-VARNSLUW.js.map} +0 -0
  360. /package/dist/{chunk-WJAGO5LL.js.map → chunk-VEB7NEON.js.map} +0 -0
  361. /package/dist/{chunk-GMZNJZRP.js.map → chunk-VLBFSD7B.js.map} +0 -0
  362. /package/dist/{chunk-JNIVZNIB.js.map → chunk-WKVL2G7X.js.map} +0 -0
  363. /package/dist/{chunk-KJXP6RUG.js.map → chunk-WNEVEMJ3.js.map} +0 -0
  364. /package/dist/{chunk-HNEOLXRF.js.map → chunk-WQIYGYY6.js.map} +0 -0
  365. /package/dist/{chunk-GQJKVQJR.js.map → chunk-WYLBEJQI.js.map} +0 -0
  366. /package/dist/{chunk-36DZ242S.js.map → chunk-XNROYP5E.js.map} +0 -0
  367. /package/dist/{chunk-XNAOCY67.js.map → chunk-XVZIBMSY.js.map} +0 -0
  368. /package/dist/{chunk-PXTLPC3P.js.map → chunk-YGVZ4QOZ.js.map} +0 -0
  369. /package/dist/{chunk-JX32ROLZ.js.map → chunk-YZTFQBYY.js.map} +0 -0
  370. /package/dist/{chunk-XSXM5LYZ.js.map → chunk-ZCRDYQL6.js.map} +0 -0
  371. /package/dist/{chunk-Z3XVYXQ3.js.map → chunk-ZXTAHSQU.js.map} +0 -0
  372. /package/dist/{resolution-ZU5BIAJA.js.map → entity-canonical-id-migration-GD5MPFUF.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  composeMemoryEnvelope
3
- } from "./chunk-5LRV557D.js";
3
+ } from "./chunk-2FIJQNL7.js";
4
4
  import {
5
5
  log
6
6
  } from "./chunk-3WCASNQZ.js";
@@ -17,4 +17,4 @@ function composeSalvagedEnvelope(label, input, ctx) {
17
17
  export {
18
18
  composeSalvagedEnvelope
19
19
  };
20
- //# sourceMappingURL=chunk-OQJKY3Z5.js.map
20
+ //# sourceMappingURL=chunk-UAAAXSKQ.js.map
@@ -2,7 +2,7 @@ import {
2
2
  WHO_KNOWS_DEFAULT_LIMIT,
3
3
  WHO_KNOWS_MAX_LIMIT,
4
4
  validateWhoKnowsInput
5
- } from "./chunk-AYHPSYZI.js";
5
+ } from "./chunk-UUYAW3JH.js";
6
6
 
7
7
  // src/who-knows-cli.ts
8
8
  function extractWhoKnowsRawArgs(rest) {
@@ -74,4 +74,4 @@ export {
74
74
  renderWhoKnowsText,
75
75
  renderWhoKnows
76
76
  };
77
- //# sourceMappingURL=chunk-S36KJNQH.js.map
77
+ //# sourceMappingURL=chunk-UM73Q46J.js.map
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-23G5P7TA.js";
13
13
  import {
14
14
  tagPersistedMemories
15
- } from "./chunk-K7BN34IA.js";
15
+ } from "./chunk-PL26BCRN.js";
16
16
  import {
17
17
  resolveScopeProfilePlan
18
18
  } from "./chunk-WC3V7HHP.js";
@@ -1093,4 +1093,4 @@ export {
1093
1093
  ExtractionDeadlineError,
1094
1094
  ExtractionRunCoordinator
1095
1095
  };
1096
- //# sourceMappingURL=chunk-7EJCAFMS.js.map
1096
+ //# sourceMappingURL=chunk-UTXYOWDR.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseEntityFile
3
- } from "./chunk-IHS2UGYM.js";
3
+ } from "./chunk-TTIEXXL3.js";
4
4
  import {
5
5
  inferMemoryStatus
6
6
  } from "./chunk-7RJUVTVF.js";
@@ -253,4 +253,4 @@ export {
253
253
  WHO_KNOWS_MCP_TOOLS,
254
254
  handleWhoKnowsHttpQuery
255
255
  };
256
- //# sourceMappingURL=chunk-AYHPSYZI.js.map
256
+ //# sourceMappingURL=chunk-UUYAW3JH.js.map
@@ -5,7 +5,7 @@ import {
5
5
  rejectSymlinkPath,
6
6
  renderFrontmatter,
7
7
  writeBundleFile
8
- } from "./chunk-4D2YH47Z.js";
8
+ } from "./chunk-TRW7N4FS.js";
9
9
  import {
10
10
  parseOaiMemCitation
11
11
  } from "./chunk-D24OXEPB.js";
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-3UXOZBHV.js";
15
15
  import {
16
16
  StorageManager
17
- } from "./chunk-IHS2UGYM.js";
17
+ } from "./chunk-TTIEXXL3.js";
18
18
  import {
19
19
  OKF_PROFILE_TYPE,
20
20
  okfTypeForMemory
@@ -272,4 +272,4 @@ export {
272
272
  exportOkfBundle,
273
273
  firstHeading
274
274
  };
275
- //# sourceMappingURL=chunk-MSMGQDVW.js.map
275
+ //# sourceMappingURL=chunk-UVUBLLM3.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  hasCodexMaterializeSentinel,
6
6
  materializeForNamespace
7
- } from "./chunk-PIWFNPQT.js";
7
+ } from "./chunk-AL3TCNSJ.js";
8
8
  import {
9
9
  projectProceduresToSkills
10
10
  } from "./chunk-236PXYG7.js";
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-ZCUTSMR2.js";
14
14
  import {
15
15
  StorageManager
16
- } from "./chunk-IHS2UGYM.js";
16
+ } from "./chunk-TTIEXXL3.js";
17
17
  import {
18
18
  excludeSupportPassportPrivateMemories
19
19
  } from "./chunk-PWPIERBM.js";
@@ -134,4 +134,4 @@ export {
134
134
  runCodexMaterialize,
135
135
  runPostConsolidationMaterialize
136
136
  };
137
- //# sourceMappingURL=chunk-JZIZBJCW.js.map
137
+ //# sourceMappingURL=chunk-V4FI2TG6.js.map
@@ -5,16 +5,16 @@ import {
5
5
  citationTemplateFingerprint,
6
6
  isCachedIdentityReusable,
7
7
  isReconcileMemoryIdentity
8
- } from "./chunk-SA6GMZJY.js";
8
+ } from "./chunk-DP3TSAYT.js";
9
9
  import {
10
10
  offlineSyncStorageForSnapshot
11
- } from "./chunk-GKJJNO7C.js";
11
+ } from "./chunk-4OE4UE2Y.js";
12
12
  import {
13
13
  createPersistedSupportPassportPrivateFileExclusion
14
14
  } from "./chunk-PWPIERBM.js";
15
15
  import {
16
16
  iterateOfflineSyncSnapshotFileRecords
17
- } from "./chunk-23ZQPP2G.js";
17
+ } from "./chunk-HOSJESKO.js";
18
18
 
19
19
  // src/access-offline-manifest.ts
20
20
  import * as nodePath from "path";
@@ -250,4 +250,4 @@ export {
250
250
  retainExcludedClassifications,
251
251
  createOfflineSyncManifestStream
252
252
  };
253
- //# sourceMappingURL=chunk-MO6N4QYY.js.map
253
+ //# sourceMappingURL=chunk-VARNSLUW.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  resolveDefaultNamespaceRoot
3
- } from "./chunk-GMZNJZRP.js";
3
+ } from "./chunk-VLBFSD7B.js";
4
4
  import {
5
5
  StorageManager
6
- } from "./chunk-IHS2UGYM.js";
6
+ } from "./chunk-TTIEXXL3.js";
7
7
  import {
8
8
  composeLocationDayBody,
9
9
  composeLocationDayMeta,
@@ -23,7 +23,7 @@ import {
23
23
  serializeLocationDay,
24
24
  updateLocationSourceDay,
25
25
  writeLocationDay
26
- } from "./chunk-K7BN34IA.js";
26
+ } from "./chunk-PL26BCRN.js";
27
27
  import {
28
28
  resolveNamespaceCapabilities
29
29
  } from "./chunk-C5LWPYS3.js";
@@ -728,4 +728,4 @@ export {
728
728
  runLocationBackfill,
729
729
  runLocationCliCommand
730
730
  };
731
- //# sourceMappingURL=chunk-WJAGO5LL.js.map
731
+ //# sourceMappingURL=chunk-VEB7NEON.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  StorageManager
3
- } from "./chunk-IHS2UGYM.js";
3
+ } from "./chunk-TTIEXXL3.js";
4
4
  import {
5
5
  keyring_exports,
6
6
  secureStoreDir
@@ -416,4 +416,4 @@ export {
416
416
  resolveNamespaceStorageRoot,
417
417
  NamespaceStorageRouter
418
418
  };
419
- //# sourceMappingURL=chunk-GMZNJZRP.js.map
419
+ //# sourceMappingURL=chunk-VLBFSD7B.js.map
@@ -79,6 +79,7 @@ function assertSafeEntityId(entityId) {
79
79
  }
80
80
 
81
81
  // src/storage/entity-canonical-id-references.ts
82
+ import { statSync } from "fs";
82
83
  import path2 from "path";
83
84
  import {
84
85
  closeSync,
@@ -109,6 +110,10 @@ function parseJournalMappings(raw) {
109
110
  }
110
111
  return cleaned;
111
112
  }
113
+ function parseJournalComplete(raw) {
114
+ const parsed = JSON.parse(raw);
115
+ return parsed !== null && parsed.complete === true;
116
+ }
112
117
  function readJournalFileNoFollow(statePath) {
113
118
  let fd;
114
119
  try {
@@ -169,12 +174,36 @@ async function appendCanonicalizedTombstone(stateDir, input, currentIds, append,
169
174
  });
170
175
  return result;
171
176
  }
177
+ function memoizedJournalCompletion(cache, stateDir) {
178
+ let memo;
179
+ return () => {
180
+ let key = "missing";
181
+ try {
182
+ const journalPath = path2.join(stateDir(), ENTITY_CANONICAL_ID_MIGRATION_FILE);
183
+ const j = statSync(journalPath);
184
+ key = `${j.dev}:${j.ino}:${j.mtimeMs}:${j.ctimeMs}:${j.size}`;
185
+ } catch {
186
+ key = "missing";
187
+ }
188
+ if (memo && memo.key === key) return memo.complete;
189
+ const entry = cache.getEntry(stateDir());
190
+ memo = { key, complete: entry.complete };
191
+ return memo.complete;
192
+ };
193
+ }
172
194
  var HistoricalEntityCanonicalIdCache = class {
173
195
  mappings = {};
196
+ complete = false;
174
197
  key = null;
175
198
  stateDir = null;
176
199
  get(stateDir) {
177
- const lastKnown = this.stateDir === stateDir ? this.mappings : {};
200
+ return this.getEntry(stateDir).mappings;
201
+ }
202
+ /** Table plus the journal's completion flag, cached under one identity. */
203
+ getEntry(stateDir) {
204
+ const lastKnownMappings = this.stateDir === stateDir ? this.mappings : {};
205
+ const lastKnownComplete = this.stateDir === stateDir ? this.complete : false;
206
+ const lastKnown = { mappings: lastKnownMappings, complete: lastKnownComplete };
178
207
  const result = readJournalFileNoFollow(path2.join(stateDir, ENTITY_CANONICAL_ID_MIGRATION_FILE));
179
208
  if (result.kind === "refused") {
180
209
  log.warn("ignoring non-regular entity canonical-id journal (symlink refused)");
@@ -186,18 +215,21 @@ var HistoricalEntityCanonicalIdCache = class {
186
215
  const key = result.kind === "missing" ? "missing" : result.key;
187
216
  if (key !== this.key || stateDir !== this.stateDir) {
188
217
  let table = {};
218
+ let complete = false;
189
219
  if (result.kind === "ok") {
190
220
  try {
191
221
  table = parseJournalMappings(result.raw);
222
+ complete = parseJournalComplete(result.raw);
192
223
  } catch {
193
224
  return lastKnown;
194
225
  }
195
226
  }
196
227
  this.mappings = table;
228
+ this.complete = complete;
197
229
  this.key = key;
198
230
  this.stateDir = stateDir;
199
231
  }
200
- return this.mappings;
232
+ return { mappings: this.mappings, complete: this.complete };
201
233
  }
202
234
  };
203
235
  function resolveHistoricalEntityCanonicalId(normalized, mappings) {
@@ -367,6 +399,7 @@ export {
367
399
  assertSafeEntityId,
368
400
  ENTITY_CANONICAL_ID_MIGRATION_FILE,
369
401
  appendCanonicalizedTombstone,
402
+ memoizedJournalCompletion,
370
403
  HistoricalEntityCanonicalIdCache,
371
404
  resolveHistoricalEntityCanonicalId,
372
405
  canonicalizeEntityRefOption,
@@ -383,4 +416,4 @@ export {
383
416
  repairContentAfterJournalMove,
384
417
  repairContentAfterJournalMoveSync
385
418
  };
386
- //# sourceMappingURL=chunk-NZFFGO5O.js.map
419
+ //# sourceMappingURL=chunk-VXWOJPSY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/storage/entity-canonical-id-lock.ts","../src/storage/entity-id-safety.ts","../src/storage/entity-canonical-id-references.ts"],"sourcesContent":["import { appendFileSync, mkdirSync, realpathSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { invalidateForScope } from \"../memory-cache.js\";\nimport { serializeMutations, withHeldFileLock } from \"../utils/serialize-mutations.js\";\n\nconst ENTITY_CANONICAL_ID_MUTATION_LOCK_STALE_MS = 60_000;\nconst ENTITY_CANONICAL_ID_MUTATION_LOCK_MAX_WAIT_MS = 300_000;\n\nexport function isEntityPagePath(baseDir: string, filePath: string): boolean {\n if (path.extname(filePath) !== \".md\") return false;\n const parentDir = path.dirname(path.resolve(filePath));\n const entitiesDir = path.resolve(baseDir, \"entities\");\n if (parentDir === entitiesDir) return true;\n try {\n return realpathSync(parentDir) === path.join(realpathSync(baseDir), \"entities\");\n } catch {\n return false;\n }\n}\n\nfunction recordRawEntityMutation(baseDir: string, stateDir: string): void {\n invalidateForScope(baseDir, \"entity-write\");\n mkdirSync(stateDir, { recursive: true });\n appendFileSync(path.join(stateDir, \".entity-mutation-version.log\"), \"x\");\n}\n\nexport function withEntityCanonicalMutationLock<T>(\n stateDir: string,\n task: (refreshLock: () => Promise<boolean>) => Promise<T>,\n): Promise<T> {\n const lockPath = path.join(stateDir, \"entity-canonical-id-mutation.lock\");\n return serializeMutations(lockPath, () =>\n withHeldFileLock(\n lockPath,\n {\n staleMs: ENTITY_CANONICAL_ID_MUTATION_LOCK_STALE_MS,\n maxWaitMs: ENTITY_CANONICAL_ID_MUTATION_LOCK_MAX_WAIT_MS,\n },\n async (acquired, lock) => {\n if (!acquired) throw new Error(\"Timed out waiting for entity mutation lock.\");\n return task(() => lock.refresh());\n },\n ),\n );\n}\n\nexport async function withRawEntityPageMutation<T>(\n baseDir: string,\n filePath: string,\n task: (refreshLock: () => Promise<boolean>) => Promise<T>,\n): Promise<T> {\n if (!isEntityPagePath(baseDir, filePath)) {\n return task(async () => true);\n }\n const stateDir = path.join(baseDir, \"state\");\n return withEntityCanonicalMutationLock(stateDir, async (refreshLock) => {\n try {\n return await task(refreshLock);\n } finally {\n recordRawEntityMutation(baseDir, stateDir);\n }\n });\n}\n","const UNSAFE_ENTITY_ID_PATTERN = /[\\/\\\\\\p{Cc}\\p{Zl}\\p{Zp}]/u;\n\nexport function assertSafeEntityId(entityId: string): void {\n if (UNSAFE_ENTITY_ID_PATTERN.test(entityId)) {\n throw new Error(\"Refusing unsafe entity id containing a path separator or control character.\");\n }\n}\n","import { statSync } from \"node:fs\";\n/**\n * Write-boundary surface of the entity canonical-id migration (issue #2213).\n *\n * The migration itself (entity-canonical-id-migration.ts) renames legacy\n * entity files and rewrites references ONCE, to convergence, then retires.\n * Everything here exists so nothing can re-introduce a legacy reference\n * afterwards without the migration having to rescan the corpus:\n *\n * - store-mediated writes canonicalize the caller-supplied `entityRef`\n * ({@link canonicalizeEntityRefOption});\n * - bulk writers that persist raw record bytes (capsule import/merge)\n * canonicalize the frontmatter line ({@link canonicalizeEntityRefFrontmatter});\n * - raw-byte writers that CANNOT parse what they write (offline sync,\n * consolidation-undo, governance restores) request one bounded\n * reconciliation pass instead ({@link requestEntityCanonicalIdReconcile}).\n */\nimport path from \"node:path\";\nimport {\n closeSync,\n constants,\n fstatSync,\n lstatSync,\n realpathSync,\n openSync,\n readFileSync,\n renameSync,\n rmSync,\n writeFileSync,\n} from \"node:fs\";\nimport { randomUUID } from \"node:crypto\";\nimport { log } from \"../logger.js\";\nimport { isErrnoCode } from \"../utils/errno.js\";\nimport { RECALL_FALLBACK_DIRS } from \"../utils/category-dir.js\";\nimport { withEntityCanonicalMutationLock } from \"./entity-canonical-id-lock.js\";\nimport { assertSafeEntityId } from \"./entity-id-safety.js\";\nimport { normalizeSupersessionKey } from \"../temporal-supersession.js\";\n\nexport const ENTITY_CANONICAL_ID_MIGRATION_FILE = \"entity-canonical-id-migration-v1.json\";\n\n/**\n * Parse a journal document into a mapping table. A document without a valid\n * `mappings` object is a LEGITIMATELY empty table; an unreadable/unparsable\n * document THROWS so callers can distinguish \"empty\" from \"failed\".\n */\nfunction parseJournalMappings(raw: string): Readonly<Record<string, string>> {\n const parsed: unknown = JSON.parse(raw);\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed) || !(\"mappings\" in parsed)) return {};\n const mappings = parsed.mappings;\n if (!mappings || typeof mappings !== \"object\" || Array.isArray(mappings)) return {};\n // Null prototype: journal-supplied ids like `constructor` must be own\n // entries, never collide with Object.prototype (Codex P2, round 20).\n const cleaned: Record<string, string> = Object.create(null) as Record<string, string>;\n for (const [legacyId, canonicalId] of Object.entries(mappings)) {\n if (legacyId.length > 0 && typeof canonicalId === \"string\" && canonicalId.length > 0) {\n assertSafeEntityId(legacyId);\n assertSafeEntityId(canonicalId);\n cleaned[legacyId] = canonicalId;\n }\n }\n return cleaned;\n}\n\n/** Whether the journal says its migration completed. Throws like the mapping parser. */\nfunction parseJournalComplete(raw: string): boolean {\n // SAFETY: JSON.parse output is unknown; the shape is validated on access.\n const parsed = JSON.parse(raw) as { complete?: unknown };\n return parsed !== null && parsed.complete === true;\n}\n\ntype JournalRead =\n | { kind: \"ok\"; raw: string; key: string }\n | { kind: \"missing\" }\n | { kind: \"refused\" }\n | { kind: \"error\" };\n\n/**\n * Open the journal WITHOUT following symlinks and read content + identity\n * from the same opened inode (repo rule: reject symlink traversal from\n * memory directories). O_NOFOLLOW makes the open refuse a symlinked FINAL\n * component (ELOOP); the parent `state/` directory is verified AFTER the\n * open, together with a path↔fd identity pairing, so a parent swapped\n * around the open cannot hold: a swap still in place fails the parent\n * lstat, and a swap reverted fails the dev/ino pairing against the real\n * journal. Platforms without O_NOFOLLOW get the same post-open checks.\n */\nfunction readJournalFileNoFollow(statePath: string): JournalRead {\n let fd: number;\n try {\n fd = openSync(statePath, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0));\n } catch (error) {\n if (isErrnoCode(error, \"ENOENT\")) return { kind: \"missing\" };\n if (isErrnoCode(error, \"ELOOP\")) return { kind: \"refused\" };\n return { kind: \"error\" };\n }\n try {\n const s = fstatSync(fd);\n if (!s.isFile()) return { kind: \"refused\" };\n const parent = lstatSync(path.dirname(statePath));\n if (parent.isSymbolicLink() || !parent.isDirectory()) return { kind: \"refused\" };\n const l = lstatSync(statePath);\n if (l.isSymbolicLink() || l.dev !== s.dev || l.ino !== s.ino) return { kind: \"refused\" };\n return {\n kind: \"ok\",\n raw: readFileSync(fd, \"utf-8\"),\n key: `${s.dev}:${s.ino}:${s.mtimeMs}:${s.ctimeMs}:${s.size}`,\n };\n } catch {\n return { kind: \"error\" };\n } finally {\n closeSync(fd);\n }\n}\n\nexport function loadHistoricalEntityCanonicalIds(stateDir: string): Readonly<Record<string, string>> {\n const result = readJournalFileNoFollow(path.join(stateDir, ENTITY_CANONICAL_ID_MIGRATION_FILE));\n if (result.kind !== \"ok\") return {};\n try {\n return parseJournalMappings(result.raw);\n } catch {\n return {};\n }\n}\n\n/**\n * Append a tombstone with its identity canonicalized against the CURRENT\n * journal, then recheck: a peer publishing a mapping inside the\n * resolve-to-append window would leave the guard under the legacy id while\n * lookups canonicalize. Each identity change appends the replacement FIRST\n * (AGENTS.md §14 — the retired fact must never be without an active guard),\n * then revokes the superseded one — a park makes the prior canonical\n * claimant a distinct entity, and a stale keyed guard under it would\n * suppress that entity's facts. When the journal will not settle, one final\n * replacement runs under the entity MUTATION lock (parks publish under it).\n */\nexport async function appendCanonicalizedTombstone(\n stateDir: string,\n input: { entityRef?: string; supersessionKey?: string },\n currentIds: () => Readonly<Record<string, string>>,\n append: (identity: TombstoneIdentity) => Promise<string | null>,\n revoke: (tombstoneId: string) => Promise<unknown>,\n label: string,\n): Promise<string | null> {\n let refIds = currentIds();\n let identity = canonicalizeTombstoneIdentity(input.entityRef, input.supersessionKey, refIds);\n let result = await append(identity);\n const replaceIfChanged = async (next: TombstoneIdentity): Promise<boolean> => {\n if (next.entityRef === identity.entityRef && next.supersessionKey === identity.supersessionKey) {\n return false;\n }\n identity = next;\n const superseded = result;\n result = await append(next);\n if (superseded !== null) {\n try {\n await revoke(superseded);\n } catch (err) {\n log.warn(`failed to revoke superseded tombstone ${superseded} for ${label}: ${err}`);\n }\n }\n return true;\n };\n for (let attempt = 0; attempt < 3; attempt += 1) {\n const fresh = currentIds();\n if (fresh === refIds) return result;\n refIds = fresh;\n if (!(await replaceIfChanged(canonicalizeTombstoneIdentity(input.entityRef, input.supersessionKey, fresh)))) {\n return result;\n }\n }\n await withEntityCanonicalMutationLock(stateDir, async () => {\n await replaceIfChanged(canonicalizeTombstoneIdentity(input.entityRef, input.supersessionKey, currentIds()));\n });\n return result;\n}\n\n/**\n * Journal mapping table keyed by the journal FILE's identity, so a long-lived\n * StorageManager never canonicalizes against a stale snapshot after ANY other\n * writer changes the journal — a peer process completing a migration, or\n * `pruneBlocked()` parking a contested mapping (which rewrites the journal\n * without bumping any shared version). `writeState` publishes via\n * temp-file-plus-rename, so every journal write swaps the inode and the key\n * always moves — the identity is taken from the fstat of the SAME opened\n * inode the content is read from (no stat→read window). Reload cost is one\n * open per lookup and one journal parse per actual change.\n *\n * Failure semantics: last-known data is served ONLY for the SAME state dir\n * (module-level instances can face several stores — another store's table\n * must never leak in), and a failed read/parse never commits the journal's\n * identity, so the next lookup retries instead of caching an empty table\n * under a valid key.\n */\n\n/** Journal lookup result: mapping table plus its completion flag. */\nexport type HistoricalEntityIdsEntry = {\n mappings: Readonly<Record<string, string>>;\n complete: boolean;\n};\n\n\n\n/**\n * Memoized journal-completion view keyed on the journal file's stat identity.\n * entityList consults completion once per listed entity; without this each\n * consult re-opens and re-reads the journal (quadratic I/O on large corpora).\n */\nexport function memoizedJournalCompletion(\n cache: HistoricalEntityCanonicalIdCache,\n stateDir: () => string,\n): () => boolean {\n let memo: { key: string; complete: boolean } | undefined;\n return (): boolean => {\n let key = \"missing\";\n try {\n const journalPath = path.join(stateDir(), ENTITY_CANONICAL_ID_MIGRATION_FILE);\n const j = statSync(journalPath);\n key = `${j.dev}:${j.ino}:${j.mtimeMs}:${j.ctimeMs}:${j.size}`;\n } catch {\n key = \"missing\";\n }\n if (memo && memo.key === key) return memo.complete;\n const entry = cache.getEntry(stateDir());\n memo = { key, complete: entry.complete };\n return memo.complete;\n };\n}\n\nexport class HistoricalEntityCanonicalIdCache {\n private mappings: Readonly<Record<string, string>> = {};\n private complete = false;\n private key: string | null = null;\n private stateDir: string | null = null;\n\n get(stateDir: string): Readonly<Record<string, string>> {\n return this.getEntry(stateDir).mappings;\n }\n\n\n /** Table plus the journal's completion flag, cached under one identity. */\n getEntry(stateDir: string): HistoricalEntityIdsEntry {\n const lastKnownMappings = this.stateDir === stateDir ? this.mappings : {};\n const lastKnownComplete = this.stateDir === stateDir ? this.complete : false;\n const lastKnown: HistoricalEntityIdsEntry = { mappings: lastKnownMappings, complete: lastKnownComplete };\n const result = readJournalFileNoFollow(path.join(stateDir, ENTITY_CANONICAL_ID_MIGRATION_FILE));\n if (result.kind === \"refused\") {\n // Symlinked/non-regular journal: never follow it, never adopt its\n // identity — serve this store's last-known table. If it later becomes\n // a regular file its identity differs from the stored key and reloads.\n log.warn(\"ignoring non-regular entity canonical-id journal (symlink refused)\");\n return lastKnown;\n }\n if (result.kind === \"error\") {\n // A TRANSIENT open/read failure (EACCES/EIO) must not dump a valid\n // table for {}: a write during the outage would skip canonicalization\n // AND its post-write identity check would compare equal. Serve this\n // store's last-known table; only a genuine ENOENT means \"no journal\".\n return lastKnown;\n }\n const key = result.kind === \"missing\" ? \"missing\" : result.key;\n if (key !== this.key || stateDir !== this.stateDir) {\n let table: Readonly<Record<string, string>> = {};\n let complete = false;\n if (result.kind === \"ok\") {\n try {\n table = parseJournalMappings(result.raw);\n complete = parseJournalComplete(result.raw);\n } catch {\n // Parse failed under a VALID identity: do not commit the key —\n // the next lookup retries instead of pinning an empty table.\n return lastKnown;\n }\n }\n this.mappings = table;\n this.complete = complete;\n this.key = key;\n this.stateDir = stateDir;\n }\n return { mappings: this.mappings, complete: this.complete };\n }\n}\n\nexport function resolveHistoricalEntityCanonicalId(\n normalized: string,\n mappings: Readonly<Record<string, string>>,\n): string {\n let current = normalized;\n const seen = new Set<string>();\n while (!seen.has(current)) {\n seen.add(current);\n // Own properties only: an unmapped id like `constructor` must not read\n // Object.prototype and return a function (Codex P2, round 20).\n const next = Object.hasOwn(mappings, current) ? mappings[current] : undefined;\n if (!next || next === current) break;\n current = next;\n }\n return current;\n}\n\n/**\n * Canonicalize the `entityRef` a memory-write caller supplied (issue #2213).\n *\n * Extraction and capture callers pass whatever id the LLM or user produced,\n * which can name a legacy id this migration already renamed. Resolving at the\n * WRITE boundary means store-mediated writes can never re-introduce legacy\n * references — which is what let the completed migration retire its recurring\n * full-corpus reference rewrite. It also keeps write-time tombstone lookups on\n * the same id space as migrated tombstones. Unknown ids pass through verbatim.\n */\nexport function canonicalizeEntityRefOption<T extends { entityRef?: string }>(\n options: T,\n mappings: Readonly<Record<string, string>>,\n): T {\n // Non-strings (absent, or a JS caller's null/junk) pass through untouched:\n // this boundary canonicalizes ids, it does not take over input validation\n // the write path never performed — serialization already drops falsy refs.\n if (typeof options.entityRef !== \"string\") return options;\n return { ...options, entityRef: resolveHistoricalEntityCanonicalId(options.entityRef, mappings) };\n}\n\n/**\n * Canonicalize the effective `entityRef:` line inside a raw memory record's\n * leading frontmatter block (issue #2213). Bulk writers that persist record\n * bytes verbatim — capsule import/merge — are a write boundary too: a capsule\n * can carry pre-migration memories whose refs the target's completed journal\n * already renamed, and no later reconciliation pass exists to absorb them.\n *\n * Line selection mirrors the frontmatter parser and the migration's own\n * serializer: the LAST `entityRef` key wins (indentation tolerated), its\n * indent is preserved, and CRLF records keep their line endings. The closing\n * delimiter must be a standalone `---` line. Non-frontmatter content, records\n * without an `entityRef` line, and ids the journal does not map all pass\n * through byte-identical.\n */\nexport function canonicalizeEntityRefFrontmatter(\n content: string,\n mappings: Readonly<Record<string, string>>,\n): string {\n if (Object.keys(mappings).length === 0) return content;\n const loc = locateEntityRefLine(content);\n if (loc === null) return content;\n const canonical = resolveHistoricalEntityCanonicalId(loc.value, mappings);\n if (canonical === loc.value) return content;\n const line = loc.lines[loc.index]!;\n const indent = /^\\s*/.exec(line)?.[0] ?? \"\";\n loc.lines[loc.index] = `${indent}entityRef: ${canonical}${line.endsWith(\"\\r\") ? \"\\r\" : \"\"}`;\n return loc.lines.join(\"\\n\") + content.slice(loc.closeIndex);\n}\n\n/** The raw `entityRef` value in a record's leading frontmatter, or null. */\nexport function readEntityRefFromFrontmatter(content: string): string | null {\n return locateEntityRefLine(content)?.value ?? null;\n}\n\nfunction locateEntityRefLine(\n content: string,\n): { lines: string[]; index: number; value: string; closeIndex: number } | null {\n if (!/^---\\r?\\n/.test(content)) return null;\n const close = /\\r?\\n---(?:\\r?\\n|$)/g;\n close.lastIndex = content.indexOf(\"\\n\") + 1;\n const closeMatch = close.exec(content);\n if (!closeMatch) return null;\n const lines = content.slice(0, closeMatch.index).split(\"\\n\");\n let index = -1;\n for (let i = 1; i < lines.length; i += 1) {\n if (/^\\s*entityRef\\s*:/.test(lines[i] ?? \"\")) index = i;\n }\n if (index === -1) return null;\n const line = lines[index]!;\n const value = line.slice(line.indexOf(\":\") + 1).replace(/\\r$/, \"\").trim();\n if (value.length === 0) return null;\n return { lines, index, value, closeIndex: closeMatch.index };\n}\n\n/**\n * Reconcile-pending marker (issue #2213). Raw-byte memory writers that CANNOT\n * canonicalize inline — offline-sync file replication (opaque, possibly\n * encrypted buffers), consolidation-undo restores, governance-run restores —\n * touch this marker instead. The next migration invocation honors it by\n * running ONE bounded reference-reconciliation pass over the completed\n * journal's retained mappings, then clears it. This replaces the retired\n * every-run corpus rewrite with a signal that fires only when a raw writer\n * actually landed unvetted bytes.\n */\nexport const ENTITY_CANONICAL_ID_RECONCILE_MARKER = \"entity-canonical-id-reconcile.pending\";\n/** The generation a migration run renamed aside for consumption; a crash can strand it. */\nexport const ENTITY_CANONICAL_ID_RECONCILE_CONSUMING_MARKER = `${ENTITY_CANONICAL_ID_RECONCILE_MARKER}.consuming`;\n\nexport function requestEntityCanonicalIdReconcileSync(stateDir: string): void {\n const markerPath = path.join(stateDir, ENTITY_CANONICAL_ID_RECONCILE_MARKER);\n const temporary = `${markerPath}.${process.pid}.${randomUUID()}.tmp`;\n try {\n // Never write THROUGH a symlinked marker OR a symlinked state dir (repo\n // rule: reject symlink traversal from memory directories). The parent is\n // lstat-verified as a real directory — direct restore/import callers can\n // reach this helper without validateRoots() — and temp-file-plus-rename\n // handles the final component: rename() replaces a planted link ITSELF\n // rather than following it, with no O_NOFOLLOW dependency.\n const parent = lstatSync(stateDir);\n if (parent.isSymbolicLink() || !parent.isDirectory()) {\n log.warn(`refusing to write entity canonical-id reconcile marker: ${stateDir} is not a real directory`);\n return;\n }\n const parentRealPath = realpathSync(stateDir);\n writeFileSync(temporary, `${new Date().toISOString()}\\n`, { mode: 0o600 });\n // Revalidate the parent between the temp write and publication (Codex\n // P2, round 20): a state-dir swapped for a symlink after the check above\n // would have landed the temp file through the link. Node has no openat,\n // so the residual window is the realpath→rename gap — this recheck\n // reduces check-then-use to the platform primitive's own atomicity.\n const recheck = lstatSync(stateDir);\n if (recheck.isSymbolicLink() || !recheck.isDirectory() || realpathSync(stateDir) !== parentRealPath) {\n rmSync(temporary, { force: true });\n log.warn(`refusing to publish entity canonical-id reconcile marker: ${stateDir} changed during write`);\n return;\n }\n renameSync(temporary, markerPath);\n } catch (error) {\n rmSync(temporary, { force: true });\n // Best effort by design: a marker failure must not fail the restore/sync\n // that requested it (AGENTS.md §4). The reference stays legacy-but-readable\n // until the next mapping change.\n log.warn(`could not request entity canonical-id reconcile: ${error}`);\n }\n}\n\nexport async function requestEntityCanonicalIdReconcile(stateDir: string): Promise<void> {\n requestEntityCanonicalIdReconcileSync(stateDir);\n}\n\n/**\n * Post-persist TOCTOU guard (issue #2213). A writer resolves `entityRef`\n * against one journal generation, then awaits (snapshots, locks, fsyncs)\n * before its bytes land — a peer migration can publish AND finish its final\n * reference scan inside that window, leaving the just-written file behind.\n * Callers pass the mapping table captured at resolve time plus a fresh cache\n * read taken AFTER the write: the cache returns the identical object while\n * the journal file is unchanged, so an identity mismatch means the journal\n * moved mid-write and one bounded reconcile pass is requested.\n */\nexport function reconcileIfJournalMovedSync(\n stateDir: string,\n idsAtResolve: Readonly<Record<string, string>>,\n idsAfterWrite: Readonly<Record<string, string>>,\n): void {\n if (idsAtResolve === idsAfterWrite) return;\n requestEntityCanonicalIdReconcileSync(stateDir);\n}\n\nexport async function reconcileIfJournalMoved(\n stateDir: string,\n idsAtResolve: Readonly<Record<string, string>>,\n idsAfterWrite: Readonly<Record<string, string>>,\n): Promise<void> {\n reconcileIfJournalMovedSync(stateDir, idsAtResolve, idsAfterWrite);\n}\n\n/**\n * Classify a raw write target for entity-reference handling (issue #2213):\n * - `\"memory\"` — hot recall / cold / archive record whose FRONTMATTER\n * `entityRef` the writer must canonicalize at the write (and repair after).\n * - `\"entity\"` — an `entities/` page. Its migrated surface is relationship\n * TARGETS in the body, which only `rewriteRelationshipTargets` understands;\n * raw writers persist bytes faithfully and request the bounded reconcile\n * pass instead of attempting a frontmatter rewrite.\n * - `\"outside\"` — transcripts, profiles, runtime state, and every other file\n * outside the migration's scan scope: write byte-identical, no marker.\n */\nexport type EntityRefWritePathKind = \"memory\" | \"entity\" | \"outside\";\n\nexport function classifyEntityRefWritePath(baseDir: string, filePath: string): EntityRefWritePathKind {\n if (!filePath.endsWith(\".md\")) return \"outside\";\n const rel = path.relative(baseDir, filePath);\n if (rel.startsWith(\"..\") || path.isAbsolute(rel)) return \"outside\";\n const top = rel.split(path.sep)[0] ?? \"\";\n if (top === \"entities\") return \"entity\";\n return RECALL_FALLBACK_DIRS.includes(top) || top === \"cold\" || top === \"archive\" ? \"memory\" : \"outside\";\n}\n\n/** True when `filePath` is in the migration's scan scope at all. */\nexport function pathMayCarryEntityRefs(baseDir: string, filePath: string): boolean {\n return classifyEntityRefWritePath(baseDir, filePath) !== \"outside\";\n}\n\n/**\n * Canonicalize a tombstone's identity fields at the append chokepoint\n * (issue #2213): emitters (forget, temporal supersession, pattern\n * reinforcement, supersede) build inputs from records that may have been\n * read before a peer migration completed. The supersession key embeds the\n * NORMALIZED entity segment (`entity::attr`), so it is re-prefixed when the\n * ref moved — otherwise the keyed guard lands in the legacy id space while\n * write-time lookups canonicalize, and a paraphrase resurrects.\n */\nexport interface TombstoneIdentity {\n entityRef: string | undefined;\n supersessionKey: string | undefined;\n}\n\nexport function canonicalizeTombstoneIdentity(\n entityRef: string | undefined,\n supersessionKey: string | undefined,\n refIds: Readonly<Record<string, string>>,\n): TombstoneIdentity {\n if (typeof entityRef !== \"string\") return { entityRef, supersessionKey };\n const canonical = resolveHistoricalEntityCanonicalId(entityRef, refIds);\n if (canonical === entityRef) return { entityRef, supersessionKey };\n if (supersessionKey) {\n const stalePrefix = `${normalizeSupersessionKey(entityRef)}::`;\n if (supersessionKey.startsWith(stalePrefix)) {\n supersessionKey = `${normalizeSupersessionKey(canonical)}::${supersessionKey.slice(stalePrefix.length)}`;\n }\n }\n return { entityRef: canonical, supersessionKey };\n}\n\n/**\n * Post-persist repair (issue #2213): when the journal moved across a persist,\n * re-resolve the caller's ORIGINAL ref against the fresh table and rewrite\n * the file in place (bounded). When the journal will not settle, take the\n * entity MUTATION lock — parks/removals (the direction the reconcile pass\n * cannot repair, because the removed mapping is gone from the table) publish\n * under it — settle once, then request the marker for additive moves only.\n */\nexport async function repairEntityRefAfterJournalMove(options: {\n stateDir: string;\n currentIds: () => Readonly<Record<string, string>>;\n idsAtResolve: Readonly<Record<string, string>>;\n rawRef: string;\n frontmatter: { entityRef?: string };\n rewrite: () => Promise<void>;\n}): Promise<void> {\n let refIds = options.idsAtResolve;\n for (let attempt = 0; attempt < 3; attempt += 1) {\n const fresh = options.currentIds();\n if (fresh === refIds) return;\n refIds = fresh;\n const desired = resolveHistoricalEntityCanonicalId(options.rawRef, fresh);\n if (desired === options.frontmatter.entityRef) return;\n options.frontmatter.entityRef = desired;\n await options.rewrite();\n }\n await withEntityCanonicalMutationLock(options.stateDir, async () => {\n const desired = resolveHistoricalEntityCanonicalId(options.rawRef, options.currentIds());\n if (desired !== options.frontmatter.entityRef) {\n options.frontmatter.entityRef = desired;\n await options.rewrite();\n }\n });\n await requestEntityCanonicalIdReconcile(options.stateDir);\n}\n\n/**\n * Content-form counterpart of {@link repairEntityRefAfterJournalMove} for\n * async writers that persist raw record bytes (capsule import/merge,\n * binary-lifecycle redirects): same bounded loop, same locked settle.\n */\nexport async function repairContentAfterJournalMove(options: {\n stateDir: string;\n cache: HistoricalEntityCanonicalIdCache;\n idsAtWrite: Readonly<Record<string, string>>;\n rawContent: string;\n lastWritten: string;\n rewrite: (content: string) => Promise<void>;\n}): Promise<void> {\n let refIds = options.idsAtWrite;\n let written = options.lastWritten;\n for (let attempt = 0; attempt < 3; attempt += 1) {\n const fresh = options.cache.get(options.stateDir);\n if (fresh === refIds) return;\n refIds = fresh;\n const desired = canonicalizeEntityRefFrontmatter(options.rawContent, fresh);\n if (desired === written) return;\n written = desired;\n await options.rewrite(desired);\n }\n await withEntityCanonicalMutationLock(options.stateDir, async () => {\n const desired = canonicalizeEntityRefFrontmatter(options.rawContent, options.cache.get(options.stateDir));\n if (desired !== written) {\n written = desired;\n await options.rewrite(desired);\n }\n });\n await requestEntityCanonicalIdReconcile(options.stateDir);\n}\n\n/**\n * Sync variant (space promotion, curation, review actions). Sync callers\n * cannot take the async mutation lock, so exhaustion surfaces a retryable\n * error after requesting the marker — a silent return could leave the bytes\n * on a parked canonical claimant the reconcile pass cannot restore.\n */\nexport function repairContentAfterJournalMoveSync(options: {\n stateDir: string;\n cache: HistoricalEntityCanonicalIdCache;\n idsAtWrite: Readonly<Record<string, string>>;\n rawContent: string;\n lastWritten: string;\n rewrite: (content: string) => void;\n}): void {\n let refIds = options.idsAtWrite;\n let written = options.lastWritten;\n for (let attempt = 0; attempt < 3; attempt += 1) {\n const fresh = options.cache.get(options.stateDir);\n if (fresh === refIds) return;\n refIds = fresh;\n const desired = canonicalizeEntityRefFrontmatter(options.rawContent, fresh);\n if (desired === written) return;\n written = desired;\n options.rewrite(desired);\n }\n requestEntityCanonicalIdReconcileSync(options.stateDir);\n throw new Error(\n \"entity canonical-id journal kept changing during post-write repair; retry the write\",\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,gBAAgB,WAAW,oBAAoB;AACxD,OAAO,UAAU;AAIjB,IAAM,6CAA6C;AACnD,IAAM,gDAAgD;AAE/C,SAAS,iBAAiB,SAAiB,UAA2B;AAC3E,MAAI,KAAK,QAAQ,QAAQ,MAAM,MAAO,QAAO;AAC7C,QAAM,YAAY,KAAK,QAAQ,KAAK,QAAQ,QAAQ,CAAC;AACrD,QAAM,cAAc,KAAK,QAAQ,SAAS,UAAU;AACpD,MAAI,cAAc,YAAa,QAAO;AACtC,M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/B;AACA,QAAM,gCAAgC,QAAQ,UAAU,YAAY;AAClE,UAAM,UAAU,iCAAiC,QAAQ,YAAY,QAAQ,MAAM,IAAI,QAAQ,QAAQ,CAAC;AACxG,QAAI,YAAY,SAAS;AACvB,gBAAU;AACV,YAAM,QAAQ,QAAQ,OAAO;AAAA,IAC/B;AAAA,EACF,CAAC;AACD,QAAM,kCAAkC,QAAQ,QAAQ;AAC1D;AAQO,SAAS,kCAAkC,SAOzC;AACP,MAAI,SAAS,QAAQ;AACrB,MAAI,UAAU,QAAQ;AACtB,WAAS,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG;AAC/C,UAAM,QAAQ,QAAQ,MAAM,IAAI,QAAQ,QAAQ;AAChD,QAAI,UAAU,OAAQ;AACtB,aAAS;AACT,UAAM,UAAU,iCAAiC,QAAQ,YAAY,KAAK;AAC1E,QAAI,YAAY,QAAS;AACzB,cAAU;AACV,YAAQ,QAAQ,OAAO;AAAA,EACzB;AACA,wCAAsC,QAAQ,QAAQ;AACtD,QAAM,IAAI;AAAA,IACR;AAAA,EACF;AACF;","names":["path","realpathSync","path","path","realpathSync","path"]}
@@ -2,7 +2,7 @@ import {
2
2
  pathMayCarryEntityRefs,
3
3
  requestEntityCanonicalIdReconcile,
4
4
  withRawEntityPageMutation
5
- } from "./chunk-NZFFGO5O.js";
5
+ } from "./chunk-VXWOJPSY.js";
6
6
  import {
7
7
  TombstoneBlockedCaptureWriteLock,
8
8
  buildCapturePathLockIdentity,
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  CONTENT_HASH_INDEX_RETRY_MAX_DELAY_MS,
23
23
  ContentHashIndex
24
- } from "./chunk-DEY7B77Y.js";
24
+ } from "./chunk-AHCELJMH.js";
25
25
  import {
26
26
  withHeldFileLock
27
27
  } from "./chunk-5B5WYAHQ.js";
@@ -31,7 +31,7 @@ import {
31
31
  import {
32
32
  readMaybeEncryptedFileFromChunks,
33
33
  writeMaybeEncryptedFileFromChunks
34
- } from "./chunk-MAAL6OZV.js";
34
+ } from "./chunk-ZG3HZZ6K.js";
35
35
  import {
36
36
  RECALL_FALLBACK_DIRS
37
37
  } from "./chunk-VS2IYZRU.js";
@@ -2297,4 +2297,4 @@ export {
2297
2297
  parseTombstoneBlockedOfflineSyncMemory,
2298
2298
  TombstoneBlockedCaptureIndexHost
2299
2299
  };
2300
- //# sourceMappingURL=chunk-JNIVZNIB.js.map
2300
+ //# sourceMappingURL=chunk-WKVL2G7X.js.map
@@ -1,9 +1,9 @@
1
- import {
2
- assertPathInsideRoot
3
- } from "./chunk-C7HJ3NEI.js";
4
1
  import {
5
2
  isMacOsReplicationJunkBasename
6
3
  } from "./chunk-QUIRIG2P.js";
4
+ import {
5
+ assertPathInsideRoot
6
+ } from "./chunk-C7HJ3NEI.js";
7
7
  import {
8
8
  RECALL_FALLBACK_DIRS
9
9
  } from "./chunk-VS2IYZRU.js";
@@ -96,4 +96,4 @@ async function scanMemoryDir(memoryDir) {
96
96
  export {
97
97
  scanMemoryDir
98
98
  };
99
- //# sourceMappingURL=chunk-KJXP6RUG.js.map
99
+ //# sourceMappingURL=chunk-WNEVEMJ3.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runLocationSync
3
- } from "./chunk-WJAGO5LL.js";
3
+ } from "./chunk-VEB7NEON.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-HNEOLXRF.js.map
61
+ //# sourceMappingURL=chunk-WQIYGYY6.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  scanMemoryDir
3
- } from "./chunk-KJXP6RUG.js";
3
+ } from "./chunk-WNEVEMJ3.js";
4
4
  import {
5
5
  isSearchAborted,
6
6
  throwIfSearchAborted
@@ -253,4 +253,4 @@ function isMeilisearchIndexNotFoundError(err) {
253
253
  export {
254
254
  MeilisearchBackend
255
255
  };
256
- //# sourceMappingURL=chunk-GQJKVQJR.js.map
256
+ //# sourceMappingURL=chunk-WYLBEJQI.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  rebuildMemoryProjection
3
- } from "./chunk-JX32ROLZ.js";
3
+ } from "./chunk-YZTFQBYY.js";
4
4
 
5
5
  // src/convergence-refresh.ts
6
6
  async function refreshConvergedNamespaces(namespaces, namespaceSearchRouter, getStorage, searchEnabled) {
@@ -32,4 +32,4 @@ async function refreshConvergedNamespaces(namespaces, namespaceSearchRouter, get
32
32
  export {
33
33
  refreshConvergedNamespaces
34
34
  };
35
- //# sourceMappingURL=chunk-36DZ242S.js.map
35
+ //# sourceMappingURL=chunk-XNROYP5E.js.map
@@ -37,10 +37,10 @@ import {
37
37
  } from "./chunk-YCVB7X56.js";
38
38
  import {
39
39
  fillWearableConversationLocations
40
- } from "./chunk-K7BN34IA.js";
40
+ } from "./chunk-PL26BCRN.js";
41
41
  import {
42
42
  composeMemoryEnvelope
43
- } from "./chunk-5LRV557D.js";
43
+ } from "./chunk-2FIJQNL7.js";
44
44
  import {
45
45
  log
46
46
  } from "./chunk-3WCASNQZ.js";
@@ -1329,4 +1329,4 @@ export {
1329
1329
  syncWearableSource,
1330
1330
  defaultTimezone
1331
1331
  };
1332
- //# sourceMappingURL=chunk-XNAOCY67.js.map
1332
+ //# sourceMappingURL=chunk-XVZIBMSY.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readHarmonicSourceMemory,
3
3
  readUnresolvedHarmonicSources
4
- } from "./chunk-QPH52AZB.js";
4
+ } from "./chunk-QNDOTDJK.js";
5
5
  import {
6
6
  readProjectedMemoryStates
7
7
  } from "./chunk-AZEZSQ5R.js";
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-LXATZLSC.js";
12
12
  import {
13
13
  StorageManager
14
- } from "./chunk-IHS2UGYM.js";
14
+ } from "./chunk-TTIEXXL3.js";
15
15
  import {
16
16
  isValidityExpiredNow
17
17
  } from "./chunk-6CIAGZ6X.js";
@@ -50,7 +50,7 @@ import {
50
50
  } from "./chunk-2Z5DIDQD.js";
51
51
  import {
52
52
  SecureStoreLockedError
53
- } from "./chunk-MAAL6OZV.js";
53
+ } from "./chunk-ZG3HZZ6K.js";
54
54
  import {
55
55
  RECALL_FALLBACK_DIRS
56
56
  } from "./chunk-VS2IYZRU.js";
@@ -416,4 +416,4 @@ export {
416
416
  readProjectedHarmonicGraph,
417
417
  searchHarmonicRetrieval
418
418
  };
419
- //# sourceMappingURL=chunk-PXTLPC3P.js.map
419
+ //# sourceMappingURL=chunk-YGVZ4QOZ.js.map
@@ -7,10 +7,10 @@ import {
7
7
  import {
8
8
  listMemoryGovernanceRuns,
9
9
  readMemoryGovernanceRunArtifact
10
- } from "./chunk-33UAWCBN.js";
10
+ } from "./chunk-DDLRKPR2.js";
11
11
  import {
12
12
  StorageManager
13
- } from "./chunk-IHS2UGYM.js";
13
+ } from "./chunk-TTIEXXL3.js";
14
14
  import {
15
15
  normalizeProjectionPreview,
16
16
  normalizeProjectionTags
@@ -21,7 +21,7 @@ import {
21
21
  readProjectedGovernanceRows,
22
22
  readProjectedNativeKnowledgeRows,
23
23
  writeProjectionMetaHighWater
24
- } from "./chunk-P55FACBG.js";
24
+ } from "./chunk-3BOQPLCF.js";
25
25
  import {
26
26
  MEMORY_LIFECYCLE_EVENT_SORT_ORDER,
27
27
  buildLifecycleEventsForMemory,
@@ -1156,4 +1156,4 @@ export {
1156
1156
  verifyMemoryProjection,
1157
1157
  repairMemoryProjection
1158
1158
  };
1159
- //# sourceMappingURL=chunk-JX32ROLZ.js.map
1159
+ //# sourceMappingURL=chunk-YZTFQBYY.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  defineOperation
3
- } from "./chunk-L3IP56F4.js";
3
+ } from "./chunk-BIE3ZH3N.js";
4
4
  import {
5
5
  EngramAccessInputError
6
6
  } from "./chunk-3MUKQQ7A.js";
@@ -92,4 +92,4 @@ defineOperation({
92
92
  };
93
93
  }
94
94
  });
95
- //# sourceMappingURL=chunk-XSXM5LYZ.js.map
95
+ //# sourceMappingURL=chunk-ZCRDYQL6.js.map