@remnic/core 9.7.13 → 9.7.15

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 (358) hide show
  1. package/dist/access-admin-ops-surface.d.ts +6 -6
  2. package/dist/access-admin-ops-surface.js +22 -22
  3. package/dist/access-boundary.d.ts +6 -6
  4. package/dist/access-boundary.js +23 -23
  5. package/dist/access-cli.js +51 -51
  6. package/dist/access-http.d.ts +6 -6
  7. package/dist/access-http.js +28 -28
  8. package/dist/access-identity-continuity-surface.d.ts +5 -5
  9. package/dist/access-identity-continuity-surface.js +22 -22
  10. package/dist/access-lcm-surface.d.ts +6 -6
  11. package/dist/access-lcm-surface.js +22 -22
  12. package/dist/access-mcp.d.ts +6 -6
  13. package/dist/access-mcp.js +27 -27
  14. package/dist/access-observe-write-surface.d.ts +6 -6
  15. package/dist/access-observe-write-surface.js +22 -22
  16. package/dist/access-operations-batch.js +25 -25
  17. package/dist/access-operations.d.ts +6 -6
  18. package/dist/access-operations.js +26 -26
  19. package/dist/access-recall-surface.d.ts +6 -6
  20. package/dist/access-recall-surface.js +22 -22
  21. package/dist/{access-service-tHd3eQpd.d.ts → access-service-DpcYZ9Nl.d.ts} +4 -4
  22. package/dist/access-service.d.ts +6 -6
  23. package/dist/access-service.js +22 -22
  24. package/dist/access-surface-catalog.d.ts +6 -6
  25. package/dist/action-confidence.d.ts +1 -1
  26. package/dist/active-memory-bridge.d.ts +1 -1
  27. package/dist/active-recall.d.ts +1 -1
  28. package/dist/active-recall.js +1 -1
  29. package/dist/behavior-learner.d.ts +1 -1
  30. package/dist/behavior-signals.d.ts +1 -1
  31. package/dist/bootstrap.d.ts +5 -5
  32. package/dist/briefing.d.ts +2 -2
  33. package/dist/briefing.js +6 -6
  34. package/dist/buffer-surprise-report.d.ts +1 -1
  35. package/dist/buffer.d.ts +2 -2
  36. package/dist/bulk-import/index.d.ts +3 -3
  37. package/dist/calibration.d.ts +1 -1
  38. package/dist/capabilities.d.ts +1 -1
  39. package/dist/{capsule-merge-Z2HUO6IK.js → capsule-merge-5KKJQBWQ.js} +4 -4
  40. package/dist/{catalog-DEMiw6HZ.d.ts → catalog-C9444P10.d.ts} +1 -1
  41. package/dist/causal-behavior.d.ts +1 -1
  42. package/dist/causal-behavior.js +2 -2
  43. package/dist/causal-chain.js +2 -2
  44. package/dist/causal-consolidation.d.ts +1 -1
  45. package/dist/causal-consolidation.js +9 -9
  46. package/dist/causal-retrieval.js +2 -2
  47. package/dist/causal-trajectory-graph.d.ts +1 -1
  48. package/dist/causal-trajectory-graph.js +1 -1
  49. package/dist/causal-trajectory.js +1 -1
  50. package/dist/{chunk-2RSL6YRA.js → chunk-2AZXIZEN.js} +3 -3
  51. package/dist/{chunk-OBMR4VIX.js → chunk-2S6QHZGJ.js} +186 -15
  52. package/dist/chunk-2S6QHZGJ.js.map +1 -0
  53. package/dist/{chunk-5S7Z5SHA.js → chunk-34RC5RT7.js} +2 -2
  54. package/dist/{chunk-JKLJ6A7W.js → chunk-3D6AFGQR.js} +2 -2
  55. package/dist/{chunk-2AL7N3BH.js → chunk-3IY64MV6.js} +4 -2
  56. package/dist/chunk-3IY64MV6.js.map +1 -0
  57. package/dist/{chunk-VZ5OJE4X.js → chunk-5VQJBH2G.js} +2 -2
  58. package/dist/{chunk-N3JDIRBW.js → chunk-74F5STS4.js} +2 -2
  59. package/dist/{chunk-OC35KQIN.js → chunk-A5UXZRRM.js} +3 -3
  60. package/dist/{chunk-OKUEZOGW.js → chunk-AITCS2RC.js} +2 -2
  61. package/dist/{chunk-7XGSIUP5.js → chunk-AJLLIIML.js} +1 -1
  62. package/dist/{chunk-CE3GMHT4.js → chunk-BS4SGLWV.js} +2 -2
  63. package/dist/{chunk-2V5QI6NQ.js → chunk-DCFV7A7H.js} +6 -6
  64. package/dist/{chunk-I3GKTDM2.js → chunk-DMSDUGDM.js} +3 -3
  65. package/dist/{chunk-D4TLWDYR.js → chunk-DPAENM7O.js} +2 -2
  66. package/dist/{chunk-AHLPZ2SF.js → chunk-DYP3YYJJ.js} +7 -3
  67. package/dist/chunk-DYP3YYJJ.js.map +1 -0
  68. package/dist/{chunk-7MW3CVLD.js → chunk-DZKHSDOM.js} +2 -2
  69. package/dist/{chunk-HG32URJJ.js → chunk-E6CBU7XP.js} +2 -2
  70. package/dist/{chunk-675YU5IK.js → chunk-EHCONI6E.js} +2 -2
  71. package/dist/{chunk-NVXQTRBL.js → chunk-FDCTQWLW.js} +2 -2
  72. package/dist/{chunk-PA6DMYEK.js → chunk-FIJUY7GG.js} +9 -9
  73. package/dist/{chunk-UTRJFDP2.js → chunk-FNZQGN76.js} +2 -2
  74. package/dist/{chunk-V53GJUSL.js → chunk-G4CN3ZXL.js} +6 -6
  75. package/dist/{chunk-IQULRIZM.js → chunk-G6XXLKC5.js} +3 -3
  76. package/dist/{chunk-CLFY35ED.js → chunk-HDTQVNWD.js} +3 -3
  77. package/dist/{chunk-TMGK6YE7.js → chunk-HF77M34J.js} +2 -2
  78. package/dist/{chunk-6N7R7TR2.js → chunk-INELTPRG.js} +15 -1
  79. package/dist/chunk-INELTPRG.js.map +1 -0
  80. package/dist/{chunk-ZC3HG22I.js → chunk-JREB6UFH.js} +2 -2
  81. package/dist/{chunk-TRH533CA.js → chunk-K7LOWSLU.js} +38 -9
  82. package/dist/chunk-K7LOWSLU.js.map +1 -0
  83. package/dist/{chunk-TWGGNUWJ.js → chunk-KDXVOFYY.js} +2 -2
  84. package/dist/{chunk-RT7IP3D3.js → chunk-KSNVDPDF.js} +2 -2
  85. package/dist/{chunk-ZIDSD6VC.js → chunk-LRNMRXJO.js} +2 -2
  86. package/dist/{chunk-QPZCAVDC.js → chunk-LZOV7MX7.js} +12 -12
  87. package/dist/{chunk-VY6LKKVN.js → chunk-NWTGD4AN.js} +6 -1
  88. package/dist/chunk-NWTGD4AN.js.map +1 -0
  89. package/dist/{chunk-Z6WN2KSH.js → chunk-OAZVR2BV.js} +3 -3
  90. package/dist/{chunk-KQMKF4G2.js → chunk-OVJ2HIPE.js} +21 -21
  91. package/dist/{chunk-OCY3CRPG.js → chunk-PBNZVPFS.js} +3 -3
  92. package/dist/{chunk-G5PVJJRA.js → chunk-PBSAPHHA.js} +1 -1
  93. package/dist/chunk-PBSAPHHA.js.map +1 -0
  94. package/dist/{chunk-XVLEGMJI.js → chunk-PLQE6MJA.js} +2 -2
  95. package/dist/{chunk-NKCPUHCI.js → chunk-PQVK2S3J.js} +2 -2
  96. package/dist/{chunk-OIFZII6J.js → chunk-Q5WG43OP.js} +3 -3
  97. package/dist/{chunk-YI7XUXLX.js → chunk-QKQYXZVS.js} +28 -26
  98. package/dist/chunk-QKQYXZVS.js.map +1 -0
  99. package/dist/{chunk-XUQUBZ7O.js → chunk-QQGPUKMT.js} +2 -2
  100. package/dist/{chunk-XUQUBZ7O.js.map → chunk-QQGPUKMT.js.map} +1 -1
  101. package/dist/{chunk-WU46YPY6.js → chunk-RAR2BSEM.js} +1 -1
  102. package/dist/{chunk-WU46YPY6.js.map → chunk-RAR2BSEM.js.map} +1 -1
  103. package/dist/{chunk-3SIC3E65.js → chunk-RO4LQGT3.js} +2 -2
  104. package/dist/{chunk-BQTSGK5Y.js → chunk-RVZRYUQH.js} +2 -2
  105. package/dist/{chunk-T6U7HDIY.js → chunk-T7Y5KPLN.js} +2 -2
  106. package/dist/{chunk-HLTAPHZZ.js → chunk-UDQUSU27.js} +2 -2
  107. package/dist/{chunk-2ZPQUTMW.js → chunk-VDW4VU7B.js} +5 -5
  108. package/dist/{chunk-ZRXSHGXT.js → chunk-VJVNLNDQ.js} +3 -3
  109. package/dist/{chunk-UTZW3X2R.js → chunk-XDSXEKYK.js} +2 -2
  110. package/dist/{chunk-X47LWMKA.js → chunk-XMMESCPD.js} +26 -1
  111. package/dist/chunk-XMMESCPD.js.map +1 -0
  112. package/dist/{chunk-FUUF7FMX.js → chunk-ZHIVCODT.js} +2 -2
  113. package/dist/{cli-D8Tsa4Sh.d.ts → cli-Cd5fMmhq.d.ts} +5 -5
  114. package/dist/cli.d.ts +8 -8
  115. package/dist/cli.js +42 -42
  116. package/dist/compounding/engine.d.ts +2 -2
  117. package/dist/compounding/engine.js +6 -6
  118. package/dist/compounding/preference-consolidator.d.ts +1 -1
  119. package/dist/compression-optimizer.d.ts +1 -1
  120. package/dist/config.d.ts +1 -1
  121. package/dist/config.js +1 -1
  122. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  123. package/dist/connectors/codex-materialize-runner.js +6 -6
  124. package/dist/connectors/codex-materialize.d.ts +1 -1
  125. package/dist/connectors/index.d.ts +1 -1
  126. package/dist/connectors/index.js +6 -6
  127. package/dist/consolidation-provenance-check.d.ts +2 -2
  128. package/dist/consolidation-provenance-check.js +4 -4
  129. package/dist/consolidation-undo.d.ts +2 -2
  130. package/dist/consolidation-undo.js +3 -3
  131. package/dist/contradiction/index.d.ts +2 -2
  132. package/dist/conversation-index/backend.d.ts +1 -1
  133. package/dist/conversation-index/chunker.d.ts +1 -1
  134. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  135. package/dist/conversation-index/indexer.d.ts +1 -1
  136. package/dist/conversation-index/search.d.ts +1 -1
  137. package/dist/day-summary.d.ts +1 -1
  138. package/dist/delinearize.d.ts +1 -1
  139. package/dist/direct-answer-wiring.d.ts +1 -1
  140. package/dist/direct-answer.d.ts +1 -1
  141. package/dist/embedding-fallback.d.ts +1 -1
  142. package/dist/enrichment/index.d.ts +1 -1
  143. package/dist/entity-retrieval.d.ts +2 -2
  144. package/dist/entity-retrieval.js +6 -6
  145. package/dist/entity-schema.d.ts +1 -1
  146. package/dist/explicit-capture.d.ts +5 -5
  147. package/dist/extraction-faithfulness.d.ts +1 -1
  148. package/dist/extraction-judge-telemetry.d.ts +1 -1
  149. package/dist/extraction-judge-training.d.ts +1 -1
  150. package/dist/extraction-judge.d.ts +1 -1
  151. package/dist/extraction.d.ts +1 -1
  152. package/dist/extraction.js +2 -2
  153. package/dist/fallback-llm.d.ts +1 -1
  154. package/dist/graph-dashboard-diff.d.ts +1 -1
  155. package/dist/graph-dashboard-key.d.ts +1 -1
  156. package/dist/graph-dashboard-parser.d.ts +1 -1
  157. package/dist/{graph-edge-decay-FO7AM4UR.js → graph-edge-decay-IOGBBAGC.js} +3 -3
  158. package/dist/graph-edge-reinforcement.d.ts +1 -1
  159. package/dist/graph-snapshot.d.ts +1 -1
  160. package/dist/graph-snapshot.js +2 -2
  161. package/dist/graph.d.ts +55 -10
  162. package/dist/graph.js +1 -1
  163. package/dist/identity-continuity.d.ts +1 -1
  164. package/dist/importance.d.ts +1 -1
  165. package/dist/importers/index.d.ts +1 -1
  166. package/dist/in-flight-reads.d.ts +1 -1
  167. package/dist/index.d.ts +14 -14
  168. package/dist/index.js +51 -51
  169. package/dist/intent.d.ts +1 -1
  170. package/dist/lcm/engine.d.ts +1 -1
  171. package/dist/lcm/index.d.ts +1 -1
  172. package/dist/lcm/tools.d.ts +1 -1
  173. package/dist/lifecycle.d.ts +1 -1
  174. package/dist/live-connectors-runner.d.ts +1 -1
  175. package/dist/local-llm.d.ts +1 -1
  176. package/dist/local-llm.js +1 -1
  177. package/dist/local-model-endpoint.d.ts +1 -1
  178. package/dist/maintenance/memory-governance.d.ts +1 -1
  179. package/dist/maintenance/memory-governance.js +6 -6
  180. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +6 -6
  181. package/dist/maintenance/rebuild-memory-projection.js +7 -7
  182. package/dist/mcp-memory-inspector-app.d.ts +6 -6
  183. package/dist/memory-action-policy.d.ts +1 -1
  184. package/dist/memory-cache.d.ts +44 -2
  185. package/dist/memory-cache.js +7 -1
  186. package/dist/memory-corpus-version.js +2 -2
  187. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  188. package/dist/memory-projection-store.d.ts +1 -1
  189. package/dist/memory-provenance.d.ts +1 -1
  190. package/dist/memory-worth-outcomes.d.ts +2 -2
  191. package/dist/models-json.d.ts +1 -1
  192. package/dist/namespaces/migrate.d.ts +3 -3
  193. package/dist/namespaces/migrate.js +15 -15
  194. package/dist/namespaces/principal.d.ts +1 -1
  195. package/dist/namespaces/search.d.ts +1 -1
  196. package/dist/namespaces/search.js +9 -9
  197. package/dist/namespaces/storage.d.ts +3 -3
  198. package/dist/namespaces/storage.js +6 -6
  199. package/dist/native-knowledge.d.ts +1 -1
  200. package/dist/operator-toolkit.d.ts +2 -2
  201. package/dist/operator-toolkit.js +21 -21
  202. package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
  203. package/dist/orchestration/maintenance.d.ts +2 -2
  204. package/dist/orchestration/maintenance.js +8 -8
  205. package/dist/{orchestrator-B_WXBmuE.d.ts → orchestrator-Bp_jeBHK.d.ts} +4 -4
  206. package/dist/orchestrator.d.ts +5 -5
  207. package/dist/orchestrator.js +51 -51
  208. package/dist/page-versioning.js +3 -3
  209. package/dist/patterns-cli.d.ts +1 -1
  210. package/dist/{pipeline-Dvtvt141.d.ts → pipeline-BAj5bx7g.d.ts} +1 -1
  211. package/dist/policy-runtime.d.ts +1 -1
  212. package/dist/provenance.d.ts +1 -1
  213. package/dist/{qmd-DwBLh_hl.d.ts → qmd-_MDSlj1m.d.ts} +1 -1
  214. package/dist/qmd-preflight.d.ts +2 -2
  215. package/dist/qmd-recall-cache.d.ts +1 -1
  216. package/dist/qmd.d.ts +2 -2
  217. package/dist/qmd.js +3 -3
  218. package/dist/recall-disclosure-escalation.d.ts +1 -1
  219. package/dist/recall-explain-renderer.d.ts +1 -1
  220. package/dist/recall-explain-renderer.js +3 -3
  221. package/dist/recall-planner-llm.d.ts +1 -1
  222. package/dist/recall-state.d.ts +1 -1
  223. package/dist/recall-tag-filter.d.ts +1 -1
  224. package/dist/recall-timings.d.ts +1 -1
  225. package/dist/recall-xray-cli.d.ts +1 -1
  226. package/dist/recall-xray-cli.js +4 -4
  227. package/dist/recall-xray-renderer.d.ts +1 -1
  228. package/dist/recall-xray-renderer.js +3 -3
  229. package/dist/recall-xray.d.ts +1 -1
  230. package/dist/recall-xray.js +2 -2
  231. package/dist/replay/normalizers/chatgpt.d.ts +1 -1
  232. package/dist/replay/normalizers/claude.d.ts +1 -1
  233. package/dist/replay/normalizers/openclaw.d.ts +1 -1
  234. package/dist/replay/normalizers/shared.d.ts +1 -1
  235. package/dist/replay/runner.d.ts +1 -1
  236. package/dist/replay/types.d.ts +1 -1
  237. package/dist/resolve-auth-token.d.ts +1 -1
  238. package/dist/resume-bundles.js +2 -2
  239. package/dist/retrieval-agents.d.ts +2 -2
  240. package/dist/retrieval-tiers.d.ts +1 -1
  241. package/dist/routing/engine.d.ts +1 -1
  242. package/dist/routing/store.d.ts +1 -1
  243. package/dist/search/embed-helper.d.ts +1 -1
  244. package/dist/search/factory.d.ts +1 -1
  245. package/dist/search/factory.js +8 -8
  246. package/dist/search/index.d.ts +1 -1
  247. package/dist/search/index.js +8 -8
  248. package/dist/search/lancedb-backend.d.ts +1 -1
  249. package/dist/search/lancedb-backend.js +2 -2
  250. package/dist/search/meilisearch-backend.d.ts +1 -1
  251. package/dist/search/meilisearch-backend.js +2 -2
  252. package/dist/search/noop-backend.d.ts +1 -1
  253. package/dist/search/orama-backend.d.ts +1 -1
  254. package/dist/search/orama-backend.js +2 -2
  255. package/dist/search/port.d.ts +12 -1
  256. package/dist/search/port.js +1 -1
  257. package/dist/search/remote-backend.d.ts +1 -1
  258. package/dist/search/remote-backend.js +2 -2
  259. package/dist/{semantic-consolidation-Dia_6FOn.d.ts → semantic-consolidation-C2m5eHHE.d.ts} +1 -1
  260. package/dist/semantic-consolidation.d.ts +2 -2
  261. package/dist/semantic-consolidation.js +7 -7
  262. package/dist/semantic-rule-promotion.js +6 -6
  263. package/dist/semantic-rule-verifier.d.ts +1 -1
  264. package/dist/semantic-rule-verifier.js +6 -6
  265. package/dist/session-observer-bands.d.ts +1 -1
  266. package/dist/session-observer-state.d.ts +1 -1
  267. package/dist/shared-context/manager.d.ts +1 -1
  268. package/dist/signal.d.ts +1 -1
  269. package/dist/{storage-RshM7i8-.d.ts → storage-hr_Y2z5R.d.ts} +17 -1
  270. package/dist/storage.d.ts +2 -2
  271. package/dist/storage.js +5 -5
  272. package/dist/summarizer.d.ts +1 -1
  273. package/dist/summarizer.js +2 -2
  274. package/dist/summary-snapshot.d.ts +1 -1
  275. package/dist/temporal-supersession.d.ts +2 -2
  276. package/dist/temporal-timeline-recall.d.ts +1 -1
  277. package/dist/temporal-validity.d.ts +1 -1
  278. package/dist/threading.d.ts +1 -1
  279. package/dist/tier-migration.d.ts +2 -2
  280. package/dist/tier-routing.d.ts +1 -1
  281. package/dist/topics.d.ts +1 -1
  282. package/dist/transcript.d.ts +1 -1
  283. package/dist/transfer/capsule-import.js +4 -4
  284. package/dist/trust-score-stage.d.ts +1 -1
  285. package/dist/trust-score.d.ts +1 -1
  286. package/dist/{types-CHSXOq7s.d.ts → types-Cg8q7W7_.d.ts} +16 -0
  287. package/dist/types.d.ts +1 -1
  288. package/dist/types.js +1 -1
  289. package/dist/utility-runtime.d.ts +1 -1
  290. package/dist/verified-recall.js +6 -6
  291. package/package.json +2 -2
  292. package/src/config.ts +18 -0
  293. package/src/graph.test.ts +137 -1
  294. package/src/graph.ts +274 -17
  295. package/src/local-llm-thinking.test.ts +55 -1
  296. package/src/local-llm.ts +14 -0
  297. package/src/memory-cache.ts +70 -0
  298. package/src/namespaces/storage.ts +2 -0
  299. package/src/orchestration/maintenance.ts +7 -0
  300. package/src/orchestration/workspace-ops.ts +4 -0
  301. package/src/orchestrator.ts +6 -1
  302. package/src/qmd.test.ts +22 -0
  303. package/src/qmd.ts +13 -1
  304. package/src/search/port.ts +11 -0
  305. package/src/storage.ts +60 -13
  306. package/src/types.ts +21 -0
  307. package/dist/chunk-2AL7N3BH.js.map +0 -1
  308. package/dist/chunk-6N7R7TR2.js.map +0 -1
  309. package/dist/chunk-AHLPZ2SF.js.map +0 -1
  310. package/dist/chunk-G5PVJJRA.js.map +0 -1
  311. package/dist/chunk-OBMR4VIX.js.map +0 -1
  312. package/dist/chunk-TRH533CA.js.map +0 -1
  313. package/dist/chunk-VY6LKKVN.js.map +0 -1
  314. package/dist/chunk-X47LWMKA.js.map +0 -1
  315. package/dist/chunk-YI7XUXLX.js.map +0 -1
  316. /package/dist/{capsule-merge-Z2HUO6IK.js.map → capsule-merge-5KKJQBWQ.js.map} +0 -0
  317. /package/dist/{chunk-2RSL6YRA.js.map → chunk-2AZXIZEN.js.map} +0 -0
  318. /package/dist/{chunk-5S7Z5SHA.js.map → chunk-34RC5RT7.js.map} +0 -0
  319. /package/dist/{chunk-JKLJ6A7W.js.map → chunk-3D6AFGQR.js.map} +0 -0
  320. /package/dist/{chunk-VZ5OJE4X.js.map → chunk-5VQJBH2G.js.map} +0 -0
  321. /package/dist/{chunk-N3JDIRBW.js.map → chunk-74F5STS4.js.map} +0 -0
  322. /package/dist/{chunk-OC35KQIN.js.map → chunk-A5UXZRRM.js.map} +0 -0
  323. /package/dist/{chunk-OKUEZOGW.js.map → chunk-AITCS2RC.js.map} +0 -0
  324. /package/dist/{chunk-7XGSIUP5.js.map → chunk-AJLLIIML.js.map} +0 -0
  325. /package/dist/{chunk-CE3GMHT4.js.map → chunk-BS4SGLWV.js.map} +0 -0
  326. /package/dist/{chunk-2V5QI6NQ.js.map → chunk-DCFV7A7H.js.map} +0 -0
  327. /package/dist/{chunk-I3GKTDM2.js.map → chunk-DMSDUGDM.js.map} +0 -0
  328. /package/dist/{chunk-D4TLWDYR.js.map → chunk-DPAENM7O.js.map} +0 -0
  329. /package/dist/{chunk-7MW3CVLD.js.map → chunk-DZKHSDOM.js.map} +0 -0
  330. /package/dist/{chunk-HG32URJJ.js.map → chunk-E6CBU7XP.js.map} +0 -0
  331. /package/dist/{chunk-675YU5IK.js.map → chunk-EHCONI6E.js.map} +0 -0
  332. /package/dist/{chunk-NVXQTRBL.js.map → chunk-FDCTQWLW.js.map} +0 -0
  333. /package/dist/{chunk-PA6DMYEK.js.map → chunk-FIJUY7GG.js.map} +0 -0
  334. /package/dist/{chunk-UTRJFDP2.js.map → chunk-FNZQGN76.js.map} +0 -0
  335. /package/dist/{chunk-V53GJUSL.js.map → chunk-G4CN3ZXL.js.map} +0 -0
  336. /package/dist/{chunk-IQULRIZM.js.map → chunk-G6XXLKC5.js.map} +0 -0
  337. /package/dist/{chunk-CLFY35ED.js.map → chunk-HDTQVNWD.js.map} +0 -0
  338. /package/dist/{chunk-TMGK6YE7.js.map → chunk-HF77M34J.js.map} +0 -0
  339. /package/dist/{chunk-ZC3HG22I.js.map → chunk-JREB6UFH.js.map} +0 -0
  340. /package/dist/{chunk-TWGGNUWJ.js.map → chunk-KDXVOFYY.js.map} +0 -0
  341. /package/dist/{chunk-RT7IP3D3.js.map → chunk-KSNVDPDF.js.map} +0 -0
  342. /package/dist/{chunk-ZIDSD6VC.js.map → chunk-LRNMRXJO.js.map} +0 -0
  343. /package/dist/{chunk-QPZCAVDC.js.map → chunk-LZOV7MX7.js.map} +0 -0
  344. /package/dist/{chunk-Z6WN2KSH.js.map → chunk-OAZVR2BV.js.map} +0 -0
  345. /package/dist/{chunk-KQMKF4G2.js.map → chunk-OVJ2HIPE.js.map} +0 -0
  346. /package/dist/{chunk-OCY3CRPG.js.map → chunk-PBNZVPFS.js.map} +0 -0
  347. /package/dist/{chunk-XVLEGMJI.js.map → chunk-PLQE6MJA.js.map} +0 -0
  348. /package/dist/{chunk-NKCPUHCI.js.map → chunk-PQVK2S3J.js.map} +0 -0
  349. /package/dist/{chunk-OIFZII6J.js.map → chunk-Q5WG43OP.js.map} +0 -0
  350. /package/dist/{chunk-3SIC3E65.js.map → chunk-RO4LQGT3.js.map} +0 -0
  351. /package/dist/{chunk-BQTSGK5Y.js.map → chunk-RVZRYUQH.js.map} +0 -0
  352. /package/dist/{chunk-T6U7HDIY.js.map → chunk-T7Y5KPLN.js.map} +0 -0
  353. /package/dist/{chunk-HLTAPHZZ.js.map → chunk-UDQUSU27.js.map} +0 -0
  354. /package/dist/{chunk-2ZPQUTMW.js.map → chunk-VDW4VU7B.js.map} +0 -0
  355. /package/dist/{chunk-ZRXSHGXT.js.map → chunk-VJVNLNDQ.js.map} +0 -0
  356. /package/dist/{chunk-UTZW3X2R.js.map → chunk-XDSXEKYK.js.map} +0 -0
  357. /package/dist/{chunk-FUUF7FMX.js.map → chunk-ZHIVCODT.js.map} +0 -0
  358. /package/dist/{graph-edge-decay-FO7AM4UR.js.map → graph-edge-decay-IOGBBAGC.js.map} +0 -0
