@remnic/core 9.65.1 → 9.65.2

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 (536) hide show
  1. package/dist/access-admin-ops-surface.d.ts +11 -11
  2. package/dist/access-admin-ops-surface.js +35 -34
  3. package/dist/access-authorization-probe.d.ts +12 -13
  4. package/dist/access-authorization-probe.js +36 -35
  5. package/dist/access-boundary.d.ts +12 -156
  6. package/dist/access-boundary.js +35 -34
  7. package/dist/access-cli.js +107 -104
  8. package/dist/access-cli.js.map +1 -1
  9. package/dist/access-coding-context-resolution.d.ts +1 -1
  10. package/dist/access-extraction-force-flush.d.ts +11 -11
  11. package/dist/access-extraction-force-flush.js +35 -34
  12. package/dist/access-health-types.d.ts +1 -1
  13. package/dist/access-http-lcm-compaction.d.ts +11 -11
  14. package/dist/access-http-lifecycle-flush.d.ts +12 -13
  15. package/dist/access-http-offline-stream.d.ts +11 -11
  16. package/dist/access-http-query.d.ts +2 -2
  17. package/dist/access-http-query.js +37 -36
  18. package/dist/access-http.d.ts +12 -12
  19. package/dist/access-http.js +54 -53
  20. package/dist/access-identity-continuity-surface.d.ts +9 -9
  21. package/dist/access-identity-continuity-surface.js +35 -34
  22. package/dist/access-lcm-surface.d.ts +11 -11
  23. package/dist/access-lcm-surface.js +35 -34
  24. package/dist/access-mcp-admin-tools.js +1 -1
  25. package/dist/access-mcp-output-schemas.js +1 -1
  26. package/dist/access-mcp.d.ts +11 -11
  27. package/dist/access-mcp.js +47 -44
  28. package/dist/access-memory-search-fanout.d.ts +2 -2
  29. package/dist/{access-namespace-preflight-BKUnKsBv.d.ts → access-namespace-preflight-Dhvcl-T0.d.ts} +1 -1
  30. package/dist/access-namespace-preflight.d.ts +3 -3
  31. package/dist/access-namespace-preflight.js +35 -34
  32. package/dist/access-observe-write-surface.d.ts +11 -11
  33. package/dist/access-observe-write-surface.js +35 -34
  34. package/dist/access-offline-manifest.d.ts +9 -9
  35. package/dist/access-offline-manifest.js +5 -5
  36. package/dist/access-operations-batch.js +38 -37
  37. package/dist/access-operations.d.ts +18 -19
  38. package/dist/access-operations.js +41 -40
  39. package/dist/access-recall-concurrency.d.ts +11 -11
  40. package/dist/access-recall-concurrency.js +35 -34
  41. package/dist/access-recall-response.d.ts +11 -11
  42. package/dist/access-recall-response.js +35 -34
  43. package/dist/access-recall-surface.d.ts +11 -11
  44. package/dist/access-recall-surface.js +35 -34
  45. package/dist/access-schema.d.ts +118 -118
  46. package/dist/access-schema.js +3 -3
  47. package/dist/{access-service-B1Lbb-nQ.d.ts → access-service-Bke1alZO.d.ts} +478 -74
  48. package/dist/access-service-helpers.d.ts +11 -11
  49. package/dist/access-service.d.ts +11 -11
  50. package/dist/access-service.js +35 -34
  51. package/dist/access-surface-catalog.d.ts +12 -13
  52. package/dist/access-surface-catalog.js +39 -36
  53. package/dist/access-surface-catalog.js.map +1 -1
  54. package/dist/access-wearables-meetings-surface.d.ts +3 -3
  55. package/dist/action-confidence.d.ts +1 -1
  56. package/dist/active-memory-bridge.d.ts +1 -1
  57. package/dist/active-recall.d.ts +1 -1
  58. package/dist/active-recall.js +6 -1
  59. package/dist/active-recall.js.map +1 -1
  60. package/dist/adapters/index.js +4 -4
  61. package/dist/adapters/registry.js +2 -2
  62. package/dist/ambient-provenance.d.ts +1 -1
  63. package/dist/artifact-search.d.ts +1 -1
  64. package/dist/{auto-sync-5L7EUZ27.js → auto-sync-H64ZCNIR.js} +13 -5
  65. package/dist/{auto-sync-5L7EUZ27.js.map → auto-sync-H64ZCNIR.js.map} +1 -1
  66. package/dist/behavior-learner.d.ts +1 -1
  67. package/dist/behavior-signals.d.ts +1 -1
  68. package/dist/bootstrap.d.ts +9 -9
  69. package/dist/briefing-window.d.ts +2 -2
  70. package/dist/briefing.d.ts +2 -2
  71. package/dist/briefing.js +16 -15
  72. package/dist/buffer-surprise-report.d.ts +1 -1
  73. package/dist/buffer-turn-helpers.d.ts +1 -1
  74. package/dist/buffer.d.ts +2 -2
  75. package/dist/buffer.js +4 -4
  76. package/dist/bulk-import/index.d.ts +3 -3
  77. package/dist/calibration.d.ts +1 -1
  78. package/dist/calibration.js +1 -1
  79. package/dist/capabilities.d.ts +1 -1
  80. package/dist/{capsule-crypto-7FJQINUR.js → capsule-crypto-YO5QJ6L3.js} +2 -2
  81. package/dist/{catalog-DjVhJoRM.d.ts → catalog-DV6qnbr7.d.ts} +1 -1
  82. package/dist/causal-behavior.d.ts +1 -1
  83. package/dist/causal-consolidation.d.ts +1 -1
  84. package/dist/causal-consolidation.js +17 -16
  85. package/dist/causal-consolidation.js.map +1 -1
  86. package/dist/causal-trajectory-graph.d.ts +1 -1
  87. package/dist/{chunk-LYIZXQYY.js → chunk-2E36UXVW.js} +2 -2
  88. package/dist/{chunk-7QFBLYFP.js → chunk-2XDWWPTN.js} +3 -3
  89. package/dist/{chunk-CFRBTATE.js → chunk-2YI72KM3.js} +3 -3
  90. package/dist/{chunk-3YTTAGPB.js → chunk-3DVBKTSO.js} +2 -2
  91. package/dist/{chunk-VPGRXEAB.js → chunk-3I7ASZN3.js} +2 -2
  92. package/dist/{chunk-EIR5VLIH.js → chunk-4K7IW3F7.js} +2 -2
  93. package/dist/chunk-4K7IW3F7.js.map +1 -0
  94. package/dist/{chunk-WTOE7CW4.js → chunk-4KYOLI6M.js} +13 -13
  95. package/dist/chunk-573TEZCD.js +88 -0
  96. package/dist/chunk-573TEZCD.js.map +1 -0
  97. package/dist/{chunk-ESCQ6LY7.js → chunk-5NM4OH4P.js} +3 -3
  98. package/dist/{chunk-Y23B2QXP.js → chunk-5YQ63T4B.js} +2 -2
  99. package/dist/{chunk-PMVPCZJZ.js → chunk-6433HV72.js} +2 -2
  100. package/dist/{chunk-4NZHHGVL.js → chunk-7BDZTALN.js} +4 -1
  101. package/dist/chunk-7BDZTALN.js.map +1 -0
  102. package/dist/{chunk-NS5ETDYD.js → chunk-7BEPVIH3.js} +3 -3
  103. package/dist/{chunk-JG22O53B.js → chunk-7CBKAQIG.js} +2 -1
  104. package/dist/chunk-7CBKAQIG.js.map +1 -0
  105. package/dist/{chunk-W6TSGWYS.js → chunk-7YQ4IYS2.js} +2 -2
  106. package/dist/chunk-AAXJNINV.js +55 -0
  107. package/dist/chunk-AAXJNINV.js.map +1 -0
  108. package/dist/{chunk-YQ3CBLL4.js → chunk-BWLRUMOG.js} +78 -8
  109. package/dist/chunk-BWLRUMOG.js.map +1 -0
  110. package/dist/{chunk-2NLLXCJG.js → chunk-BXLOS5AJ.js} +2 -2
  111. package/dist/{chunk-CEH2AFXG.js → chunk-C24UZSFW.js} +6 -6
  112. package/dist/{chunk-ZPN7W3OP.js → chunk-CDUUDBWJ.js} +3 -3
  113. package/dist/{chunk-5UYSCYR7.js → chunk-CT56C22C.js} +4 -4
  114. package/dist/{chunk-HJQZQUPC.js → chunk-DJZWNKFO.js} +5 -5
  115. package/dist/{chunk-X7Y7WX73.js → chunk-DQEMWVMT.js} +1 -1
  116. package/dist/{chunk-CCTVAVTT.js → chunk-DZUJ46DO.js} +2 -2
  117. package/dist/{chunk-N6TRHP72.js → chunk-EILZG5VC.js} +2 -2
  118. package/dist/{chunk-GXWDWOWP.js → chunk-GDFVPUJ5.js} +2 -2
  119. package/dist/{chunk-7PWWGYGO.js → chunk-GNCCUR6K.js} +2 -2
  120. package/dist/{chunk-KPBLJCCV.js → chunk-IID2CMUU.js} +2 -2
  121. package/dist/{chunk-DEFI2QBT.js → chunk-J275IYMG.js} +25 -22
  122. package/dist/chunk-J275IYMG.js.map +1 -0
  123. package/dist/{chunk-UYCIS6V5.js → chunk-JCWY73FK.js} +2 -2
  124. package/dist/{chunk-SYJ6EKKE.js → chunk-JYYBA7TF.js} +2 -2
  125. package/dist/{chunk-T42L3S6A.js → chunk-LBWQ65SX.js} +4 -4
  126. package/dist/{chunk-MSTNSVXI.js → chunk-LDBFXD4F.js} +2 -1
  127. package/dist/chunk-LDBFXD4F.js.map +1 -0
  128. package/dist/{chunk-LWVO2QZV.js → chunk-LGO6A7GJ.js} +50 -50
  129. package/dist/{chunk-CEQF6L5K.js → chunk-LUNJ3WFO.js} +9 -7
  130. package/dist/chunk-LUNJ3WFO.js.map +1 -0
  131. package/dist/{chunk-2572MRP2.js → chunk-LZH5FR2W.js} +2 -2
  132. package/dist/{chunk-256FBCVX.js → chunk-M4AHBM72.js} +7 -7
  133. package/dist/{chunk-YEQEGSJA.js → chunk-MN4KB2A4.js} +3 -3
  134. package/dist/{chunk-AGKIG3YA.js → chunk-NKKD4ZAU.js} +2 -2
  135. package/dist/{chunk-3TMYV3LP.js → chunk-NTWN6HB2.js} +5 -5
  136. package/dist/{chunk-63FHSH7E.js → chunk-OCZIYAE5.js} +4 -4
  137. package/dist/{chunk-I2HTKOOP.js → chunk-ODZG724P.js} +2 -2
  138. package/dist/{chunk-HQSBYI5X.js → chunk-OTHZWLUD.js} +2 -2
  139. package/dist/{chunk-4W6INNXO.js → chunk-PE255F4T.js} +2 -2
  140. package/dist/{chunk-6L27N6YI.js → chunk-QOS5LBZN.js} +2 -2
  141. package/dist/{chunk-G72IPMR7.js → chunk-R4OCGPSH.js} +2 -2
  142. package/dist/{chunk-MIBKEW7A.js → chunk-R7JAM2XF.js} +3 -3
  143. package/dist/{chunk-LCU5R6TQ.js → chunk-RAIUTAZZ.js} +22 -3
  144. package/dist/chunk-RAIUTAZZ.js.map +1 -0
  145. package/dist/chunk-RIAM7DND.js +167 -0
  146. package/dist/chunk-RIAM7DND.js.map +1 -0
  147. package/dist/{chunk-JBPKEARU.js → chunk-RKNJBZ55.js} +4 -4
  148. package/dist/{chunk-HUNSEO5U.js → chunk-S2DPMJXH.js} +2 -2
  149. package/dist/{chunk-3PXVYJMC.js → chunk-SB7D4BT7.js} +536 -114
  150. package/dist/chunk-SB7D4BT7.js.map +1 -0
  151. package/dist/{chunk-JFJ3MHGV.js → chunk-SBDCZ2AX.js} +1 -1
  152. package/dist/chunk-SBDCZ2AX.js.map +1 -0
  153. package/dist/{chunk-HQSPXTQO.js → chunk-SIHSCCUQ.js} +1 -1
  154. package/dist/{chunk-R3AAOKR2.js → chunk-SPUJNJJC.js} +2 -2
  155. package/dist/{chunk-IAY7YBXS.js → chunk-SQI57UCJ.js} +2 -2
  156. package/dist/{chunk-CTQRPANJ.js → chunk-SVSRPG6M.js} +2 -2
  157. package/dist/{chunk-56BSXSHC.js → chunk-TBOJ76ER.js} +14 -1
  158. package/dist/{chunk-56BSXSHC.js.map → chunk-TBOJ76ER.js.map} +1 -1
  159. package/dist/{chunk-Z54TXZ2F.js → chunk-TF77C7SV.js} +14 -7
  160. package/dist/chunk-TF77C7SV.js.map +1 -0
  161. package/dist/{chunk-S2VBSTTA.js → chunk-THG4GYIE.js} +2 -2
  162. package/dist/{chunk-IXRC7EQG.js → chunk-TR7DGXGI.js} +2 -2
  163. package/dist/{chunk-GEULB2VI.js → chunk-TZNQUNKL.js} +7 -1
  164. package/dist/chunk-TZNQUNKL.js.map +1 -0
  165. package/dist/{chunk-BC4QD3FM.js → chunk-UIN2BWDD.js} +2 -2
  166. package/dist/{chunk-JTSVMJHV.js → chunk-UXO5IMBK.js} +3 -3
  167. package/dist/{chunk-DBXZZIDU.js → chunk-V3MXUL3D.js} +138 -73
  168. package/dist/chunk-V3MXUL3D.js.map +1 -0
  169. package/dist/{chunk-KQAFEZQX.js → chunk-VDX2J7OX.js} +2 -2
  170. package/dist/{chunk-MUJ4QFUQ.js → chunk-W4BMEGQA.js} +4 -4
  171. package/dist/{chunk-5HK3CJAR.js → chunk-W675UJCZ.js} +2 -2
  172. package/dist/{chunk-MDVBCPOS.js → chunk-XCTXS7VY.js} +2 -2
  173. package/dist/{chunk-53ENM6F6.js → chunk-XRYZRW54.js} +2 -2
  174. package/dist/{chunk-VJ6ECBIP.js → chunk-Y7DK7HHJ.js} +2 -2
  175. package/dist/{chunk-3MADV4YC.js → chunk-YB42WZCY.js} +2 -2
  176. package/dist/{chunk-X5SDZMO7.js → chunk-YHCBJULX.js} +2 -2
  177. package/dist/{chunk-3RHFGGI5.js → chunk-YLDXWCZP.js} +20 -5
  178. package/dist/chunk-YLDXWCZP.js.map +1 -0
  179. package/dist/{chunk-6JJT5AKI.js → chunk-Z7PBQPJ4.js} +2 -2
  180. package/dist/{chunk-ALCJRQ72.js → chunk-ZO6AXLEH.js} +2 -2
  181. package/dist/{chunk-VZVP2W4O.js → chunk-ZQHI2BZB.js} +2 -2
  182. package/dist/{chunk-CUS6S7PN.js → chunk-ZWXJBFZU.js} +9 -9
  183. package/dist/chunk-ZWXJBFZU.js.map +1 -0
  184. package/dist/{cli-Pulnz-qm.d.ts → cli-cShQ13XG.d.ts} +5 -5
  185. package/dist/cli.d.ts +13 -13
  186. package/dist/cli.js +77 -75
  187. package/dist/coding/pre-action-gate.d.ts +1 -1
  188. package/dist/compounding/engine.d.ts +2 -2
  189. package/dist/compounding/engine.js +17 -16
  190. package/dist/compounding/preference-consolidator.d.ts +1 -1
  191. package/dist/compression-optimizer.d.ts +1 -1
  192. package/dist/config.d.ts +1 -1
  193. package/dist/config.js +6 -1
  194. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  195. package/dist/connectors/codex-materialize-runner.js +16 -15
  196. package/dist/connectors/codex-materialize.d.ts +1 -1
  197. package/dist/connectors/index.d.ts +1 -1
  198. package/dist/connectors/index.js +16 -15
  199. package/dist/consolidation-provenance-check.d.ts +2 -2
  200. package/dist/consolidation-undo.d.ts +2 -2
  201. package/dist/contradiction/index.d.ts +2 -2
  202. package/dist/contradiction/index.js +10 -2
  203. package/dist/converge-config.d.ts +1 -1
  204. package/dist/convergence-refresh.d.ts +2 -2
  205. package/dist/convergence-refresh.js +18 -17
  206. package/dist/conversation-index/backend.d.ts +1 -1
  207. package/dist/conversation-index/chunker.d.ts +1 -1
  208. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  209. package/dist/conversation-index/indexer.d.ts +1 -1
  210. package/dist/conversation-index/search.d.ts +1 -1
  211. package/dist/corpus-watermark.d.ts +1 -1
  212. package/dist/corpus-watermark.js +18 -17
  213. package/dist/cross-lingual-recall.d.ts +1 -1
  214. package/dist/day-summary.d.ts +1 -1
  215. package/dist/delinearize.d.ts +1 -1
  216. package/dist/dependency-propagation-config.d.ts +1 -1
  217. package/dist/{dependency-propagation-delivery-Co17gxYb.d.ts → dependency-propagation-delivery-CsGg-VwS.d.ts} +1 -1
  218. package/dist/direct-answer-wiring.d.ts +1 -1
  219. package/dist/direct-answer.d.ts +1 -1
  220. package/dist/embedding-fallback.d.ts +1 -1
  221. package/dist/enrichment/index.d.ts +1 -1
  222. package/dist/entity-origin-fields.d.ts +1 -1
  223. package/dist/entity-retrieval.d.ts +2 -2
  224. package/dist/entity-retrieval.js +16 -15
  225. package/dist/entity-schema.d.ts +1 -1
  226. package/dist/episodic-context.d.ts +1 -1
  227. package/dist/explicit-capture.d.ts +9 -9
  228. package/dist/explicit-capture.js +7 -6
  229. package/dist/external-wiki-access.d.ts +12 -13
  230. package/dist/external-wiki-access.js +36 -35
  231. package/dist/external-wiki-collection-registration.d.ts +1 -1
  232. package/dist/external-wiki-collection.d.ts +1 -1
  233. package/dist/external-wiki-mcp-tools.d.ts +11 -11
  234. package/dist/extraction-error-classification.d.ts +1 -1
  235. package/dist/extraction-faithfulness.d.ts +1 -1
  236. package/dist/extraction-judge-telemetry.d.ts +1 -1
  237. package/dist/extraction-judge-training.d.ts +1 -1
  238. package/dist/extraction-judge.d.ts +1 -1
  239. package/dist/extraction-judge.js +2 -2
  240. package/dist/extraction-liveness.d.ts +1 -1
  241. package/dist/extraction-normalization.d.ts +1 -1
  242. package/dist/extraction-normalization.js +2 -2
  243. package/dist/extraction-prompt.d.ts +2 -2
  244. package/dist/extraction-prompt.js +1 -1
  245. package/dist/extraction-source-grounding-rules.d.ts +1 -1
  246. package/dist/extraction-source-grounding.d.ts +1 -1
  247. package/dist/extraction.d.ts +1 -1
  248. package/dist/extraction.js +22 -21
  249. package/dist/fallback-llm.d.ts +1 -1
  250. package/dist/graph-dashboard-diff.d.ts +1 -1
  251. package/dist/graph-dashboard-key.d.ts +1 -1
  252. package/dist/graph-dashboard-parser.d.ts +1 -1
  253. package/dist/graph-edge-reinforcement.d.ts +1 -1
  254. package/dist/graph-path-reconstruction.d.ts +1 -1
  255. package/dist/graph-path-scoring.d.ts +1 -1
  256. package/dist/graph-snapshot.d.ts +1 -1
  257. package/dist/graph.d.ts +1 -1
  258. package/dist/harmonic-retrieval.js +1 -1
  259. package/dist/importance.d.ts +1 -1
  260. package/dist/importers/index.d.ts +1 -1
  261. package/dist/in-flight-reads.d.ts +1 -1
  262. package/dist/index.d.ts +716 -699
  263. package/dist/index.js +173 -125
  264. package/dist/intent.d.ts +1 -1
  265. package/dist/lcm/engine.d.ts +1 -1
  266. package/dist/lcm/engine.js +3 -3
  267. package/dist/lcm/index.d.ts +1 -1
  268. package/dist/lcm/index.js +6 -6
  269. package/dist/lcm/tools.d.ts +1 -1
  270. package/dist/lifecycle.d.ts +1 -1
  271. package/dist/live-connectors-runner.d.ts +1 -1
  272. package/dist/local-llm.d.ts +1 -1
  273. package/dist/local-model-endpoint.d.ts +1 -1
  274. package/dist/maintenance/memory-governance.d.ts +1 -1
  275. package/dist/maintenance/memory-governance.js +16 -15
  276. package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
  277. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +16 -15
  278. package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
  279. package/dist/maintenance/rebuild-memory-projection.js +17 -16
  280. package/dist/{maintenance-DiSLtVN7.d.ts → maintenance-jhMpeGne.d.ts} +3 -3
  281. package/dist/mcp-memory-inspector-app.d.ts +11 -11
  282. package/dist/mcp-read-only-tools.js +1 -1
  283. package/dist/memory-action-policy.d.ts +1 -1
  284. package/dist/memory-cache.d.ts +1 -1
  285. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  286. package/dist/memory-projection-store.d.ts +1 -1
  287. package/dist/memory-provenance.d.ts +1 -1
  288. package/dist/memory-snapshot.d.ts +1 -1
  289. package/dist/memory-subject-cli.d.ts +177 -0
  290. package/dist/memory-subject-cli.js +16 -0
  291. package/dist/memory-subject.d.ts +128 -0
  292. package/dist/memory-subject.js +44 -0
  293. package/dist/memory-subject.js.map +1 -0
  294. package/dist/memory-worth-outcomes.d.ts +5 -4
  295. package/dist/memory-worth-outcomes.js +1 -1
  296. package/dist/models-json.d.ts +1 -1
  297. package/dist/namespaces/migrate.d.ts +3 -3
  298. package/dist/namespaces/migrate.js +17 -16
  299. package/dist/namespaces/principal.d.ts +1 -1
  300. package/dist/namespaces/search.d.ts +1 -1
  301. package/dist/namespaces/search.js +6 -6
  302. package/dist/namespaces/storage.d.ts +3 -3
  303. package/dist/namespaces/storage.js +16 -15
  304. package/dist/native-knowledge.d.ts +1 -1
  305. package/dist/offline-sync-impression-drain.d.ts +1 -1
  306. package/dist/operator-doctor-corpus.d.ts +1 -1
  307. package/dist/operator-doctor-corpus.js +19 -18
  308. package/dist/operator-doctor-replica.d.ts +1 -1
  309. package/dist/operator-toolkit.d.ts +3 -3
  310. package/dist/operator-toolkit.js +26 -24
  311. package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
  312. package/dist/orchestration/maintenance.d.ts +4 -4
  313. package/dist/orchestration/maintenance.js +22 -21
  314. package/dist/{orchestrator-DzCaxNS4.d.ts → orchestrator-DyGUC7re.d.ts} +8 -8
  315. package/dist/orchestrator.d.ts +9 -9
  316. package/dist/orchestrator.js +108 -105
  317. package/dist/patterns-cli.d.ts +1 -1
  318. package/dist/{pipeline-HJ8DKbFl.d.ts → pipeline-C25Oxtp1.d.ts} +1 -1
  319. package/dist/policy-runtime.d.ts +1 -1
  320. package/dist/proactive-contention.d.ts +1 -1
  321. package/dist/provenance.d.ts +1 -1
  322. package/dist/{public-http-DwXauTX3.d.ts → public-http-CMe7NQzj.d.ts} +1 -1
  323. package/dist/{qmd-BzxluoLt.d.ts → qmd-DkDVCbgF.d.ts} +1 -1
  324. package/dist/qmd-preflight.d.ts +2 -2
  325. package/dist/qmd-recall-cache.d.ts +1 -1
  326. package/dist/qmd.d.ts +2 -2
  327. package/dist/qmd.js +4 -4
  328. package/dist/recall-concurrency-config.d.ts +1 -1
  329. package/dist/recall-disclosure-escalation.d.ts +1 -1
  330. package/dist/recall-explain-renderer.d.ts +1 -1
  331. package/dist/recall-explain-renderer.js +3 -3
  332. package/dist/recall-memory-map.d.ts +1 -1
  333. package/dist/recall-planner-llm.d.ts +1 -1
  334. package/dist/recall-state.d.ts +1 -1
  335. package/dist/recall-tag-filter.d.ts +1 -1
  336. package/dist/recall-timings.d.ts +1 -1
  337. package/dist/recall-xray-cli.d.ts +1 -1
  338. package/dist/recall-xray-cli.js +4 -4
  339. package/dist/recall-xray-renderer.d.ts +1 -1
  340. package/dist/recall-xray-renderer.js +3 -3
  341. package/dist/recall-xray.d.ts +1 -1
  342. package/dist/recall-xray.js +2 -2
  343. package/dist/reconcile/cursor.d.ts +1 -1
  344. package/dist/reconcile/manifest.d.ts +1 -1
  345. package/dist/reconcile/manifest.js +3 -3
  346. package/dist/reconcile/plan.d.ts +1 -1
  347. package/dist/replay/normalizers/chatgpt.d.ts +1 -1
  348. package/dist/replay/normalizers/claude.d.ts +1 -1
  349. package/dist/replay/normalizers/openclaw.d.ts +1 -1
  350. package/dist/replay/normalizers/shared.d.ts +1 -1
  351. package/dist/replay/runner.d.ts +1 -1
  352. package/dist/replay/types.d.ts +1 -1
  353. package/dist/replica-divergence.d.ts +1 -1
  354. package/dist/replica-peers-config.d.ts +1 -1
  355. package/dist/{resolution-DKMBPXHI.js → resolution-MFY72STR.js} +11 -3
  356. package/dist/resolution-MFY72STR.js.map +1 -0
  357. package/dist/resolve-auth-token.d.ts +1 -1
  358. package/dist/resume-bundles.js +7 -2
  359. package/dist/retrieval-agents.d.ts +2 -2
  360. package/dist/retrieval-tiers.d.ts +1 -1
  361. package/dist/routing/engine.d.ts +1 -1
  362. package/dist/routing/store.d.ts +1 -1
  363. package/dist/salvage-envelope.d.ts +1 -1
  364. package/dist/salvage-envelope.js +10 -2
  365. package/dist/schemas.d.ts +104 -90
  366. package/dist/schemas.js +1 -1
  367. package/dist/{scope-profiles-CEMZz0t5.d.ts → scope-profiles-B9xMoFO-.d.ts} +1 -1
  368. package/dist/search/embed-helper.d.ts +1 -1
  369. package/dist/search/factory.d.ts +1 -1
  370. package/dist/search/factory.js +5 -5
  371. package/dist/search/index.d.ts +1 -1
  372. package/dist/search/index.js +9 -9
  373. package/dist/search/lancedb-backend.d.ts +1 -1
  374. package/dist/search/meilisearch-backend.d.ts +1 -1
  375. package/dist/search/noop-backend.d.ts +1 -1
  376. package/dist/search/orama-backend.d.ts +1 -1
  377. package/dist/search/port.d.ts +1 -1
  378. package/dist/search/remote-backend.d.ts +1 -1
  379. package/dist/{semantic-consolidation-D9dYj6vu.d.ts → semantic-consolidation-C4uykW84.d.ts} +1 -1
  380. package/dist/semantic-consolidation.d.ts +2 -2
  381. package/dist/semantic-consolidation.js +17 -16
  382. package/dist/semantic-rule-promotion.js +16 -15
  383. package/dist/semantic-rule-verifier.d.ts +1 -1
  384. package/dist/semantic-rule-verifier.js +16 -15
  385. package/dist/{service-_qgST_0y.d.ts → service-DCZDZNcV.d.ts} +2 -2
  386. package/dist/session-observer-bands.d.ts +1 -1
  387. package/dist/session-observer-state.d.ts +1 -1
  388. package/dist/shared-context/manager.d.ts +11 -11
  389. package/dist/signal.d.ts +1 -1
  390. package/dist/source-agent-qualifier.d.ts +1 -1
  391. package/dist/source-agent-qualifier.js +18 -17
  392. package/dist/{storage-B9lbNTYE.d.ts → storage-CcKmEjL8.d.ts} +3 -2
  393. package/dist/storage.d.ts +2 -2
  394. package/dist/storage.js +18 -17
  395. package/dist/subject-config.d.ts +38 -0
  396. package/dist/subject-config.js +20 -0
  397. package/dist/subject-config.js.map +1 -0
  398. package/dist/summarizer.d.ts +1 -1
  399. package/dist/summary-snapshot.d.ts +1 -1
  400. package/dist/support-passport/index.d.ts +14 -14
  401. package/dist/support-passport/index.js +38 -37
  402. package/dist/temporal-supersession.d.ts +2 -2
  403. package/dist/temporal-timeline-recall.d.ts +1 -1
  404. package/dist/temporal-validity.d.ts +1 -1
  405. package/dist/threading.d.ts +1 -1
  406. package/dist/tier-migration.d.ts +2 -2
  407. package/dist/tier-routing.d.ts +1 -1
  408. package/dist/topics.d.ts +1 -1
  409. package/dist/transcript.d.ts +1 -1
  410. package/dist/transfer/backup.js +2 -2
  411. package/dist/transfer/capsule-export.js +2 -2
  412. package/dist/transfer/capsule-import.js +2 -2
  413. package/dist/transfer/types.d.ts +66 -66
  414. package/dist/trust-score-stage.d.ts +1 -1
  415. package/dist/trust-score.d.ts +1 -1
  416. package/dist/{types-BrEzuxPA.d.ts → types-Pi0lfaEt.d.ts} +38 -29
  417. package/dist/types.d.ts +1 -1
  418. package/dist/types.js +1 -1
  419. package/dist/utility-runtime.d.ts +1 -1
  420. package/dist/verified-recall.js +16 -15
  421. package/dist/who-knows-cli.d.ts +11 -11
  422. package/dist/who-knows-cli.js +17 -16
  423. package/dist/who-knows.d.ts +11 -11
  424. package/dist/who-knows.js +16 -15
  425. package/dist/write-envelope.d.ts +5 -2
  426. package/dist/write-envelope.js +10 -1
  427. package/package.json +2 -2
  428. package/scripts/build-with-heap.mjs +1 -1
  429. package/src/access-boundary.ts +2 -0
  430. package/src/access-mcp-admin-tools.ts +14 -0
  431. package/src/access-mcp-output-schemas.ts +6 -0
  432. package/src/access-mcp.ts +6 -6
  433. package/src/access-operations-batch.ts +8 -0
  434. package/src/access-service.ts +85 -0
  435. package/src/access-surface-catalog.ts +2 -0
  436. package/src/config.ts +10 -17
  437. package/src/extraction-prompt.ts +1 -0
  438. package/src/extraction.ts +4 -1
  439. package/src/index.ts +5 -6
  440. package/src/mcp-read-only-tools.ts +1 -0
  441. package/src/memory-subject-cli.ts +135 -0
  442. package/src/memory-subject.test.ts +48 -0
  443. package/src/memory-subject.ts +314 -0
  444. package/src/memory-worth-outcomes.test.ts +6 -2
  445. package/src/memory-worth-outcomes.ts +11 -7
  446. package/src/operator-toolkit.ts +1 -1
  447. package/src/orchestration/extraction-persist.ts +48 -48
  448. package/src/orchestration/recall-internal.ts +6 -5
  449. package/src/procedural/library-maintenance.test.ts +582 -0
  450. package/src/procedural/library-maintenance.ts +546 -0
  451. package/src/procedural/maintenance-config.ts +78 -0
  452. package/src/procedural/procedure-recall.ts +29 -1
  453. package/src/procedural/procedure-stats.ts +20 -0
  454. package/src/schemas.ts +7 -0
  455. package/src/spaces/index.ts +38 -2
  456. package/src/storage.ts +6 -2
  457. package/src/subject-config.ts +80 -0
  458. package/src/types.ts +26 -29
  459. package/src/write-envelope.test.ts +14 -0
  460. package/src/write-envelope.ts +24 -3
  461. package/dist/chunk-3PXVYJMC.js.map +0 -1
  462. package/dist/chunk-3RHFGGI5.js.map +0 -1
  463. package/dist/chunk-4NZHHGVL.js.map +0 -1
  464. package/dist/chunk-CEQF6L5K.js.map +0 -1
  465. package/dist/chunk-CUS6S7PN.js.map +0 -1
  466. package/dist/chunk-DBXZZIDU.js.map +0 -1
  467. package/dist/chunk-DEFI2QBT.js.map +0 -1
  468. package/dist/chunk-EIR5VLIH.js.map +0 -1
  469. package/dist/chunk-GEULB2VI.js.map +0 -1
  470. package/dist/chunk-JFJ3MHGV.js.map +0 -1
  471. package/dist/chunk-JG22O53B.js.map +0 -1
  472. package/dist/chunk-LCU5R6TQ.js.map +0 -1
  473. package/dist/chunk-MSTNSVXI.js.map +0 -1
  474. package/dist/chunk-YQ3CBLL4.js.map +0 -1
  475. package/dist/chunk-Z54TXZ2F.js.map +0 -1
  476. /package/dist/{capsule-crypto-7FJQINUR.js.map → capsule-crypto-YO5QJ6L3.js.map} +0 -0
  477. /package/dist/{chunk-LYIZXQYY.js.map → chunk-2E36UXVW.js.map} +0 -0
  478. /package/dist/{chunk-7QFBLYFP.js.map → chunk-2XDWWPTN.js.map} +0 -0
  479. /package/dist/{chunk-CFRBTATE.js.map → chunk-2YI72KM3.js.map} +0 -0
  480. /package/dist/{chunk-3YTTAGPB.js.map → chunk-3DVBKTSO.js.map} +0 -0
  481. /package/dist/{chunk-VPGRXEAB.js.map → chunk-3I7ASZN3.js.map} +0 -0
  482. /package/dist/{chunk-WTOE7CW4.js.map → chunk-4KYOLI6M.js.map} +0 -0
  483. /package/dist/{chunk-ESCQ6LY7.js.map → chunk-5NM4OH4P.js.map} +0 -0
  484. /package/dist/{chunk-Y23B2QXP.js.map → chunk-5YQ63T4B.js.map} +0 -0
  485. /package/dist/{chunk-PMVPCZJZ.js.map → chunk-6433HV72.js.map} +0 -0
  486. /package/dist/{chunk-NS5ETDYD.js.map → chunk-7BEPVIH3.js.map} +0 -0
  487. /package/dist/{chunk-W6TSGWYS.js.map → chunk-7YQ4IYS2.js.map} +0 -0
  488. /package/dist/{chunk-2NLLXCJG.js.map → chunk-BXLOS5AJ.js.map} +0 -0
  489. /package/dist/{chunk-CEH2AFXG.js.map → chunk-C24UZSFW.js.map} +0 -0
  490. /package/dist/{chunk-ZPN7W3OP.js.map → chunk-CDUUDBWJ.js.map} +0 -0
  491. /package/dist/{chunk-5UYSCYR7.js.map → chunk-CT56C22C.js.map} +0 -0
  492. /package/dist/{chunk-HJQZQUPC.js.map → chunk-DJZWNKFO.js.map} +0 -0
  493. /package/dist/{chunk-X7Y7WX73.js.map → chunk-DQEMWVMT.js.map} +0 -0
  494. /package/dist/{chunk-CCTVAVTT.js.map → chunk-DZUJ46DO.js.map} +0 -0
  495. /package/dist/{chunk-N6TRHP72.js.map → chunk-EILZG5VC.js.map} +0 -0
  496. /package/dist/{chunk-GXWDWOWP.js.map → chunk-GDFVPUJ5.js.map} +0 -0
  497. /package/dist/{chunk-7PWWGYGO.js.map → chunk-GNCCUR6K.js.map} +0 -0
  498. /package/dist/{chunk-KPBLJCCV.js.map → chunk-IID2CMUU.js.map} +0 -0
  499. /package/dist/{chunk-UYCIS6V5.js.map → chunk-JCWY73FK.js.map} +0 -0
  500. /package/dist/{chunk-SYJ6EKKE.js.map → chunk-JYYBA7TF.js.map} +0 -0
  501. /package/dist/{chunk-T42L3S6A.js.map → chunk-LBWQ65SX.js.map} +0 -0
  502. /package/dist/{chunk-LWVO2QZV.js.map → chunk-LGO6A7GJ.js.map} +0 -0
  503. /package/dist/{chunk-2572MRP2.js.map → chunk-LZH5FR2W.js.map} +0 -0
  504. /package/dist/{chunk-256FBCVX.js.map → chunk-M4AHBM72.js.map} +0 -0
  505. /package/dist/{chunk-YEQEGSJA.js.map → chunk-MN4KB2A4.js.map} +0 -0
  506. /package/dist/{chunk-AGKIG3YA.js.map → chunk-NKKD4ZAU.js.map} +0 -0
  507. /package/dist/{chunk-3TMYV3LP.js.map → chunk-NTWN6HB2.js.map} +0 -0
  508. /package/dist/{chunk-63FHSH7E.js.map → chunk-OCZIYAE5.js.map} +0 -0
  509. /package/dist/{chunk-I2HTKOOP.js.map → chunk-ODZG724P.js.map} +0 -0
  510. /package/dist/{chunk-HQSBYI5X.js.map → chunk-OTHZWLUD.js.map} +0 -0
  511. /package/dist/{chunk-4W6INNXO.js.map → chunk-PE255F4T.js.map} +0 -0
  512. /package/dist/{chunk-6L27N6YI.js.map → chunk-QOS5LBZN.js.map} +0 -0
  513. /package/dist/{chunk-G72IPMR7.js.map → chunk-R4OCGPSH.js.map} +0 -0
  514. /package/dist/{chunk-MIBKEW7A.js.map → chunk-R7JAM2XF.js.map} +0 -0
  515. /package/dist/{chunk-JBPKEARU.js.map → chunk-RKNJBZ55.js.map} +0 -0
  516. /package/dist/{chunk-HUNSEO5U.js.map → chunk-S2DPMJXH.js.map} +0 -0
  517. /package/dist/{chunk-HQSPXTQO.js.map → chunk-SIHSCCUQ.js.map} +0 -0
  518. /package/dist/{chunk-R3AAOKR2.js.map → chunk-SPUJNJJC.js.map} +0 -0
  519. /package/dist/{chunk-IAY7YBXS.js.map → chunk-SQI57UCJ.js.map} +0 -0
  520. /package/dist/{chunk-CTQRPANJ.js.map → chunk-SVSRPG6M.js.map} +0 -0
  521. /package/dist/{chunk-S2VBSTTA.js.map → chunk-THG4GYIE.js.map} +0 -0
  522. /package/dist/{chunk-IXRC7EQG.js.map → chunk-TR7DGXGI.js.map} +0 -0
  523. /package/dist/{chunk-BC4QD3FM.js.map → chunk-UIN2BWDD.js.map} +0 -0
  524. /package/dist/{chunk-JTSVMJHV.js.map → chunk-UXO5IMBK.js.map} +0 -0
  525. /package/dist/{chunk-KQAFEZQX.js.map → chunk-VDX2J7OX.js.map} +0 -0
  526. /package/dist/{chunk-MUJ4QFUQ.js.map → chunk-W4BMEGQA.js.map} +0 -0
  527. /package/dist/{chunk-5HK3CJAR.js.map → chunk-W675UJCZ.js.map} +0 -0
  528. /package/dist/{chunk-MDVBCPOS.js.map → chunk-XCTXS7VY.js.map} +0 -0
  529. /package/dist/{chunk-53ENM6F6.js.map → chunk-XRYZRW54.js.map} +0 -0
  530. /package/dist/{chunk-VJ6ECBIP.js.map → chunk-Y7DK7HHJ.js.map} +0 -0
  531. /package/dist/{chunk-3MADV4YC.js.map → chunk-YB42WZCY.js.map} +0 -0
  532. /package/dist/{chunk-X5SDZMO7.js.map → chunk-YHCBJULX.js.map} +0 -0
  533. /package/dist/{chunk-6JJT5AKI.js.map → chunk-Z7PBQPJ4.js.map} +0 -0
  534. /package/dist/{chunk-ALCJRQ72.js.map → chunk-ZO6AXLEH.js.map} +0 -0
  535. /package/dist/{chunk-VZVP2W4O.js.map → chunk-ZQHI2BZB.js.map} +0 -0
  536. /package/dist/{resolution-DKMBPXHI.js.map → memory-subject-cli.js.map} +0 -0
