@remnic/core 10.0.4 → 10.0.5

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 (299) hide show
  1. package/dist/access-admin-ops-surface.js +46 -46
  2. package/dist/access-authorization-probe.js +47 -47
  3. package/dist/access-boundary.js +46 -46
  4. package/dist/access-cli.d.ts.map +1 -1
  5. package/dist/access-cli.js +117 -112
  6. package/dist/access-cli.js.map +1 -1
  7. package/dist/access-extraction-force-flush.js +46 -46
  8. package/dist/access-http-briefing.js +47 -47
  9. package/dist/access-http-query.js +48 -48
  10. package/dist/access-http.d.ts.map +1 -1
  11. package/dist/access-http.js +69 -68
  12. package/dist/access-identity-continuity-surface.js +46 -46
  13. package/dist/access-lcm-surface.js +46 -46
  14. package/dist/access-mcp-correction-tools.d.ts +10 -0
  15. package/dist/access-mcp-correction-tools.d.ts.map +1 -0
  16. package/dist/access-mcp-correction-tools.js +8 -0
  17. package/dist/access-mcp.d.ts.map +1 -1
  18. package/dist/access-mcp.js +60 -59
  19. package/dist/access-namespace-preflight.js +46 -46
  20. package/dist/access-observe-write-category.js +3 -3
  21. package/dist/access-observe-write-surface.js +46 -46
  22. package/dist/access-offline-manifest.js +5 -5
  23. package/dist/access-operations-batch.js +49 -49
  24. package/dist/access-operations.d.ts +1 -0
  25. package/dist/access-operations.d.ts.map +1 -1
  26. package/dist/access-operations.js +56 -56
  27. package/dist/access-recall-concurrency.js +46 -46
  28. package/dist/access-recall-diagnostics.js +2 -2
  29. package/dist/access-recall-response.js +46 -46
  30. package/dist/access-recall-surface.js +46 -46
  31. package/dist/access-service.d.ts.map +1 -1
  32. package/dist/access-service.js +46 -46
  33. package/dist/access-surface-catalog.js +48 -48
  34. package/dist/active-recall.js +22 -22
  35. package/dist/adapters/index.js +4 -4
  36. package/dist/adapters/registry.js +2 -2
  37. package/dist/auto-sync-FN7E3OTO.js +2 -2
  38. package/dist/briefing.js +18 -18
  39. package/dist/buffer.js +1 -1
  40. package/dist/causal-consolidation.js +18 -18
  41. package/dist/{chunk-5YDWSWBU.js → chunk-2CP577K6.js} +2 -2
  42. package/dist/{chunk-ABET5LA5.js → chunk-37HCPM56.js} +23 -23
  43. package/dist/{chunk-5QHTQMRL.js → chunk-4CWUZBPF.js} +8 -6
  44. package/dist/chunk-4CWUZBPF.js.map +1 -0
  45. package/dist/{chunk-H6FA36LC.js → chunk-4K2H4KTR.js} +5 -5
  46. package/dist/{chunk-TSEUVMJL.js → chunk-52CQKST6.js} +39 -39
  47. package/dist/{chunk-H7BZBSP6.js → chunk-52II7PB6.js} +4 -4
  48. package/dist/{chunk-RH6MQ5NG.js → chunk-5BPXMAUP.js} +17 -68
  49. package/dist/chunk-5BPXMAUP.js.map +1 -0
  50. package/dist/{chunk-WLC6XA6C.js → chunk-5BY3IA2U.js} +16 -53
  51. package/dist/chunk-5BY3IA2U.js.map +1 -0
  52. package/dist/{chunk-ABDTBGI2.js → chunk-5CQO6LVM.js} +2 -2
  53. package/dist/{chunk-HSZBALHV.js → chunk-5LNPW7NE.js} +2 -2
  54. package/dist/{chunk-U3LVARGV.js → chunk-5X4ZJESN.js} +2 -2
  55. package/dist/{chunk-SNGNGH53.js → chunk-63UNVGZW.js} +4 -4
  56. package/dist/{chunk-2KB7TTAP.js → chunk-64S6X4IU.js} +4 -4
  57. package/dist/{chunk-3QAIX7TV.js → chunk-6KHF6PAB.js} +2 -2
  58. package/dist/{chunk-MYBCB4AT.js → chunk-6T42L5FI.js} +2 -2
  59. package/dist/{chunk-R6EOFKZG.js → chunk-7LYRFI5A.js} +2 -2
  60. package/dist/{chunk-4NFRYOHT.js → chunk-ANZXWOYD.js} +2 -2
  61. package/dist/{chunk-QDKABMUE.js → chunk-AXC7UTLM.js} +2 -2
  62. package/dist/{chunk-5XXTZ4Y7.js → chunk-B657ZGDH.js} +2 -2
  63. package/dist/{chunk-NSQ3GUVO.js → chunk-CYEK6Z3P.js} +4 -4
  64. package/dist/{chunk-IRYKRBEX.js → chunk-DJMVSUPK.js} +3 -3
  65. package/dist/{chunk-GLS3A4SQ.js → chunk-DST7HRSG.js} +2 -2
  66. package/dist/{chunk-UCCB7RKF.js → chunk-EMVJU7WC.js} +2 -2
  67. package/dist/{chunk-IY7ZISXV.js → chunk-ENNC3RZ6.js} +2 -2
  68. package/dist/{chunk-QLK3SL7Q.js → chunk-ETSJD5IV.js} +131 -12
  69. package/dist/chunk-ETSJD5IV.js.map +1 -0
  70. package/dist/{chunk-PTFL3INS.js → chunk-FC6RCOIU.js} +2 -2
  71. package/dist/{chunk-CQQTEDHS.js → chunk-FLV7M7CT.js} +2 -2
  72. package/dist/{chunk-IXF7TRMQ.js → chunk-FRH2UC7Q.js} +2 -2
  73. package/dist/{chunk-3SL52JKD.js → chunk-FZVROZKC.js} +5 -5
  74. package/dist/{chunk-Z2EVKNZR.js → chunk-GEGUBU3D.js} +2 -2
  75. package/dist/{chunk-LIGP5M2C.js → chunk-GF4H3B3R.js} +8 -8
  76. package/dist/{chunk-7OOW72QA.js → chunk-GVUW5XK5.js} +305 -136
  77. package/dist/chunk-GVUW5XK5.js.map +1 -0
  78. package/dist/{chunk-XTWF5XR6.js → chunk-HPAOMYKM.js} +67 -67
  79. package/dist/{chunk-ZOGZMAGI.js → chunk-I25RINZK.js} +2 -2
  80. package/dist/{chunk-FMIVV5SV.js → chunk-I56MTWE7.js} +2 -2
  81. package/dist/{chunk-EUL3S3LE.js → chunk-J5WI4QRP.js} +4 -4
  82. package/dist/{chunk-436IRJUD.js → chunk-JA54KIYD.js} +2 -2
  83. package/dist/{chunk-QWNBQ2T5.js → chunk-JMF5Q4JY.js} +10 -10
  84. package/dist/{chunk-IDSSDL4W.js → chunk-JXSYWTFK.js} +21 -4
  85. package/dist/{chunk-IDSSDL4W.js.map → chunk-JXSYWTFK.js.map} +1 -1
  86. package/dist/chunk-KIUVEMBI.js +49 -0
  87. package/dist/chunk-KIUVEMBI.js.map +1 -0
  88. package/dist/{chunk-IINXHPCV.js → chunk-KQI2PKYP.js} +2 -2
  89. package/dist/{chunk-RGPPNNDJ.js → chunk-KSUOM3YU.js} +9 -9
  90. package/dist/{chunk-CXG2T7BJ.js → chunk-KZEMFD6E.js} +3 -3
  91. package/dist/{chunk-O57VUN4U.js → chunk-L2VS27PZ.js} +2 -2
  92. package/dist/{chunk-IVGJXS5F.js → chunk-L34W4W4I.js} +2 -2
  93. package/dist/{chunk-MEP3POVW.js → chunk-L3PWXD73.js} +2 -2
  94. package/dist/{chunk-NQHSXHJP.js → chunk-L6GNS5GB.js} +2 -2
  95. package/dist/{chunk-YMXCJ7SE.js → chunk-M47Q6566.js} +2 -2
  96. package/dist/{chunk-DQJCQHII.js → chunk-MQNOIH2C.js} +6 -6
  97. package/dist/{chunk-IDSZNHIP.js → chunk-MULNBSPP.js} +4 -4
  98. package/dist/{chunk-4DXVWBDB.js → chunk-NBQIFCJE.js} +2 -2
  99. package/dist/{chunk-H2XCCUOT.js → chunk-NHSVW7UT.js} +15 -15
  100. package/dist/{chunk-BDHWKFGM.js → chunk-OFEHITAZ.js} +2 -2
  101. package/dist/{chunk-RYN4AIRM.js → chunk-OZABSIOV.js} +4 -4
  102. package/dist/{chunk-Y7CXM7UM.js → chunk-QMFKW4OU.js} +3 -3
  103. package/dist/{chunk-Z63GU5NN.js → chunk-QWWMS4AE.js} +1 -1
  104. package/dist/chunk-QWWMS4AE.js.map +1 -0
  105. package/dist/{chunk-R4O2G6ML.js → chunk-RSMIRLKM.js} +2 -2
  106. package/dist/{chunk-6AH2DDHI.js → chunk-S5TGRZWY.js} +2 -2
  107. package/dist/{chunk-TYOBAFCY.js → chunk-SNXBXYUE.js} +3 -3
  108. package/dist/{chunk-MEMH5NKJ.js → chunk-SUAX5JWY.js} +2 -2
  109. package/dist/{chunk-IHIP7TJ3.js → chunk-SWRN6U7Q.js} +2 -2
  110. package/dist/{chunk-DBA2W6VV.js → chunk-SZXPKUMN.js} +6 -6
  111. package/dist/{chunk-WQUGCOKF.js → chunk-TFA6HPOA.js} +4 -4
  112. package/dist/{chunk-VWCFR4NR.js → chunk-U6OXJQEH.js} +5 -5
  113. package/dist/{chunk-DYRXRQHV.js → chunk-V32NHP2R.js} +2 -2
  114. package/dist/{chunk-ORAL4HJC.js → chunk-WG4TMZJ2.js} +2 -2
  115. package/dist/{chunk-QVBB2CLG.js → chunk-WRICYGYG.js} +27 -26
  116. package/dist/chunk-WRICYGYG.js.map +1 -0
  117. package/dist/{chunk-CV5AMCPX.js → chunk-XPRAOTJY.js} +2 -2
  118. package/dist/{chunk-RZCRXCLI.js → chunk-XQSJXNWC.js} +2 -2
  119. package/dist/{chunk-P22M3DX3.js → chunk-YJAOYEWI.js} +2 -2
  120. package/dist/{chunk-OAFRMLL4.js → chunk-YJEUHGZZ.js} +2 -2
  121. package/dist/cli.js +89 -88
  122. package/dist/coding/export-okf-codegraph.js +16 -16
  123. package/dist/compounding/engine.js +17 -17
  124. package/dist/config.d.ts.map +1 -1
  125. package/dist/config.js +22 -22
  126. package/dist/connectors/codex-materialize-runner.js +17 -17
  127. package/dist/connectors/index.js +17 -17
  128. package/dist/consolidation-provenance-check.js +2 -2
  129. package/dist/contradiction/index.js +7 -7
  130. package/dist/convergence-refresh.js +19 -19
  131. package/dist/conversation-index/backend.js +2 -2
  132. package/dist/corpus-watermark.js +19 -19
  133. package/dist/correction/correction-access-wiring.d.ts +6 -6
  134. package/dist/correction/correction-access-wiring.d.ts.map +1 -1
  135. package/dist/correction/correction-classify.d.ts +25 -0
  136. package/dist/correction/correction-classify.d.ts.map +1 -0
  137. package/dist/correction/correction-config.d.ts +11 -0
  138. package/dist/correction/correction-config.d.ts.map +1 -0
  139. package/dist/correction/correction-contract.d.ts +13 -1
  140. package/dist/correction/correction-contract.d.ts.map +1 -1
  141. package/dist/correction/correction-executor.d.ts +2 -0
  142. package/dist/correction/correction-executor.d.ts.map +1 -1
  143. package/dist/correction/correction-planner.d.ts +24 -3
  144. package/dist/correction/correction-planner.d.ts.map +1 -1
  145. package/dist/entity-retrieval.js +17 -17
  146. package/dist/event-order-recall.js +2 -2
  147. package/dist/explicit-capture.js +2 -2
  148. package/dist/external-wiki-access.js +47 -47
  149. package/dist/extraction-span-materialize.js +2 -2
  150. package/dist/extraction.js +22 -22
  151. package/dist/harmonic-retrieval.js +17 -17
  152. package/dist/index.js +189 -188
  153. package/dist/lcm/index.js +3 -3
  154. package/dist/local-llm.d.ts.map +1 -1
  155. package/dist/local-llm.js +1 -1
  156. package/dist/location/index.js +19 -19
  157. package/dist/maintenance/memory-governance.js +17 -17
  158. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +17 -17
  159. package/dist/maintenance/rebuild-memory-projection-runner.js +19 -19
  160. package/dist/maintenance/rebuild-memory-projection.js +18 -18
  161. package/dist/memory-browse-operations.js +47 -47
  162. package/dist/memory-browse.js +1 -1
  163. package/dist/memory-subject.js +1 -1
  164. package/dist/namespaces/migrate.js +18 -18
  165. package/dist/namespaces/search.js +6 -6
  166. package/dist/namespaces/storage.js +17 -17
  167. package/dist/operator-doctor-corpus.js +20 -20
  168. package/dist/operator-toolkit.js +32 -32
  169. package/dist/orchestration/maintenance.js +28 -28
  170. package/dist/orchestration/session-context.d.ts.map +1 -1
  171. package/dist/orchestrator.js +113 -112
  172. package/dist/recall-explain-renderer.js +3 -3
  173. package/dist/recall-navigate-access.js +2 -2
  174. package/dist/recall-navigate-disclosure.js +2 -2
  175. package/dist/recall-navigate.js +2 -2
  176. package/dist/recall-navigation-operations.js +47 -47
  177. package/dist/recall-navigation.js +46 -46
  178. package/dist/recall-why-service.js +2 -2
  179. package/dist/recall-xray-cli.js +4 -4
  180. package/dist/recall-xray-renderer.js +3 -3
  181. package/dist/recall-xray.js +2 -2
  182. package/dist/reconcile/manifest.js +3 -3
  183. package/dist/{resolution-RSG4HZTL.js → resolution-TV3F7ZTH.js} +7 -7
  184. package/dist/resolution-TV3F7ZTH.js.map +1 -0
  185. package/dist/resume-bundles.js +23 -23
  186. package/dist/salvage-envelope.js +1 -1
  187. package/dist/search/factory.js +5 -5
  188. package/dist/search/index.js +9 -9
  189. package/dist/semantic-consolidation.js +23 -23
  190. package/dist/semantic-rule-promotion.js +17 -17
  191. package/dist/semantic-rule-verifier.js +17 -17
  192. package/dist/source-agent-qualifier.js +17 -17
  193. package/dist/standup/build.js +17 -17
  194. package/dist/storage.js +16 -16
  195. package/dist/subject-config.js +1 -1
  196. package/dist/summarizer.js +3 -3
  197. package/dist/support-passport/index.js +63 -63
  198. package/dist/transfer/export-okf.js +17 -17
  199. package/dist/types.d.ts +6 -23
  200. package/dist/types.d.ts.map +1 -1
  201. package/dist/types.js +1 -1
  202. package/dist/verified-recall.js +17 -17
  203. package/dist/who-knows-cli.js +18 -18
  204. package/dist/who-knows.js +17 -17
  205. package/dist/write-envelope.js +1 -1
  206. package/package.json +2 -2
  207. package/src/access-cli.ts +4 -0
  208. package/src/access-http.ts +1 -0
  209. package/src/access-mcp-correction-tools.ts +56 -0
  210. package/src/access-mcp.ts +4 -49
  211. package/src/access-operations.ts +3 -0
  212. package/src/access-service.ts +12 -21
  213. package/src/config.test.ts +26 -0
  214. package/src/config.ts +4 -60
  215. package/src/correction/correction-access-wiring.ts +56 -16
  216. package/src/correction/correction-classify.test.ts +185 -0
  217. package/src/correction/correction-classify.ts +157 -0
  218. package/src/correction/correction-config.ts +93 -0
  219. package/src/correction/correction-contract.ts +61 -14
  220. package/src/correction/correction-executor.test.ts +102 -2
  221. package/src/correction/correction-executor.ts +19 -1
  222. package/src/correction/correction-planner.test.ts +141 -0
  223. package/src/correction/correction-planner.ts +117 -11
  224. package/src/correction/correction-surfaces.test.ts +22 -1
  225. package/src/local-llm-qos.test.ts +36 -0
  226. package/src/local-llm.ts +20 -3
  227. package/src/orchestration/session-context.ts +0 -15
  228. package/src/recall-handles-wiring.test.ts +24 -0
  229. package/src/types.ts +6 -23
  230. package/dist/chunk-5QHTQMRL.js.map +0 -1
  231. package/dist/chunk-7OOW72QA.js.map +0 -1
  232. package/dist/chunk-QLK3SL7Q.js.map +0 -1
  233. package/dist/chunk-QVBB2CLG.js.map +0 -1
  234. package/dist/chunk-RH6MQ5NG.js.map +0 -1
  235. package/dist/chunk-WLC6XA6C.js.map +0 -1
  236. package/dist/chunk-Z63GU5NN.js.map +0 -1
  237. /package/dist/{resolution-RSG4HZTL.js.map → access-mcp-correction-tools.js.map} +0 -0
  238. /package/dist/{chunk-5YDWSWBU.js.map → chunk-2CP577K6.js.map} +0 -0
  239. /package/dist/{chunk-ABET5LA5.js.map → chunk-37HCPM56.js.map} +0 -0
  240. /package/dist/{chunk-H6FA36LC.js.map → chunk-4K2H4KTR.js.map} +0 -0
  241. /package/dist/{chunk-TSEUVMJL.js.map → chunk-52CQKST6.js.map} +0 -0
  242. /package/dist/{chunk-H7BZBSP6.js.map → chunk-52II7PB6.js.map} +0 -0
  243. /package/dist/{chunk-ABDTBGI2.js.map → chunk-5CQO6LVM.js.map} +0 -0
  244. /package/dist/{chunk-HSZBALHV.js.map → chunk-5LNPW7NE.js.map} +0 -0
  245. /package/dist/{chunk-U3LVARGV.js.map → chunk-5X4ZJESN.js.map} +0 -0
  246. /package/dist/{chunk-SNGNGH53.js.map → chunk-63UNVGZW.js.map} +0 -0
  247. /package/dist/{chunk-2KB7TTAP.js.map → chunk-64S6X4IU.js.map} +0 -0
  248. /package/dist/{chunk-3QAIX7TV.js.map → chunk-6KHF6PAB.js.map} +0 -0
  249. /package/dist/{chunk-MYBCB4AT.js.map → chunk-6T42L5FI.js.map} +0 -0
  250. /package/dist/{chunk-R6EOFKZG.js.map → chunk-7LYRFI5A.js.map} +0 -0
  251. /package/dist/{chunk-4NFRYOHT.js.map → chunk-ANZXWOYD.js.map} +0 -0
  252. /package/dist/{chunk-QDKABMUE.js.map → chunk-AXC7UTLM.js.map} +0 -0
  253. /package/dist/{chunk-5XXTZ4Y7.js.map → chunk-B657ZGDH.js.map} +0 -0
  254. /package/dist/{chunk-NSQ3GUVO.js.map → chunk-CYEK6Z3P.js.map} +0 -0
  255. /package/dist/{chunk-IRYKRBEX.js.map → chunk-DJMVSUPK.js.map} +0 -0
  256. /package/dist/{chunk-GLS3A4SQ.js.map → chunk-DST7HRSG.js.map} +0 -0
  257. /package/dist/{chunk-UCCB7RKF.js.map → chunk-EMVJU7WC.js.map} +0 -0
  258. /package/dist/{chunk-IY7ZISXV.js.map → chunk-ENNC3RZ6.js.map} +0 -0
  259. /package/dist/{chunk-PTFL3INS.js.map → chunk-FC6RCOIU.js.map} +0 -0
  260. /package/dist/{chunk-CQQTEDHS.js.map → chunk-FLV7M7CT.js.map} +0 -0
  261. /package/dist/{chunk-IXF7TRMQ.js.map → chunk-FRH2UC7Q.js.map} +0 -0
  262. /package/dist/{chunk-3SL52JKD.js.map → chunk-FZVROZKC.js.map} +0 -0
  263. /package/dist/{chunk-Z2EVKNZR.js.map → chunk-GEGUBU3D.js.map} +0 -0
  264. /package/dist/{chunk-LIGP5M2C.js.map → chunk-GF4H3B3R.js.map} +0 -0
  265. /package/dist/{chunk-XTWF5XR6.js.map → chunk-HPAOMYKM.js.map} +0 -0
  266. /package/dist/{chunk-ZOGZMAGI.js.map → chunk-I25RINZK.js.map} +0 -0
  267. /package/dist/{chunk-FMIVV5SV.js.map → chunk-I56MTWE7.js.map} +0 -0
  268. /package/dist/{chunk-EUL3S3LE.js.map → chunk-J5WI4QRP.js.map} +0 -0
  269. /package/dist/{chunk-436IRJUD.js.map → chunk-JA54KIYD.js.map} +0 -0
  270. /package/dist/{chunk-QWNBQ2T5.js.map → chunk-JMF5Q4JY.js.map} +0 -0
  271. /package/dist/{chunk-IINXHPCV.js.map → chunk-KQI2PKYP.js.map} +0 -0
  272. /package/dist/{chunk-RGPPNNDJ.js.map → chunk-KSUOM3YU.js.map} +0 -0
  273. /package/dist/{chunk-CXG2T7BJ.js.map → chunk-KZEMFD6E.js.map} +0 -0
  274. /package/dist/{chunk-O57VUN4U.js.map → chunk-L2VS27PZ.js.map} +0 -0
  275. /package/dist/{chunk-IVGJXS5F.js.map → chunk-L34W4W4I.js.map} +0 -0
  276. /package/dist/{chunk-MEP3POVW.js.map → chunk-L3PWXD73.js.map} +0 -0
  277. /package/dist/{chunk-NQHSXHJP.js.map → chunk-L6GNS5GB.js.map} +0 -0
  278. /package/dist/{chunk-YMXCJ7SE.js.map → chunk-M47Q6566.js.map} +0 -0
  279. /package/dist/{chunk-DQJCQHII.js.map → chunk-MQNOIH2C.js.map} +0 -0
  280. /package/dist/{chunk-IDSZNHIP.js.map → chunk-MULNBSPP.js.map} +0 -0
  281. /package/dist/{chunk-4DXVWBDB.js.map → chunk-NBQIFCJE.js.map} +0 -0
  282. /package/dist/{chunk-H2XCCUOT.js.map → chunk-NHSVW7UT.js.map} +0 -0
  283. /package/dist/{chunk-BDHWKFGM.js.map → chunk-OFEHITAZ.js.map} +0 -0
  284. /package/dist/{chunk-RYN4AIRM.js.map → chunk-OZABSIOV.js.map} +0 -0
  285. /package/dist/{chunk-Y7CXM7UM.js.map → chunk-QMFKW4OU.js.map} +0 -0
  286. /package/dist/{chunk-R4O2G6ML.js.map → chunk-RSMIRLKM.js.map} +0 -0
  287. /package/dist/{chunk-6AH2DDHI.js.map → chunk-S5TGRZWY.js.map} +0 -0
  288. /package/dist/{chunk-TYOBAFCY.js.map → chunk-SNXBXYUE.js.map} +0 -0
  289. /package/dist/{chunk-MEMH5NKJ.js.map → chunk-SUAX5JWY.js.map} +0 -0
  290. /package/dist/{chunk-IHIP7TJ3.js.map → chunk-SWRN6U7Q.js.map} +0 -0
  291. /package/dist/{chunk-DBA2W6VV.js.map → chunk-SZXPKUMN.js.map} +0 -0
  292. /package/dist/{chunk-WQUGCOKF.js.map → chunk-TFA6HPOA.js.map} +0 -0
  293. /package/dist/{chunk-VWCFR4NR.js.map → chunk-U6OXJQEH.js.map} +0 -0
  294. /package/dist/{chunk-DYRXRQHV.js.map → chunk-V32NHP2R.js.map} +0 -0
  295. /package/dist/{chunk-ORAL4HJC.js.map → chunk-WG4TMZJ2.js.map} +0 -0
  296. /package/dist/{chunk-CV5AMCPX.js.map → chunk-XPRAOTJY.js.map} +0 -0
  297. /package/dist/{chunk-RZCRXCLI.js.map → chunk-XQSJXNWC.js.map} +0 -0
  298. /package/dist/{chunk-P22M3DX3.js.map → chunk-YJAOYEWI.js.map} +0 -0
  299. /package/dist/{chunk-OAFRMLL4.js.map → chunk-YJEUHGZZ.js.map} +0 -0