@@ -1,12 +1,12 @@
1
1
  import { OperationName } from './access-boundary.js';
2
2
  import 'zod';
3
- import './access-service-tHd3eQpd.js';
4
- import './catalog-DEMiw6HZ.js';
5
- import './types-CHSXOq7s.js';
3
+ import './access-service-DpcYZ9Nl.js';
4
+ import './catalog-C9444P10.js';
5
+ import './types-Cg8q7W7_.js';
6
6
  import './message-parts/index.js';
7
- import './orchestrator-B_WXBmuE.js';
7
+ import './orchestrator-Bp_jeBHK.js';
8
8
  import './briefing.js';
9
- import './storage-RshM7i8-.js';
9
+ import './storage-hr_Y2z5R.js';
10
10
  import './page-versioning.js';
11
11
  import './consolidation-operator.js';
12
12
  import './memory-projection-store.js';
@@ -34,7 +34,7 @@ import './utility-runtime.js';
34
34
  import './tier-routing.js';
35
35
  import './lifecycle.js';
36
36
  import './orchestration/compression-guideline-coordinator.js';
37
- import './semantic-consolidation-Dia_6FOn.js';
37
+ import './semantic-consolidation-C2m5eHHE.js';
38
38
  import './connectors/codex-materialize.js';
39
39
  import './logger.js';