@@ -1,22 +1,22 @@
1
- import { b as NamespaceRecord } from './catalog-DjVhJoRM.js';
2
- import { P as PluginConfig, C as CodingContext, x as MemoryCategory, G as GatewayConfig, M as MemoryFile, aG as DaySummaryResult, o as RecallDisclosure, R as RecallPlanMode, K as MemoryLifecycleEvent, E as EntityFile, z as MemoryStatus, p as SourceConnectorProvenance, bd as DreamsStatusResult, D as DreamsPhase, a as DreamsRunResult } from './types-BrEzuxPA.js';
3
- import { S as ScopePlan, E as EngramAccessNamespaceWritableRequest, W as WritableNamespaceResult } from './access-namespace-preflight-BKUnKsBv.js';
4
- import { S as StorageManager } from './storage-B9lbNTYE.js';
1
+ import { b as NamespaceRecord } from './catalog-DV6qnbr7.js';
2
+ import { P as PluginConfig, C as CodingContext, M as MemoryFile, x as MemoryCategory, G as GatewayConfig, N as MemorySubject, au as SubjectGuardMode, aI as DaySummaryResult, o as RecallDisclosure, R as RecallPlanMode, K as MemoryLifecycleEvent, E as EntityFile, z as MemoryStatus, p as SourceConnectorProvenance, bf as DreamsStatusResult, D as DreamsPhase, a as DreamsRunResult } from './types-Pi0lfaEt.js';
3
+ import { S as ScopePlan, E as EngramAccessNamespaceWritableRequest, W as WritableNamespaceResult } from './access-namespace-preflight-Dhvcl-T0.js';
4
+ import { S as StorageManager } from './storage-CcKmEjL8.js';
5
5
  import { a as Peer, b as PeerProfile } from './types-B1VHaf2w.js';