@@ -12,9 +12,6 @@ import {
12
12
  import {
13
13
  isSharedContextWriteInputError
14
14
  } from "./chunk-IFBSZGW3.js";
15
- import {
16
- UNATTRIBUTED_ACCESS_WRITE_ORIGIN
17
- } from "./chunk-OGXXGHW6.js";
18
15
  import {
19
16
  ACTIVE_DECISION_STATUSES,
20
17
  CodegraphRuntimeError,
@@ -34,14 +31,17 @@ import {
34
31
  serializeDecisionRecord
35
32
  } from "./chunk-EQUD7FP4.js";
36
33
  import {
37
- WriteQuarantineStore
38
- } from "./chunk-BANSBRNX.js";
34
+ UNATTRIBUTED_ACCESS_WRITE_ORIGIN
35
+ } from "./chunk-OGXXGHW6.js";
39
36
  import {
40
37
  WHO_KNOWS_DEFAULT_LIMIT,
41
38
  computeWhoKnows,
42
39
  loadWhoKnowsEntities,
43
40
  validateWhoKnowsInput
44
- } from "./chunk-RZCRXCLI.js";
41
+ } from "./chunk-XQSJXNWC.js";
42
+ import {
43
+ WriteQuarantineStore
44
+ } from "./chunk-BANSBRNX.js";
45
45
  import {
46
46
  trustResultFor
47
47
  } from "./chunk-GNVZQ5JN.js";