40
40
  import './embedding-fallback.js';
@@ -1,5 +1,5 @@
1
1
  import { RetrievedMemoryCorrectionState, RetrievedMemorySafety } from './memory-provenance.js';
2
- import './types-CHSXOq7s.js';
2
+ import './types-Cg8q7W7_.js';
3
3
  import './message-parts/index.js';
4
4
  import './user-model.js';
5
5
 
@@ -1,4 +1,4 @@
1
- import { P as PluginConfig, M as MemoryFile } from './types-CHSXOq7s.js';
1
+ import { P as PluginConfig, M as MemoryFile } from './types-Cg8q7W7_.js';
2
2
  import './message-parts/index.js';
3
3
 
4
4
  interface ActiveMemoryMetadata {
@@ -1,4 +1,4 @@
1
- import { A as ActiveRecallChatType, c as ActiveRecallQueryMode, d as ActiveRecallPromptStyle, e as ActiveRecallThinking, f as ActiveRecallModelFallbackPolicy } from './types-CHSXOq7s.js';
1
+ import { A as ActiveRecallChatType, c as ActiveRecallQueryMode, d as ActiveRecallPromptStyle, e as ActiveRecallThinking, f as ActiveRecallModelFallbackPolicy } from './types-Cg8q7W7_.js';
2
2
  import './message-parts/index.js';
3
3
 
4
4
  interface ActiveRecallTurn {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_REASONING_MODEL
3
- } from "./chunk-6N7R7TR2.js";
3
+ } from "./chunk-INELTPRG.js";
4
4
  import "./chunk-NDAH7BJ5.js";