6
6
  import { RecallExplainJsonPayload } from './recall-explain-renderer.js';
7
7
  import { CitationUsageRequest, CitationUsageResult } from './access-citation.js';
8
8
  import { EngramAccessHealthResponse } from './access-health-types.js';
9
9
  import { ResolveSecretRefFn } from './resolve-auth-token.js';
10
- import { O as Orchestrator, I as IntentDebugSnapshot, G as GraphRecallSnapshot, P as PatternReinforcementResult } from './orchestrator-DzCaxNS4.js';
10
+ import { O as Orchestrator, I as IntentDebugSnapshot, G as GraphRecallSnapshot, P as PatternReinforcementResult } from './orchestrator-DyGUC7re.js';
11
11
  import { BudgetWarning } from './cross-namespace-budget.js';
12
12
  import { ExplicitCaptureInput } from './explicit-capture.js';
13
13
  import { LiveConnectorsRunSummary } from './live-connectors-runner.js';
14
14
  import { readMemoryGovernanceRunArtifact } from './maintenance/memory-governance.js';
15
- import { W as WearablesService, c as MeetingsListResult, b as MeetingsGetResult, a as MeetingsDayBuildSummary } from './service-_qgST_0y.js';
15
+ import { W as WearablesService, c as MeetingsListResult, b as MeetingsGetResult, a as MeetingsDayBuildSummary } from './service-DCZDZNcV.js';
16
16
  import { AnomalyDetectorResult } from './recall-audit-anomaly.js';