@@ -59,7 +59,7 @@ import {
59
59
  } from "./chunk-ROBHL3GL.js";
60
60
  import {
61
61
  summarizeHourlyStatus
62
- } from "./chunk-NQHSXHJP.js";
62
+ } from "./chunk-L6GNS5GB.js";
63
63
  import {
64
64
  planSessionTranscriptMigration
65
65
  } from "./chunk-WWDO7ZWM.js";
@@ -84,7 +84,7 @@ import {
84
84
  } from "./chunk-VYDGHJIN.js";
85
85
  import {
86
86
  planDisclosureStep
87
- } from "./chunk-MYBCB4AT.js";
87
+ } from "./chunk-6T42L5FI.js";
88
88
  import {
89
89
  parseNavigateLinkType
90
90
  } from "./chunk-7O5EW7KX.js";
@@ -93,29 +93,29 @@ import {
93
93
  } from "./chunk-H7XKCNR6.js";
94
94
  import {
95
95
  toRecallExplainJson
96
- } from "./chunk-BDHWKFGM.js";
96
+ } from "./chunk-OFEHITAZ.js";
97
97
  import {
98
98
  estimateRecallTokens,
99
99
  summarizeDisclosureTokens
100
- } from "./chunk-NSQ3GUVO.js";
100
+ } from "./chunk-CYEK6Z3P.js";
101
+ import {
102
+ buildEmbeddingAwareSnapshotStream
103
+ } from "./chunk-BNMI3JBV.js";
101
104
  import {
102
105
  readAggregateExtractionWatermark
103
- } from "./chunk-R6EOFKZG.js";
106
+ } from "./chunk-7LYRFI5A.js";
104
107
  import {
105
108
  ReplicaDivergenceMonitor
106
109
  } from "./chunk-E6UNM67F.js";