5
5
  import "./chunk-Z5LAYHGJ.js";
6
6
  import "./chunk-G6NKALRN.js";
@@ -1,4 +1,4 @@
1
- import { B as BehaviorSignalEvent, P as PluginConfig, g as BehaviorLoopPolicyState } from './types-CHSXOq7s.js';
1
+ import { B as BehaviorSignalEvent, P as PluginConfig, g as BehaviorLoopPolicyState } from './types-Cg8q7W7_.js';
2
2
  import './message-parts/index.js';
3
3
 
4
4
  declare const TUNABLE_BEHAVIOR_PARAMETERS: readonly ["recencyWeight", "lifecyclePromoteHeatThreshold", "lifecycleStaleDecayThreshold", "cronRecallInstructionHeavyTokenCap"];
@@ -1,4 +1,4 @@
1
- import { u as MemoryCategory, B as BehaviorSignalEvent } from './types-CHSXOq7s.js';
1
+ import { u as MemoryCategory, B as BehaviorSignalEvent } from './types-Cg8q7W7_.js';
2
2
  import './message-parts/index.js';
3
3
 
4
4
  declare function buildBehaviorSignalHash(category: MemoryCategory, content: string): string;
@@ -1,8 +1,8 @@
1
- import { P as PluginConfig } from './types-CHSXOq7s.js';
2
- import { O as Orchestrator } from './orchestrator-B_WXBmuE.js';
1
+ import { P as PluginConfig } from './types-Cg8q7W7_.js';
2
+ import { O as Orchestrator } from './orchestrator-Bp_jeBHK.js';
3
3
  import './message-parts/index.js';