17
17
  import { WearablesMeetingsScope } from './access-wearables-meetings-surface.js';
18
18
  import { GraphSnapshotRequest, GraphSnapshotResponse } from './graph-snapshot.js';
19
- import { S as ScopeProfileLayerResolution, a as ScopeProfilePromotionResolution, R as ResolvedScopeProfilePlan } from './scope-profiles-CEMZz0t5.js';
19
+ import { S as ScopeProfileLayerResolution, a as ScopeProfilePromotionResolution, R as ResolvedScopeProfilePlan } from './scope-profiles-B9xMoFO-.js';
20
20
  import { RecallContextComposition } from './recall-context-composition.js';
21
21
  import { LastRecallSnapshot } from './recall-state.js';
22
22
  import { TrustZoneStoreStatus, TrustZoneName, TrustZoneRecordKind, TrustZoneSourceClass, TrustZoneProvenanceScore, TrustZonePromotionResult, TrustZoneDemoSeedResult } from './trust-zones.js';
@@ -321,6 +321,10 @@ interface ProcedureStatsReport {
321
321
  counts: ProcedureStatusCounts;
322
322
  recent: ProcedureStatsRecent;
323
323
  config: ProcedureStatsConfigSnapshot;
324
+ /** ISO timestamp of the last library-maintenance run marker, or null (issue #2370). */
325
+ lastMaintenanceAt: string | null;
326
+ /** Active procedures currently carrying a `needsRepair` flag (issue #2370). */
327
+ needsRepairFlags: number;
324
328
  }
325
329
  /**
326
330
  * Read all memories from storage and tally procedures by status + recency.
@@ -337,6 +341,98 @@ declare function computeProcedureStats(options: {
337
341
  */
338
342
  declare function formatProcedureStatsText(report: ProcedureStatsReport): string;
339
343
 