107
110
  import {
108
- buildEmbeddingAwareSnapshotStream
109
- } from "./chunk-BNMI3JBV.js";
111
+ recordMemoryOutcome
112
+ } from "./chunk-UD7UNYRD.js";
110
113
  import {
111
114
  recordObjectiveStateSnapshotsFromObservedMessages
112
115
  } from "./chunk-6WHJ2EAB.js";
113
116
  import {
114
117
  objectiveStateStoreOverrideForNamespace
115
118
  } from "./chunk-HM7RHKS4.js";
116
- import {
117
- recordMemoryOutcome
118
- } from "./chunk-UD7UNYRD.js";
119
119
  import {
120
120
  runMemoryBrowse
121
121
  } from "./chunk-IJ4FEGZR.js";
@@ -127,7 +127,7 @@ import {
127
127
  } from "./chunk-2YA5N2BY.js";
128
128
  import {
129
129
  readProjectedHarmonicGraph
130
- } from "./chunk-P22M3DX3.js";
130
+ } from "./chunk-YJAOYEWI.js";
131
131
  import {
132
132
  buildGraphSnapshot
133
133
  } from "./chunk-CHDGJJV6.js";
@@ -145,7 +145,7 @@ import {
145
145
  } from "./chunk-BLVHDY2U.js";
146
146
  import {
147
147
  LocalLlmClient
148
- } from "./chunk-IDSSDL4W.js";
148
+ } from "./chunk-JXSYWTFK.js";
149
149
  import {
150
150
  REDACTION_RULES_SUBDIR
151
151
  } from "./chunk-LTHVM4XN.js";
@@ -163,6 +163,9 @@ import {
163
163
  composeRecallContext,
164
164
  renderAuthorityBoundContent
165
165
  } from "./chunk-NVKO5YKP.js";
166
+ import {
167
+ callDeepRecallPolicyLlm
168
+ } from "./chunk-JNLEJE4A.js";
166
169
  import {
167
170
  renderDeepRecallResult
168
171
  } from "./chunk-RF2SMMPP.js";
@@ -176,9 +179,6 @@ import {
176
179
  CrossNamespaceBudget,
177
180
  toBudgetWarning
178
181
  } from "./chunk-UFGFMWAD.js";