4
4
  import './briefing.js';
5
- import './storage-RshM7i8-.js';
5
+ import './storage-hr_Y2z5R.js';
6
6
  import './page-versioning.js';
7
7
  import './consolidation-operator.js';
8
8
  import './memory-projection-store.js';
@@ -22,7 +22,7 @@ import './session-integrity.js';
22
22
  import './summarizer.js';
23
23
  import './orchestration/maintenance.js';
24
24
  import './namespaces/search.js';
25
- import './catalog-DEMiw6HZ.js';
25
+ import './catalog-C9444P10.js';
26
26
  import './recall-state.js';
27
27
  import './compounding/engine.js';
28
28
  import './shared-context/manager.js';
@@ -32,7 +32,7 @@ import './utility-runtime.js';
32
32
  import './tier-routing.js';
33
33
  import './lifecycle.js';
34
34
  import './orchestration/compression-guideline-coordinator.js';
35
- import './semantic-consolidation-Dia_6FOn.js';
35
+ import './semantic-consolidation-C2m5eHHE.js';
36
36
  import './connectors/codex-materialize.js';
37
37
  import './logger.js';
38
38
  import './embedding-fallback.js';
@@ -1,5 +1,5 @@
1
- import { S as StorageManager } from './storage-RshM7i8-.js';
2
- import { h as BriefingSections, i as BriefingFollowup, j as BriefingFocus, C as CalendarSource, k as CalendarEvent, M as MemoryFile, l as BriefingActiveThread, m as BriefingResult, E as EntityFile, n as BriefingRecentEntity } from './types-CHSXOq7s.js';
1
+ import { S as StorageManager } from './storage-hr_Y2z5R.js';
2
+ import { h as BriefingSections, i as BriefingFollowup, j as BriefingFocus, C as CalendarSource, k as CalendarEvent, M as MemoryFile, l as BriefingActiveThread, m as BriefingResult, E as EntityFile, n as BriefingRecentEntity } from './types-Cg8q7W7_.js';
3
3
  import './page-versioning.js';
4
4
  import './consolidation-operator.js';
5
5
  import './memory-projection-store.js';
package/dist/briefing.js CHANGED
@@ -17,8 +17,8 @@ import {
17
17
  renderBriefingMarkdown,
18
18
  resolveBriefingSaveDir,
19
19
  validateBriefingFormat
20
- } from "./chunk-TWGGNUWJ.js";
21
- import "./chunk-TRH533CA.js";
20
+ } from "./chunk-KDXVOFYY.js";
21
+ import "./chunk-K7LOWSLU.js";
22
22
  import "./chunk-L2B3EE7B.js";
23
23
  import "./chunk-B3ABVQ36.js";
24
24
  import "./chunk-5UZXUTVO.js";
@@ -29,7 +29,7 @@ import "./chunk-6CIAGZ6X.js";
29
29
  import "./chunk-J6A3CX5N.js";
30
30
  import "./chunk-4KJLYTLS.js";
31
31
  import "./chunk-SVOZFLIQ.js";
32
- import "./chunk-G5PVJJRA.js";
32
+ import "./chunk-PBSAPHHA.js";
33
33
  import "./chunk-RULE4VG5.js";
34
34
  import "./chunk-SCU65EZI.js";
35
35
  import "./chunk-RHOZ5LLO.js";
@@ -39,9 +39,9 @@ import "./chunk-LDXUBPMO.js";
39
39
  import "./chunk-VA4WSW54.js";
40
40
  import "./chunk-AAD2ZS6P.js";
41
41
  import "./chunk-G7D6GZ5J.js";
42
- import "./chunk-VZ5OJE4X.js";
43
- import "./chunk-OKUEZOGW.js";
44
- import "./chunk-X47LWMKA.js";
42
+ import "./chunk-5VQJBH2G.js";
43
+ import "./chunk-AITCS2RC.js";
44
+ import "./chunk-XMMESCPD.js";
45
45
  import "./chunk-42JKGUFJ.js";
46
46
  import "./chunk-PDJTHRAW.js";
47
47
  import "./chunk-W5H6ZRPT.js";
@@ -1,4 +1,4 @@
1
- import { Z as BufferSurpriseEvent } from './types-CHSXOq7s.js';
1
+ import { Z as BufferSurpriseEvent } from './types-Cg8q7W7_.js';
2
2
  import './message-parts/index.js';
3
3
 