344
+ /**
345
+ * Procedure library health maintenance (issue #2370).
346
+ *
347
+ * The library-health loop the agent-memory survey describes: consume the
348
+ * telemetry Remnic already records (Memory Worth counters, access
349
+ * timestamps, causal trajectories) and propose merge / repair-flag /
350
+ * retire transitions for ACTIVE procedure memories.
351
+ *
352
+ * Shadow-first contract (mirrors `memory_governance_run`): the default run
353
+ * mode produces a JSON report and writes NOTHING — not even the run
354
+ * marker. Applying requires `apply: true` AND
355
+ * `procedural.maintenance.enabled: true`.
356
+ *
357
+ * Actions, evaluated in this order per run:
358
+ * 1. Merge — cluster active procedures by normalized trigger phrase +
359
+ * step signature; most-recently-updated member becomes the
360
+ * canonical, the rest are superseded pointing at it. The
361
+ * canonical is stamped with the issue-#687 frontmatter
362
+ * contract (`reinforcement_count`, `last_reinforced_at`,
363
+ * `derived_via`, `derived_from`) so `patterns explain` reads
364
+ * procedure canonicals unchanged. A user-edited body never
365
+ * merges — the cluster is flagged instead.
366
+ * 2. Repair — flag (never rewrite) procedures whose `ProcedureStep`
367
+ * toolCall tools no longer appear in recent causal
368
+ * trajectories, via `structuredAttributes.needsRepair`.
369
+ * 3. Retire — demote to `archived` when failure-dominant past the
370
+ * configured thresholds, or idle past `retireIdleDays` with
371
+ * zero recorded outcomes. Demotion, never deletion; page
372
+ * versioning snapshots every overwrite. User-edited
373
+ * procedures are exempt and flagged instead.
374
+ *
375
+ * Deliberately NOT part of `runMemoryGovernance` — same isolation decision
376
+ * as procedure mining (docs/procedural-memory.md).
377
+ */
378
+
379
+ type ProcedureLibraryStorage = {
380
+ readAllMemories: () => Promise<MemoryFile[]>;
381
+ writeMemoryFrontmatter: (memory: MemoryFile, patch: Record<string, unknown>, extras?: Record<string, unknown>) => Promise<unknown>;
382
+ archiveMemory: (memory: MemoryFile, opts: {
383
+ at: Date;
384
+ actor: string;
385
+ reasonCode: string;
386
+ ruleVersion?: string;
387
+ relatedMemoryIds?: string[];
388
+ }) => Promise<string | null>;
389
+ };
390
+ type ProcedureMaintenanceActionKind = "merge" | "retire" | "flag_repair" | "flag_user_edited";
391
+ type ProcedureMaintenanceReasonCode = "merge_duplicate_signature" | "retire_failure_dominant" | "retire_idle" | "needs_repair_stale_tools" | "user_edited_protected";
392
+ interface ProcedureMaintenanceEvidence {
393
+ memoryId: string;
394
+ mwSuccess: number;
395
+ mwFail: number;
396
+ lastAccessed: string | null;
397
+ updated: string | null;
398
+ }
399
+ interface ProcedureMaintenanceAction {
400
+ action: ProcedureMaintenanceActionKind;
401
+ reasonCode: ProcedureMaintenanceReasonCode;
402
+ /** Canonical first for merges; otherwise the single targeted memory. */
403
+ memoryIds: string[];
404
+ canonicalId?: string;
405
+ reason: string;
406
+ evidence: ProcedureMaintenanceEvidence[];
407
+ }
408
+ interface ProcedureLibraryMaintenanceReport {
409
+ schemaVersion: 1;
410
+ generatedAt: string;
411
+ mode: "shadow" | "apply";
412
+ scannedProcedures: number;
413
+ proposed: ProcedureMaintenanceAction[];
414
+ applied: ProcedureMaintenanceAction[];
415
+ appliedCount: number;
416
+ skippedReason?: "procedural_disabled" | "maintenance_disabled";
417
+ }
418
+ interface ProcedureMaintenanceMarker {
419
+ schemaVersion: 1;
420
+ lastRunAt: string;
421
+ lastApplyAt: string | null;
422
+ appliedCount: number;
423
+ }
424
+ /**
425
+ * Run one library-health maintenance pass over the procedures in a storage.
426
+ * Shadow mode performs NO writes (not even the state marker).
427
+ */
428
+ declare function runProcedureLibraryMaintenance(options: {
429
+ storage: ProcedureLibraryStorage;
430
+ memoryDir: string;
431
+ config: PluginConfig;
432
+ apply?: boolean;
433
+ now?: Date;
434
+ }): Promise<ProcedureLibraryMaintenanceReport>;
435
+
340
436
  interface ConsoleBufferState {
341
437
  /** Number of turns currently held in the default buffer slot. */
342
438
  turnsCount: number;
@@ -933,24 +1029,24 @@ declare const SupportPassportDraftCardSchema: z.ZodEffects<z.ZodObject<{
933
1029
  category: z.ZodEnum<["communication", "environment", "transitions", "sensory", "regulation", "interests", "other"]>;
934
1030
  sourceMemoryIds: z.ZodArray<z.ZodString, "many">;
935
1031
  }, "strict", z.ZodTypeAny, {
1032
+ category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
936
1033
  title: string;
937
1034
  sourceMemoryIds: string[];
938
- category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
939
1035
  statement: string;
940
1036
  }, {
1037
+ category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
941
1038
  title: string;
942
1039
  sourceMemoryIds: string[];
943
- category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
944
1040
  statement: string;
945
1041
  }>, {
1042
+ category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
946
1043
  title: string;
947
1044
  sourceMemoryIds: string[];
948
- category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
949
1045
  statement: string;
950
1046
  }, {
1047
+ category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
951
1048
  title: string;
952
1049
  sourceMemoryIds: string[];
953
- category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
954
1050
  statement: string;
955
1051
  }>;
956
1052
  declare const SupportPassportDraftOutputSchema: z.ZodObject<{
@@ -960,38 +1056,38 @@ declare const SupportPassportDraftOutputSchema: z.ZodObject<{
960
1056
  category: z.ZodEnum<["communication", "environment", "transitions", "sensory", "regulation", "interests", "other"]>;
961
1057
  sourceMemoryIds: z.ZodArray<z.ZodString, "many">;
962
1058
  }, "strict", z.ZodTypeAny, {
1059
+ category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
963
1060
  title: string;
964
1061
  sourceMemoryIds: string[];
965
- category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
966
1062
  statement: string;
967
1063
  }, {
1064
+ category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
968
1065
  title: string;
969
1066
  sourceMemoryIds: string[];
970
- category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
971
1067
  statement: string;
972
1068
  }>, {
1069
+ category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
973
1070
  title: string;
974
1071
  sourceMemoryIds: string[];
975
- category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
976
1072
  statement: string;
977
1073
  }, {
1074
+ category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
978
1075
  title: string;
979
1076
  sourceMemoryIds: string[];
980
- category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
981
1077
  statement: string;
982
1078
  }>, "many">;
983
1079
  }, "strict", z.ZodTypeAny, {
984
1080
  cards: {
1081
+ category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
985
1082
  title: string;
986
1083
  sourceMemoryIds: string[];
987
- category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
988
1084
  statement: string;
989
1085
  }[];
990
1086
  }, {
991
1087
  cards: {
1088
+ category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
992
1089
  title: string;
993
1090
  sourceMemoryIds: string[];
994
- category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
995
1091
  statement: string;
996
1092
  }[];
997
1093
  }>;
@@ -1037,20 +1133,20 @@ declare const SupportPassportAnswerOutputSchema: z.ZodEffects<z.ZodObject<{
1037
1133
  citedCardIds: z.ZodArray<z.ZodString, "many">;
1038
1134
  coverage: z.ZodEnum<["grounded", "not_in_guide"]>;
1039
1135
  }, "strict", z.ZodTypeAny, {
1040
- answer: string;
1041
1136
  coverage: "grounded" | "not_in_guide";
1137
+ answer: string;
1042
1138
  citedCardIds: string[];
1043
1139
  }, {
1044
- answer: string;
1045
1140
  coverage: "grounded" | "not_in_guide";
1141
+ answer: string;
1046
1142
  citedCardIds: string[];
1047
1143
  }>, {
1048
- answer: string;
1049
1144
  coverage: "grounded" | "not_in_guide";
1145
+ answer: string;
1050
1146
  citedCardIds: string[];
1051
1147
  }, {
1052
- answer: string;
1053
1148
  coverage: "grounded" | "not_in_guide";
1149
+ answer: string;
1054
1150
  citedCardIds: string[];
1055
1151
  }>;
1056
1152
  declare const SupportPassportAnswerModelInputSchema: z.ZodObject<{
@@ -1066,38 +1162,38 @@ declare const SupportPassportAnswerModelInputSchema: z.ZodObject<{
1066
1162
  category: z.ZodEnum<["communication", "environment", "transitions", "sensory", "regulation", "interests", "other"]>;
1067
1163
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
1068
1164
  }, "strict", z.ZodTypeAny, {
1069
- title: string;
1070
1165
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1166
+ title: string;
1071
1167
  updatedAt: string;
1072
1168
  cardId: string;
1073
1169
  statement: string;
1074
1170
  }, {
1075
- title: string;
1076
1171
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1172
+ title: string;
1077
1173
  updatedAt: string;
1078
1174
  cardId: string;
1079
1175
  statement: string;
1080
1176
  }>, "many">;
1081
1177
  }, "strict", z.ZodTypeAny, {
1082
- schemaVersion: 1;
1083
1178
  expiresAt: string;
1179
+ schemaVersion: 1;
1084
1180
  updatedAt: string;
1085
1181
  grantId: string;
1086
1182
  cards: {
1087
- title: string;
1088
1183
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1184
+ title: string;
1089
1185
  updatedAt: string;
1090
1186
  cardId: string;
1091
1187
  statement: string;
1092
1188
  }[];
1093
1189
  }, {
1094
- schemaVersion: 1;
1095
1190
  expiresAt: string;
1191
+ schemaVersion: 1;
1096
1192
  updatedAt: string;
1097
1193
  grantId: string;
1098
1194
  cards: {
1099
- title: string;
1100
1195
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1196
+ title: string;
1101
1197
  updatedAt: string;
1102
1198
  cardId: string;
1103
1199
  statement: string;
@@ -1107,13 +1203,13 @@ declare const SupportPassportAnswerModelInputSchema: z.ZodObject<{
1107
1203
  }, "strict", z.ZodTypeAny, {
1108
1204
  question: string;
1109
1205
  guide: {
1110
- schemaVersion: 1;
1111
1206
  expiresAt: string;
1207
+ schemaVersion: 1;
1112
1208
  updatedAt: string;
1113
1209
  grantId: string;
1114
1210
  cards: {
1115
- title: string;
1116
1211
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1212
+ title: string;
1117
1213
  updatedAt: string;
1118
1214
  cardId: string;
1119
1215
  statement: string;
@@ -1122,13 +1218,13 @@ declare const SupportPassportAnswerModelInputSchema: z.ZodObject<{
1122
1218
  }, {
1123
1219
  question: string;
1124
1220
  guide: {
1125
- schemaVersion: 1;
1126
1221
  expiresAt: string;
1222
+ schemaVersion: 1;
1127
1223
  updatedAt: string;
1128
1224
  grantId: string;
1129
1225
  cards: {
1130
- title: string;
1131
1226
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1227
+ title: string;
1132
1228
  updatedAt: string;
1133
1229
  cardId: string;
1134
1230
  statement: string;
@@ -1226,6 +1322,148 @@ declare class SupportPassportModelAdapter {
1226
1322
  private invokeRoute;
1227
1323
  }
1228
1324
 
1325
+ /**
1326
+ * Single input-validation and error boundary for the CLI/MCP/HTTP access
1327
+ * surfaces (issue #1525, epic #1520 Phase 1).
1328
+ *
1329
+ * Every operation that crosses the access-service facade passes through ONE
1330
+ * registry entry: a zod-validated request envelope, a shared error mapper,
1331
+ * and the "reject invalid input and list valid options" behavior that
1332
+ * CLAUDE.md rules 14/17/24/28/36/48/51 previously had to be re-implemented
1333
+ * per handler. The three surfaces become thin adapters — one operation
1334
+ * definition, three transports — so a validation fix lands everywhere at
1335
+ * once.
1336
+ *
1337
+ * Host-agnostic (rule 31): operation names carry no `openclaw-*`/`engram-*`
1338
+ * prefix. Session/namespace tenancy stays in the handler layer (resolved via
1339
+ * ScopePlan #1521); the boundary validates SHAPE, not tenancy.
1340
+ */
1341
+
1342
+ /**
1343
+ * Canonical operation ids. One id is shared by the MCP tool, the HTTP route,
1344
+ * and the CLI command that expose the same operation. Add to this union as
1345
+ * each domain-group migration PR (memory ops → connectors → namespaces …)
1346
+ * lands; the fitness test in `access-surface-catalog.test.ts` treats the
1347
+ * registered set as the migration state.
1348
+ */
1349
+ declare const OPERATION_NAMES: readonly ["memory_get", "memory_search", "external_wiki_search", "memory_store", "coding_decision", "coding_architecture", "codegraph_index", "codegraph_list_projects", "codegraph_delete_project", "codegraph_index_status", "codegraph_search_graph", "codegraph_trace_path", "codegraph_detect_changes", "codegraph_query_graph", "codegraph_get_schema", "codegraph_get_snippet", "codegraph_get_architecture", "codegraph_search_code", "codegraph_manage_adr", "codegraph_ingest_traces", "memory_correct_plan", "memory_correct_apply", "coding_delta", "recall", "recall_explain", "set_coding_context", "recall_tier_explain", "recall_xray", "who_knows", "promotion_candidates", "namespace_writable", "wearables_status", "wearables_sync", "transcript_day", "transcript_search", "transcript_memories", "meetings_list", "meetings_get", "meetings_build", "action_confidence", "chatgpt_memory_inspector", "day_summary", "capsule_export", "capsule_import", "capsule_list", "memory_governance_run", "entity_synthesis_run", "procedure_mining_run", "pattern_reinforcement_run", "procedural_stats", "procedure_library_maintenance", "memory_timeline", "suggestion_submit", "entity_get", "review_queue_list", "correction_pending", "observe", "lcm_search", "lcm_compaction_flush", "extraction_force_flush", "lcm_compaction_record", "continuity_audit_generate", "continuity_incident_open", "continuity_incident_close", "continuity_incident_list", "continuity_loop_add_or_update", "continuity_loop_review", "identity_anchor_get", "identity_anchor_update", "memory_identity", "work_task", "work_project", "work_board", "shared_context_write_output", "shared_feedback_record", "shared_priorities_append", "relay_mission_append", "relay_mission_read", "shared_context_cross_signals_run", "shared_context_curate_daily", "compounding_weekly_synthesize", "compounding_promote_candidate", "compression_guidelines_optimize", "compression_guidelines_activate", "memory_profile", "memory_entities_list", "memory_questions", "memory_last_recall", "memory_intent_debug", "memory_qmd_debug", "memory_graph_explain", "graph_snapshot", "memory_feedback", "memory_promote", "memory_outcome", "memory_action_apply", "context_checkpoint", "briefing", "review_list", "review_resolve", "contradiction_scan_run", "memory_summarize_hourly", "conversation_index_update", "profiling_report", "graph_edge_decay_run", "live_connectors_run", "peer_list", "peer_get", "peer_set", "peer_delete", "peer_profile_get", "peer_forget", "console_state", "dreams_status", "dreams_run", "support_passport_memory_preview", "support_passport_cards_list", "support_passport_draft_create", "support_passport_drafts_generate", "support_passport_card_replace", "support_passport_card_approve", "support_passport_card_reject", "support_passport_card_withdraw", "support_passport_grant_create", "support_passport_grants_list", "support_passport_grant_revoke", "support_passport_grant_read", "support_passport_grant_ask", "adapters_status", "offline_sync_snapshot", "offline_sync_snapshot_stream", "offline_sync_files", "offline_sync_file_content", "offline_sync_apply_file_content", "offline_sync_apply", "lcm_status", "memory_list", "recall_timings", "entity_list", "maintenance_status", "quality_status", "trust_zones_status", "trust_zones_records", "review_disposition", "trust_zones_promote", "trust_zones_demo_seed", "citations_observed", "contradiction_detail", "graph_events", "chat_message", "chat_events"];
1350
+ /**
1351
+ * Canonical operation ids. One id is shared by the MCP tool, the HTTP route,
1352
+ * and the CLI command that expose the same operation. Derived from
1353
+ * {@link OPERATION_NAMES} (single source of truth) so the runtime catalog
1354
+ * used for token-capability validation cannot drift from the type. The
1355
+ * fitness test in `access-surface-catalog.test.ts` treats the registered set
1356
+ * as the migration state.
1357
+ */
1358
+ type OperationName = (typeof OPERATION_NAMES)[number];
1359
+ /**
1360
+ * Per-call context. `service` is the facade the handler delegates to; the
1361
+ * boundary never reaches past it. `authenticatedPrincipal` is resolved by
1362
+ * the SURFACE (MCP header / HTTP identity / CLI flag) before the boundary
1363
+ * runs, so handlers stay principal-source-agnostic. `hooks` carries
1364
+ * transport-level callbacks (e.g. HTTP write-quota enforcement) that must
1365
+ * fire atomically inside the service call; surfaces that have no such hook
1366
+ * leave it undefined.
1367
+ */
1368
+ interface OperationContext {
1369
+ readonly service: EngramAccessService;
1370
+ readonly authenticatedPrincipal?: string;
1371
+ readonly operatorPrincipal?: string;
1372
+ /** Per-request cancellation supplied by transports that own a request lifecycle. */
1373
+ readonly abortSignal?: AbortSignal;
1374
+ /** Server-resolved connector identity (Phase 1 provenance). Set by the HTTP auth boundary from the matched token's connector; flows to write handlers so frontmatter records which connector submitted the memory. Client-supplied values are always overridden. */
1375
+ readonly sourceConnector?: string;
1376
+ readonly hooks?: OperationHooks;
1377
+ }
1378
+ /**
1379
+ * Transport-level callbacks a handler forwards into the service call. Kept
1380
+ * narrow on purpose: the boundary owns validation + dispatch shape, not
1381
+ * transport policy. Add fields here only when a surface genuinely needs a
1382
+ * callback the service itself consumes.
1383
+ */
1384
+ interface OperationHooks {
1385
+ /** HTTP write-quota gate; throws to reject the write when exhausted. */
1386
+ readonly enforceWriteQuota?: () => void | Promise<void>;
1387
+ /** Commit-boundary accounting for writes that can fail after durability. */
1388
+ readonly recordWriteCommit?: () => void;
1389
+ }
1390
+ interface OperationSpec<In, Out> {
1391
+ /** Canonical operation id; matches an {@link OperationName}. */
1392
+ readonly name: OperationName;
1393
+ readonly description: string;
1394
+ /** Zod schema validating the raw request envelope. */
1395
+ readonly schema: z.ZodType<In>;
1396
+ /** Handler invoked with the parsed input; throws EngramAccessInputError for domain faults. */
1397
+ readonly handler: (input: In, ctx: OperationContext) => Promise<Out>;
1398
+ /**
1399
+ * Marks an operation as inherently FLEET-WIDE / global — it runs across ALL
1400
+ * namespaces (or against a single non-namespaced global layer) and carries no
1401
+ * `namespace` argument, so the MCP `tools/call` effective-namespace chokepoint
1402
+ * never applies. When set, {@link defineOperation}'s run wrapper rejects any
1403
+ * namespace-SCOPED token (fail closed) via assertFleetWideOperationAllowed
1404
+ * BEFORE the handler — no side effect on denial. Unrestricted/legacy tokens
1405
+ * (cron, internal callers, no capability record) are unaffected (issue #1850).
1406
+ */
1407
+ readonly fleetWide?: boolean;
1408
+ /**
1409
+ * Alternate op allow-list: when set, the token may invoke this operation if
1410
+ * its ops allow-list permits ANY of these ops (instead of the default rule
1411
+ * that requires the op's own {@link name}). Lets a read-only diagnostic be
1412
+ * granted by the write ops it diagnoses — e.g. `namespace_writable` is
1413
+ * runnable by any token permitted to `observe`/`memory_store`, so a token
1414
+ * minted before the diagnostic op existed can still call it. Unrestricted /
1415
+ * legacy tokens (no ops axis) are unaffected. Keeps the boundary and any HTTP
1416
+ * transport for the same op enforcing ONE policy.
1417
+ */
1418
+ readonly allowedByOps?: readonly OperationName[];
1419
+ }
1420
+ interface BoundOperation<In = unknown, Out = unknown> {
1421
+ readonly spec: OperationSpec<In, Out>;
1422
+ /** Validate the raw envelope, then invoke the handler. Throws EngramAccessInputError on any validation failure. */
1423
+ readonly run: (rawInput: unknown, ctx: OperationContext) => Promise<Out>;
1424
+ }
1425
+ /**
1426
+ * Coerce boolean-like strings at the edge (rule 36). Accepts actual booleans
1427
+ * and the string spellings clients send ("true"/"false"/"1"/"0"/"yes"/"no"/
1428
+ * "on"/"off", case-insensitive). Rejects anything else loudly — `Boolean("false")`
1429
+ * would silently be `true`, which is the bug rule 36 exists to prevent.
1430
+ *
1431
+ * `undefined`/`null`/`""` → `undefined`, so callers can keep treating an
1432
+ * absent flag as "use the default" without a separate presence check.
1433
+ */
1434
+ declare function coerceBooleanLike(value: unknown): boolean | undefined;
1435
+ /**
1436
+ * Coerce + validate a positive integer from a numeric string or number
1437
+ * (rule 28). Loosely-typed MCP/CLI clients send `"5"`; `typeof saved === "number"`
1438
+ * on read-back would reject it later, so we coerce at the edge and reject
1439
+ * booleans/objects loudly (`Number(true) === 1` would silently pass otherwise).
1440
+ *
1441
+ * `undefined`/`null`/`""` → `undefined`.
1442
+ */
1443
+ declare function coercePositiveInteger(value: unknown, label: string): number | undefined;
1444
+ /**
1445
+ * Expand `~` in a path-shaped input (rule 17). Node `fs` does NOT expand `~`;
1446
+ * ad-hoc regex drifts. `undefined`/`null`/`""` → `undefined`.
1447
+ */
1448
+ declare function normalizeOptionalPath(value: unknown): string | undefined;
1449
+ /**
1450
+ * Turn a zod failure into an {@link EngramAccessInputError} whose message
1451
+ * names the offending field and — for enum/union issues — lists the valid
1452
+ * options, so the caller can correct rather than guess (rule 51).
1453
+ */
1454
+ declare function formatZodIssues(error: z.ZodError): string;
1455
+ declare function defineOperation<In, Out>(spec: OperationSpec<In, Out>): BoundOperation<In, Out>;
1456
+ /** Look up a registered operation by canonical name. */
1457
+ declare function getOperation(name: OperationName): BoundOperation | undefined;
1458
+ /** Whether a probe must authorize an operation's effective namespace. */
1459
+ declare function operationRequiresAuthorizedNamespace(name: OperationName): boolean;
1460
+ /** Whether an operation resolves its namespace from the authenticated principal. */
1461
+ declare function operationUsesPrincipalNamespace(name: OperationName): boolean;
1462
+ /** All registered operation names. */
1463
+ declare function listRegisteredOperations(): readonly OperationName[];
1464
+ /** Test-only: clear the registry so pilot definitions can be re-registered. */
1465
+ declare function __resetRegistryForTest(): void;
1466
+
1229
1467
  declare const SUPPORT_PASSPORT_CARD_CATEGORIES: readonly ["communication", "environment", "transitions", "sensory", "regulation", "interests", "other"];
1230
1468
  declare const SUPPORT_PASSPORT_CARD_STATUSES: readonly ["pending_review", "active", "rejected", "superseded", "archived"];
1231
1469
  declare const SupportPassportCardCategorySchema: z.ZodEnum<["communication", "environment", "transitions", "sensory", "regulation", "interests", "other"]>;
@@ -1245,18 +1483,18 @@ declare const SupportPassportCardSchema: z.ZodObject<{
1245
1483
  reviewBy: z.ZodEffects<z.ZodString, string, string>;
1246
1484
  revision: z.ZodString;
1247
1485
  }, "strict", z.ZodTypeAny, {
1248
- title: string;
1249
- status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
1250
1486
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1487
+ status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
1488
+ title: string;
1251
1489
  updatedAt: string;
1252
1490
  cardId: string;
1253
1491
  statement: string;
1254
1492
  reviewBy: string;
1255
1493
  revision: string;
1256
1494
  }, {
1257
- title: string;
1258
- status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
1259
1495
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1496
+ status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
1497
+ title: string;
1260
1498
  updatedAt: string;
1261
1499
  cardId: string;
1262
1500
  statement: string;
@@ -1273,36 +1511,36 @@ declare const SupportPassportCardListSchema: z.ZodEffects<z.ZodArray<z.ZodObject
1273
1511
  reviewBy: z.ZodEffects<z.ZodString, string, string>;
1274
1512
  revision: z.ZodString;
1275
1513
  }, "strict", z.ZodTypeAny, {
1276
- title: string;
1277
- status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
1278
1514
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1515
+ status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
1516
+ title: string;
1279
1517
  updatedAt: string;
1280
1518
  cardId: string;
1281
1519
  statement: string;
1282
1520
  reviewBy: string;
1283
1521
  revision: string;
1284
1522
  }, {
1285
- title: string;
1286
- status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
1287
1523
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1524
+ status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
1525
+ title: string;
1288
1526
  updatedAt: string;
1289
1527
  cardId: string;
1290
1528
  statement: string;
1291
1529
  reviewBy: string;
1292
1530
  revision: string;
1293
1531
  }>, "many">, {
1294
- title: string;
1295
- status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
1296
1532
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1533
+ status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
1534
+ title: string;
1297
1535
  updatedAt: string;
1298
1536
  cardId: string;
1299
1537
  statement: string;
1300
1538
  reviewBy: string;
1301
1539
  revision: string;
1302
1540
  }[], {
1303
- title: string;
1304
- status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
1305
1541
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1542
+ status: "active" | "pending_review" | "rejected" | "superseded" | "archived";
1543
+ title: string;
1306
1544
  updatedAt: string;
1307
1545
  cardId: string;
1308
1546
  statement: string;
@@ -1323,14 +1561,14 @@ declare const SupportPassportManualDraftInputSchema: z.ZodObject<{
1323
1561
  category: z.ZodEnum<["communication", "environment", "transitions", "sensory", "regulation", "interests", "other"]>;
1324
1562
  reviewBy: z.ZodEffects<z.ZodString, string, string>;
1325
1563
  }, "strict", z.ZodTypeAny, {
1326
- title: string;
1327
1564
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1565
+ title: string;
1328
1566
  statement: string;
1329
1567
  reviewBy: string;
1330
1568
  principal: string;
1331
1569
  }, {
1332
- title: string;
1333
1570
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1571
+ title: string;
1334
1572
  statement: string;
1335
1573
  reviewBy: string;
1336
1574
  principal: string;
@@ -1362,8 +1600,8 @@ declare const SupportPassportReplaceCardInputSchema: z.ZodObject<{
1362
1600
  category: z.ZodEnum<["communication", "environment", "transitions", "sensory", "regulation", "interests", "other"]>;
1363
1601
  reviewBy: z.ZodEffects<z.ZodString, string, string>;
1364
1602
  }, "strict", z.ZodTypeAny, {
1365
- title: string;
1366
1603
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1604
+ title: string;
1367
1605
  cardId: string;
1368
1606
  statement: string;
1369
1607
  reviewBy: string;
@@ -1371,8 +1609,8 @@ declare const SupportPassportReplaceCardInputSchema: z.ZodObject<{
1371
1609
  expectedRevision: string;
1372
1610
  reasonCode?: string | undefined;
1373
1611
  }, {
1374
- title: string;
1375
1612
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1613
+ title: string;
1376
1614
  cardId: string;
1377
1615
  statement: string;
1378
1616
  reviewBy: string;
@@ -1431,10 +1669,10 @@ declare const SupportPassportGrantStateSchema: z.ZodEffects<z.ZodObject<{
1431
1669
  expiresAt: z.ZodEffects<z.ZodString, string, string>;
1432
1670
  revokedAt: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1433
1671
  }, "strict", z.ZodTypeAny, {
1434
- schemaVersion: 1;
1672
+ namespace: string;
1435
1673
  createdAt: string;
1436
1674
  expiresAt: string;
1437
- namespace: string;
1675
+ schemaVersion: 1;
1438
1676
  stateVersion: number;
1439
1677
  grantId: string;
1440
1678
  principalHash: string;
@@ -1446,10 +1684,10 @@ declare const SupportPassportGrantStateSchema: z.ZodEffects<z.ZodObject<{
1446
1684
  }[];
1447
1685
  revokedAt?: string | undefined;
1448
1686
  }, {
1449
- schemaVersion: 1;
1687
+ namespace: string;
1450
1688
  createdAt: string;
1451
1689
  expiresAt: string;
1452
- namespace: string;
1690
+ schemaVersion: 1;
1453
1691
  stateVersion: number;
1454
1692
  grantId: string;
1455
1693
  principalHash: string;
@@ -1461,10 +1699,10 @@ declare const SupportPassportGrantStateSchema: z.ZodEffects<z.ZodObject<{
1461
1699
  }[];
1462
1700
  revokedAt?: string | undefined;
1463
1701
  }>, {
1464
- schemaVersion: 1;
1702
+ namespace: string;
1465
1703
  createdAt: string;
1466
1704
  expiresAt: string;
1467
- namespace: string;
1705
+ schemaVersion: 1;
1468
1706
  stateVersion: number;
1469
1707
  grantId: string;
1470
1708
  principalHash: string;
@@ -1476,10 +1714,10 @@ declare const SupportPassportGrantStateSchema: z.ZodEffects<z.ZodObject<{
1476
1714
  }[];
1477
1715
  revokedAt?: string | undefined;
1478
1716
  }, {
1479
- schemaVersion: 1;
1717
+ namespace: string;
1480
1718
  createdAt: string;
1481
1719
  expiresAt: string;
1482
- namespace: string;
1720
+ schemaVersion: 1;
1483
1721
  stateVersion: number;
1484
1722
  grantId: string;
1485
1723
  principalHash: string;
@@ -1650,9 +1888,9 @@ declare const SupportPassportOwnerGrantSchema: z.ZodObject<{
1650
1888
  revokedAt: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1651
1889
  status: z.ZodEnum<["active", "expired", "revoked"]>;
1652
1890
  }, "strict", z.ZodTypeAny, {
1653
- status: "active" | "expired" | "revoked";
1654
1891
  createdAt: string;
1655
1892
  expiresAt: string;
1893
+ status: "active" | "expired" | "revoked";
1656
1894
  stateVersion: number;
1657
1895
  grantId: string;
1658
1896
  cards: {
@@ -1661,9 +1899,9 @@ declare const SupportPassportOwnerGrantSchema: z.ZodObject<{
1661
1899
  }[];
1662
1900
  revokedAt?: string | undefined;
1663
1901
  }, {
1664
- status: "active" | "expired" | "revoked";
1665
1902
  createdAt: string;
1666
1903
  expiresAt: string;
1904
+ status: "active" | "expired" | "revoked";
1667
1905
  stateVersion: number;
1668
1906
  grantId: string;
1669
1907
  cards: {
@@ -1691,9 +1929,9 @@ declare const SupportPassportCreatedGrantSchema: z.ZodObject<{
1691
1929
  revokedAt: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1692
1930
  status: z.ZodEnum<["active", "expired", "revoked"]>;
1693
1931
  }, "strict", z.ZodTypeAny, {
1694
- status: "active" | "expired" | "revoked";
1695
1932
  createdAt: string;
1696
1933
  expiresAt: string;
1934
+ status: "active" | "expired" | "revoked";
1697
1935
  stateVersion: number;
1698
1936
  grantId: string;
1699
1937
  cards: {
@@ -1702,9 +1940,9 @@ declare const SupportPassportCreatedGrantSchema: z.ZodObject<{
1702
1940
  }[];
1703
1941
  revokedAt?: string | undefined;
1704
1942
  }, {
1705
- status: "active" | "expired" | "revoked";
1706
1943
  createdAt: string;
1707
1944
  expiresAt: string;
1945
+ status: "active" | "expired" | "revoked";
1708
1946
  stateVersion: number;
1709
1947
  grantId: string;
1710
1948
  cards: {
@@ -1717,9 +1955,9 @@ declare const SupportPassportCreatedGrantSchema: z.ZodObject<{
1717
1955
  }, "strict", z.ZodTypeAny, {
1718
1956
  secret: string;
1719
1957
  grant: {
1720
- status: "active" | "expired" | "revoked";
1721
1958
  createdAt: string;
1722
1959
  expiresAt: string;
1960
+ status: "active" | "expired" | "revoked";
1723
1961
  stateVersion: number;
1724
1962
  grantId: string;
1725
1963
  cards: {
@@ -1731,9 +1969,9 @@ declare const SupportPassportCreatedGrantSchema: z.ZodObject<{
1731
1969
  }, {
1732
1970
  secret: string;
1733
1971
  grant: {
1734
- status: "active" | "expired" | "revoked";
1735
1972
  createdAt: string;
1736
1973
  expiresAt: string;
1974
+ status: "active" | "expired" | "revoked";
1737
1975
  stateVersion: number;
1738
1976
  grantId: string;
1739
1977
  cards: {
@@ -1750,14 +1988,14 @@ declare const SupportPassportPublicCardSchema: z.ZodObject<{
1750
1988
  category: z.ZodEnum<["communication", "environment", "transitions", "sensory", "regulation", "interests", "other"]>;
1751
1989
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
1752
1990
  }, "strict", z.ZodTypeAny, {
1753
- title: string;
1754
1991
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1992
+ title: string;
1755
1993
  updatedAt: string;
1756
1994
  cardId: string;
1757
1995
  statement: string;
1758
1996
  }, {
1759
- title: string;
1760
1997
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
1998
+ title: string;
1761
1999
  updatedAt: string;
1762
2000
  cardId: string;
1763
2001
  statement: string;
@@ -1774,38 +2012,38 @@ declare const SupportPassportPublicGuideSchema: z.ZodObject<{
1774
2012
  category: z.ZodEnum<["communication", "environment", "transitions", "sensory", "regulation", "interests", "other"]>;
1775
2013
  updatedAt: z.ZodEffects<z.ZodString, string, string>;
1776
2014
  }, "strict", z.ZodTypeAny, {
1777
- title: string;
1778
2015
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
2016
+ title: string;
1779
2017
  updatedAt: string;
1780
2018
  cardId: string;
1781
2019
  statement: string;
1782
2020
  }, {
1783
- title: string;
1784
2021
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
2022
+ title: string;
1785
2023
  updatedAt: string;
1786
2024
  cardId: string;
1787
2025
  statement: string;
1788
2026
  }>, "many">;
1789
2027
  }, "strict", z.ZodTypeAny, {
1790
- schemaVersion: 1;
1791
2028
  expiresAt: string;
2029
+ schemaVersion: 1;
1792
2030
  updatedAt: string;
1793
2031
  grantId: string;
1794
2032
  cards: {
1795
- title: string;
1796
2033
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
2034
+ title: string;
1797
2035
  updatedAt: string;
1798
2036
  cardId: string;
1799
2037
  statement: string;
1800
2038
  }[];
1801
2039
  }, {
1802
- schemaVersion: 1;
1803
2040
  expiresAt: string;
2041
+ schemaVersion: 1;
1804
2042
  updatedAt: string;
1805
2043
  grantId: string;
1806
2044
  cards: {
1807
- title: string;
1808
2045
  category: "other" | "communication" | "environment" | "transitions" | "sensory" | "regulation" | "interests";
2046
+ title: string;
1809
2047
  updatedAt: string;
1810
2048
  cardId: string;
1811
2049
  statement: string;
@@ -1873,10 +2111,10 @@ declare const SupportPassportModelAuditRecordSchema: z.ZodEffects<z.ZodObject<{
1873
2111
  operation: "draft_cards" | "answer_question";
1874
2112
  route: "unavailable" | "direct" | "local" | "gateway";
1875
2113
  latencyMs: number;
1876
- occurredAt: string;
1877
2114
  actorHash: string;
1878
2115
  subjectIdsHash: string;
1879
2116
  outputSchemaVersion: 1;
2117
+ occurredAt: string;
1880
2118
  usage?: {
1881
2119
  inputTokens?: number | undefined;
1882
2120
  outputTokens?: number | undefined;
@@ -1890,10 +2128,10 @@ declare const SupportPassportModelAuditRecordSchema: z.ZodEffects<z.ZodObject<{
1890
2128
  operation: "draft_cards" | "answer_question";
1891
2129
  route: "unavailable" | "direct" | "local" | "gateway";
1892
2130
  latencyMs: number;
1893
- occurredAt: string;
1894
2131
  actorHash: string;
1895
2132
  subjectIdsHash: string;
1896
2133
  outputSchemaVersion: 1;
2134
+ occurredAt: string;
1897
2135
  usage?: {
1898
2136
  inputTokens?: number | undefined;
1899
2137
  outputTokens?: number | undefined;
@@ -1907,10 +2145,10 @@ declare const SupportPassportModelAuditRecordSchema: z.ZodEffects<z.ZodObject<{
1907
2145
  operation: "draft_cards" | "answer_question";
1908
2146
  route: "unavailable" | "direct" | "local" | "gateway";
1909
2147
  latencyMs: number;
1910
- occurredAt: string;
1911
2148
  actorHash: string;
1912
2149
  subjectIdsHash: string;
1913
2150
  outputSchemaVersion: 1;
2151
+ occurredAt: string;
1914
2152
  usage?: {
1915
2153
  inputTokens?: number | undefined;
1916
2154
  outputTokens?: number | undefined;
@@ -1924,10 +2162,10 @@ declare const SupportPassportModelAuditRecordSchema: z.ZodEffects<z.ZodObject<{
1924
2162
  operation: "draft_cards" | "answer_question";
1925
2163
  route: "unavailable" | "direct" | "local" | "gateway";
1926
2164
  latencyMs: number;
1927
- occurredAt: string;
1928
2165
  actorHash: string;
1929
2166
  subjectIdsHash: string;
1930
2167
  outputSchemaVersion: 1;
2168
+ occurredAt: string;
1931
2169
  usage?: {
1932
2170
  inputTokens?: number | undefined;
1933
2171
  outputTokens?: number | undefined;
@@ -2113,6 +2351,7 @@ type McpTool = {
2113
2351
  * header and reject requests advertising an unknown version.
2114
2352
  */
2115
2353
  declare const MCP_SUPPORTED_PROTOCOL_VERSIONS: readonly string[];
2354
+ declare const MCP_MIGRATED_OPERATIONS: Readonly<Record<string, OperationName>>;
2116
2355
  declare class EngramMcpServer {
2117
2356
  private readonly service;
2118
2357
  private buffer;
@@ -2332,6 +2571,137 @@ declare function handleWhoKnowsHttpQuery(deps: {
2332
2571
  }) => Promise<WhoKnowsResult>;
2333
2572
  }): Promise<WhoKnowsHttpOutcome>;
2334
2573
 
2574
+ /**
2575
+ * Memory subject: user-centric vs agent-centric classification (issue #2372).
2576
+ *
2577
+ * Scope says WHERE a memory lives; subject says WHOM it is about — and that
2578
+ * is what determines where it may safely go. `user` memories model one
2579
+ * person (preferences, relationships, biography, moments, commitments);
2580
+ * `agent` memories model how to operate (procedures, principles,
2581
+ * tool-usage lessons, debugging strategies, environment facts with no
2582
+ * personal content).
2583
+ *
2584
+ * This module owns, in one place:
2585
+ * - the deterministic write-time classification (category defaults with an
2586
+ * optional extractor override),
2587
+ * - the promotion guard shared by EVERY promotion surface (spaces promote
2588
+ * AND scope-profile promotion targets — AGENTS.md §27 uniform gating),
2589
+ * - read-only promotion-candidate surfacing (reuse-signaled agent-subject
2590
+ * memories with no equivalent in the target layer), and
2591
+ * - the deterministic backfill pass (shadow/apply, no LLM).
2592
+ */
2593
+
2594
+ declare const SUBJECT_VALUES: readonly ["user", "agent"];
2595
+ declare const SUBJECT_GUARD_MODES: readonly ["off", "warn", "enforce"];
2596
+ /** The CLI / per-call override that permits a user-subject promotion. */
2597
+ declare const SUBJECT_GUARD_OVERRIDE_FLAG = "--allow-user-subject";
2598
+ declare function isMemorySubject(value: unknown): value is MemorySubject;
2599
+ declare function isSubjectGuardMode(value: unknown): value is SubjectGuardMode;
2600
+ declare function subjectDefaultForCategory(category: MemoryCategory): MemorySubject;
2601
+ /**
2602
+ * Resolve the write-time subject: the extractor's single-token value when it
2603
+ * emitted a valid one, else the category default. Never reclassifies on read.
2604
+ */
2605
+ declare function resolveWriteSubject(category: MemoryCategory, extractorValue: unknown): MemorySubject;
2606
+ /** Scope-profile promotion targets that are shared layers. */
2607
+ declare function isSharedPromotionTarget(target: string): boolean;
2608
+ interface SubjectGuardDecision {
2609
+ action: "allow" | "warn" | "reject";
2610
+ /** Effective subject — an absent subject resolves to "user" (fail closed, §36). */
2611
+ effectiveSubject: MemorySubject;
2612
+ /** Structured reason; empty string when action === "allow". */
2613
+ reason: string;
2614
+ /** The override that permits this promotion when action is reject/warn. */
2615
+ override: typeof SUBJECT_GUARD_OVERRIDE_FLAG;
2616
+ }
2617
+ /**
2618
+ * Evaluate one promotion against the subject guard. Shared by the spaces
2619
+ * promotion workflow and the scope-profile promotion targets so the two
2620
+ * surfaces cannot drift (issue #2372 acceptance 2, AGENTS.md §27).
2621
+ *
2622
+ * - mode "off", non-shared targets, agent-subject memories, and explicit
2623
+ * `allowUserSubject` overrides all allow.
2624
+ * - a `user`-subject memory (or a memory with NO subject — fail closed)
2625
+ * promoted to a shared layer warns under "warn" and rejects under
2626
+ * "enforce", with the override named in the reason (§39: never a silent
2627
+ * accept).
2628
+ */
2629
+ declare function evaluateSubjectGuard(params: {
2630
+ subject: MemorySubject | undefined;
2631
+ sharedTarget: boolean;
2632
+ mode: SubjectGuardMode;
2633
+ allowUserSubject?: boolean;
2634
+ }): SubjectGuardDecision;
2635
+ type PromotionReuseSignal = "reinforcement" | "memory_worth" | "access_count";
2636
+ interface PromotionCandidate {
2637
+ id: string;
2638
+ path: string;
2639
+ category: MemoryCategory;
2640
+ content: string;
2641
+ accessCount: number;
2642
+ reinforcementCount: number;
2643
+ mwSuccess: number;
2644
+ mwFail: number;
2645
+ reuseSignal: PromotionReuseSignal;
2646
+ }
2647
+ /** Default reuse-signal threshold for `accessCount` (config `promotionCandidates.minAccessCount`). */
2648
+ declare const PROMOTION_CANDIDATES_DEFAULT_MIN_ACCESS = 3;
2649
+ /** Canonical content form for target-equivalence checks (same normalize pipeline as dedup). */
2650
+ declare function promotionCandidateKey(content: string): string;
2651
+ /**
2652
+ * List `subject: "agent"` memories that (a) are active, (b) show a reuse
2653
+ * signal (`reinforcement_count > 0` OR `mw_success > mw_fail` OR
2654
+ * `accessCount >= minAccessCount`), and (c) have no equivalent already in
2655
+ * the promotion target layer (content-hash check via the dedup normalizer).
2656
+ * Pure over the two memory lists; callers resolve namespaces.
2657
+ */
2658
+ declare function computePromotionCandidates(options: {
2659
+ memories: MemoryFile[];
2660
+ targetMemories: MemoryFile[];
2661
+ minAccessCount: number;
2662
+ limit?: number;
2663
+ }): PromotionCandidate[];
2664
+ interface PromotionCandidatesResult {
2665
+ namespace: string;
2666
+ targetNamespace: string;
2667
+ minAccessCount: number;
2668
+ candidates: PromotionCandidate[];
2669
+ }
2670
+ declare const PROMOTION_CANDIDATES_MCP_TOOLS: McpTool[];
2671
+ /**
2672
+ * Storage surface the backfill needs (mirrors pattern-reinforcement's
2673
+ * structural interface so tests can pass an in-memory stub).
2674
+ * `writeMemoryFrontmatter` invalidates caches and syncs the fact-hash index
2675
+ * (§25/§31), so a stamped memory is immediately discoverable.
2676
+ */
2677
+ interface SubjectBackfillStorage {
2678
+ readAllMemories(): Promise<MemoryFile[]>;
2679
+ writeMemoryFrontmatter(memory: MemoryFile, patch: Partial<MemoryFile["frontmatter"]>): Promise<boolean>;
2680
+ }
2681
+ interface SubjectBackfillReport {
2682
+ mode: "shadow" | "apply";
2683
+ scanned: number;
2684
+ stamped: number;
2685
+ alreadyStamped: number;
2686
+ stamps: Array<{
2687
+ id: string;
2688
+ category: MemoryCategory;
2689
+ subject: MemorySubject;
2690
+ path: string;
2691
+ }>;
2692
+ }
2693
+ /**
2694
+ * Stamp `subject` on memories that have none, using ONLY the deterministic
2695
+ * category defaults (never an LLM, never reclassifying an existing subject —
2696
+ * issue #2372 §1.3). `shadow` reports the intended stamps without writing;
2697
+ * `apply` writes through `writeMemoryFrontmatter`, which invalidates the
2698
+ * memory caches and re-syncs the fact-hash index.
2699
+ */
2700
+ declare function backfillMemorySubjects(options: {
2701
+ storage: SubjectBackfillStorage;
2702
+ mode: "shadow" | "apply";
2703
+ }): Promise<SubjectBackfillReport>;
2704
+
2335
2705
  declare abstract class SupportPassportAccessServiceBase {
2336
2706
  private _supportPassportSurface;
2337
2707
  abstract get configRef(): PluginConfig;
@@ -3264,6 +3634,18 @@ declare class EngramAccessService extends SupportPassportAccessServiceBase {
3264
3634
  namespace?: string;
3265
3635
  authenticatedPrincipal?: string;
3266
3636
  }): Promise<WhoKnowsResult>;
3637
+ /**
3638
+ * Read-only promotion-candidate surfacing (issue #2372): agent-subject,
3639
+ * active, reuse-signaled memories in the caller's namespace with no
3640
+ * equivalent in the target layer. No auto-promotion — callers use the
3641
+ * existing promotion commands.
3642
+ */
3643
+ promotionCandidates(request: {
3644
+ namespace?: string;
3645
+ targetNamespace?: string;
3646
+ limit?: number;
3647
+ authenticatedPrincipal?: string;
3648
+ }): Promise<PromotionCandidatesResult>;
3267
3649
  memoryStore(request: EngramAccessMemoryStoreRequest, hooks?: {
3268
3650
  enforceWriteQuota?: () => void | Promise<void>;
3269
3651
  }): Promise<EngramAccessWriteResponse>;
@@ -3445,6 +3827,28 @@ declare class EngramAccessService extends SupportPassportAccessServiceBase {
3445
3827
  }, principal?: string): Promise<ProcedureStatsReport & {
3446
3828
  namespace: string;
3447
3829
  }>;
3830
+ /**
3831
+ * Procedure library health maintenance (issue #2370). Shadow-first: the
3832
+ * gate is checked BEFORE any storage read, so `maintenance.enabled=false`
3833
+ * returns `{ enabled: false }` having touched nothing but config. Apply
3834
+ * mode additionally requires `apply: true`; `dryRun: true` forces shadow.
3835
+ *
3836
+ * The authenticated principal (never a client-supplied actor) drives the
3837
+ * namespace via the same writable resolver `procedureMiningRun` uses, so
3838
+ * cross-tenant writes are impossible.
3839
+ */
3840
+ procedureLibraryMaintenance(request: {
3841
+ namespace?: string;
3842
+ apply?: boolean;
3843
+ dryRun?: boolean;
3844
+ authenticatedPrincipal?: string;
3845
+ }, principal?: string): Promise<{
3846
+ enabled: false;
3847
+ } | {
3848
+ enabled: true;
3849
+ namespace: string;
3850
+ report: ProcedureLibraryMaintenanceReport;
3851
+ }>;
3448
3852
  memorySummarizeHourly(): Promise<{
3449
3853
  ok: true;
3450
3854
  message: string;
@@ -4085,4 +4489,4 @@ declare class EngramAccessService extends SupportPassportAccessServiceBase {
4085
4489
  }): Promise<MemoryPromotionResult>;
4086
4490
  }
4087
4491
 
4088
- export { type SupportPassportAnswerOutput as $, type AccessProfilingReportRequest as A, type CodegraphSurfaceResponse as B, type CodingScopedWriteInput as C, type DecisionSurfaceRequest as D, type EngramAccessReviewQueueResponse as E, type EngramAccessRecallResponse as F, type EngramAccessRecallRequest as G, type EngramAccessMemorySummary as H, type EngramAccessSetCodingContextRequest as I, type McpTool as J, EngramMcpServer as K, type ProcedureStatsRecent as L, type MemoryPromotionTargetKind as M, type ProcedureStatsReport as N, type ProcedureStatusCounts as O, type ProcedureStatsConfigSnapshot as P, SUPPORT_PASSPORT_CARD_STATUSES as Q, SUPPORT_PASSPORT_DRAFT_MAX_CONTENT_CHARACTERS as R, SUPPORT_PASSPORT_CARD_CATEGORIES as S, SUPPORT_PASSPORT_DRAFT_MAX_MEMORIES as T, SUPPORT_PASSPORT_NOT_IN_GUIDE_ANSWER as U, SUPPORT_PASSPORT_SOURCE_MEMORY_ID_MAX_LENGTH as V, type WhoKnowsResult as W, SupportPassportAccessSurface as X, type SupportPassportAccessSurfaceDependencies as Y, type SupportPassportAnswerModelInput as Z, SupportPassportAnswerModelInputSchema as _, type AccessProfilingReportResponse as a, SupportPassportReplaceCardInputSchema as a$, SupportPassportAnswerOutputSchema as a0, type SupportPassportAnswerResult as a1, type SupportPassportCard as a2, type SupportPassportCardCategory as a3, SupportPassportCardCategorySchema as a4, SupportPassportCardListSchema as a5, type SupportPassportCardMutationInput as a6, SupportPassportCardMutationInputSchema as a7, SupportPassportCardSchema as a8, type SupportPassportCardServiceDependencies as a9, SupportPassportMemoryIdSchema as aA, type SupportPassportMemoryPreview as aB, SupportPassportModelAdapter as aC, type SupportPassportModelAdapterOptions as aD, type SupportPassportModelAuditRecord as aE, SupportPassportModelAuditRecordSchema as aF, type SupportPassportModelAuditSink as aG, SupportPassportModelAuditStore as aH, SupportPassportModelCallError as aI, type SupportPassportModelClients as aJ, type SupportPassportModelFailureMetadata as aK, type SupportPassportModelMessage as aL, type SupportPassportModelResultMetadata as aM, type SupportPassportModelRoute as aN, type SupportPassportModelRouteKind as aO, type SupportPassportModelRouteResult as aP, type SupportPassportModelUsage as aQ, SupportPassportNamespaceSchema as aR, type SupportPassportOwnerCreateGrantRequest as aS, SupportPassportOwnerCreateGrantRequestSchema as aT, type SupportPassportOwnerGrant as aU, SupportPassportOwnerGrantSchema as aV, type SupportPassportOwnerScope as aW, SupportPassportPublicCardSchema as aX, type SupportPassportPublicGuide as aY, SupportPassportPublicGuideSchema as aZ, type SupportPassportReplaceCardInput as a_, type SupportPassportCardStatus as aa, SupportPassportCardStatusSchema as ab, SupportPassportCardTitleSchema as ac, type SupportPassportCreateGrantInput as ad, SupportPassportCreateGrantInputSchema as ae, type SupportPassportCreateGrantRequest as af, SupportPassportCreateGrantRequestSchema as ag, type SupportPassportCreateGrantResult as ah, type SupportPassportCreatedGrant as ai, SupportPassportCreatedGrantSchema as aj, type SupportPassportDraftCard as ak, SupportPassportDraftCardSchema as al, type SupportPassportDraftModelInput as am, SupportPassportDraftModelInputSchema as an, SupportPassportDraftOutputSchema as ao, type SupportPassportDraftResult as ap, SupportPassportError as aq, type SupportPassportErrorCode as ar, type SupportPassportGrantCardRef as as, SupportPassportGrantCardRefSchema as at, type SupportPassportGrantState as au, SupportPassportGrantStateSchema as av, SupportPassportListCardsInputSchema as aw, SupportPassportListGrantsInputSchema as ax, type SupportPassportManualDraftInput as ay, SupportPassportManualDraftInputSchema as az, type EngramAccessCapsuleListResponse as b, type EngramAccessScopeDebug as b$, type SupportPassportRevokeGrantInput as b0, SupportPassportRevokeGrantInputSchema as b1, type SupportPassportRevokeGrantResult as b2, SupportPassportSourceMemoryIdSchema as b3, WHO_KNOWS_AUTHORSHIP_BONUS as b4, WHO_KNOWS_DEFAULT_LIMIT as b5, WHO_KNOWS_MAX_EVIDENCE as b6, WHO_KNOWS_MAX_LIMIT as b7, WHO_KNOWS_MCP_TOOLS as b8, type WhoKnowsEntity as b9, type EngramAccessEntityResponse as bA, type EngramAccessEntitySummary as bB, type EngramAccessLcmCompactionRecordRequest as bC, type EngramAccessLcmStatusResponse as bD, type EngramAccessMaintenanceResponse as bE, type EngramAccessMemoryBrowseRequest as bF, type EngramAccessMemoryBrowseResponse as bG, type EngramAccessMemoryRecord as bH, type EngramAccessObserveMessage as bI, type EngramAccessOfflineSyncApplyFileContentRequest as bJ, type EngramAccessOfflineSyncApplyFileContentResponse as bK, type EngramAccessOfflineSyncApplyRequest as bL, type EngramAccessOfflineSyncApplyResponse as bM, type EngramAccessOfflineSyncFileContentRequest as bN, type EngramAccessOfflineSyncFileContentResponse as bO, type EngramAccessOfflineSyncFilesRequest as bP, type EngramAccessOfflineSyncFilesResponse as bQ, type EngramAccessOfflineSyncFinalizeConvergenceRequest as bR, type EngramAccessOfflineSyncFinalizeConvergenceResponse as bS, type EngramAccessOfflineSyncManifestRequest as bT, type EngramAccessOfflineSyncSnapshotRequest as bU, type EngramAccessOfflineSyncSnapshotResponse as bV, type EngramAccessQualityResponse as bW, type EngramAccessRecallExplainRequest as bX, type EngramAccessRecallExplainResponse as bY, type EngramAccessReviewDispositionRequest as bZ, type EngramAccessReviewDispositionResponse as b_, type WhoKnowsEvidence as ba, type WhoKnowsHit as bb, type WhoKnowsHttpOutcome as bc, type WhoKnowsStorage as bd, acceptsSupportPassportModelResponse as be, buildSupportPassportDirectGatewayConfig as bf, computeProcedureStats as bg, computeSupportPassportCardRevision as bh, computeWhoKnows as bi, createSupportPassportModelAdapter as bj, formatProcedureStatsText as bk, handleWhoKnowsHttpQuery as bl, hashSupportPassportAuditValues as bm, loadWhoKnowsEntities as bn, resolveSupportPassportModelRoutePlan as bo, tokenizeTopic as bp, validateWhoKnowsInput as bq, type EngramAccessLcmCompactionFlushRequest as br, type ExtractionForceFlushDelegate as bs, delegateExtractionForceFlush as bt, MCP_SUPPORTED_PROTOCOL_VERSIONS as bu, ENGRAM_ACCESS_WRITE_SCHEMA_VERSION as bv, type EngramAccessActionConfidenceRequest as bw, type EngramAccessActionConfidenceResponse as bx, type EngramAccessDaySummaryRequest as by, type EngramAccessEntityListResponse as bz, type MemoryPromotionResult as c, type EngramAccessTimelineResponse as c0, type EngramAccessTrustZoneBrowseRequest as c1, type EngramAccessTrustZoneBrowseResponse as c2, type EngramAccessTrustZoneDemoSeedRequest as c3, type EngramAccessTrustZoneDemoSeedResponse as c4, type EngramAccessTrustZonePromoteRequest as c5, type EngramAccessTrustZonePromoteResponse as c6, type EngramAccessTrustZoneRecordSummary as c7, type EngramAccessTrustZoneStatusResponse as c8, type EngramAccessWriteEnvelope as c9, buildProjectedGovernanceProposedActions as ca, hasGroupedGovernanceActions as cb, shapeMemorySummary as cc, type EngramAccessExtractionForceFlushRequest as d, type EngramAccessExtractionForceFlushResponse as e, EngramAccessService as f, type EngramAccessLcmCompactionFlushResponse as g, type EngramAccessLcmCompactionRecordResponse as h, type EngramAccessOfflineSyncSnapshotStreamResponse as i, type EngramAccessLcmSearchRequest as j, type EngramAccessLcmSearchResponse as k, type MemoryScopePlan as l, type EngramAccessMemoryStoreRequest as m, type EngramAccessSuggestionSubmitRequest as n, type EngramAccessBriefingRequest as o, type EngramAccessBriefingResponse as p, type EngramAccessWriteResponse as q, type EngramAccessObserveRequest as r, type EngramAccessObserveResponse as s, type ArchitectureSurfaceRequest as t, type ArchitectureSurfaceResponse as u, type DecisionSurfaceResponse as v, type DeltaSurfaceRequest as w, type DeltaSurfaceResponse as x, type EngramAccessMemoryResponse as y, type CodegraphSurfaceRequest as z };
4492
+ export { type ProcedureStatsRecent as $, type AccessProfilingReportRequest as A, type BoundOperation as B, type CodingScopedWriteInput as C, type DecisionSurfaceRequest as D, type EngramAccessReviewQueueResponse as E, type CodegraphSurfaceResponse as F, type EngramAccessRecallResponse as G, type EngramAccessRecallRequest as H, type EngramAccessMemorySummary as I, type EngramAccessSetCodingContextRequest as J, type McpTool as K, EngramMcpServer as L, type MemoryPromotionTargetKind as M, OPERATION_NAMES as N, type OperationName as O, type PromotionCandidatesResult as P, PROMOTION_CANDIDATES_DEFAULT_MIN_ACCESS as Q, PROMOTION_CANDIDATES_MCP_TOOLS as R, type SubjectBackfillReport as S, type ProcedureLibraryMaintenanceReport as T, type ProcedureMaintenanceAction as U, type ProcedureMaintenanceActionKind as V, type WhoKnowsResult as W, type ProcedureMaintenanceEvidence as X, type ProcedureMaintenanceMarker as Y, type ProcedureMaintenanceReasonCode as Z, type ProcedureStatsConfigSnapshot as _, type AccessProfilingReportResponse as a, SupportPassportModelAuditStore as a$, type ProcedureStatsReport as a0, type ProcedureStatusCounts as a1, type PromotionCandidate as a2, type PromotionReuseSignal as a3, SUBJECT_GUARD_MODES as a4, SUBJECT_GUARD_OVERRIDE_FLAG as a5, SUBJECT_VALUES as a6, SUPPORT_PASSPORT_CARD_CATEGORIES as a7, SUPPORT_PASSPORT_CARD_STATUSES as a8, SUPPORT_PASSPORT_DRAFT_MAX_CONTENT_CHARACTERS as a9, SupportPassportCreateGrantRequestSchema as aA, type SupportPassportCreateGrantResult as aB, type SupportPassportCreatedGrant as aC, SupportPassportCreatedGrantSchema as aD, type SupportPassportDraftCard as aE, SupportPassportDraftCardSchema as aF, type SupportPassportDraftModelInput as aG, SupportPassportDraftModelInputSchema as aH, SupportPassportDraftOutputSchema as aI, type SupportPassportDraftResult as aJ, SupportPassportError as aK, type SupportPassportErrorCode as aL, type SupportPassportGrantCardRef as aM, SupportPassportGrantCardRefSchema as aN, type SupportPassportGrantState as aO, SupportPassportGrantStateSchema as aP, SupportPassportListCardsInputSchema as aQ, SupportPassportListGrantsInputSchema as aR, type SupportPassportManualDraftInput as aS, SupportPassportManualDraftInputSchema as aT, SupportPassportMemoryIdSchema as aU, type SupportPassportMemoryPreview as aV, SupportPassportModelAdapter as aW, type SupportPassportModelAdapterOptions as aX, type SupportPassportModelAuditRecord as aY, SupportPassportModelAuditRecordSchema as aZ, type SupportPassportModelAuditSink as a_, SUPPORT_PASSPORT_DRAFT_MAX_MEMORIES as aa, SUPPORT_PASSPORT_NOT_IN_GUIDE_ANSWER as ab, SUPPORT_PASSPORT_SOURCE_MEMORY_ID_MAX_LENGTH as ac, type SubjectBackfillStorage as ad, type SubjectGuardDecision as ae, SupportPassportAccessSurface as af, type SupportPassportAccessSurfaceDependencies as ag, type SupportPassportAnswerModelInput as ah, SupportPassportAnswerModelInputSchema as ai, type SupportPassportAnswerOutput as aj, SupportPassportAnswerOutputSchema as ak, type SupportPassportAnswerResult as al, type SupportPassportCard as am, type SupportPassportCardCategory as an, SupportPassportCardCategorySchema as ao, SupportPassportCardListSchema as ap, type SupportPassportCardMutationInput as aq, SupportPassportCardMutationInputSchema as ar, SupportPassportCardSchema as as, type SupportPassportCardServiceDependencies as at, type SupportPassportCardStatus as au, SupportPassportCardStatusSchema as av, SupportPassportCardTitleSchema as aw, type SupportPassportCreateGrantInput as ax, SupportPassportCreateGrantInputSchema as ay, type SupportPassportCreateGrantRequest as az, type EngramAccessCapsuleListResponse as b, __resetRegistryForTest as b$, SupportPassportModelCallError as b0, type SupportPassportModelClients as b1, type SupportPassportModelFailureMetadata as b2, type SupportPassportModelMessage as b3, type SupportPassportModelResultMetadata as b4, type SupportPassportModelRoute as b5, type SupportPassportModelRouteKind as b6, type SupportPassportModelRouteResult as b7, type SupportPassportModelUsage as b8, SupportPassportNamespaceSchema as b9, buildSupportPassportDirectGatewayConfig as bA, computeProcedureStats as bB, computePromotionCandidates as bC, computeSupportPassportCardRevision as bD, computeWhoKnows as bE, createSupportPassportModelAdapter as bF, evaluateSubjectGuard as bG, formatProcedureStatsText as bH, handleWhoKnowsHttpQuery as bI, hashSupportPassportAuditValues as bJ, isMemorySubject as bK, isSharedPromotionTarget as bL, isSubjectGuardMode as bM, loadWhoKnowsEntities as bN, promotionCandidateKey as bO, resolveSupportPassportModelRoutePlan as bP, resolveWriteSubject as bQ, runProcedureLibraryMaintenance as bR, subjectDefaultForCategory as bS, tokenizeTopic as bT, validateWhoKnowsInput as bU, type EngramAccessLcmCompactionFlushRequest as bV, type ExtractionForceFlushDelegate as bW, delegateExtractionForceFlush as bX, type OperationContext as bY, type OperationHooks as bZ, type OperationSpec as b_, type SupportPassportOwnerCreateGrantRequest as ba, SupportPassportOwnerCreateGrantRequestSchema as bb, type SupportPassportOwnerGrant as bc, SupportPassportOwnerGrantSchema as bd, type SupportPassportOwnerScope as be, SupportPassportPublicCardSchema as bf, type SupportPassportPublicGuide as bg, SupportPassportPublicGuideSchema as bh, type SupportPassportReplaceCardInput as bi, SupportPassportReplaceCardInputSchema as bj, type SupportPassportRevokeGrantInput as bk, SupportPassportRevokeGrantInputSchema as bl, type SupportPassportRevokeGrantResult as bm, SupportPassportSourceMemoryIdSchema as bn, WHO_KNOWS_AUTHORSHIP_BONUS as bo, WHO_KNOWS_DEFAULT_LIMIT as bp, WHO_KNOWS_MAX_EVIDENCE as bq, WHO_KNOWS_MAX_LIMIT as br, WHO_KNOWS_MCP_TOOLS as bs, type WhoKnowsEntity as bt, type WhoKnowsEvidence as bu, type WhoKnowsHit as bv, type WhoKnowsHttpOutcome as bw, type WhoKnowsStorage as bx, acceptsSupportPassportModelResponse as by, backfillMemorySubjects as bz, type MemoryPromotionResult as c, coerceBooleanLike as c0, coercePositiveInteger as c1, defineOperation as c2, formatZodIssues as c3, getOperation as c4, listRegisteredOperations as c5, normalizeOptionalPath as c6, operationRequiresAuthorizedNamespace as c7, operationUsesPrincipalNamespace as c8, MCP_MIGRATED_OPERATIONS as c9, type EngramAccessOfflineSyncSnapshotRequest as cA, type EngramAccessOfflineSyncSnapshotResponse as cB, type EngramAccessQualityResponse as cC, type EngramAccessRecallExplainRequest as cD, type EngramAccessRecallExplainResponse as cE, type EngramAccessReviewDispositionRequest as cF, type EngramAccessReviewDispositionResponse as cG, type EngramAccessScopeDebug as cH, type EngramAccessTimelineResponse as cI, type EngramAccessTrustZoneBrowseRequest as cJ, type EngramAccessTrustZoneBrowseResponse as cK, type EngramAccessTrustZoneDemoSeedRequest as cL, type EngramAccessTrustZoneDemoSeedResponse as cM, type EngramAccessTrustZonePromoteRequest as cN, type EngramAccessTrustZonePromoteResponse as cO, type EngramAccessTrustZoneRecordSummary as cP, type EngramAccessTrustZoneStatusResponse as cQ, type EngramAccessWriteEnvelope as cR, buildProjectedGovernanceProposedActions as cS, hasGroupedGovernanceActions as cT, shapeMemorySummary as cU, MCP_SUPPORTED_PROTOCOL_VERSIONS as ca, ENGRAM_ACCESS_WRITE_SCHEMA_VERSION as cb, type EngramAccessActionConfidenceRequest as cc, type EngramAccessActionConfidenceResponse as cd, type EngramAccessDaySummaryRequest as ce, type EngramAccessEntityListResponse as cf, type EngramAccessEntityResponse as cg, type EngramAccessEntitySummary as ch, type EngramAccessLcmCompactionRecordRequest as ci, type EngramAccessLcmStatusResponse as cj, type EngramAccessMaintenanceResponse as ck, type EngramAccessMemoryBrowseRequest as cl, type EngramAccessMemoryBrowseResponse as cm, type EngramAccessMemoryRecord as cn, type EngramAccessObserveMessage as co, type EngramAccessOfflineSyncApplyFileContentRequest as cp, type EngramAccessOfflineSyncApplyFileContentResponse as cq, type EngramAccessOfflineSyncApplyRequest as cr, type EngramAccessOfflineSyncApplyResponse as cs, type EngramAccessOfflineSyncFileContentRequest as ct, type EngramAccessOfflineSyncFileContentResponse as cu, type EngramAccessOfflineSyncFilesRequest as cv, type EngramAccessOfflineSyncFilesResponse as cw, type EngramAccessOfflineSyncFinalizeConvergenceRequest as cx, type EngramAccessOfflineSyncFinalizeConvergenceResponse as cy, type EngramAccessOfflineSyncManifestRequest as cz, type EngramAccessExtractionForceFlushRequest as d, type EngramAccessExtractionForceFlushResponse as e, EngramAccessService as f, type EngramAccessLcmCompactionFlushResponse as g, type EngramAccessLcmCompactionRecordResponse as h, type EngramAccessOfflineSyncSnapshotStreamResponse as i, type EngramAccessLcmSearchRequest as j, type EngramAccessLcmSearchResponse as k, type MemoryScopePlan as l, type EngramAccessMemoryStoreRequest as m, type EngramAccessSuggestionSubmitRequest as n, type EngramAccessBriefingRequest as o, type EngramAccessBriefingResponse as p, type EngramAccessWriteResponse as q, type EngramAccessObserveRequest as r, type EngramAccessObserveResponse as s, type ArchitectureSurfaceRequest as t, type ArchitectureSurfaceResponse as u, type DecisionSurfaceResponse as v, type DeltaSurfaceRequest as w, type DeltaSurfaceResponse as x, type EngramAccessMemoryResponse as y, type CodegraphSurfaceRequest as z };