179
- import {
180
- callDeepRecallPolicyLlm
181
- } from "./chunk-JNLEJE4A.js";
182
182
  import {
183
183
  buildProposedActions,
184
184
  buildQualityScore,
@@ -186,11 +186,11 @@ import {
186
186
  listMemoryGovernanceRuns,
187
187
  readMemoryGovernanceRunArtifact,
188
188
  runMemoryGovernance
189
- } from "./chunk-H6FA36LC.js";
189
+ } from "./chunk-4K2H4KTR.js";
190
190
  import {
191
191
  CorpusWatermarkCache,
192
192
  computeServiceCorpusCensus
193
- } from "./chunk-4NFRYOHT.js";
193
+ } from "./chunk-ANZXWOYD.js";
194
194
  import {
195
195
  defaultCapsulesDir
196
196
  } from "./chunk-ZY2MNJR6.js";
@@ -200,19 +200,31 @@ import {
200
200
  enqueuePassiveCorrectionNotification,
201
201
  parseBriefingFocus,
202
202
  parseBriefingWindow
203
- } from "./chunk-LIGP5M2C.js";
203
+ } from "./chunk-GF4H3B3R.js";
204
204
  import {
205
205
  ExtractionDeadlineError
206
206
  } from "./chunk-KE5PWLI6.js";
207
+ import {
208
+ meetingsBuild,
209
+ meetingsGet,
210
+ meetingsList,
211
+ wearablesStatus,
212
+ wearablesSync,
213
+ wearablesTranscriptDay,
214
+ wearablesTranscriptMemories,
215
+ wearablesTranscriptSearch
216
+ } from "./chunk-SYOIVK7K.js";
207
217
  import {
208
218
  CORRECTION_TEXT_MAX,
209
219
  CorrectionContractError,
220
+ DEFAULT_CORRECTION_CLASSIFY_TIMEOUT_MS,
221
+ MAX_CORRECTION_CLASSIFY_TIMEOUT_MS,
210
222
  deterministicFallbackPlan,
211
223
  newPlanId,
212
224
  validateCorrectionAction,
213
225
  validateCorrectionRequest,
214
226
  validateRedactionPattern
215
- } from "./chunk-QLK3SL7Q.js";
227
+ } from "./chunk-ETSJD5IV.js";
216
228
  import {
217
229
  isCodingKnowledgeFeatureEnabled
218
230
  } from "./chunk-FEHIOYML.js";
@@ -244,10 +256,10 @@ import {
244
256
  qmdCollectionPathParts,
245
257
  qmdResultPathCandidates,
246
258
  selfDeps
247
- } from "./chunk-ABET5LA5.js";
259
+ } from "./chunk-37HCPM56.js";
248
260
  import {
249
261
  namespaceCollectionName
250
- } from "./chunk-R4O2G6ML.js";
262
+ } from "./chunk-RSMIRLKM.js";
251
263
  import {
252
264
  normalizeProjectionPreview,
253
265
  normalizeProjectionTags
@@ -270,21 +282,26 @@ import {
270
282
  supersessionKeysForFact
271
283
  } from "./chunk-5WITETWU.js";
272
284
  import {
273
- FallbackLlmClient
285
+ FallbackLlmClient,
286
+ gatewayTaskChainOptions
274
287
  } from "./chunk-TKC5LZ43.js";
288
+ import {
289
+ fallbackLlmRuntimeContextFromConfig
290
+ } from "./chunk-EP6BA7VV.js";
291
+ import {
292
+ DEFAULT_RECALL_DISCLOSURE,
293
+ isRecallDisclosure
294
+ } from "./chunk-QWWMS4AE.js";
295
+ import {
296
+ extractJsonCandidates
297
+ } from "./chunk-YBA52OKG.js";
275
298
  import {
276
299
  delegateExtractionForceFlush
277
300
  } from "./chunk-RMMA44HE.js";
278
301
  import {
279
- meetingsBuild,
280
- meetingsGet,
281
- meetingsList,
282
- wearablesStatus,
283
- wearablesSync,
284
- wearablesTranscriptDay,
285
- wearablesTranscriptMemories,
286
- wearablesTranscriptSearch
287
- } from "./chunk-SYOIVK7K.js";
302
+ ObserveTranscriptPersister,
303
+ observeTranscriptSessionKey
304
+ } from "./chunk-T2JSUEH6.js";
288
305
  import {
289
306
  splitCanonicalWriteRequest
290
307
  } from "./chunk-HRZZJ4XB.js";
@@ -318,7 +335,7 @@ import {
318
335
  } from "./chunk-Z2YFLXHU.js";
319
336
  import {
320
337
  createOfflineSyncManifestStream
321
- } from "./chunk-SNGNGH53.js";
338
+ } from "./chunk-63UNVGZW.js";
322
339
  import {
323
340
  offlineSyncStorageForSnapshot
324
341
  } from "./chunk-EP5WXE2G.js";