4
4
  /**
package/dist/buffer.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as StorageManager } from './storage-RshM7i8-.js';
2
- import { P as PluginConfig, o as BufferTurn } from './types-CHSXOq7s.js';
1
+ import { S as StorageManager } from './storage-hr_Y2z5R.js';
2
+ import { P as PluginConfig, o as BufferTurn } from './types-Cg8q7W7_.js';
3
3
  import './page-versioning.js';
4
4
  import './consolidation-operator.js';
5
5
  import './memory-projection-store.js';
@@ -1,6 +1,6 @@
1
- import { b6 as BulkImportSourceAdapter } from '../types-CHSXOq7s.js';
2
- export { b5 as BulkImportError, $ as BulkImportOptions, a1 as BulkImportResult, a0 as BulkImportSource, ba as ImportSourceRole, _ as ImportTurn, bb as ImportTurnValidationIssue, bl as isImportRole, bn as parseIsoTimestamp, bo as validateImportTurn } from '../types-CHSXOq7s.js';
3
- export { a as ProcessBatchContext, P as ProcessBatchFn, b as ProcessBatchResult, f as formatBatchTranscript, r as resolveBulkImportContext, c as runBulkImportPipeline, v as validateBatchSize } from '../pipeline-Dvtvt141.js';
1
+ import { b6 as BulkImportSourceAdapter } from '../types-Cg8q7W7_.js';
2
+ export { b5 as BulkImportError, $ as BulkImportOptions, a1 as BulkImportResult, a0 as BulkImportSource, ba as ImportSourceRole, _ as ImportTurn, bb as ImportTurnValidationIssue, bl as isImportRole, bn as parseIsoTimestamp, bo as validateImportTurn } from '../types-Cg8q7W7_.js';
3
+ export { a as ProcessBatchContext, P as ProcessBatchFn, b as ProcessBatchResult, f as formatBatchTranscript, r as resolveBulkImportContext, c as runBulkImportPipeline, v as validateBatchSize } from '../pipeline-BAj5bx7g.js';
4
4
  import '../message-parts/index.js';
5
5
 
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import { FallbackLlmClient } from './fallback-llm.js';
2
- import { G as GatewayConfig, r as AgentPersonaModelConfig } from './types-CHSXOq7s.js';
2
+ import { G as GatewayConfig, r as AgentPersonaModelConfig } from './types-Cg8q7W7_.js';
3
3
  import './resolve-provider-secret.js';
4
4
  import './message-parts/index.js';
5
5
 
@@ -1,4 +1,4 @@
1
- import { P as PluginConfig } from './types-CHSXOq7s.js';
1
+ import { P as PluginConfig } from './types-Cg8q7W7_.js';
2
2
  import './message-parts/index.js';
3
3
 
4
4
  /**
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createVersion
3
- } from "./chunk-VZ5OJE4X.js";
3
+ } from "./chunk-5VQJBH2G.js";
4
4
  import {
5
5
  bumpMemoryCorpusVersionForDir
6
- } from "./chunk-OKUEZOGW.js";
7
- import "./chunk-X47LWMKA.js";
6
+ } from "./chunk-AITCS2RC.js";
7
+ import "./chunk-XMMESCPD.js";
8
8
  import "./chunk-42JKGUFJ.js";
9
9
  import "./chunk-PDJTHRAW.js";
10
10
  import {
@@ -195,4 +195,4 @@ async function readLocalFile(absPath) {
195
195
  export {
196
196
  mergeCapsule
197
197
  };
198
- //# sourceMappingURL=capsule-merge-Z2HUO6IK.js.map
198
+ //# sourceMappingURL=capsule-merge-5KKJQBWQ.js.map
@@ -1,4 +1,4 @@
1
- import { P as PluginConfig } from './types-CHSXOq7s.js';
1
+ import { P as PluginConfig } from './types-Cg8q7W7_.js';
2
2
 
3
3
  /**
4
4
  * Rebuildable namespace catalog (issue #1499).
@@ -2,7 +2,7 @@ import { CausalChainIndex } from './causal-chain.js';
2
2
  import { ConsolidatedPreference } from './compounding/preference-consolidator.js';
3
3
  import './causal-trajectory.js';
4
4
  import './objective-state.js';
5
- import './types-CHSXOq7s.js';
5
+ import './types-Cg8q7W7_.js';
6
6
  import './message-parts/index.js';
7
7
  import './lcm/engine.js';
8
8
  import './lcm/archive.js';
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  readChainIndex,
3
3
  resolveChainsDir
4
- } from "./chunk-NKCPUHCI.js";
4
+ } from "./chunk-PQVK2S3J.js";
5
5
  import "./chunk-2A3OXAP2.js";
6
6
  import {
7
7
  resolveCausalTrajectoryStoreDir
8
- } from "./chunk-7XGSIUP5.js";
8
+ } from "./chunk-AJLLIIML.js";
9
9
  import {
10
10
  normalizeRecallTokens
11
11
  } from "./chunk-ZBJMUXZH.js";
@@ -6,9 +6,9 @@ import {
6
6
  stitchCausalChain,
7
7
  validateCausalEdge,
8
8
  writeChainIndex
9
- } from "./chunk-NKCPUHCI.js";
9
+ } from "./chunk-PQVK2S3J.js";
10
10
  import "./chunk-2A3OXAP2.js";
11
- import "./chunk-7XGSIUP5.js";
11
+ import "./chunk-AJLLIIML.js";
12
12
  import "./chunk-ZBJMUXZH.js";
13
13
  import "./chunk-37CTGERM.js";
14
14
  import "./chunk-A2IYSXDQ.js";
@@ -1,4 +1,4 @@
1
- import { G as GatewayConfig, r as AgentPersonaModelConfig, P as PluginConfig, M as MemoryFile } from './types-CHSXOq7s.js';
1
+ import { G as GatewayConfig, r as AgentPersonaModelConfig, P as PluginConfig, M as MemoryFile } from './types-Cg8q7W7_.js';
2
2
  import { RolloutSummaryInput, MaterializeResult } from './connectors/codex-materialize.js';
3
3
  import './message-parts/index.js';
4
4
 
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  readChainIndex,
3
3
  resolveChainsDir
4
- } from "./chunk-NKCPUHCI.js";
4
+ } from "./chunk-PQVK2S3J.js";
5
5
  import {
6
6
  buildExtensionsBlockForConsolidation
7
- } from "./chunk-FUUF7FMX.js";
7
+ } from "./chunk-ZHIVCODT.js";
8
8
  import {
9
9
  runPostConsolidationMaterialize
10
- } from "./chunk-3SIC3E65.js";
10
+ } from "./chunk-RO4LQGT3.js";
11
11
  import "./chunk-QLULYKWZ.js";
12
12
  import "./chunk-JLNBQWZ2.js";
13
13
  import "./chunk-3UXOZBHV.js";
14
14
  import "./chunk-2A3OXAP2.js";
15
15
  import {
16
16
  resolveCausalTrajectoryStoreDir
17
- } from "./chunk-7XGSIUP5.js";
17
+ } from "./chunk-AJLLIIML.js";
18
18
  import "./chunk-ZBJMUXZH.js";
19
- import "./chunk-TRH533CA.js";
19
+ import "./chunk-K7LOWSLU.js";
20
20
  import "./chunk-L2B3EE7B.js";
21
21
  import "./chunk-B3ABVQ36.js";
22
22
  import "./chunk-5UZXUTVO.js";
@@ -27,7 +27,7 @@ import "./chunk-6CIAGZ6X.js";
27
27
  import "./chunk-J6A3CX5N.js";
28
28
  import "./chunk-4KJLYTLS.js";
29
29
  import "./chunk-SVOZFLIQ.js";
30
- import "./chunk-G5PVJJRA.js";
30
+ import "./chunk-PBSAPHHA.js";
31
31
  import "./chunk-RULE4VG5.js";
32
32
  import "./chunk-SCU65EZI.js";
33
33
  import "./chunk-RHOZ5LLO.js";
@@ -37,9 +37,9 @@ import "./chunk-LDXUBPMO.js";
37
37
  import "./chunk-VA4WSW54.js";
38
38
  import "./chunk-AAD2ZS6P.js";
39
39
  import "./chunk-G7D6GZ5J.js";
40
- import "./chunk-VZ5OJE4X.js";
41
- import "./chunk-OKUEZOGW.js";
42
- import "./chunk-X47LWMKA.js";
40
+ import "./chunk-5VQJBH2G.js";
41
+ import "./chunk-AITCS2RC.js";
42
+ import "./chunk-XMMESCPD.js";
43
43
  import "./chunk-42JKGUFJ.js";
44
44
  import "./chunk-PDJTHRAW.js";
45
45
  import "./chunk-W5H6ZRPT.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  readChainIndex,
3
3
  resolveChainsDir
4
- } from "./chunk-NKCPUHCI.js";
4
+ } from "./chunk-PQVK2S3J.js";
5
5
  import "./chunk-2A3OXAP2.js";
6
6
  import {
7
7
  readCausalTrajectoryRecords,
8
8
  searchCausalTrajectories
9
- } from "./chunk-7XGSIUP5.js";
9
+ } from "./chunk-AJLLIIML.js";
10
10
  import "./chunk-ZBJMUXZH.js";
11
11
  import {
12
12
  log
@@ -1,7 +1,7 @@
1
1
  import { GraphEdge } from './graph.js';
2
2
  import { CausalTrajectoryRecord } from './causal-trajectory.js';
3
3
  import './capabilities.js';
4
- import './types-CHSXOq7s.js';
4
+ import './types-Cg8q7W7_.js';
5
5
  import './message-parts/index.js';
6
6
  import './objective-state.js';
7
7
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  appendEdge
3
- } from "./chunk-OBMR4VIX.js";
3
+ } from "./chunk-2S6QHZGJ.js";
4
4
  import "./chunk-2LSZVONP.js";
5
5
  import "./chunk-DEUNUKTD.js";
6
6
  import "./chunk-PZ5AY32C.js";
@@ -6,7 +6,7 @@ import {
6
6
  resolveCausalTrajectoryStoreDir,
7
7
  searchCausalTrajectories,
8
8
  validateCausalTrajectoryRecord
9
- } from "./chunk-7XGSIUP5.js";
9
+ } from "./chunk-AJLLIIML.js";
10
10
  import "./chunk-ZBJMUXZH.js";
11
11
  import "./chunk-A2IYSXDQ.js";
12
12
  import "./chunk-LPSF4OQH.js";
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-TBBDFYXW.js";
4
4
  import {
5
5
  StorageManager
6
- } from "./chunk-TRH533CA.js";
6
+ } from "./chunk-K7LOWSLU.js";
7
7
  import {
8
8
  assertPathInsideRoot
9
9
  } from "./chunk-VSMRDBFT.js";
10
10
  import {
11
11
  bumpMemoryCorpusVersionForDir
12
- } from "./chunk-OKUEZOGW.js";
12
+ } from "./chunk-AITCS2RC.js";
13
13
  import {
14
14
  RECALL_FALLBACK_DIRS
15
15
  } from "./chunk-VS2IYZRU.js";
@@ -755,4 +755,4 @@ export {
755
755
  listMemoryGovernanceRuns,
756
756
  readMemoryGovernanceRunArtifact
757
757
  };
758
- //# sourceMappingURL=chunk-2RSL6YRA.js.map
758
+ //# sourceMappingURL=chunk-2AZXIZEN.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-DEUNUKTD.js";
7
7
 
8
8
  // src/graph.ts
9
- import { appendFile, mkdir, readFile } from "fs/promises";
9
+ import { appendFile, mkdir, readFile, stat } from "fs/promises";
10
10
  import * as path from "path";
11
11
  var DEFAULT_GRAPH_TRAVERSAL_CONFIDENCE_FLOOR = 0.2;
12
12
  var DEFAULT_GRAPH_TRAVERSAL_PAGERANK_ITERATIONS = 8;
@@ -217,14 +217,96 @@ var GraphIndex = class _GraphIndex {
217
217
  if (this.edgeCache && Date.now() - this.edgeCache.loadedAt < _GraphIndex.EDGE_CACHE_TTL_MS) {
218
218
  return this.edgeCache.allEdges;
219
219
  }
220
- const allEdges = await readAllEdges(this.memoryDir, {
221
- entityGraph: this.cfg.entityGraphEnabled,
222
- timeGraph: this.cfg.timeGraphEnabled,
223
- causalGraph: this.cfg.causalGraphEnabled
224
- });
225
- this.edgeCache = { allEdges, loadedAt: Date.now() };
220
+ let allEdges = [];
221
+ let meta = await this.readEnabledGraphFileMeta();
222
+ let stable = false;
223
+ for (let attempt = 0; attempt < 3; attempt++) {
224
+ const before = meta;
225
+ allEdges = await readAllEdges(this.memoryDir, {
226
+ entityGraph: this.cfg.entityGraphEnabled,
227
+ timeGraph: this.cfg.timeGraphEnabled,
228
+ causalGraph: this.cfg.causalGraphEnabled
229
+ });
230
+ meta = await this.readEnabledGraphFileMeta();
231
+ if (this.graphFileMetaEqual(before, meta)) {
232
+ stable = true;
233
+ break;
234
+ }
235
+ }
236
+ if (stable) {
237
+ this.edgeCache = { allEdges, loadedAt: Date.now(), meta };
238
+ } else {
239
+ this.edgeCache = null;
240
+ }
226
241
  return allEdges;
227
242
  }
243
+ /**
244
+ * Identity ({ size, mtimeMs, ino }) of each ENABLED graph file (issue #1904).
245
+ * Missing files (ENOENT) and any stat error map to the all-zero sentinel so
246
+ * the baseline is fail-open: a later revalidation sees a mismatch (or a peer
247
+ * creation flipping ino from 0 to non-zero) and forces a full reload rather
248
+ * than trusting a stale incremental push.
249
+ */
250
+ async readEnabledGraphFileMeta() {
251
+ const enabled = [];
252
+ if (this.cfg.entityGraphEnabled) enabled.push("entity");
253
+ if (this.cfg.timeGraphEnabled) enabled.push("time");
254
+ if (this.cfg.causalGraphEnabled) enabled.push("causal");
255
+ const meta = {};
256
+ for (const type of enabled) {
257
+ try {
258
+ const st = await stat(graphFilePath(this.memoryDir, type));
259
+ meta[type] = { size: st.size, mtimeMs: st.mtimeMs, ino: Number(st.ino) };
260
+ } catch {
261
+ meta[type] = { size: 0, mtimeMs: 0, ino: 0 };
262
+ }
263
+ }
264
+ return meta;
265
+ }
266
+ /** True iff both metadata maps carry identical identity for every key. */
267
+ graphFileMetaEqual(a, b) {
268
+ const types = ["entity", "time", "causal"];
269
+ for (const type of types) {
270
+ const x = a[type];
271
+ const y = b[type];
272
+ if (!x && !y) continue;
273
+ if (!x || !y) return false;
274
+ if (x.size !== y.size || x.mtimeMs !== y.mtimeMs || x.ino !== y.ino) return false;
275
+ }
276
+ return true;
277
+ }
278
+ /**
279
+ * Re-stat every graph file whose identity the cache just committed and return
280
+ * false if any has moved since (issue #1904, Codex). Closes the validation→
281
+ * in-place-push TOCTOU window: a peer process (concurrent CLI / daemon /
282
+ * decay job) can append between edgeFilesUnchangedExceptOurAppends()'s final
283
+ * stat and the allEdges.push(...). Without this re-check the cache would be
284
+ * accepted with identity predating the peer write and miss the peer edge for
285
+ * the TTL. A residual infinitesimal window (peer writes during this re-stat)
286
+ * remains and is TTL-bounded.
287
+ */
288
+ async edgeCacheIdentityUnchangedSinceCommit() {
289
+ if (!this.edgeCache) return false;
290
+ for (const type of Object.keys(this.edgeCache.meta)) {
291
+ const committed = this.edgeCache.meta[type];
292
+ if (!committed) continue;
293
+ let cur;
294
+ try {
295
+ const st = await stat(graphFilePath(this.memoryDir, type));
296
+ cur = { size: st.size, mtimeMs: st.mtimeMs, ino: Number(st.ino) };
297
+ } catch (err) {
298
+ if (err?.code === "ENOENT") {
299
+ cur = { size: 0, mtimeMs: 0, ino: 0 };
300
+ } else {
301
+ return false;
302
+ }
303
+ }
304
+ if (cur.size !== committed.size || cur.mtimeMs !== committed.mtimeMs || cur.ino !== committed.ino) {
305
+ return false;
306
+ }
307
+ }
308
+ return true;
309
+ }
228
310
  /**
229
311
  * Called after a memory is written to disk.
230
312
  *
@@ -244,52 +326,141 @@ var GraphIndex = class _GraphIndex {
244
326
  const timeOn = g ? g.timeGraph : this.cfg.timeGraphEnabled;
245
327
  const causalOn = g ? g.causalGraph : this.cfg.causalGraphEnabled;
246
328
  const ts = (/* @__PURE__ */ new Date()).toISOString();