@@ -342,49 +359,6 @@ import {
342
359
  import {
343
360
  displayErrorDetail
344
361
  } from "./chunk-RL6NEVXT.js";
345
- import {
346
- assertOperationAuthorizationAllowed,
347
- capabilityAllowsOp,
348
- enforceNamespaceAllowList,
349
- isNamespaceAllowed,
350
- tokenCapabilityStore
351
- } from "./chunk-IG747LRN.js";
352
- import {
353
- writeFileAtomically
354
- } from "./chunk-BTNNL7ZW.js";
355
- import {
356
- computeContentHash
357
- } from "./chunk-5FVVY2EB.js";
358
- import {
359
- applyOfflineSyncChangeset,
360
- applyOfflineSyncFileContentChunk,
361
- buildOfflineSyncSnapshot,
362
- buildOfflineSyncSnapshotForPaths,
363
- buildOfflineSyncSnapshotFromBase,
364
- normalizeOfflineSyncChangeset,
365
- readOfflineSyncFileContentChunk
366
- } from "./chunk-TGF43K66.js";
367
- import {
368
- compileOfflineSyncExcludeGlobs
369
- } from "./chunk-63LFM77Z.js";
370
- import {
371
- validateArchiveRelativePath
372
- } from "./chunk-GCGJW34D.js";
373
- import {
374
- serializeMutations,
375
- withHeldFileLock
376
- } from "./chunk-FFAZ2XFU.js";
377
- import {
378
- createRecallCorpusVersionCapture,
379
- mergeRecallCorpusVersions
380
- } from "./chunk-YVRQ5JRA.js";
381
- import {
382
- DEFAULT_RECALL_DISCLOSURE,
383
- isRecallDisclosure
384
- } from "./chunk-Z63GU5NN.js";
385
- import {
386
- extractJsonCandidates
387
- } from "./chunk-YBA52OKG.js";
388
362
  import {
389
363
  SUPPORT_PASSPORT_ATTRIBUTE_KEYS,
390
364
  SUPPORT_PASSPORT_CARD_TAG,
@@ -408,6 +382,19 @@ import {
408
382
  isSupportPassportPrivateMemory,
409
383
  projectSupportPassportCard
410
384
  } from "./chunk-PWPIERBM.js";
385
+ import {
386
+ assertOperationAuthorizationAllowed,
387
+ capabilityAllowsOp,
388
+ enforceNamespaceAllowList,
389
+ isNamespaceAllowed,
390
+ tokenCapabilityStore
391
+ } from "./chunk-IG747LRN.js";
392
+ import {
393
+ writeFileAtomically
394
+ } from "./chunk-BTNNL7ZW.js";
395
+ import {
396
+ computeContentHash
397
+ } from "./chunk-5FVVY2EB.js";
411
398
  import {
412
399
  stripAttributesSuffix
413
400
  } from "./chunk-JDSVLVCG.js";
@@ -420,9 +407,32 @@ import {
420
407
  parseIdOrHandle,
421
408
  resolveHandle
422
409
  } from "./chunk-JAKIDQB2.js";
410
+ import {
411
+ applyOfflineSyncChangeset,
412
+ applyOfflineSyncFileContentChunk,
413
+ buildOfflineSyncSnapshot,
414
+ buildOfflineSyncSnapshotForPaths,
415
+ buildOfflineSyncSnapshotFromBase,
416
+ normalizeOfflineSyncChangeset,
417
+ readOfflineSyncFileContentChunk
418
+ } from "./chunk-TGF43K66.js";
419
+ import {
420
+ compileOfflineSyncExcludeGlobs
421
+ } from "./chunk-63LFM77Z.js";
422
+ import {
423
+ validateArchiveRelativePath
424
+ } from "./chunk-GCGJW34D.js";
425
+ import {
426
+ serializeMutations,
427
+ withHeldFileLock
428
+ } from "./chunk-FFAZ2XFU.js";
423
429
  import {
424
430
  parseIsoOffsetTimestamp
425
431
  } from "./chunk-P7FMDTKL.js";
432
+ import {
433
+ createRecallCorpusVersionCapture,
434
+ mergeRecallCorpusVersions
435
+ } from "./chunk-YVRQ5JRA.js";
426
436
  import {
427
437
  defaultNamespaceAtFlatRoot,
428
438
  memorySearchThroughScope,
@@ -461,10 +471,6 @@ import {
461
471
  PendingObserveExtractionTracker,
462
472
  pendingObserveScopeHint
463
473
  } from "./chunk-LNEWDF2A.js";
464
- import {
465
- ObserveTranscriptPersister,
466
- observeTranscriptSessionKey
467
- } from "./chunk-T2JSUEH6.js";
468
474
  import {
469
475
  AccessIdempotencyStore,
470
476
  hashAccessIdempotencyPayload
@@ -1431,17 +1437,19 @@ var CorrectionPlanner = class _CorrectionPlanner {
1431
1437
  "Correction requires at least one readable namespace \u2014 principal has no read scope."
1432
1438
  );
1433
1439
  }
1434
- const located = await this.locateCandidates(cleaned, namespaces, abortSignal);
1440
+ const explicitDuplicate = cleaned.duplicateOf ? await this.planExplicitDuplicate(cleaned, namespaces, abortSignal) : null;
1441
+ const located = explicitDuplicate ? { candidates: [explicitDuplicate.loser] } : await this.locateCandidates(cleaned, namespaces, abortSignal);
1435
1442
  throwIfAborted(abortSignal, "correction planning aborted");
1436
- if (located.candidates.length === 0) {
1443
+ if (!explicitDuplicate && located.candidates.length === 0) {
1437
1444
  return this.persist(
1438
1445
  this.emptyPlan(cleaned, namespaces[0], "no matching memories found for the correction text"),
1439
1446
  abortSignal
1440
1447
  );
1441
1448
  }
1442
- const llm = await this.deps.classifyAndDraft({
1449
+ const llm = explicitDuplicate ? explicitDuplicate.llm : await this.deps.classifyAndDraft({
1443
1450
  text: cleaned.text,
1444
- candidates: located.candidates
1451
+ candidates: located.candidates,
1452
+ abortSignal
1445
1453
  });
1446
1454
  throwIfAborted(abortSignal, "correction planning aborted");
1447
1455
  for (const action of llm.actions) {
@@ -1463,9 +1471,14 @@ var CorrectionPlanner = class _CorrectionPlanner {
1463
1471
  }
1464
1472
  const candidateIds = new Set(located.candidates.map((c) => c.memoryId));
1465
1473
  if (llm.actions.length > 0 && candidateIds.size > 0) {
1474
+ const explicitWinner = cleaned.duplicateOf;
1466
1475
  const filtered = llm.actions.filter((action) => {
1467
1476
  const id = action.kind === "supersede" ? action.loserId : action.kind === "edit" || action.kind === "retract" || action.kind === "rescope" ? action.memoryId : null;
1468
- return id === null || candidateIds.has(id);
1477
+ if (id !== null && !candidateIds.has(id)) return false;
1478
+ if (action.kind === "supersede" && action.winnerId && action.winnerId !== explicitWinner && !candidateIds.has(action.winnerId)) {
1479
+ return false;
1480
+ }
1481
+ return true;
1469
1482
  });
1470
1483
  if (filtered.length < llm.actions.length) {
1471
1484
  const dropped = llm.actions.length - filtered.length;
@@ -1503,6 +1516,57 @@ var CorrectionPlanner = class _CorrectionPlanner {
1503
1516
  throwIfAborted(abortSignal, "correction planning aborted");
1504
1517
  return this.persist(plan, abortSignal);
1505
1518
  }
1519
+ async planExplicitDuplicate(request, namespaces, abortSignal) {
1520
+ const winnerId = request.duplicateOf;
1521
+ if (!winnerId || !request.targetIds || request.targetIds.length !== 1) {
1522
+ throw new CorrectionContractError(
1523
+ "CorrectionRequest.duplicateOf requires exactly one targetIds entry (the duplicate memory)."
1524
+ );
1525
+ }
1526
+ if (request.targetIds[0] === winnerId) {
1527
+ throw new CorrectionContractError(
1528
+ "CorrectionRequest.duplicateOf must be a different memory from targetIds."
1529
+ );
1530
+ }
1531
+ const loserId = request.targetIds[0];
1532
+ const loser = await this.inspectDuplicateParty(loserId, namespaces, "target");
1533
+ throwIfAborted(abortSignal, "correction planning aborted");
1534
+ await this.inspectDuplicateParty(winnerId, namespaces, "duplicateOf");
1535
+ throwIfAborted(abortSignal, "correction planning aborted");
1536
+ return {
1537
+ loser,
1538
+ llm: {
1539
+ classification: "outdated",
1540
+ confidence: 1,
1541
+ actions: [{ kind: "supersede", loserId, winnerId }],
1542
+ relevance: [{
1543
+ memoryId: loserId,
1544
+ why: `duplicate of ${winnerId}; recoverable supersede`
1545
+ }],
1546
+ warnings: []
1547
+ }
1548
+ };
1549
+ }
1550
+ async inspectDuplicateParty(memoryId, namespaces, role) {
1551
+ const notFound = role === "target" ? `target memory not found: ${memoryId}` : `duplicateOf memory not found: ${memoryId}`;
1552
+ const inactive = (status) => role === "target" ? `target memory is not active: ${memoryId} (${status})` : `duplicateOf memory is not active: ${memoryId} (${status})`;
1553
+ if (this.deps.inspectMemory) {
1554
+ const found = await this.deps.inspectMemory({ memoryId, namespaces });
1555
+ if (!found) throw new CorrectionContractError(notFound);
1556
+ const status = found.status && found.status.length > 0 ? found.status : "active";
1557
+ if (status !== "active") throw new CorrectionContractError(inactive(status));
1558
+ return found.candidate;
1559
+ }
1560
+ try {
1561
+ const resolved = await this.deps.resolveTargets({ targetIds: [memoryId], namespaces });
1562
+ const candidate = resolved.find((item) => item.memoryId === memoryId) ?? resolved[0];
1563
+ if (!candidate) throw new CorrectionContractError(notFound);
1564
+ return candidate;
1565
+ } catch (err) {
1566
+ if (err instanceof CorrectionContractError) throw new CorrectionContractError(notFound);
1567
+ throw err;
1568
+ }
1569
+ }
1506
1570
  async locateCandidates(request, namespaces, abortSignal) {
1507
1571
  if (request.targetIds && request.targetIds.length > 0) {
1508
1572
  const targets = await this.deps.resolveTargets({
@@ -2055,13 +2119,27 @@ var CorrectionExecutor = class {
2055
2119
  if (action.replacement && !replacementResult) {
2056
2120
  continue;
2057
2121
  }
2122
+ if (action.winnerId && !action.replacement) {
2123
+ const winner = await this.deps.getMemory(namespace, action.winnerId, abortSignal);
2124
+ const winnerStatus = winner ? winner.status ?? "active" : void 0;
2125
+ if (!winner || winnerStatus !== "active") {
2126
+ results.push({
2127
+ action,
2128
+ status: "failed",
2129
+ error: winner ? `supersede winner is not active: ${action.winnerId} (${winnerStatus})` : `supersede winner not found: ${action.winnerId}`
2130
+ });
2131
+ continue;
2132
+ }
2133
+ }
2058
2134
  await this.retireAndTombstone(
2059
2135
  namespace,
2060
2136
  action,
2061
2137
  "supersession",
2062
2138
  results,
2063
2139
  appliedTouched,
2064
- { supersededBy: replacementResult?.memoryId },
2140
+ {
2141
+ supersededBy: replacementResult?.memoryId ?? action.winnerId
2142
+ },
2065
2143
  abortSignal
2066
2144
  );
2067
2145
  if (results.at(-1)?.status === "applied") {
@@ -2370,6 +2448,94 @@ var CorrectionService = class {
2370
2448
  // src/correction/correction-access-wiring.ts
2371
2449
  import path3 from "path";
2372
2450
  import { createHash } from "crypto";
2451
+
2452
+ // src/correction/correction-classify.ts
2453
+ async function completeCorrectionClassify(messages, deps, abortSignal) {
2454
+ throwIfAborted(abortSignal, "correction classify aborted");
2455
+ const timeoutMs = classifyTimeoutMs(deps.config);
2456
+ const gatewayPrimary = deps.config.modelSource === "gateway";
2457
+ const localEnabled = resolveLocalLlmCapabilities(deps.config).localLlm === true && !gatewayPrimary;
2458
+ if (localEnabled) {
2459
+ const localAttempt = startAttempt(abortSignal, timeoutMs);
2460
+ try {
2461
+ const local = await deps.localLlm.chatCompletion(messages, {
2462
+ operation: "correction-classify",
2463
+ priority: "background",
2464
+ timeoutMs,
2465
+ temperature: 0.2,
2466
+ signal: localAttempt.signal
2467
+ });
2468
+ if (abortSignal?.aborted) throw abortError("correction classify aborted");
2469
+ if (local?.content) return local.content;
2470
+ if (deps.config.localLlmFallback === false) {
2471
+ throw new Error("correction classify: local LLM unavailable and fallback disabled");
2472
+ }
2473
+ } catch (err) {
2474
+ if (abortSignal?.aborted) {
2475
+ throw isAbortError(err) ? err : abortError("correction classify aborted");
2476
+ }
2477
+ if (deps.config.localLlmFallback === false) {
2478
+ if (isAbortError(err)) {
2479
+ throw new Error("correction classify: local LLM timed out and fallback disabled");
2480
+ }
2481
+ throw err;
2482
+ }
2483
+ } finally {
2484
+ localAttempt.dispose();
2485
+ }
2486
+ } else if (!gatewayPrimary && deps.config.localLlmFallback === false) {
2487
+ throw new Error("correction classify: local LLM disabled and fallback disabled");
2488
+ }
2489
+ throwIfAborted(abortSignal, "correction classify aborted");
2490
+ const fallbackAttempt = startAttempt(abortSignal, timeoutMs);
2491
+ try {
2492
+ const fallbackOptions = {
2493
+ temperature: 0.2,
2494
+ timeoutMs,
2495
+ signal: fallbackAttempt.signal,
2496
+ ...gatewayTaskChainOptions(deps.config)
2497
+ };
2498
+ const fallback = deps.fallbackChat ? await deps.fallbackChat(messages, fallbackOptions) : await new FallbackLlmClient(
2499
+ deps.config.gatewayConfig,
2500
+ fallbackLlmRuntimeContextFromConfig(deps.config)
2501
+ ).chatCompletion(messages, fallbackOptions);
2502
+ if (abortSignal?.aborted) throw abortError("correction classify aborted");
2503
+ return fallback?.content ?? null;
2504
+ } catch (err) {
2505
+ if (abortSignal?.aborted) {
2506
+ throw isAbortError(err) ? err : abortError("correction classify aborted");
2507
+ }
2508
+ if (isAbortError(err)) return null;
2509
+ throw err;
2510
+ } finally {
2511
+ fallbackAttempt.dispose();
2512
+ }
2513
+ }
2514
+ function classifyTimeoutMs(config) {
2515
+ const configured = config.correctionClassifyTimeoutMs;
2516
+ if (typeof configured === "number" && Number.isInteger(configured) && configured >= 1 && configured <= MAX_CORRECTION_CLASSIFY_TIMEOUT_MS) {
2517
+ return configured;
2518
+ }
2519
+ return DEFAULT_CORRECTION_CLASSIFY_TIMEOUT_MS;
2520
+ }
2521
+ function startAttempt(caller, timeoutMs) {
2522
+ const controller = new AbortController();
2523
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
2524
+ const onCaller = () => controller.abort();
2525
+ if (caller?.aborted) controller.abort();
2526
+ else caller?.addEventListener("abort", onCaller, { once: true });
2527
+ let disposed = false;
2528
+ const dispose = () => {
2529
+ if (disposed) return;
2530
+ disposed = true;
2531
+ clearTimeout(timer);
2532
+ caller?.removeEventListener("abort", onCaller);
2533
+ };
2534
+ controller.signal.addEventListener("abort", dispose, { once: true });
2535
+ return { signal: controller.signal, dispose };
2536
+ }
2537
+
2538
+ // src/correction/correction-access-wiring.ts
2373
2539
  function createCorrectionService(wiring) {
2374
2540
  const cfg = wiring.orchestrator.config;
2375
2541
  const correctionEnabled = isCorrectionFeatureEnabled(cfg);
@@ -2394,8 +2560,9 @@ function makePlannerDeps(wiring, opts) {
2394
2560
  return {
2395
2561
  searchCorpus: async ({ text, namespaces, limit }) => searchMemories(wiring, text, namespaces, limit),
2396
2562
  resolveTargets: async ({ targetIds, namespaces }) => resolveTargetMemories(wiring, targetIds, namespaces),
2563
+ inspectMemory: async ({ memoryId, namespaces }) => inspectCorrectionMemory(wiring, memoryId, namespaces),
2397
2564
  expandNeighbors: async ({ seedIds, namespaces, limit }) => expandEntityNeighbors(wiring, seedIds, namespaces, limit),
2398
- classifyAndDraft: async ({ text, candidates }) => classifyAndDraft(wiring, text, candidates),
2565
+ classifyAndDraft: async ({ text, candidates, abortSignal }) => classifyAndDraft(wiring, text, candidates, abortSignal),
2399
2566
  renderDiff: async ({ candidates, actions }) => renderCorrectionDiff(wiring, candidates, actions),
2400
2567
  storageDir: async (namespace) => (await wiring.orchestrator.getStorage(namespace)).dir,
2401
2568
  maxAffected: opts.maxAffected,
@@ -2568,18 +2735,42 @@ async function expandEntityNeighbors(wiring, seedIds, namespaces, limit) {
2568
2735
  }
2569
2736
  return out;
2570
2737
  }
2571
- async function classifyAndDraft(wiring, text, candidates) {
2738
+ async function classifyAndDraft(wiring, text, candidates, abortSignal) {
2572
2739
  try {
2573
- if (!wiring.llmComplete) {
2574
- return fallbackClassification(candidates, "no LLM client available");
2575
- }
2740
+ throwIfAborted(abortSignal, "correction classify aborted");
2576
2741
  const user = buildClassifyPrompt(text, candidates);
2577
- const raw = await wiring.llmComplete({ system: CLASSIFY_SYSTEM_PROMPT, user });
2742
+ const raw = wiring.llmComplete ? await wiring.llmComplete({ system: CLASSIFY_SYSTEM_PROMPT, user, abortSignal }) : await completeCorrectionClassify(
2743
+ [
2744
+ { role: "system", content: CLASSIFY_SYSTEM_PROMPT },
2745
+ { role: "user", content: user }
2746
+ ],
2747
+ { config: wiring.orchestrator.config, localLlm: wiring.orchestrator.localLlm },
2748
+ abortSignal
2749
+ );
2750
+ if (raw == null) return fallbackClassification(candidates, "correction classify unavailable");
2751
+ throwIfAborted(abortSignal, "correction classify aborted");
2578
2752
  return parseClassifyResponse(raw, candidates);
2579
2753
  } catch (err) {
2754
+ if (isAbortError(err) || abortSignal?.aborted) {
2755
+ throw isAbortError(err) ? err : abortError("correction classify aborted");
2756
+ }
2580
2757
  return fallbackClassification(candidates, `LLM unavailable: ${errMsg2(err)}`);
2581
2758
  }
2582
2759
  }
2760
+ async function inspectCorrectionMemory(wiring, memoryId, namespaces) {
2761
+ for (const ns of namespaces) {
2762
+ const storage = await wiring.orchestrator.getStorage(ns);
2763
+ const memory = await storage.getMemoryByIdIncludingArchived(memoryId);
2764
+ if (!memory || memory.frontmatter.id !== memoryId) continue;
2765
+ const candidate = toCandidate(memory, ns, 1);
2766
+ if (isSupportPassportPrivateMemory(memory)) return { candidate, status: "ineligible" };
2767
+ if (typeof memory.frontmatter.archivedAt === "string" && memory.frontmatter.archivedAt.length > 0) {
2768
+ return { candidate, status: "archived" };
2769
+ }
2770
+ return { candidate, status: memory.frontmatter.status ?? "active" };
2771
+ }
2772
+ return null;
2773
+ }
2583
2774
  async function renderCorrectionDiff(_wiring, candidates, actions) {
2584
2775
  const lines = [];
2585
2776
  for (const action of actions) {
@@ -2596,7 +2787,7 @@ async function renderCorrectionDiff(_wiring, candidates, actions) {
2596
2787
  function describeAfterState(action) {
2597
2788
  switch (action.kind) {
2598
2789
  case "supersede":
2599
- return action.replacement?.content ?? "(superseded without replacement)";
2790
+ return action.replacement?.content ?? (action.winnerId ? `(superseded by ${action.winnerId}; recoverable)` : "(superseded without replacement)");
2600
2791
  case "edit":
2601
2792
  return action.patch;
2602
2793
  case "retract":
@@ -2912,7 +3103,8 @@ function toExecutorMemory(m) {
2912
3103
  ...fm.entityRef ? { entityRef: fm.entityRef } : {},
2913
3104
  ...supersessionKeys.length > 0 ? { supersessionKeys } : {},
2914
3105
  ...supersessionKeys.length > 0 ? { supersessionKey: supersessionKeys[0] } : {},
2915
- ...typeof fm.contentHash === "string" && fm.contentHash.length > 0 ? { contentHash: fm.contentHash } : {}
3106
+ ...typeof fm.contentHash === "string" && fm.contentHash.length > 0 ? { contentHash: fm.contentHash } : {},
3107
+ status: fm.status ?? "active"
2916
3108
  };
2917
3109
  }
2918
3110
  function isCorrectionFeatureEnabled(config) {
@@ -2968,6 +3160,7 @@ Given a correction statement and candidate memories, respond with a JSON object:
2968
3160
 
2969
3161
  Action shapes:
2970
3162
  - {"kind":"supersede","loserId":"<id>","replacement":{"content":"<new fact>"}}
3163
+ - {"kind":"supersede","loserId":"<id>","winnerId":"<existing id>"}
2971
3164
  - {"kind":"edit","memoryId":"<id>","patch":"<new full content>"}
2972
3165
  - {"kind":"retract","memoryId":"<id>"}
2973
3166
  - {"kind":"rescope","memoryId":"<id>","toNamespace":"<ns>"}
@@ -6992,21 +7185,6 @@ var SessionContextCoordinator = class {
6992
7185
  canWriteNamespace: async (req) => {
6993
7186
  const principal = req.principal || resolvePrincipal(req.sessionKey, this.deps.config);
6994
7187
  return canWriteNamespace(principal, req.namespace, this.deps.config);
6995
- },
6996
- llmComplete: async ({ system, user }) => {
6997
- const llmResult = await this.deps.localLlm.chatCompletion(
6998
- [
6999
- { role: "system", content: system },
7000
- { role: "user", content: user }
7001
- ],
7002
- { operation: "correction-classify", priority: "background" }
7003
- );
7004
- if (!llmResult) {
7005
- throw new Error(
7006
- "passive correction classify+draft: local LLM unavailable (disabled or in cooldown)"
7007
- );
7008
- }
7009
- return llmResult.content;
7010
7188
  }
7011
7189
  });
7012
7190
  return this.deps._passiveCorrectionService;
@@ -16346,24 +16524,6 @@ var EngramAccessService = class extends SupportPassportAccessServiceBase {
16346
16524
  } catch {
16347
16525
  return Promise.resolve(false);
16348
16526
  }
16349
- },
16350
- // Wire the orchestrator's extraction LLM so classify+draft actually
16351
- // drafts actions instead of always hitting the deterministic fallback
16352
- // (review thread PG5). The planner's classifyAndDraft already falls back
16353
- // on any LLM outage, so returning null (LLM disabled/cooldown) or a
16354
- // thrown error both degrade safely to the deterministic path (rule 13).
16355
- llmComplete: async ({ system, user }) => {
16356
- const result = await this.orchestrator.localLlm.chatCompletion(
16357
- [
16358
- { role: "system", content: system },
16359
- { role: "user", content: user }
16360
- ],
16361
- { operation: "correction-classify", priority: "background" }
16362
- );
16363
- if (!result) {
16364
- throw new Error("correction classify+draft: local LLM unavailable (disabled or in cooldown)");
16365
- }
16366
- return result.content;
16367
16527
  }
16368
16528
  });
16369
16529
  this._correctionService = service;
@@ -16385,11 +16545,20 @@ var EngramAccessService = class extends SupportPassportAccessServiceBase {
16385
16545
  }
16386
16546
  }
16387
16547
  async correctionPlan(request, opts) {
16548
+ let next = request;
16388
16549
  if (request.targetIds?.some((id) => isHandleToken(id))) {
16389
- const targetIds = request.targetIds.map((id) => this.resolveMemoryIdOrHandleInput(id, request.sessionKey));
16390
- return this.correctionService().plan({ ...request, targetIds }, opts);
16550
+ next = {
16551
+ ...next,
16552
+ targetIds: request.targetIds.map((id) => this.resolveMemoryIdOrHandleInput(id, request.sessionKey))
16553
+ };
16554
+ }
16555
+ if (request.duplicateOf && isHandleToken(request.duplicateOf)) {
16556
+ next = {
16557
+ ...next,
16558
+ duplicateOf: this.resolveMemoryIdOrHandleInput(request.duplicateOf, request.sessionKey)
16559
+ };
16391
16560
  }
16392
- return this.correctionService().plan(request, opts);
16561
+ return this.correctionService().plan(next, opts);
16393
16562
  }
16394
16563
  async correctionApply(planId, opts) {
16395
16564
  return this.correctionService().apply(planId, opts);
@@ -18565,4 +18734,4 @@ export {
18565
18734
  EngramAccessService,
18566
18735
  AccessAdminOpsSurface
18567
18736
  };
18568
- //# sourceMappingURL=chunk-7OOW72QA.js.map
18737
+ //# sourceMappingURL=chunk-GVUW5XK5.js.map