329
+ const appended = [];
247
330
  try {
248
331
  if (entityOn && opts.entityRef && opts.entitySiblings?.length) {
249
332
  const siblings = opts.entitySiblings.slice(0, this.cfg.maxEntityGraphEdgesPerMemory);
250
333
  for (const sibling of siblings) {
251
- await appendEdge(this.memoryDir, {
334
+ const edge = {
252
335
  from: opts.memoryPath,
253
336
  to: sibling,
254
337
  type: "entity",
255
338
  weight: 1,
256
339
  label: opts.entityRef,
257
340
  ts
258
- });
341
+ };
342
+ appended.push(edge);
343
+ await appendEdge(this.memoryDir, edge);
259
344
  }
260
345
  }
261
346
  if (timeOn && opts.threadId && opts.recentInThread?.length) {
262
347
  const predecessor = opts.recentInThread[opts.recentInThread.length - 1];
263
348
  if (predecessor && predecessor !== opts.memoryPath) {
264
- await appendEdge(this.memoryDir, {
349
+ const edge = {
265
350
  from: predecessor,
266
351
  to: opts.memoryPath,
267
352
  type: "time",
268
353
  weight: 1,
269
354
  label: opts.threadId,
270
355
  ts
271
- });
356
+ };
357
+ appended.push(edge);
358
+ await appendEdge(this.memoryDir, edge);
272
359
  }
273
360
  }
274
361
  if (causalOn && opts.causalPredecessor) {
275
362
  const phrase = detectCausalPhrase(opts.content);
276
363
  if (phrase) {
277
- await appendEdge(this.memoryDir, {
364
+ const edge = {
278
365
  from: opts.causalPredecessor,
279
366
  to: opts.memoryPath,
280
367
  type: "causal",
281
368
  weight: 1,
282
369
  label: phrase,
283
370
  ts
284
- });
371
+ };
372
+ appended.push(edge);
373
+ await appendEdge(this.memoryDir, edge);
285
374
  }
286
375
  }
287
376
  } catch (err) {
288
377
  const { log } = await import("./logger.js");
289
378
  log.warn(`[graph] onMemoryWritten error: ${err}`);
290
379
  } finally {
291
- this.edgeCache = null;
380
+ if (!this.edgeCache || Date.now() - this.edgeCache.loadedAt >= _GraphIndex.EDGE_CACHE_TTL_MS) {
381
+ this.edgeCache = null;
382
+ } else if (this.cfg.graphEdgeCacheIncrementalEnabled === false) {
383
+ this.edgeCache = null;
384
+ } else {
385
+ try {
386
+ if (await this.edgeFilesUnchangedExceptOurAppends(appended)) {
387
+ if (appended.length > 0) {
388
+ this.edgeCache.allEdges.push(...appended);
389
+ if (this.edgeCache && !await this.edgeCacheIdentityUnchangedSinceCommit()) {
390
+ this.edgeCache = null;
391
+ }
392
+ }
393
+ } else {
394
+ this.edgeCache = null;
395
+ }
396
+ } catch {
397
+ this.edgeCache = null;
398
+ }
399
+ }
400
+ }
401
+ }
402
+ /**
403
+ * Cross-process coherence check for the incremental edge cache (issue #1904).
404
+ *
405
+ * Returns true iff every ENABLED graph file's current identity is explained
406
+ * ENTIRELY by THIS call's own append — no other process wrote to any graph
407
+ * file since load. Per file:
408
+ * - inode must be unchanged. A local append (`appendFile`) keeps the inode;
409
+ * an external atomic temp+rename rewrite (e.g. the edge-decay job) changes
410
+ * it, so an inode change — even one that preserves byte length, such as
411
+ * decaying confidence 0.9->0.8 — forces a reload (Codex).
412
+ * - a file WE appended to (delta > 0): size must equal baseline + our exact
413
+ * appended bytes. If it was absent at load (sentinel ino 0), our append
414
+ * created it, so we accept size === delta and adopt the new identity.
415
+ * - a file we did NOT touch (delta 0): size AND mtime must be unchanged, so
416
+ * an in-place equal-length rewrite (mtime bump) or a peer append (size
417
+ * bump) both force a reload.
418
+ * On success it commits the new identity baseline so the next append
419
+ * revalidates against post-this-write truth. Fail-open: an unreadable file
420
+ * (non-ENOENT) returns false, forcing a full reload.
421
+ */
422
+ async edgeFilesUnchangedExceptOurAppends(appended) {
423
+ if (!this.edgeCache) return false;
424
+ const expectedDelta = {};
425
+ for (const edge of appended) {
426
+ const bytes = Buffer.byteLength(`${JSON.stringify(edge)}
427
+ `, "utf8");
428
+ expectedDelta[edge.type] = (expectedDelta[edge.type] ?? 0) + bytes;
429
+ }
430
+ const enabled = [];
431
+ if (this.cfg.entityGraphEnabled) enabled.push("entity");
432
+ if (this.cfg.timeGraphEnabled) enabled.push("time");
433
+ if (this.cfg.causalGraphEnabled) enabled.push("causal");
434
+ const observed = {};
435
+ for (const type of enabled) {
436
+ let cur;
437
+ try {
438
+ const st = await stat(graphFilePath(this.memoryDir, type));
439
+ cur = { size: st.size, mtimeMs: st.mtimeMs, ino: Number(st.ino) };
440
+ } catch (err) {
441
+ if (err?.code === "ENOENT") {
442
+ cur = { size: 0, mtimeMs: 0, ino: 0 };
443
+ } else {
444
+ return false;
445
+ }
446
+ }
447
+ const base = this.edgeCache.meta[type] ?? { size: 0, mtimeMs: 0, ino: 0 };
448
+ const delta = expectedDelta[type] ?? 0;
449
+ if (delta > 0) {
450
+ if (base.ino === 0) {
451
+ if (cur.ino === 0 || cur.size !== delta) return false;
452
+ } else {
453
+ if (cur.ino !== base.ino || cur.size !== base.size + delta) return false;
454
+ }
455
+ } else {
456
+ if (cur.ino !== base.ino || cur.size !== base.size || cur.mtimeMs !== base.mtimeMs) {
457
+ return false;
458
+ }
459
+ }
460
+ observed[type] = cur;
292
461
  }
462
+ this.edgeCache.meta = observed;
463
+ return true;
293
464
  }
294
465
  /**
295
466
  * Spreading activation BFS (SYNAPSE-inspired).
@@ -532,4 +703,4 @@ export {
532
703
  applyPageRankRefinement,
533
704
  applyLateralInhibition
534
705
  };
535
- //# sourceMappingURL=chunk-OBMR4VIX.js.map
706
+ //# sourceMappingURL=chunk-2S6QHZGJ.js.map