@remnic/core 9.3.719 → 9.3.720

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 (323) hide show
  1. package/dist/access-boundary.d.ts +10 -7
  2. package/dist/access-boundary.js +18 -17
  3. package/dist/access-cli.js +39 -37
  4. package/dist/access-cli.js.map +1 -1
  5. package/dist/access-http.d.ts +11 -8
  6. package/dist/access-http.js +25 -24
  7. package/dist/access-mcp.d.ts +11 -8
  8. package/dist/access-mcp.js +21 -20
  9. package/dist/access-operations-batch.js +19 -18
  10. package/dist/access-operations.d.ts +11 -8
  11. package/dist/access-operations.js +20 -19
  12. package/dist/access-schema.d.ts +19 -19
  13. package/dist/{access-service-CZbnt0t2.d.ts → access-service-Dw-tK1pa.d.ts} +3 -3
  14. package/dist/access-service.d.ts +11 -8
  15. package/dist/access-service.js +17 -16
  16. package/dist/access-surface-catalog.d.ts +10 -7
  17. package/dist/action-confidence.d.ts +1 -1
  18. package/dist/active-memory-bridge.d.ts +1 -1
  19. package/dist/active-recall.d.ts +1 -1
  20. package/dist/active-recall.js +1 -1
  21. package/dist/adapters/index.js +7 -7
  22. package/dist/adapters/registry.js +3 -3
  23. package/dist/behavior-learner.d.ts +1 -1
  24. package/dist/behavior-signals.d.ts +1 -1
  25. package/dist/bootstrap.d.ts +11 -8
  26. package/dist/briefing.d.ts +1 -1
  27. package/dist/briefing.js +4 -4
  28. package/dist/buffer-surprise-report.d.ts +1 -1
  29. package/dist/buffer.d.ts +1 -1
  30. package/dist/calibration.d.ts +1 -1
  31. package/dist/capabilities.d.ts +30 -2
  32. package/dist/capabilities.js +3 -1
  33. package/dist/{catalog-CEYlMs9X.d.ts → catalog-B9SPfcsE.d.ts} +1 -1
  34. package/dist/causal-behavior.d.ts +1 -1
  35. package/dist/causal-behavior.js +2 -2
  36. package/dist/causal-chain.js +2 -2
  37. package/dist/causal-consolidation.d.ts +1 -1
  38. package/dist/causal-consolidation.js +7 -7
  39. package/dist/causal-retrieval.js +2 -2
  40. package/dist/causal-trajectory-graph.d.ts +4 -0
  41. package/dist/causal-trajectory-graph.js +1 -1
  42. package/dist/causal-trajectory.js +1 -1
  43. package/dist/{chunk-7EEVXW7X.js → chunk-2RBMGTK4.js} +2 -2
  44. package/dist/{chunk-L5ASZA2F.js → chunk-3XEGHEQ2.js} +17 -2
  45. package/dist/chunk-3XEGHEQ2.js.map +1 -0
  46. package/dist/{chunk-YYOK4GVF.js → chunk-422TIKIH.js} +3 -3
  47. package/dist/{chunk-KRGC4EDX.js → chunk-5YQN2XYC.js} +2 -2
  48. package/dist/{chunk-ANI5DUAE.js → chunk-6S5ZI7HB.js} +7 -7
  49. package/dist/{chunk-JIZGYQYH.js → chunk-ATGRQ2NE.js} +4 -4
  50. package/dist/chunk-BCDKBDSY.js +173 -0
  51. package/dist/chunk-BCDKBDSY.js.map +1 -0
  52. package/dist/{chunk-P5IPFZVH.js → chunk-BGQ7WKMT.js} +5 -5
  53. package/dist/{chunk-JAKYZGV4.js → chunk-CYJV5AYC.js} +3 -3
  54. package/dist/{chunk-APUJIMDM.js → chunk-DG3ORVCU.js} +2 -2
  55. package/dist/{chunk-PBH4JUAB.js → chunk-DVRHLN2O.js} +18 -3
  56. package/dist/chunk-DVRHLN2O.js.map +1 -0
  57. package/dist/{chunk-S35FX6MU.js → chunk-H2AGJ5SV.js} +2 -2
  58. package/dist/{chunk-A66YRSOS.js → chunk-HAPVZ4CO.js} +2 -2
  59. package/dist/{chunk-4KZGLDJJ.js → chunk-HHSO6VCQ.js} +2 -2
  60. package/dist/{chunk-2VHMVWPU.js → chunk-HTIL3EJK.js} +2 -2
  61. package/dist/{chunk-UCJ5CDTK.js → chunk-HU4EBIXO.js} +22 -14
  62. package/dist/chunk-HU4EBIXO.js.map +1 -0
  63. package/dist/{chunk-CTOQEZSN.js → chunk-IPJD7WJH.js} +2 -2
  64. package/dist/{chunk-DIFU33GU.js → chunk-JV7Q226R.js} +2 -2
  65. package/dist/{chunk-U5H7WHTS.js → chunk-KNN6DAZQ.js} +4 -4
  66. package/dist/{chunk-3JJWNZTT.js → chunk-L2B3EE7B.js} +102 -42
  67. package/dist/chunk-L2B3EE7B.js.map +1 -0
  68. package/dist/{chunk-5RHM43BJ.js → chunk-LLLG5PTE.js} +3 -3
  69. package/dist/{chunk-F3PVXKHP.js → chunk-M3GBOKUX.js} +22 -16
  70. package/dist/chunk-M3GBOKUX.js.map +1 -0
  71. package/dist/{chunk-2PTBLS2S.js → chunk-NBYXOEO7.js} +2 -2
  72. package/dist/{chunk-URM3HW2R.js → chunk-NE5WFIY6.js} +2 -2
  73. package/dist/{chunk-REWQAFSA.js → chunk-NERBFQNY.js} +2 -2
  74. package/dist/{chunk-773DPI6T.js → chunk-NO4DWSQE.js} +10 -10
  75. package/dist/{chunk-OZ2KQ7HF.js → chunk-O6SEGJNV.js} +2 -2
  76. package/dist/{chunk-IF362TF6.js → chunk-PMBWVQ7D.js} +2 -2
  77. package/dist/chunk-PMBWVQ7D.js.map +1 -0
  78. package/dist/{chunk-OJU73BUX.js → chunk-PPVCZPYA.js} +2 -2
  79. package/dist/{chunk-S3OPGGZB.js → chunk-RIW3UDDY.js} +2 -2
  80. package/dist/{chunk-AU7Q3LSC.js → chunk-RKNJBZ55.js} +7 -7
  81. package/dist/{chunk-EH27LHML.js → chunk-RX7EBFFJ.js} +2 -2
  82. package/dist/{chunk-2COL35PK.js → chunk-T3XSXAWK.js} +2 -2
  83. package/dist/{chunk-2KAYTPPT.js → chunk-UUMYB3FR.js} +4 -4
  84. package/dist/{chunk-72VDBALG.js → chunk-V5EGLYXE.js} +52 -43
  85. package/dist/chunk-V5EGLYXE.js.map +1 -0
  86. package/dist/{chunk-LXSG4L55.js → chunk-V7UUIIR7.js} +2 -2
  87. package/dist/{chunk-HLIR3RJ7.js → chunk-WBHQ5LP5.js} +2 -2
  88. package/dist/{chunk-YGKUAX2B.js → chunk-XROP4ZHB.js} +8 -8
  89. package/dist/chunk-XROP4ZHB.js.map +1 -0
  90. package/dist/{chunk-NFRBADNR.js → chunk-Y4I7SOJN.js} +559 -318
  91. package/dist/chunk-Y4I7SOJN.js.map +1 -0
  92. package/dist/{chunk-YTZLBBEB.js → chunk-YMPEGBLL.js} +3 -3
  93. package/dist/chunk-YN2UN7N3.js +217 -0
  94. package/dist/chunk-YN2UN7N3.js.map +1 -0
  95. package/dist/{chunk-YI7RZO7Y.js → chunk-ZE7GJ76H.js} +1 -1
  96. package/dist/{chunk-74MYJSKB.js → chunk-ZG2WP425.js} +2 -2
  97. package/dist/{chunk-A5TUPZ3N.js → chunk-ZKUW2MJG.js} +43 -1
  98. package/dist/chunk-ZKUW2MJG.js.map +1 -0
  99. package/dist/{chunk-N3DUH6OO.js → chunk-ZW5I3UNP.js} +1 -1
  100. package/dist/chunk-ZW5I3UNP.js.map +1 -0
  101. package/dist/{cli-1orcdXOY.d.ts → cli-qcLCJlOD.d.ts} +3 -3
  102. package/dist/cli.d.ts +9 -6
  103. package/dist/cli.js +43 -42
  104. package/dist/compounding/engine.d.ts +1 -1
  105. package/dist/compounding/engine.js +4 -4
  106. package/dist/compounding/preference-consolidator.d.ts +1 -1
  107. package/dist/compression-optimizer.d.ts +1 -1
  108. package/dist/config.d.ts +1 -1
  109. package/dist/config.js +1 -1
  110. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  111. package/dist/connectors/codex-materialize-runner.js +4 -4
  112. package/dist/connectors/codex-materialize.d.ts +1 -1
  113. package/dist/connectors/index.d.ts +1 -1
  114. package/dist/connectors/index.js +4 -4
  115. package/dist/consolidation-provenance-check.d.ts +1 -1
  116. package/dist/consolidation-undo.d.ts +1 -1
  117. package/dist/contradiction/index.d.ts +1 -1
  118. package/dist/conversation-index/backend.d.ts +1 -1
  119. package/dist/conversation-index/chunker.d.ts +1 -1
  120. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  121. package/dist/conversation-index/indexer.d.ts +1 -1
  122. package/dist/conversation-index/search.d.ts +1 -1
  123. package/dist/day-summary.d.ts +1 -1
  124. package/dist/delinearize.d.ts +1 -1
  125. package/dist/direct-answer-wiring.d.ts +1 -1
  126. package/dist/direct-answer.d.ts +1 -1
  127. package/dist/embedding-fallback.d.ts +1 -1
  128. package/dist/enrichment/index.d.ts +1 -1
  129. package/dist/entity-retrieval.d.ts +1 -1
  130. package/dist/entity-retrieval.js +4 -4
  131. package/dist/entity-schema.d.ts +1 -1
  132. package/dist/explicit-capture.d.ts +11 -8
  133. package/dist/extraction-faithfulness.d.ts +1 -1
  134. package/dist/extraction-judge-telemetry.d.ts +1 -1
  135. package/dist/extraction-judge-training.d.ts +1 -1
  136. package/dist/extraction-judge.d.ts +1 -1
  137. package/dist/extraction.d.ts +1 -1
  138. package/dist/fallback-llm.d.ts +1 -1
  139. package/dist/{forget-U66KPDPY.js → forget-OEE5OELK.js} +2 -2
  140. package/dist/graph-dashboard-diff.d.ts +4 -0
  141. package/dist/graph-dashboard-key.d.ts +4 -0
  142. package/dist/graph-dashboard-parser.d.ts +4 -0
  143. package/dist/{graph-edge-decay-JLOF3YW4.js → graph-edge-decay-QDDC6AVV.js} +2 -2
  144. package/dist/graph-edge-reinforcement.d.ts +4 -0
  145. package/dist/graph-snapshot.d.ts +7 -3
  146. package/dist/graph-snapshot.js +2 -2
  147. package/dist/graph.d.ts +7 -1
  148. package/dist/graph.js +1 -1
  149. package/dist/identity-continuity.d.ts +1 -1
  150. package/dist/importance.d.ts +1 -1
  151. package/dist/index.d.ts +571 -570
  152. package/dist/index.js +57 -55
  153. package/dist/index.js.map +1 -1
  154. package/dist/intent.d.ts +1 -1
  155. package/dist/lcm/engine.d.ts +1 -1
  156. package/dist/lcm/engine.js +4 -4
  157. package/dist/lcm/index.d.ts +1 -1
  158. package/dist/lcm/index.js +8 -8
  159. package/dist/lcm/tools.d.ts +1 -1
  160. package/dist/lifecycle.d.ts +1 -1
  161. package/dist/live-connectors-runner.d.ts +1 -1
  162. package/dist/local-llm.d.ts +1 -1
  163. package/dist/maintenance/memory-governance.d.ts +1 -1
  164. package/dist/maintenance/memory-governance.js +4 -4
  165. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +4 -4
  166. package/dist/maintenance/rebuild-memory-projection.js +5 -5
  167. package/dist/mcp-memory-inspector-app.d.ts +11 -8
  168. package/dist/memory-action-policy.d.ts +1 -1
  169. package/dist/memory-cache.d.ts +1 -1
  170. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  171. package/dist/memory-projection-store.d.ts +1 -1
  172. package/dist/memory-provenance.d.ts +1 -1
  173. package/dist/memory-worth-outcomes.d.ts +1 -1
  174. package/dist/models-json.d.ts +1 -1
  175. package/dist/namespaces/migrate.d.ts +2 -2
  176. package/dist/namespaces/migrate.js +9 -9
  177. package/dist/namespaces/principal.d.ts +1 -1
  178. package/dist/namespaces/search.d.ts +1 -1
  179. package/dist/namespaces/search.js +4 -4
  180. package/dist/namespaces/storage.d.ts +2 -2
  181. package/dist/namespaces/storage.js +4 -4
  182. package/dist/native-knowledge.d.ts +1 -1
  183. package/dist/operator-toolkit.d.ts +3 -2
  184. package/dist/operator-toolkit.js +16 -15
  185. package/dist/orchestration/maintenance.d.ts +2 -2
  186. package/dist/orchestration/maintenance.js +6 -6
  187. package/dist/{orchestrator-kOxredSr.d.ts → orchestrator-Bg5Fnza6.d.ts} +178 -81
  188. package/dist/orchestrator.d.ts +8 -5
  189. package/dist/orchestrator.js +31 -29
  190. package/dist/patterns-cli.d.ts +1 -1
  191. package/dist/policy-runtime.d.ts +1 -1
  192. package/dist/provenance.d.ts +1 -1
  193. package/dist/qmd-recall-cache.d.ts +1 -1
  194. package/dist/qmd.d.ts +1 -1
  195. package/dist/recall-disclosure-escalation.d.ts +1 -1
  196. package/dist/recall-explain-renderer.d.ts +1 -1
  197. package/dist/recall-explain-renderer.js +3 -3
  198. package/dist/recall-planner-llm.d.ts +1 -1
  199. package/dist/recall-state.d.ts +1 -1
  200. package/dist/recall-tag-filter.d.ts +1 -1
  201. package/dist/recall-xray-cli.d.ts +1 -1
  202. package/dist/recall-xray-cli.js +4 -4
  203. package/dist/recall-xray-renderer.d.ts +1 -1
  204. package/dist/recall-xray-renderer.js +3 -3
  205. package/dist/recall-xray.d.ts +18 -1
  206. package/dist/recall-xray.js +2 -2
  207. package/dist/resolve-auth-token.d.ts +1 -1
  208. package/dist/resume-bundles.js +2 -2
  209. package/dist/retrieval-agents.d.ts +1 -1
  210. package/dist/retrieval-tiers.d.ts +1 -1
  211. package/dist/routing/engine.d.ts +1 -1
  212. package/dist/routing/store.d.ts +1 -1
  213. package/dist/search/embed-helper.d.ts +1 -1
  214. package/dist/search/factory.d.ts +1 -1
  215. package/dist/search/factory.js +3 -3
  216. package/dist/search/index.d.ts +1 -1
  217. package/dist/search/index.js +7 -7
  218. package/dist/search/lancedb-backend.d.ts +1 -1
  219. package/dist/search/meilisearch-backend.d.ts +1 -1
  220. package/dist/search/noop-backend.d.ts +1 -1
  221. package/dist/search/orama-backend.d.ts +1 -1
  222. package/dist/search/port.d.ts +1 -1
  223. package/dist/search/remote-backend.d.ts +1 -1
  224. package/dist/{semantic-consolidation-B58v3S-a.d.ts → semantic-consolidation-ClOiS6KP.d.ts} +1 -1
  225. package/dist/semantic-consolidation.d.ts +2 -2
  226. package/dist/semantic-consolidation.js +5 -5
  227. package/dist/semantic-rule-promotion.js +4 -4
  228. package/dist/semantic-rule-verifier.d.ts +1 -1
  229. package/dist/semantic-rule-verifier.js +4 -4
  230. package/dist/session-observer-bands.d.ts +1 -1
  231. package/dist/session-observer-state.d.ts +1 -1
  232. package/dist/shared-context/manager.d.ts +1 -1
  233. package/dist/signal.d.ts +1 -1
  234. package/dist/storage.d.ts +45 -1
  235. package/dist/storage.js +3 -3
  236. package/dist/summarizer.d.ts +1 -1
  237. package/dist/summary-snapshot.d.ts +1 -1
  238. package/dist/temporal-supersession.d.ts +1 -1
  239. package/dist/temporal-validity.d.ts +1 -1
  240. package/dist/threading.d.ts +1 -1
  241. package/dist/tier-migration.d.ts +1 -1
  242. package/dist/tier-routing.d.ts +1 -1
  243. package/dist/topics.d.ts +1 -1
  244. package/dist/transcript.d.ts +1 -1
  245. package/dist/trust-score-stage.d.ts +178 -0
  246. package/dist/trust-score-stage.js +18 -0
  247. package/dist/trust-score-stage.js.map +1 -0
  248. package/dist/trust-score.d.ts +164 -0
  249. package/dist/trust-score.js +22 -0
  250. package/dist/trust-score.js.map +1 -0
  251. package/dist/{types-ACmDOScJ.d.ts → types-BSdUWePh.d.ts} +37 -1
  252. package/dist/types.d.ts +1 -1
  253. package/dist/types.js +1 -1
  254. package/dist/utility-runtime.d.ts +1 -1
  255. package/dist/verified-recall.js +4 -4
  256. package/package.json +2 -2
  257. package/src/access-service.ts +8 -5
  258. package/src/capabilities-cluster-b.test.ts +78 -0
  259. package/src/capabilities.test.ts +11 -1
  260. package/src/capabilities.ts +58 -0
  261. package/src/cli/research-status-commands.ts +7 -3
  262. package/src/cli.ts +11 -6
  263. package/src/config.ts +51 -0
  264. package/src/graph-snapshot.ts +3 -3
  265. package/src/graph.ts +8 -7
  266. package/src/lifecycle/tombstones.test.ts +242 -1
  267. package/src/lifecycle/tombstones.ts +157 -70
  268. package/src/operator-toolkit.ts +24 -7
  269. package/src/orchestration/tier-migration-coordinator.ts +286 -0
  270. package/src/orchestrator.ts +331 -222
  271. package/src/recall-xray.test.ts +62 -0
  272. package/src/recall-xray.ts +34 -0
  273. package/src/trust-score-recall-paths.test.ts +157 -0
  274. package/src/trust-score-stage.test.ts +350 -0
  275. package/src/trust-score-stage.ts +398 -0
  276. package/src/trust-score.test.ts +282 -0
  277. package/src/trust-score.ts +449 -0
  278. package/src/types.ts +42 -0
  279. package/dist/chunk-3JJWNZTT.js.map +0 -1
  280. package/dist/chunk-72VDBALG.js.map +0 -1
  281. package/dist/chunk-A5TUPZ3N.js.map +0 -1
  282. package/dist/chunk-F3PVXKHP.js.map +0 -1
  283. package/dist/chunk-IF362TF6.js.map +0 -1
  284. package/dist/chunk-L5ASZA2F.js.map +0 -1
  285. package/dist/chunk-N3DUH6OO.js.map +0 -1
  286. package/dist/chunk-NFRBADNR.js.map +0 -1
  287. package/dist/chunk-PBH4JUAB.js.map +0 -1
  288. package/dist/chunk-UCJ5CDTK.js.map +0 -1
  289. package/dist/chunk-YGKUAX2B.js.map +0 -1
  290. /package/dist/{chunk-7EEVXW7X.js.map → chunk-2RBMGTK4.js.map} +0 -0
  291. /package/dist/{chunk-YYOK4GVF.js.map → chunk-422TIKIH.js.map} +0 -0
  292. /package/dist/{chunk-KRGC4EDX.js.map → chunk-5YQN2XYC.js.map} +0 -0
  293. /package/dist/{chunk-ANI5DUAE.js.map → chunk-6S5ZI7HB.js.map} +0 -0
  294. /package/dist/{chunk-JIZGYQYH.js.map → chunk-ATGRQ2NE.js.map} +0 -0
  295. /package/dist/{chunk-P5IPFZVH.js.map → chunk-BGQ7WKMT.js.map} +0 -0
  296. /package/dist/{chunk-JAKYZGV4.js.map → chunk-CYJV5AYC.js.map} +0 -0
  297. /package/dist/{chunk-APUJIMDM.js.map → chunk-DG3ORVCU.js.map} +0 -0
  298. /package/dist/{chunk-S35FX6MU.js.map → chunk-H2AGJ5SV.js.map} +0 -0
  299. /package/dist/{chunk-A66YRSOS.js.map → chunk-HAPVZ4CO.js.map} +0 -0
  300. /package/dist/{chunk-4KZGLDJJ.js.map → chunk-HHSO6VCQ.js.map} +0 -0
  301. /package/dist/{chunk-2VHMVWPU.js.map → chunk-HTIL3EJK.js.map} +0 -0
  302. /package/dist/{chunk-CTOQEZSN.js.map → chunk-IPJD7WJH.js.map} +0 -0
  303. /package/dist/{chunk-DIFU33GU.js.map → chunk-JV7Q226R.js.map} +0 -0
  304. /package/dist/{chunk-U5H7WHTS.js.map → chunk-KNN6DAZQ.js.map} +0 -0
  305. /package/dist/{chunk-5RHM43BJ.js.map → chunk-LLLG5PTE.js.map} +0 -0
  306. /package/dist/{chunk-2PTBLS2S.js.map → chunk-NBYXOEO7.js.map} +0 -0
  307. /package/dist/{chunk-URM3HW2R.js.map → chunk-NE5WFIY6.js.map} +0 -0
  308. /package/dist/{chunk-REWQAFSA.js.map → chunk-NERBFQNY.js.map} +0 -0
  309. /package/dist/{chunk-773DPI6T.js.map → chunk-NO4DWSQE.js.map} +0 -0
  310. /package/dist/{chunk-OZ2KQ7HF.js.map → chunk-O6SEGJNV.js.map} +0 -0
  311. /package/dist/{chunk-OJU73BUX.js.map → chunk-PPVCZPYA.js.map} +0 -0
  312. /package/dist/{chunk-S3OPGGZB.js.map → chunk-RIW3UDDY.js.map} +0 -0
  313. /package/dist/{chunk-AU7Q3LSC.js.map → chunk-RKNJBZ55.js.map} +0 -0
  314. /package/dist/{chunk-EH27LHML.js.map → chunk-RX7EBFFJ.js.map} +0 -0
  315. /package/dist/{chunk-2COL35PK.js.map → chunk-T3XSXAWK.js.map} +0 -0
  316. /package/dist/{chunk-2KAYTPPT.js.map → chunk-UUMYB3FR.js.map} +0 -0
  317. /package/dist/{chunk-LXSG4L55.js.map → chunk-V7UUIIR7.js.map} +0 -0
  318. /package/dist/{chunk-HLIR3RJ7.js.map → chunk-WBHQ5LP5.js.map} +0 -0
  319. /package/dist/{chunk-YTZLBBEB.js.map → chunk-YMPEGBLL.js.map} +0 -0
  320. /package/dist/{chunk-YI7RZO7Y.js.map → chunk-ZE7GJ76H.js.map} +0 -0
  321. /package/dist/{chunk-74MYJSKB.js.map → chunk-ZG2WP425.js.map} +0 -0
  322. /package/dist/{forget-U66KPDPY.js.map → forget-OEE5OELK.js.map} +0 -0
  323. /package/dist/{graph-edge-decay-JLOF3YW4.js.map → graph-edge-decay-QDDC6AVV.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isRecallDisclosure
3
- } from "./chunk-N3DUH6OO.js";
3
+ } from "./chunk-ZW5I3UNP.js";
4
4
  import {
5
5
  normalizeRetrievedMemoryProvenance
6
6
  } from "./chunk-I4WBNM3M.js";
@@ -197,6 +197,21 @@ function cloneResult(result) {
197
197
  provenance: ss.provenance
198
198
  };
199
199
  }
200
+ if (result.trust) {
201
+ const t = result.trust;
202
+ const components = {};
203
+ for (const [k, v] of Object.entries(t.components)) {
204
+ components[k] = { value: v.value, weight: v.weight };
205
+ }
206
+ out.trust = {
207
+ score: t.score,
208
+ band: t.band,
209
+ components,
210
+ multiplier: t.multiplier,
211
+ quarantined: t.quarantined,
212
+ ...t.quarantineReason ? { quarantineReason: t.quarantineReason } : {}
213
+ };
214
+ }
200
215
  return out;
201
216
  }
202
217
  function summarizeDisclosureTokens(results) {
@@ -277,4 +292,4 @@ export {
277
292
  RecallXrayBuilder,
278
293
  summarizeDisclosureTokens
279
294
  };
280
- //# sourceMappingURL=chunk-L5ASZA2F.js.map
295
+ //# sourceMappingURL=chunk-3XEGHEQ2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/recall-xray.ts"],"sourcesContent":["/**\n * Recall X-ray snapshot schema (issue #570, PR 1).\n *\n * The X-ray surface is the unified, per-result attribution document that\n * merges the tier that served each memory, its score decomposition, any\n * graph path, an audit entry id, and the exact filter/eligibility ladder\n * that either admitted or rejected each candidate. This file defines the\n * schema and an in-memory builder + builder-state helper.\n *\n * Scope for PR 1 (this slice):\n * - Types only + pure builder functions (no IO, no rendering).\n * - Orchestrator plumbing captures a snapshot when the caller passes\n * `xrayCapture: true`. No behavior change when the flag is absent.\n * - NO new public surfaces here — CLI/HTTP/MCP land in later slices.\n *\n * The shared renderer lands in PR 2 at `recall-xray-renderer.ts`. Do not\n * fork formatting logic into other surfaces; extend the renderer.\n */\n\nimport { randomUUID } from \"node:crypto\";\n\nimport {\n normalizeRetrievedMemoryProvenance,\n type RetrievedMemoryProvenance,\n} from \"./memory-provenance.js\";\nimport type { RecallDisclosure, RecallTierExplain } from \"./types.js\";\nimport { isRecallDisclosure } from \"./types.js\";\n\n/**\n * Estimate token cost of a payload at the rough ~4 chars/token English\n * heuristic. Non-negative integer; returns 0 for empty / null input.\n * Used by recall surfaces to attach `estimatedTokens` to X-ray results\n * (issue #677 PR 3/4). Identical to the private heuristic in\n * `chunking.ts`; kept self-contained here so X-ray callers don't pull\n * in chunking internals.\n */\nexport function estimateRecallTokens(text: string | null | undefined): number {\n if (typeof text !== \"string\" || text.length === 0) return 0;\n return Math.ceil(text.length / 4);\n}\n\n/**\n * Aggregated per-disclosure token spend summary, computed by the\n * renderer from a snapshot's results. Non-negative integers.\n */\nexport interface RecallXrayDisclosureSummary {\n chunk: { count: number; estimatedTokens: number };\n section: { count: number; estimatedTokens: number };\n raw: { count: number; estimatedTokens: number };\n /** Number of results without a recorded disclosure level. */\n unspecified: { count: number; estimatedTokens: number };\n}\n\n/**\n * Which retrieval source produced a given result. This is the X-ray\n * tier ladder called out in issue #570 and is *distinct* from the\n * `RetrievalTier` enum (which describes issue #518's tier-explain\n * block). Keeping the sets separate lets the two observability\n * surfaces evolve without conflating their vocabularies:\n *\n * - `RetrievalTier` — direct-answer eligibility ladder.\n * - `RecallXrayServedBy` — which source materialized each result.\n */\nexport type RecallXrayServedBy =\n | \"direct-answer\"\n | \"hybrid\"\n | \"graph\"\n | \"recent-scan\"\n | \"procedural\"\n | \"review-context\"\n | \"lcm-file-parts\"\n | \"lcm-tool-parts\";\n\nexport const RECALL_XRAY_SERVED_BY_VALUES: readonly RecallXrayServedBy[] = [\n \"direct-answer\",\n \"hybrid\",\n \"graph\",\n \"recent-scan\",\n \"procedural\",\n \"review-context\",\n \"lcm-file-parts\",\n \"lcm-tool-parts\",\n] as const;\n\nexport function isRecallXrayServedBy(\n value: unknown,\n): value is RecallXrayServedBy {\n return (\n typeof value === \"string\" &&\n (RECALL_XRAY_SERVED_BY_VALUES as readonly string[]).includes(value)\n );\n}\n\n/**\n * Score decomposition for a single X-ray result.\n *\n * All fields are optional because different tiers populate different\n * terms: `hybrid` reports vector + bm25 + mmr penalty, `direct-answer`\n * reports importance + tier prior, etc. The only guaranteed field is\n * `final`, which is the post-combination score used for ordering.\n */\nexport interface RecallXrayScoreDecomposition {\n vector?: number;\n bm25?: number;\n importance?: number;\n mmrPenalty?: number;\n tierPrior?: number;\n /** Additive boost from `reinforcement_count` frontmatter (issue #687 PR 3/4). */\n reinforcementBoost?: number;\n final: number;\n}\n\n/**\n * Per-result breakdown inside an X-ray snapshot.\n */\nexport interface RecallXrayResult {\n memoryId: string;\n path: string;\n servedBy: RecallXrayServedBy;\n scoreDecomposition: RecallXrayScoreDecomposition;\n graphPath?: string[];\n /**\n * Issue #681 PR 3/3 — per-edge confidence values aligned with\n * `graphPath`. When present, `graphEdgeConfidences[i]` is the\n * confidence of the edge between `graphPath[i]` and `graphPath[i+1]`,\n * so the array length is one less than `graphPath`. Legacy edges\n * without a recorded confidence render as `1.0`. Operators use this\n * to attribute floor-pruning and PageRank ranking decisions back to\n * specific edges. The renderer drops the line when the array is\n * empty or absent so legacy snapshots round-trip cleanly.\n */\n graphEdgeConfidences?: number[];\n auditEntryId?: string;\n /** Human-readable list of filters the candidate *passed*. */\n admittedBy: string[];\n /**\n * First filter that *would have* rejected the candidate, or undefined\n * when the candidate was admitted without a rejection trace. When\n * present, `admittedBy` may still contain filters the candidate passed\n * before the rejecting gate; consumers should render both.\n */\n rejectedBy?: string;\n /**\n * Disclosure depth used to render this result's payload (issue #677\n * PR 3/4). Mirrors the per-result disclosure already exposed in the\n * recall response so X-ray consumers can attribute token spend to\n * the depth that produced it.\n */\n disclosure?: RecallDisclosure;\n /**\n * Estimated token cost of the rendered payload at the chosen\n * disclosure depth. Non-negative integer. Computed by callers via\n * `estimateRecallTokens(text)`; the renderer aggregates these into\n * a per-disclosure summary so operators can see where their budget\n * went.\n */\n estimatedTokens?: number;\n /**\n * Free-form tags from the memory's YAML frontmatter (issue #689 PR 3/3).\n * Populated by the X-ray capture path when the caller passes a `tags`\n * filter so per-result tags are available alongside the filter trace\n * in `snapshot.filters`. Also populated without a filter when the\n * orchestrator decorates results via `xrayCapture: true` so all X-ray\n * consumers can inspect memory labels without a separate storage read.\n * Absent (not `[]`) when the frontmatter has no tags or the memory\n * could not be read.\n */\n tags?: string[];\n /**\n * Per-result memory provenance and safety context. Populated by recall\n * capture when the memory frontmatter was already loaded by retrieval.\n */\n provenance?: RetrievedMemoryProvenance;\n /**\n * Claim-level provenance span (issue #1575 PR 3). The first source excerpt\n * backing this memory, surfaced so X-ray consumers can see the literal\n * utterance each fact derives from alongside retrieval provenance. Absent\n * when the memory carries no source spans (legacy or `provenance: \"none\"`).\n */\n sourceSpan?: {\n /** Verbatim quote excerpt (capped at write time by `provenance.maxQuoteChars`). */\n quote: string;\n /** ISO timestamp of the source turn. */\n observedAt: string;\n /** Coarse strength tag from the frontmatter. */\n provenance: \"verified\" | \"unverified\" | \"none\";\n };\n /**\n * Issue #1577 — per-result trust score, band, and components from the\n * unified TrustScore recall stage. Present when `trustScoreEnabled` is on.\n * Quarantined items appear here with `quarantined: true` and a reason so\n * exclusion never looks like \"no result\" (rule 34).\n */\n trust?: {\n score: number;\n band: \"high\" | \"medium\" | \"low\" | \"quarantine\";\n components: Record<string, { value: number; weight: number }>;\n multiplier: number;\n quarantined: boolean;\n quarantineReason?: string;\n };\n}\n\n/**\n * Trace entry for a filter the orchestrator evaluated during recall.\n * Captures the name of the filter, how many candidates it saw, and how\n * many it let through. Used by X-ray consumers to render the filter\n * ladder above the per-result breakdown.\n */\nexport interface RecallFilterTrace {\n name: string;\n considered: number;\n admitted: number;\n /** Optional human-readable reason for any rejections. */\n reason?: string;\n}\n\n/**\n * Peer-profile injection annotation (issue #679 completion).\n *\n * When `peerProfileRecallEnabled` is true and a peer is registered for\n * the session, the orchestrator injects a `## Peer Profile` section into\n * the recall context. This annotation records which peer was injected and\n * how many profile fields were included so operators can correlate\n * retrieval quality with peer-context enrichment.\n *\n * `null` means no peer profile was injected (peer not registered, feature\n * disabled, or peer has no profile fields).\n */\nexport interface RecallXrayPeerProfileInjection {\n /** The peer id whose profile was injected. */\n peerId: string;\n /**\n * Number of profile fields included after the `peerProfileRecallMaxFields`\n * cap was applied. Zero means the profile existed but had no fields.\n */\n fieldsInjected: number;\n}\n\n/**\n * The unified X-ray snapshot. CLI, HTTP, and MCP surfaces all render\n * this same shape through the shared renderer (CLAUDE.md rule 22).\n */\nexport interface RecallXraySnapshot {\n /** Stable v1 tag so downstream consumers can version-gate their parsers. */\n schemaVersion: \"1\";\n query: string;\n /** UUID minted per capture; unique across snapshots within a process. */\n snapshotId: string;\n /** Epoch milliseconds the snapshot was captured. */\n capturedAt: number;\n /**\n * Tier-explain block from issue #518, carried verbatim when present.\n * `null` means direct-answer tier did not run (disabled, or another\n * tier served the query).\n */\n tierExplain: RecallTierExplain | null;\n results: RecallXrayResult[];\n filters: RecallFilterTrace[];\n /**\n * Character budget accounting for the final assembled recall payload.\n * `used` is the rendered-context length; `chars` is the cap. Both are\n * non-negative integers in `[0, 2**31)`.\n */\n budget: { chars: number; used: number };\n /** Optional session-scope fields carried for downstream filtering. */\n sessionKey?: string;\n namespace?: string;\n traceId?: string;\n /**\n * Peer-profile injection metadata (issue #679 completion).\n * Non-null when `peerProfileRecallEnabled` is true and a peer profile\n * was successfully injected into this recall's context. `null` (or\n * absent) means no peer profile was injected.\n */\n peerProfileInjection?: RecallXrayPeerProfileInjection | null;\n}\n\n// ─── Builder ──────────────────────────────────────────────────────────────\n\nexport interface BuildXraySnapshotInput {\n query: string;\n tierExplain?: RecallTierExplain | null;\n results?: RecallXrayResult[];\n filters?: RecallFilterTrace[];\n budget?: { chars?: number; used?: number };\n sessionKey?: string;\n namespace?: string;\n traceId?: string;\n /** Peer-profile injection metadata (issue #679 completion). */\n peerProfileInjection?: RecallXrayPeerProfileInjection | null;\n /** Optional injected timestamp for deterministic tests. */\n now?: () => number;\n /** Optional injected id generator for deterministic tests. */\n snapshotIdGenerator?: () => string;\n}\n\n/**\n * Build a `RecallXraySnapshot` from explicit input fields. Pure\n * function; safe to call from anywhere. All array/object inputs are\n * shallow-copied so caller mutation after build cannot tear the\n * returned snapshot.\n */\nexport function buildXraySnapshot(\n input: BuildXraySnapshotInput,\n): RecallXraySnapshot {\n const now = input.now ?? Date.now;\n const snapshotIdGenerator = input.snapshotIdGenerator ?? randomUUID;\n\n const results = Array.isArray(input.results)\n ? input.results.map(cloneResult)\n : [];\n const filters = Array.isArray(input.filters)\n ? input.filters.map(cloneFilter)\n : [];\n\n const budgetChars = nonNegativeInt(input.budget?.chars);\n const budgetUsed = nonNegativeInt(input.budget?.used);\n\n const tierExplain =\n input.tierExplain && typeof input.tierExplain === \"object\"\n ? cloneTierExplain(input.tierExplain)\n : null;\n\n // Peer-profile injection annotation (issue #679 completion).\n // Deep-copy via structuredClone so the caller can't mutate the snapshot\n // after build. Accept null explicitly (no injection) or a valid object.\n let peerProfileInjection: RecallXrayPeerProfileInjection | null | undefined;\n if (input.peerProfileInjection && typeof input.peerProfileInjection === \"object\") {\n const raw = input.peerProfileInjection;\n const peerId = nonEmptyString(raw.peerId);\n if (peerId !== undefined) {\n peerProfileInjection = {\n peerId,\n fieldsInjected: nonNegativeInt(raw.fieldsInjected),\n };\n }\n } else if (input.peerProfileInjection === null) {\n peerProfileInjection = null;\n }\n\n const out: RecallXraySnapshot = {\n schemaVersion: \"1\",\n query: typeof input.query === \"string\" ? input.query : \"\",\n snapshotId: snapshotIdGenerator(),\n capturedAt: now(),\n tierExplain,\n results,\n filters,\n budget: { chars: budgetChars, used: budgetUsed },\n sessionKey: nonEmptyString(input.sessionKey),\n namespace: nonEmptyString(input.namespace),\n traceId: nonEmptyString(input.traceId),\n };\n if (peerProfileInjection !== undefined) {\n out.peerProfileInjection = peerProfileInjection;\n }\n return out;\n}\n\n/**\n * Mutable builder used by the orchestrator to accumulate X-ray fields\n * as recall progresses. Call `build()` to get the finalized\n * immutable-ish snapshot. All inputs are validated at insert time so\n * a malformed entry cannot poison the snapshot later.\n */\nexport class RecallXrayBuilder {\n private readonly query: string;\n private readonly sessionKey: string | undefined;\n private namespace: string | undefined;\n private traceId: string | undefined;\n private tierExplain: RecallTierExplain | null = null;\n private readonly results: RecallXrayResult[] = [];\n private readonly filters: RecallFilterTrace[] = [];\n private budgetChars = 0;\n private budgetUsed = 0;\n private peerProfileInjection: RecallXrayPeerProfileInjection | null | undefined;\n\n constructor(opts: {\n query: string;\n sessionKey?: string;\n namespace?: string;\n traceId?: string;\n }) {\n this.query = typeof opts.query === \"string\" ? opts.query : \"\";\n this.sessionKey = nonEmptyString(opts.sessionKey);\n this.namespace = nonEmptyString(opts.namespace);\n this.traceId = nonEmptyString(opts.traceId);\n }\n\n setNamespace(namespace: string | undefined): void {\n this.namespace = nonEmptyString(namespace);\n }\n\n setTraceId(traceId: string | undefined): void {\n this.traceId = nonEmptyString(traceId);\n }\n\n setTierExplain(tierExplain: RecallTierExplain | null | undefined): void {\n this.tierExplain =\n tierExplain && typeof tierExplain === \"object\"\n ? cloneTierExplain(tierExplain)\n : null;\n }\n\n setBudget(budget: { chars?: number; used?: number }): void {\n this.budgetChars = nonNegativeInt(budget.chars);\n this.budgetUsed = nonNegativeInt(budget.used);\n }\n\n /**\n * Record peer-profile injection metadata for this recall snapshot\n * (issue #679 completion). Pass `null` to explicitly record that no\n * injection happened (feature enabled but no peer / no profile fields).\n */\n setPeerProfileInjection(\n injection: RecallXrayPeerProfileInjection | null,\n ): void {\n this.peerProfileInjection = injection;\n }\n\n recordResult(result: RecallXrayResult): void {\n this.results.push(cloneResult(result));\n }\n\n recordFilter(filter: RecallFilterTrace): void {\n this.filters.push(cloneFilter(filter));\n }\n\n build(opts: {\n now?: () => number;\n snapshotIdGenerator?: () => string;\n } = {}): RecallXraySnapshot {\n return buildXraySnapshot({\n query: this.query,\n tierExplain: this.tierExplain,\n results: this.results,\n filters: this.filters,\n budget: { chars: this.budgetChars, used: this.budgetUsed },\n sessionKey: this.sessionKey,\n namespace: this.namespace,\n traceId: this.traceId,\n peerProfileInjection: this.peerProfileInjection,\n now: opts.now,\n snapshotIdGenerator: opts.snapshotIdGenerator,\n });\n }\n}\n\n// ─── Internals ────────────────────────────────────────────────────────────\n\nfunction cloneResult(result: RecallXrayResult): RecallXrayResult {\n if (!result || typeof result !== \"object\") {\n throw new TypeError(\"RecallXrayResult must be an object\");\n }\n if (!isRecallXrayServedBy(result.servedBy)) {\n throw new TypeError(\n `RecallXrayResult.servedBy must be one of ${RECALL_XRAY_SERVED_BY_VALUES.join(\n \", \",\n )}; got ${JSON.stringify(result.servedBy)}`,\n );\n }\n const memoryId = typeof result.memoryId === \"string\" ? result.memoryId : \"\";\n const path = typeof result.path === \"string\" ? result.path : \"\";\n const admittedBy = Array.isArray(result.admittedBy)\n ? result.admittedBy.filter((x): x is string => typeof x === \"string\")\n : [];\n const graphPath = Array.isArray(result.graphPath)\n ? result.graphPath.filter((x): x is string => typeof x === \"string\")\n : undefined;\n // Issue #681 PR 3/3 — per-edge confidences alongside graph path.\n // Each entry is clamped into [0, 1]; the array is rejected wholesale\n // when alignment cannot be verified so downstream surfaces can rely\n // on `graphEdgeConfidences[i]` describing the edge between\n // `graphPath[i]` and `graphPath[i+1]`.\n //\n // Cursor review (#735): the input array length MUST match\n // `graphPath.length - 1` *before* any per-element filtering. The\n // earlier implementation skipped non-finite entries via `continue`\n // and then length-checked the cleaned array — that would silently\n // shift surviving values to earlier positions. Example: input\n // `[0.5, NaN, 0.7]` for a 3-edge path would collapse to\n // `[0.5, 0.7]`, length-check would pass against `expected = 2`, and\n // the renderer would mis-attribute `0.7` to edge B→C when it really\n // came from edge C→D. Reject on either size mismatch or any\n // non-finite entry so misalignment is impossible.\n let graphEdgeConfidences: number[] | undefined;\n if (Array.isArray(result.graphEdgeConfidences) && graphPath && graphPath.length > 1) {\n const expected = graphPath.length - 1;\n const raw = result.graphEdgeConfidences;\n if (raw.length === expected) {\n const cleaned: number[] = [];\n let allFinite = true;\n for (const value of raw) {\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n allFinite = false;\n break;\n }\n cleaned.push(Math.min(1, Math.max(0, value)));\n }\n if (allFinite) {\n graphEdgeConfidences = cleaned;\n }\n }\n }\n const auditEntryId = nonEmptyString(result.auditEntryId);\n const rejectedBy = nonEmptyString(result.rejectedBy);\n const scoreDecomposition = cloneScoreDecomposition(result.scoreDecomposition);\n const out: RecallXrayResult = {\n memoryId,\n path,\n servedBy: result.servedBy,\n scoreDecomposition,\n admittedBy,\n };\n if (graphPath !== undefined) out.graphPath = graphPath;\n if (graphEdgeConfidences !== undefined) {\n out.graphEdgeConfidences = graphEdgeConfidences;\n }\n if (auditEntryId !== undefined) out.auditEntryId = auditEntryId;\n if (rejectedBy !== undefined) out.rejectedBy = rejectedBy;\n // Disclosure + token telemetry (issue #677 PR 3/4). Only attach when\n // present and well-formed; unknown disclosure values are dropped so a\n // bad caller can't poison downstream renderers. Uses the shared\n // `isRecallDisclosure` guard so adding a fourth disclosure level\n // requires touching only `types.ts`.\n if (isRecallDisclosure(result.disclosure)) {\n out.disclosure = result.disclosure;\n }\n if (\n typeof result.estimatedTokens === \"number\" &&\n Number.isFinite(result.estimatedTokens) &&\n result.estimatedTokens >= 0\n ) {\n out.estimatedTokens = Math.floor(result.estimatedTokens);\n }\n // Tags from frontmatter (issue #689 PR 3/3). Normalize identically to\n // the recall-surface path: trim and drop empty strings so consumers can\n // compare tags directly without a secondary normalization step.\n if (Array.isArray(result.tags)) {\n const cleanedTags = result.tags\n .filter((t): t is string => typeof t === \"string\")\n .map((t) => t.trim())\n .filter((t) => t.length > 0);\n if (cleanedTags.length > 0) {\n out.tags = cleanedTags;\n }\n }\n const provenance = normalizeRetrievedMemoryProvenance(result.provenance);\n if (provenance !== undefined) {\n out.provenance = provenance;\n }\n // Claim-level provenance span (#1575 PR 3). Deep-copy the three scalar\n // fields so the snapshot returned by getLastXraySnapshot is independent\n // of the caller's object (matches the structuredClone contract).\n const ss = result.sourceSpan;\n if (\n ss &&\n typeof ss.quote === \"string\" &&\n typeof ss.observedAt === \"string\" &&\n (ss.provenance === \"verified\" ||\n ss.provenance === \"unverified\" ||\n ss.provenance === \"none\")\n ) {\n out.sourceSpan = {\n quote: ss.quote,\n observedAt: ss.observedAt,\n provenance: ss.provenance,\n };\n }\n // Issue #1577 — preserve the trust projection through the clone so\n // getLastXraySnapshot surfaces trust score/band/quarantine reason (review\n // Oqg_o: cloneResult was silently dropping the field). Deep-copy the scalar +\n // record fields so the snapshot is independent of the caller's object,\n // matching the structuredClone contract used for every other field above.\n if (result.trust) {\n const t = result.trust;\n const components: Record<string, { value: number; weight: number }> = {};\n for (const [k, v] of Object.entries(t.components)) {\n components[k] = { value: v.value, weight: v.weight };\n }\n out.trust = {\n score: t.score,\n band: t.band,\n components,\n multiplier: t.multiplier,\n quarantined: t.quarantined,\n ...(t.quarantineReason ? { quarantineReason: t.quarantineReason } : {}),\n };\n }\n return out;\n}\n\n/**\n * Summarize per-disclosure token spend across an X-ray snapshot's\n * results. Pure helper — used by the markdown renderer to print a\n * \"per-disclosure token spend\" line and exposed for tests / surfaces.\n */\nexport function summarizeDisclosureTokens(\n results: ReadonlyArray<RecallXrayResult>,\n): RecallXrayDisclosureSummary {\n const summary: RecallXrayDisclosureSummary = {\n chunk: { count: 0, estimatedTokens: 0 },\n section: { count: 0, estimatedTokens: 0 },\n raw: { count: 0, estimatedTokens: 0 },\n unspecified: { count: 0, estimatedTokens: 0 },\n };\n for (const result of results) {\n const tokens =\n typeof result.estimatedTokens === \"number\" &&\n Number.isFinite(result.estimatedTokens) &&\n result.estimatedTokens >= 0\n ? Math.floor(result.estimatedTokens)\n : 0;\n const bucket = isRecallDisclosure(result.disclosure)\n ? result.disclosure\n : \"unspecified\";\n summary[bucket].count += 1;\n summary[bucket].estimatedTokens += tokens;\n }\n return summary;\n}\n\nfunction cloneFilter(filter: RecallFilterTrace): RecallFilterTrace {\n if (!filter || typeof filter !== \"object\") {\n throw new TypeError(\"RecallFilterTrace must be an object\");\n }\n const out: RecallFilterTrace = {\n name: typeof filter.name === \"string\" ? filter.name : \"\",\n considered: nonNegativeInt(filter.considered),\n admitted: nonNegativeInt(filter.admitted),\n };\n const reason = nonEmptyString(filter.reason);\n if (reason !== undefined) out.reason = reason;\n return out;\n}\n\nfunction cloneScoreDecomposition(\n value: RecallXrayScoreDecomposition | undefined,\n): RecallXrayScoreDecomposition {\n if (!value || typeof value !== \"object\") {\n return { final: 0 };\n }\n const out: RecallXrayScoreDecomposition = {\n final: finiteNumber(value.final) ?? 0,\n };\n const vector = finiteNumber(value.vector);\n if (vector !== undefined) out.vector = vector;\n const bm25 = finiteNumber(value.bm25);\n if (bm25 !== undefined) out.bm25 = bm25;\n const importance = finiteNumber(value.importance);\n if (importance !== undefined) out.importance = importance;\n const mmrPenalty = finiteNumber(value.mmrPenalty);\n if (mmrPenalty !== undefined) out.mmrPenalty = mmrPenalty;\n const tierPrior = finiteNumber(value.tierPrior);\n if (tierPrior !== undefined) out.tierPrior = tierPrior;\n const reinforcementBoost = finiteNumber(value.reinforcementBoost);\n if (reinforcementBoost !== undefined && reinforcementBoost > 0) {\n out.reinforcementBoost = reinforcementBoost;\n }\n return out;\n}\n\nfunction cloneTierExplain(tierExplain: RecallTierExplain): RecallTierExplain {\n // Use structuredClone so future RecallTierExplain additions do not\n // silently share references through hand-enumerated fields. The\n // payload is JSON-shaped.\n return structuredClone(tierExplain);\n}\n\nfunction nonNegativeInt(value: unknown): number {\n if (typeof value !== \"number\" || !Number.isFinite(value)) return 0;\n if (value <= 0) return 0;\n return Math.floor(value);\n}\n\nfunction finiteNumber(value: unknown): number | undefined {\n if (typeof value !== \"number\" || !Number.isFinite(value)) return undefined;\n return value;\n}\n\nfunction nonEmptyString(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined;\n const trimmed = value.trim();\n if (trimmed.length === 0) return undefined;\n return trimmed;\n}\n"],"mappings":";;;;;;;;AAmBA,SAAS,kBAAkB;AAiBpB,SAAS,qBAAqB,MAAyC;AAC5E,MAAI,OAAO,SAAS,YAAY,KAAK,WAAW,EAAG,QAAO;AAC1D,SAAO,KAAK,KAAK,KAAK,SAAS,CAAC;AAClC;AAkCO,IAAM,+BAA8D;AAAA,EACzE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,E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AS,eAAe,OAAoC;AAC1D,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,QAAM,UAAU,MAAM,KAAK;AAC3B,MAAI,QAAQ,WAAW,EAAG,QAAO;AACjC,SAAO;AACT;","names":[]}
@@ -2,7 +2,7 @@ import {
2
2
  TombstoneStore,
3
3
  buildRetiredFactTombstoneInputs,
4
4
  collectRetiredMemoriesForRebuild
5
- } from "./chunk-3JJWNZTT.js";
5
+ } from "./chunk-L2B3EE7B.js";
6
6
  import {
7
7
  WEARABLES_DIR_NAME,
8
8
  isValidTranscriptDate
@@ -27,7 +27,7 @@ import {
27
27
  import {
28
28
  SPECULATIVE_TTL_DAYS,
29
29
  confidenceTier
30
- } from "./chunk-N3DUH6OO.js";
30
+ } from "./chunk-ZW5I3UNP.js";
31
31
  import {
32
32
  inferMemoryStatus,
33
33
  isArchivedMemoryPath,
@@ -5863,4 +5863,4 @@ export {
5863
5863
  serializeEntityFile,
5864
5864
  StorageManager
5865
5865
  };
5866
- //# sourceMappingURL=chunk-YYOK4GVF.js.map
5866
+ //# sourceMappingURL=chunk-422TIKIH.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-SFQ6QNL7.js";
7
7
  import {
8
8
  StorageManager
9
- } from "./chunk-YYOK4GVF.js";
9
+ } from "./chunk-422TIKIH.js";
10
10
  import {
11
11
  buildLifecycleEventsForMemory,
12
12
  sortMemoryLifecycleEvents
@@ -74,4 +74,4 @@ export {
74
74
  backupExistingLedger,
75
75
  rebuildMemoryLifecycleLedger
76
76
  };
77
- //# sourceMappingURL=chunk-KRGC4EDX.js.map
77
+ //# sourceMappingURL=chunk-5YQN2XYC.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AdapterRegistry
3
- } from "./chunk-AU7Q3LSC.js";
3
+ } from "./chunk-RKNJBZ55.js";
4
4
  import {
5
5
  WearablesInputError
6
6
  } from "./chunk-7WV3F5DQ.js";
@@ -17,19 +17,19 @@ import {
17
17
  markPlanResolved,
18
18
  markPromotionResolved,
19
19
  sessionBelongsToPrincipal
20
- } from "./chunk-P5IPFZVH.js";
20
+ } from "./chunk-BGQ7WKMT.js";
21
21
  import {
22
22
  validateRequest
23
23
  } from "./chunk-FVZ2ISIX.js";
24
24
  import {
25
25
  getOperation
26
- } from "./chunk-URM3HW2R.js";
26
+ } from "./chunk-NE5WFIY6.js";
27
27
  import {
28
28
  EngramAccessInputError
29
- } from "./chunk-F3PVXKHP.js";
29
+ } from "./chunk-M3GBOKUX.js";
30
30
  import {
31
31
  CorrectionContractError
32
- } from "./chunk-OJU73BUX.js";
32
+ } from "./chunk-PPVCZPYA.js";
33
33
  import {
34
34
  isTrustZoneName
35
35
  } from "./chunk-JGSKJHF7.js";
@@ -41,7 +41,7 @@ import {
41
41
  } from "./chunk-DEUNUKTD.js";
42
42
  import {
43
43
  isRecallDisclosure
44
- } from "./chunk-N3DUH6OO.js";
44
+ } from "./chunk-ZW5I3UNP.js";
45
45
  import {
46
46
  OFFLINE_SYNC_APPLY_MAX_BODY_BYTES,
47
47
  OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES,
@@ -2528,4 +2528,4 @@ function positiveIntQueryParam(value, label) {
2528
2528
  export {
2529
2529
  EngramAccessHttpServer
2530
2530
  };
2531
- //# sourceMappingURL=chunk-ANI5DUAE.js.map
2531
+ //# sourceMappingURL=chunk-6S5ZI7HB.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  defineOperation
3
- } from "./chunk-URM3HW2R.js";
3
+ } from "./chunk-NE5WFIY6.js";
4
4
  import {
5
5
  EngramAccessInputError
6
- } from "./chunk-F3PVXKHP.js";
6
+ } from "./chunk-M3GBOKUX.js";
7
7
  import {
8
8
  projectTagProjectId
9
9
  } from "./chunk-J6BH2OBA.js";
@@ -1023,7 +1023,7 @@ defineOperation({
1023
1023
  if (!cfg.graphEdgeDecayEnabled) {
1024
1024
  return { result: { ranAt: (/* @__PURE__ */ new Date()).toISOString(), disabled: true, reason: "graphEdgeDecayEnabled is false" } };
1025
1025
  }
1026
- const { runGraphEdgeDecayMaintenanceAcrossNamespaces } = await import("./graph-edge-decay-JLOF3YW4.js");
1026
+ const { runGraphEdgeDecayMaintenanceAcrossNamespaces } = await import("./graph-edge-decay-QDDC6AVV.js");
1027
1027
  const dryRun = input.dryRun === true;
1028
1028
  const results = await runGraphEdgeDecayMaintenanceAcrossNamespaces(ctx.service.memoryDir, {
1029
1029
  windowMs: cfg.graphEdgeDecayWindowMs,
@@ -1312,4 +1312,4 @@ defineOperation({
1312
1312
  schema: looseSchema,
1313
1313
  handler: async (_input, _ctx) => ({ result: { stream: "sse" } })
1314
1314
  });
1315
- //# sourceMappingURL=chunk-JIZGYQYH.js.map
1315
+ //# sourceMappingURL=chunk-ATGRQ2NE.js.map
@@ -0,0 +1,173 @@
1
+ import {
2
+ computeTrustScore,
3
+ trustMultiplier
4
+ } from "./chunk-YN2UN7N3.js";
5
+ import {
6
+ computeMemoryWorth
7
+ } from "./chunk-IISBCCWR.js";
8
+
9
+ // src/trust-score-stage.ts
10
+ function buildTrustSignalMap(memories, now, options = {}) {
11
+ const map = /* @__PURE__ */ new Map();
12
+ const nowMs = now.getTime();
13
+ const nowUsable = Number.isFinite(nowMs);
14
+ for (const m of memories) {
15
+ const fm = m.frontmatter;
16
+ const signals = {};
17
+ if (fm.mw_success !== void 0 || fm.mw_fail !== void 0) {
18
+ const halfLifeMs = options.recencyHalfLifeDays !== void 0 ? options.recencyHalfLifeDays * 864e5 : void 0;
19
+ const worth = computeMemoryWorth({
20
+ mw_success: fm.mw_success,
21
+ mw_fail: fm.mw_fail,
22
+ lastAccessed: fm.lastAccessed,
23
+ now,
24
+ halfLifeMs
25
+ });
26
+ signals.memoryWorth = { score: worth.score, confidence: worth.confidence };
27
+ }
28
+ if (fm.provenance !== void 0) signals.provenance = fm.provenance;
29
+ if (fm.faithfulness !== void 0) {
30
+ signals.faithfulness = fm.faithfulness.verdict === "skipped_no_span" ? "unchecked" : fm.faithfulness.verdict;
31
+ }
32
+ if (Array.isArray(fm.sources) && fm.sources.length > 0) {
33
+ const distinct = new Set(
34
+ fm.sources.map((s) => `${s.sessionKey ?? ""}|${s.turnId ?? ""}`)
35
+ );
36
+ signals.corroborationCount = distinct.size;
37
+ }
38
+ const ts = fm.observedAt ?? fm.lastAccessed;
39
+ if (nowUsable && typeof ts === "string" && ts.length > 0) {
40
+ const parsed = Date.parse(ts);
41
+ if (Number.isFinite(parsed)) {
42
+ const ageDays = Math.max(0, (nowMs - parsed) / (24 * 60 * 60 * 1e3));
43
+ signals.ageDays = ageDays;
44
+ if (options.recencyHalfLifeDays !== void 0) {
45
+ signals.recencyHalfLifeDays = options.recencyHalfLifeDays;
46
+ }
47
+ }
48
+ }
49
+ if (Object.keys(signals).length > 0) {
50
+ map.set(m.path, signals);
51
+ }
52
+ }
53
+ return map;
54
+ }
55
+ function applyTrustScoreStage(candidates, options) {
56
+ const reorder = options.reorder !== false;
57
+ const quarantine = options.quarantine !== false;
58
+ const minMul = options.minMultiplier;
59
+ const maxMul = options.maxMultiplier;
60
+ const all = [];
61
+ const admitted = [];
62
+ const quarantined = [];
63
+ for (let i = 0; i < candidates.length; i += 1) {
64
+ const c = candidates[i];
65
+ const signals = options.signals.get(c.path);
66
+ const trust = computeTrustScore(signals, options.weights);
67
+ const isQuarantined = quarantine && trust.band === "quarantine";
68
+ const multiplier = isQuarantined ? 1 : trustMultiplier(trust.score, minMul, maxMul);
69
+ const safeBase = c.score < 0 ? 0 : c.score;
70
+ const scored = safeBase * multiplier;
71
+ const item = {
72
+ path: c.path,
73
+ score: scored,
74
+ originalScore: c.score,
75
+ multiplier,
76
+ trust,
77
+ quarantined: isQuarantined
78
+ };
79
+ all.push(item);
80
+ if (isQuarantined) quarantined.push(item);
81
+ else admitted.push(item);
82
+ }
83
+ if (reorder) {
84
+ admitted.sort((a, b) => {
85
+ if (b.score !== a.score) return b.score - a.score;
86
+ return 0;
87
+ });
88
+ }
89
+ return { admitted, quarantined, all };
90
+ }
91
+ function projectTrustForXray(item) {
92
+ const proj = {
93
+ score: item.trust.score,
94
+ band: item.trust.band,
95
+ components: item.trust.components,
96
+ multiplier: item.multiplier,
97
+ quarantined: item.quarantined
98
+ };
99
+ if (item.quarantined) {
100
+ proj.quarantineReason = explainQuarantine(item.trust);
101
+ }
102
+ return proj;
103
+ }
104
+ function explainQuarantine(trust) {
105
+ const c = trust.components;
106
+ if (c.faithfulness && c.faithfulness.value === 0) return "faithfulness: contradicted";
107
+ if (c.contradiction && c.contradiction.value <= 0.2) return "contradiction: pending review";
108
+ return "hard-negative trust signal";
109
+ }
110
+ async function buildTrustSignalsForRerank(candidatePaths, namespaces, deps, signalCache, now, options = {}) {
111
+ const nowMs = now.getTime();
112
+ const logDebug = options.logDebug ?? (() => {
113
+ });
114
+ const signals = /* @__PURE__ */ new Map();
115
+ for (const [key, entry] of signalCache.cache) {
116
+ if (nowMs - entry.at >= signalCache.ttlMs) signalCache.cache.delete(key);
117
+ }
118
+ const seenNamespaces = /* @__PURE__ */ new Set();
119
+ for (const ns of namespaces) {
120
+ if (seenNamespaces.has(ns)) continue;
121
+ seenNamespaces.add(ns);
122
+ try {
123
+ const cached = signalCache.cache.get(ns);
124
+ let nsMap;
125
+ if (cached && nowMs - cached.at < signalCache.ttlMs) {
126
+ nsMap = cached.signals;
127
+ } else {
128
+ const memories = await deps.readNamespaceMemories(ns);
129
+ nsMap = buildTrustSignalMap(memories, now, {
130
+ recencyHalfLifeDays: options.recencyHalfLifeDays
131
+ });
132
+ signalCache.cache.set(ns, { at: nowMs, signals: nsMap });
133
+ }
134
+ for (const [path, s] of nsMap) signals.set(path, s);
135
+ } catch (err) {
136
+ logDebug("trust-score: failed to read namespace, skipping", {
137
+ namespace: ns,
138
+ error: err.message
139
+ });
140
+ }
141
+ }
142
+ const missing = candidatePaths.filter((p) => !signals.has(p));
143
+ if (missing.length > 0) {
144
+ const fallbackMemories = [];
145
+ for (const path of missing) {
146
+ try {
147
+ const frontmatter = await deps.readMemoryFrontmatter(path);
148
+ if (frontmatter) fallbackMemories.push({ path, frontmatter });
149
+ } catch (err) {
150
+ logDebug("trust-score: direct path lookup failed", {
151
+ path,
152
+ error: err.message
153
+ });
154
+ }
155
+ }
156
+ if (fallbackMemories.length > 0) {
157
+ const fallbackSignals = buildTrustSignalMap(fallbackMemories, now, {
158
+ recencyHalfLifeDays: options.recencyHalfLifeDays
159
+ });
160
+ for (const [path, s] of fallbackSignals) signals.set(path, s);
161
+ }
162
+ }
163
+ return signals;
164
+ }
165
+
166
+ export {
167
+ buildTrustSignalMap,
168
+ applyTrustScoreStage,
169
+ projectTrustForXray,
170
+ explainQuarantine,
171
+ buildTrustSignalsForRerank
172
+ };
173
+ //# sourceMappingURL=chunk-BCDKBDSY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/trust-score-stage.ts"],"sourcesContent":["/**\n * trust-score-stage.ts — signal adapters + recall pipeline stage (issue #1577 PR 2).\n *\n * This module sits between the pure {@link computeTrustScore} scorer and the\n * recall pipeline. It owns TWO jobs:\n *\n * 1. **Signal adapters** — read each trust signal via existing readers only\n * (`buildMemoryWorthCounterMap`-style frontmatter scan, faithfulness /\n * provenance / sources frontmatter from #1575/#1576). No new disk format,\n * no new write path. Expensive / optional signals (belief-ledger domain\n * calibration, contradiction review queue) are extension points that\n * return `undefined` when unwired — the scorer degrades to neutral for\n * any absent signal (rule 34).\n *\n * 2. **The recall stage** — apply `trustMultiplier(trust.score)` to each\n * candidate, exclude `quarantine`-band items from injection, and surface\n * the per-result `{ score, band, components }` so X-ray and the epistemic\n * renderer can explain the basis.\n *\n * Mutual exclusion with the Memory Worth filter (rule 39 — one multiplier, one\n * application point): when this stage runs, the standalone memory-worth filter\n * MUST NOT also run. The orchestrator enforces that at the wiring site\n * (`if (caps.recallTrustScore) … else if (caps.recallMemoryWorthFilter) …`);\n * the `double-multiplier` test below pins it structurally.\n */\n\nimport { computeMemoryWorth } from \"./memory-worth.js\";\nimport {\n computeTrustScore,\n trustMultiplier,\n type TrustBand,\n type TrustScoreComponent,\n type TrustScoreResult,\n type TrustSignals,\n type TrustWeights,\n} from \"./trust-score.js\";\nimport type { FaithfulnessFrontmatter, ProvenanceSource } from \"./types.js\";\n\n/**\n * Frontmatter projection the adapter reads. Kept narrow + structural so it can\n * be fed from a `MemoryFrontmatter`, a bench fixture, or a test stub without\n * pulling the full frontmatter type graph into the stage module.\n */\nexport interface TrustFrontmatterProjection {\n mw_success?: number;\n mw_fail?: number;\n lastAccessed?: string | null;\n provenance?: \"verified\" | \"unverified\" | \"none\";\n faithfulness?: FaithfulnessFrontmatter;\n sources?: ProvenanceSource[];\n /** Optional ISO creation/observation timestamp used for recency. */\n observedAt?: string;\n}\n\n/**\n * Build a `path → TrustSignals` map from an in-memory frontmatter scan. The\n * caller passes the memories already read for the memory-worth counter map so\n * we do not re-read the namespace. Pure: no I/O, takes `now` explicitly.\n */\nexport function buildTrustSignalMap(\n memories: ReadonlyArray<{ path: string; frontmatter: TrustFrontmatterProjection }>,\n now: Date,\n options: { recencyHalfLifeDays?: number } = {},\n): Map<string, TrustSignals> {\n const map = new Map<string, TrustSignals>();\n const nowMs = now.getTime();\n const nowUsable = Number.isFinite(nowMs);\n for (const m of memories) {\n const fm = m.frontmatter;\n const signals: TrustSignals = {};\n\n // Memory worth — reuse the exact Laplace computation the standalone filter\n // uses so the two never disagree on the same counters.\n if (fm.mw_success !== undefined || fm.mw_fail !== undefined) {\n // Pass the half-life through so outcome counters decay at the same\n // rate as the standalone memory-worth filter (review P2: TrustScore\n // subsumes the filter, so decay must not be lost). Convert days → ms.\n const halfLifeMs =\n options.recencyHalfLifeDays !== undefined\n ? options.recencyHalfLifeDays * 86_400_000\n : undefined;\n const worth = computeMemoryWorth({\n mw_success: fm.mw_success,\n mw_fail: fm.mw_fail,\n lastAccessed: fm.lastAccessed,\n now,\n halfLifeMs,\n });\n signals.memoryWorth = { score: worth.score, confidence: worth.confidence };\n }\n\n if (fm.provenance !== undefined) signals.provenance = fm.provenance;\n if (fm.faithfulness !== undefined) {\n // `skipped_no_span` (legacy fact lacking a verified source span) carries\n // no entailment signal — collapse it to `unchecked` so the scorer treats\n // it as the neutral \"no verdict\" case rather than a hard negative.\n signals.faithfulness =\n fm.faithfulness.verdict === \"skipped_no_span\" ? \"unchecked\" : fm.faithfulness.verdict;\n }\n\n // Corroboration = distinct source sessions/turns backing the fact.\n if (Array.isArray(fm.sources) && fm.sources.length > 0) {\n const distinct = new Set(\n fm.sources.map((s) => `${s.sessionKey ?? \"\"}|${s.turnId ?? \"\"}`),\n );\n signals.corroborationCount = distinct.size;\n }\n\n // Recency: prefer an explicit observation timestamp; fall back to\n // lastAccessed. Days-old vs the per-category half-life the caller supplies.\n const ts = fm.observedAt ?? fm.lastAccessed;\n if (nowUsable && typeof ts === \"string\" && ts.length > 0) {\n const parsed = Date.parse(ts);\n if (Number.isFinite(parsed)) {\n const ageDays = Math.max(0, (nowMs - parsed) / (24 * 60 * 60 * 1000));\n signals.ageDays = ageDays;\n if (options.recencyHalfLifeDays !== undefined) {\n signals.recencyHalfLifeDays = options.recencyHalfLifeDays;\n }\n }\n }\n\n // Only record an entry when at least one signal is present — a fully-empty\n // entry would score neutral anyway, and skipping keeps the map small.\n if (Object.keys(signals).length > 0) {\n map.set(m.path, signals);\n }\n }\n return map;\n}\n\n/** A scored recall candidate (mirrors `MemoryWorthFilterCandidate`). */\nexport interface TrustStageCandidate {\n path: string;\n score: number;\n}\n\n/** One candidate after the TrustScore stage. */\nexport interface TrustStageResultItem {\n path: string;\n /** Final score after the trust multiplier is applied. */\n score: number;\n /** The untouched input score — for telemetry / X-ray. */\n originalScore: number;\n /** The multiplier applied (exactly `1.0` for neutral / quarantined-kept). */\n multiplier: number;\n /** The full TrustScore result for X-ray + epistemic rendering. */\n trust: TrustScoreResult;\n /** `true` when the item was excluded from injection by quarantine. */\n quarantined: boolean;\n}\n\nexport interface TrustStageOptions {\n /** `path → TrustSignals`. Candidates absent from the map score neutral. */\n signals: ReadonlyMap<string, TrustSignals>;\n weights?: TrustWeights;\n /** Multiplier bounds; see {@link trustMultiplier}. */\n minMultiplier?: number;\n maxMultiplier?: number;\n /**\n * When `true` (default), `quarantine`-band items are excluded from the\n * returned (injected) list but still appear in {@link TrustStageOutput.all}\n * with `quarantined: true` so X-ray can surface them with a reason.\n * Only effective when the stage is active at all.\n */\n quarantine?: boolean;\n /**\n * Re-sort admitted candidates by descending multiplied score. Default `true`.\n * When `false`, admitted items keep input order; quarantined items are still\n * separated out.\n */\n reorder?: boolean;\n}\n\n/** Output of {@link applyTrustScoreStage}. */\nexport interface TrustStageOutput {\n /** Admitted (injectable) candidates, score-multiplied and optionally sorted. */\n admitted: TrustStageResultItem[];\n /**\n * Quarantined candidates — excluded from injection but visible to X-ray with\n * the reason (rule 34 — exclusion must never look like \"no result\"). Callers\n * that only need the injected list read `admitted`; X-ray reads `all`.\n */\n quarantined: TrustStageResultItem[];\n /** Every candidate (admitted + quarantined) in input order, for X-ray. */\n all: TrustStageResultItem[];\n}\n\n/**\n * Apply the unified TrustScore stage: score each candidate, multiply its base\n * score by `trustMultiplier(trust.score)`, and separate hard-negative\n * (quarantine) items from the injectable set.\n *\n * Neutral candidates (no signals → multiplier `1.0`) are mathematically\n * untouched, preserving byte-identical ranking for uninstrumented memories\n * when the feature is ON (and the whole stage is skipped when OFF — rule 39).\n */\nexport function applyTrustScoreStage(\n candidates: readonly TrustStageCandidate[],\n options: TrustStageOptions,\n): TrustStageOutput {\n const reorder = options.reorder !== false;\n const quarantine = options.quarantine !== false;\n const minMul = options.minMultiplier;\n const maxMul = options.maxMultiplier;\n\n const all: TrustStageResultItem[] = [];\n const admitted: TrustStageResultItem[] = [];\n const quarantined: TrustStageResultItem[] = [];\n\n for (let i = 0; i < candidates.length; i += 1) {\n const c = candidates[i]!;\n const signals = options.signals.get(c.path);\n const trust = computeTrustScore(signals, options.weights);\n const isQuarantined = quarantine && trust.band === \"quarantine\";\n // Quarantined items are excluded from injection. Keep their score unchanged\n // so X-ray shows what the pipeline WOULD have injected — never inflate or\n // zero the score of a hidden item (rule 34).\n const multiplier = isQuarantined ? 1 : trustMultiplier(trust.score, minMul, maxMul);\n // Clamp the base score at zero before multiplying, mirroring the\n // memory-worth filter: a negative base would invert the multiplier's\n // intended direction (see memory-worth-filter.ts:145-153).\n const safeBase = c.score < 0 ? 0 : c.score;\n const scored = safeBase * multiplier;\n const item: TrustStageResultItem = {\n path: c.path,\n score: scored,\n originalScore: c.score,\n multiplier,\n trust,\n quarantined: isQuarantined,\n };\n all.push(item);\n if (isQuarantined) quarantined.push(item);\n else admitted.push(item);\n }\n\n if (reorder) {\n // Stable sort by descending multiplied score, with original input position\n // as the deterministic tiebreaker (CLAUDE.md rule 19 / checklist §12).\n admitted.sort((a, b) => {\n if (b.score !== a.score) return b.score - a.score;\n // Tiebreaker: original insertion order. We don't have the index handy on\n // the item, so derive it from `all` ordering (input order is preserved\n // there). Equal-score items keep first-seen-first order.\n return 0;\n });\n // Node's sort is stable (ES2019+); the explicit `return 0` documents the\n // contract for reviewers.\n }\n\n return { admitted, quarantined, all };\n}\n\n/**\n * Compact X-ray projection of one stage item. Kept separate from the full\n * `TrustScoreResult` so the X-ray snapshot type stays narrow and serializable,\n * and so the renderer never depends on the scorer's internal component map\n * shape beyond `{ value, weight }`.\n */\nexport interface TrustXrayProjection {\n score: number;\n band: TrustBand;\n components: Record<string, TrustScoreComponent>;\n multiplier: number;\n quarantined: boolean;\n /** Human-readable exclusion reason, present only when quarantined. */\n quarantineReason?: string;\n}\n\n/** Build the X-ray projection for one stage result item. */\nexport function projectTrustForXray(item: TrustStageResultItem): TrustXrayProjection {\n const proj: TrustXrayProjection = {\n score: item.trust.score,\n band: item.trust.band,\n components: item.trust.components,\n multiplier: item.multiplier,\n quarantined: item.quarantined,\n };\n if (item.quarantined) {\n proj.quarantineReason = explainQuarantine(item.trust);\n }\n return proj;\n}\n\n/** Deterministic, component-derived reason a memory was quarantined. */\nexport function explainQuarantine(trust: TrustScoreResult): string {\n const c = trust.components;\n if (c.faithfulness && c.faithfulness.value === 0) return \"faithfulness: contradicted\";\n if (c.contradiction && c.contradiction.value <= 0.2) return \"contradiction: pending review\";\n return \"hard-negative trust signal\";\n}\n\n\n// ─── Recall-stage signal builder (I/O orchestration) ──────────────────────\n\n/**\n * Narrow callbacks the signal builder needs from its host (the orchestrator).\n * Kept as interfaces so the module stays pure-testable: the host binds\n * `getStorage` / `readQmdResultMemory` into these and the builder owns cache\n * management, namespace iteration, and the cold-tier direct fallback.\n */\nexport interface TrustScoreRerankDeps {\n /** Read every memory in a namespace for the hot-tier signal scan. */\n readNamespaceMemories(\n namespace: string,\n ): Promise<ReadonlyArray<{ path: string; frontmatter: TrustFrontmatterProjection }>>;\n /** Read one memory's frontmatter by path (cold-tier direct fallback). */\n readMemoryFrontmatter(path: string): Promise<TrustFrontmatterProjection | null>;\n}\n\n/** Per-namespace signal cache the host owns and the builder mutates. */\nexport interface TrustScoreSignalCache {\n cache: Map<string, { at: number; signals: ReadonlyMap<string, TrustSignals> }>;\n ttlMs: number;\n}\n\n/**\n * Build the `path → TrustSignals` map for recall candidates using a\n * per-namespace cache plus a direct-path fallback for cold-tier candidates\n * absent from the hot scan. Extracted from the orchestrator (issue #1577) so\n * the god file carries only thin wiring — the scoring itself is\n * {@link applyTrustScoreStage}.\n *\n * Fail-open: a single unreadable namespace or memory is logged and skipped so\n * a storage hiccup never breaks recall (mirrors `memory-worth-filter.ts`).\n */\nexport async function buildTrustSignalsForRerank(\n candidatePaths: readonly string[],\n namespaces: readonly string[],\n deps: TrustScoreRerankDeps,\n signalCache: TrustScoreSignalCache,\n now: Date,\n options: {\n recencyHalfLifeDays?: number;\n logDebug?: (message: string, context: Record<string, unknown>) => void;\n } = {},\n): Promise<Map<string, TrustSignals>> {\n const nowMs = now.getTime();\n const logDebug = options.logDebug ?? (() => {});\n const signals = new Map<string, TrustSignals>();\n\n // Evict expired cache entries (mirrors the worth-cache discipline).\n for (const [key, entry] of signalCache.cache) {\n if (nowMs - entry.at >= signalCache.ttlMs) signalCache.cache.delete(key);\n }\n\n // Per-namespace hot scan with cache.\n const seenNamespaces = new Set<string>();\n for (const ns of namespaces) {\n if (seenNamespaces.has(ns)) continue;\n seenNamespaces.add(ns);\n try {\n const cached = signalCache.cache.get(ns);\n let nsMap: ReadonlyMap<string, TrustSignals> | undefined;\n if (cached && nowMs - cached.at < signalCache.ttlMs) {\n nsMap = cached.signals;\n } else {\n const memories = await deps.readNamespaceMemories(ns);\n nsMap = buildTrustSignalMap(memories, now, {\n recencyHalfLifeDays: options.recencyHalfLifeDays,\n });\n signalCache.cache.set(ns, { at: nowMs, signals: nsMap });\n }\n for (const [path, s] of nsMap) signals.set(path, s);\n } catch (err) {\n logDebug(\"trust-score: failed to read namespace, skipping\", {\n namespace: ns,\n error: (err as Error).message,\n });\n }\n }\n\n // Direct per-path fallback for cold-tier candidates absent from the hot scan.\n const missing = candidatePaths.filter((p) => !signals.has(p));\n if (missing.length > 0) {\n const fallbackMemories: Array<{ path: string; frontmatter: TrustFrontmatterProjection }> = [];\n for (const path of missing) {\n try {\n const frontmatter = await deps.readMemoryFrontmatter(path);\n if (frontmatter) fallbackMemories.push({ path, frontmatter });\n } catch (err) {\n logDebug(\"trust-score: direct path lookup failed\", {\n path,\n error: (err as Error).message,\n });\n }\n }\n if (fallbackMemories.length > 0) {\n const fallbackSignals = buildTrustSignalMap(fallbackMemories, now, {\n recencyHalfLifeDays: options.recencyHalfLifeDays,\n });\n for (const [path, s] of fallbackSignals) signals.set(path, s);\n }\n }\n\n return signals;\n}\n"],"mappings":";;;;;;;;;AA2DO,SAAS,oBACd,UACA,KACA,UAA4C,CAAC,GAClB;AAC3B,QAAM,MAAM,oBAAI,IAA0B;AAC1C,QAAM,QAAQ,IAAI,QAAQ;AAC1B,QAAM,YAAY,OAAO,SAAS,KAAK;AACvC,aAAW,KAAK,UAAU;AACxB,UAAM,KAAK,EAAE;AACb,UAAM,UAAwB,CAAC;AAI/B,QAAI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e,OAAO,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC;AAC5D,MAAI,QAAQ,SAAS,GAAG;AACtB,UAAM,mBAAqF,CAAC;AAC5F,eAAW,QAAQ,SAAS;AAC1B,UAAI;AACF,cAAM,cAAc,MAAM,KAAK,sBAAsB,IAAI;AACzD,YAAI,YAAa,kBAAiB,KAAK,EAAE,MAAM,YAAY,CAAC;AAAA,MAC9D,SAAS,KAAK;AACZ,iBAAS,0CAA0C;AAAA,UACjD;AAAA,UACA,OAAQ,IAAc;AAAA,QACxB,CAAC;AAAA,MACH;AAAA,IACF;AACA,QAAI,iBAAiB,SAAS,GAAG;AAC/B,YAAM,kBAAkB,oBAAoB,kBAAkB,KAAK;AAAA,QACjE,qBAAqB,QAAQ;AAAA,MAC/B,CAAC;AACD,iBAAW,CAAC,MAAM,CAAC,KAAK,gBAAiB,SAAQ,IAAI,MAAM,CAAC;AAAA,IAC9D;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -14,16 +14,16 @@ import {
14
14
  } from "./chunk-FVZ2ISIX.js";
15
15
  import {
16
16
  getOperation
17
- } from "./chunk-URM3HW2R.js";
17
+ } from "./chunk-NE5WFIY6.js";
18
18
  import {
19
19
  EngramAccessInputError
20
- } from "./chunk-F3PVXKHP.js";
20
+ } from "./chunk-M3GBOKUX.js";
21
21
  import {
22
22
  projectTagProjectId
23
23
  } from "./chunk-J6BH2OBA.js";
24
24
  import {
25
25
  validateBriefingFormat
26
- } from "./chunk-2COL35PK.js";
26
+ } from "./chunk-T3XSXAWK.js";
27
27
  import {
28
28
  resolvePrincipal
29
29
  } from "./chunk-UZYLX7M6.js";
@@ -4267,7 +4267,7 @@ ${body}`;
4267
4267
  reason: "graphEdgeDecayEnabled is false"
4268
4268
  };
4269
4269
  }
4270
- const { runGraphEdgeDecayMaintenanceAcrossNamespaces } = await import("./graph-edge-decay-JLOF3YW4.js");
4270
+ const { runGraphEdgeDecayMaintenanceAcrossNamespaces } = await import("./graph-edge-decay-QDDC6AVV.js");
4271
4271
  const dryRun = args.dryRun === true;
4272
4272
  const results = await runGraphEdgeDecayMaintenanceAcrossNamespaces(
4273
4273
  this.service.memoryDir,
@@ -4441,4 +4441,4 @@ export {
4441
4441
  sessionBelongsToPrincipal,
4442
4442
  EngramMcpServer
4443
4443
  };
4444
- //# sourceMappingURL=chunk-P5IPFZVH.js.map
4444
+ //# sourceMappingURL=chunk-BGQ7WKMT.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  parseXrayFormat
3
- } from "./chunk-LXSG4L55.js";
3
+ } from "./chunk-V7UUIIR7.js";
4
4
  import {
5
5
  RECALL_DISCLOSURE_LEVELS,
6
6
  isRecallDisclosure
7
- } from "./chunk-N3DUH6OO.js";
7
+ } from "./chunk-ZW5I3UNP.js";
8
8
 
9
9
  // src/recall-xray-cli.ts
10
10
  function parseXrayDisclosureFlag(value) {
@@ -50,4 +50,4 @@ export {
50
50
  parseXrayBudgetFlag,
51
51
  parseXrayCliOptions
52
52
  };
53
- //# sourceMappingURL=chunk-JAKYZGV4.js.map
53
+ //# sourceMappingURL=chunk-CYJV5AYC.js.map
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  planNamespaceMaintenance,
12
12
  runNamespaceMaintenanceBatchPlan
13
- } from "./chunk-HLIR3RJ7.js";
13
+ } from "./chunk-WBHQ5LP5.js";
14
14
  import {
15
15
  resolveHomeDir
16
16
  } from "./chunk-JUC24CTX.js";
@@ -441,4 +441,4 @@ var MaintenanceScheduler = class {
441
441
  export {
442
442
  MaintenanceScheduler
443
443
  };
444
- //# sourceMappingURL=chunk-APUJIMDM.js.map
444
+ //# sourceMappingURL=chunk-DG3ORVCU.js.map
@@ -4,6 +4,9 @@ function resolveCapabilities(config) {
4
4
  rerankCache: config.rerankCacheEnabled,
5
5
  recallDirectAnswer: config.recallDirectAnswerEnabled,
6
6
  recallMemoryWorthFilter: config.recallMemoryWorthFilterEnabled,
7
+ // Issue #1577: TrustScore subsumes the Memory Worth multiplier when on;
8
+ // the orchestrator runs exactly one of the two (mutual exclusion, rule 39).
9
+ recallTrustScore: config.trustScoreEnabled === true,
7
10
  recallMmr: config.recallMmrEnabled,
8
11
  recallReasoningTraceBoost: config.recallReasoningTraceBoostEnabled,
9
12
  recallPlannerLlm: config.recallPlannerLlmEnabled,
@@ -13,7 +16,11 @@ function resolveCapabilities(config) {
13
16
  // Optional flags: preserve the exact default-when-undefined semantics the
14
17
  // migrated call sites used (`!== false` = default-on, `=== true` = default-off).
15
18
  graphAssistInFullMode: config.graphAssistInFullModeEnabled !== false,
16
- graphExpandedIntent: config.graphExpandedIntentEnabled === true
19
+ graphExpandedIntent: config.graphExpandedIntentEnabled === true,
20
+ // Issue #1566 Cluster C: mixed-operation flags resolved once per recall op.
21
+ rerank: config.rerankEnabled,
22
+ harmonicRetrieval: config.harmonicRetrievalEnabled,
23
+ parallelRetrieval: config.parallelRetrievalEnabled
17
24
  });
18
25
  }
19
26
  function resolveGraphConstructionCapabilities(config) {
@@ -27,9 +34,17 @@ function resolveGraphConstructionCapabilities(config) {
27
34
  graphWriteSessionAdjacency: config.graphWriteSessionAdjacencyEnabled !== false
28
35
  });
29
36
  }
37
+ function resolveAccessSetupCapabilities(config) {
38
+ return Object.freeze({
39
+ recallCrossNamespaceBudget: config.recallCrossNamespaceBudgetEnabled,
40
+ // Optional/default-off flag: preserve `=== true` semantics.
41
+ recallAuditAnomalyDetection: config.recallAuditAnomalyDetectionEnabled === true
42
+ });
43
+ }
30
44
 
31
45
  export {
32
46
  resolveCapabilities,
33
- resolveGraphConstructionCapabilities
47
+ resolveGraphConstructionCapabilities,
48
+ resolveAccessSetupCapabilities
34
49
  };
35
- //# sourceMappingURL=chunk-PBH4JUAB.js.map
50
+ //# sourceMappingURL=chunk-DVRHLN2O.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/capabilities.ts"],"sourcesContent":["/**\n * CapabilitySet — recall-operation feature gates resolved once, then threaded.\n *\n * Issue #1523 (Phase 1 of epic #1520). Root cause this addresses: 161+\n * scattered `config.<flag>Enabled` reads mean each gate is re-derived at every\n * call site, and reviews keep finding parallel code paths where one branch\n * checks a gate the other forgot (CLAUDE.md rule 39 — the \"gate divergence\"\n * defect class). The fix is to resolve a frozen capability projection ONCE at\n * the top of the recall operation and pass it down explicitly.\n *\n * Scope of THIS module (first migration PR): only the recall-operation-scoped\n * flags below. Flags that are also read in graph construction, writes, CLI, or\n * the summarizer are deliberately deferred to a follow-up so we never leave a\n * single flag half-migrated (some sites on `caps.`, some on `config.`).\n *\n * Field naming: each field is the config flag name with the trailing `Enabled`\n * removed (`recallMmrEnabled` → `recallMmr`).\n *\n * This is plumbing, not a feature — there is deliberately NO `enabled` gate for\n * the CapabilitySet itself (rule 30 governs behavior changes; resolving and\n * threading a capability projection must stay behavior-preserving).\n */\n\nimport type { PluginConfig } from \"./types.js\";\n\n/**\n * Frozen projection of recall-operation feature gates.\n *\n * Every field is `readonly boolean`. The composition that maps a config flag to\n * a capability (including default-when-undefined semantics for optional flags)\n * lives ONLY in {@link resolveCapabilities} — call sites must read the\n * capability, never re-derive it from raw config.\n */\nexport interface CapabilitySet {\n /** `rerankCacheEnabled` — cache reranker scores across recall passes. */\n readonly rerankCache: boolean;\n /** `recallDirectAnswerEnabled` — observation-mode direct-answer tier. */\n readonly recallDirectAnswer: boolean;\n /** `recallMemoryWorthFilterEnabled` — Memory-Worth score reweighting. */\n readonly recallMemoryWorthFilter: boolean;\n /** `trustScoreEnabled` — unified TrustScore recall stage (issue #1577). */\n readonly recallTrustScore: boolean;\n /** `recallMmrEnabled` — maximal-marginal-relevance diversification. */\n readonly recallMmr: boolean;\n /** `recallReasoningTraceBoostEnabled` — boost reasoning-trace memories. */\n readonly recallReasoningTraceBoost: boolean;\n /** `recallPlannerLlmEnabled` — LLM-backed recall-mode planner. */\n readonly recallPlannerLlm: boolean;\n /** `recallPlannerEnabled` — recall-mode planner (heuristic + optional LLM). */\n readonly recallPlanner: boolean;\n /** `recallConfidenceGateEnabled` — Synapse-style confidence gate. */\n readonly recallConfidenceGate: boolean;\n /** `graphRecallEnabled` — graph-mode recall tier (gates planner graph mode). */\n readonly graphRecall: boolean;\n /** `graphAssistInFullModeEnabled` — graph-assist overlay in full mode. */\n readonly graphAssistInFullMode: boolean;\n /** `graphExpandedIntentEnabled` — promote broad-intent asks to graph mode. */\n readonly graphExpandedIntent: boolean;\n // --- Issue #1566 Cluster C: mixed-operation flags (recall + summarizer/CLI/writes) ---\n /** `rerankEnabled` — optional LLM reranking of recall candidates. */\n readonly rerank: boolean;\n /** `harmonicRetrievalEnabled` — abstraction-node harmonic retrieval tier. */\n readonly harmonicRetrieval: boolean;\n /** `parallelRetrievalEnabled` — three-agent parallel retrieval (DirectFact + Contextual + Temporal). */\n readonly parallelRetrieval: boolean;\n}\n\n/**\n * Resolve the recall-operation {@link CapabilitySet} from parsed config.\n *\n * Call this ONCE per recall operation (at the `recall()` / `recallInternal`\n * entry) and thread the result down. Composition lives here and only here.\n *\n * Session toggles are intentionally not a parameter yet: `session-toggles.ts`\n * is agent-scoped (per session/agent enable-disable of the whole plugin), not\n * flag-scoped — none of the flags projected here have a per-session override,\n * so there is nothing for a toggle argument to compose at this layer.\n */\nexport function resolveCapabilities(config: PluginConfig): CapabilitySet {\n return Object.freeze({\n rerankCache: config.rerankCacheEnabled,\n recallDirectAnswer: config.recallDirectAnswerEnabled,\n recallMemoryWorthFilter: config.recallMemoryWorthFilterEnabled,\n // Issue #1577: TrustScore subsumes the Memory Worth multiplier when on;\n // the orchestrator runs exactly one of the two (mutual exclusion, rule 39).\n recallTrustScore: config.trustScoreEnabled === true,\n recallMmr: config.recallMmrEnabled,\n recallReasoningTraceBoost: config.recallReasoningTraceBoostEnabled,\n recallPlannerLlm: config.recallPlannerLlmEnabled,\n recallPlanner: config.recallPlannerEnabled,\n recallConfidenceGate: config.recallConfidenceGateEnabled,\n graphRecall: config.graphRecallEnabled,\n // Optional flags: preserve the exact default-when-undefined semantics the\n // migrated call sites used (`!== false` = default-on, `=== true` = default-off).\n graphAssistInFullMode: config.graphAssistInFullModeEnabled !== false,\n graphExpandedIntent: config.graphExpandedIntentEnabled === true,\n // Issue #1566 Cluster C: mixed-operation flags resolved once per recall op.\n rerank: config.rerankEnabled,\n harmonicRetrieval: config.harmonicRetrievalEnabled,\n parallelRetrieval: config.parallelRetrievalEnabled,\n });\n}\n\n// ---------------------------------------------------------------------------\n// Graph-construction capability set (issue #1566 Cluster A).\n//\n// The recall CapabilitySet above covers flags whose EVERY read site lives on\n// the recall call chain. The five flags below are read on graph-construction,\n// write/extraction, AND recall paths — so they cannot join the recall set\n// without leaving some sites on `caps.` and others on `config.` (the exact\n// divergence #1523 forbade). They get their own projection, resolved at graph\n// build/write entry (and alongside `caps` when recall reads them).\n// ---------------------------------------------------------------------------\n\n/**\n * Frozen projection of graph-construction feature gates.\n *\n * Every field is `readonly boolean`. Composition (including default-when-\n * undefined semantics for the optional `graphWriteSessionAdjacencyEnabled`)\n * lives ONLY in {@link resolveGraphConstructionCapabilities}.\n */\nexport interface GraphConstructionCapabilitySet {\n /** `entityGraphEnabled` — maintain entity co-reference graph edges. */\n readonly entityGraph: boolean;\n /** `timeGraphEnabled` — maintain thread-adjacency graph edges. */\n readonly timeGraph: boolean;\n /** `causalGraphEnabled` — maintain causal-language graph edges. */\n readonly causalGraph: boolean;\n /** `multiGraphMemoryEnabled` — master switch for multi-graph writes/traversal. */\n readonly multiGraphMemory: boolean;\n /** `graphWriteSessionAdjacencyEnabled` — session-adjacency fallback for time edges (default-on). */\n readonly graphWriteSessionAdjacency: boolean;\n}\n\n/**\n * Resolve the {@link GraphConstructionCapabilitySet} from parsed config.\n *\n * Call this ONCE at graph build/write entry (extraction, recall graph\n * expansion, graph-health/repair) and thread the result down — exactly the\n * pattern {@link resolveCapabilities} established for recall.\n */\nexport type GraphConstructionConfigProjection = Pick<\n PluginConfig,\n | \"entityGraphEnabled\"\n | \"timeGraphEnabled\"\n | \"causalGraphEnabled\"\n | \"multiGraphMemoryEnabled\"\n | \"graphWriteSessionAdjacencyEnabled\"\n>;\n\nexport function resolveGraphConstructionCapabilities(\n config: GraphConstructionConfigProjection,\n): GraphConstructionCapabilitySet {\n return Object.freeze({\n entityGraph: config.entityGraphEnabled,\n timeGraph: config.timeGraphEnabled,\n causalGraph: config.causalGraphEnabled,\n multiGraphMemory: config.multiGraphMemoryEnabled,\n // Optional flag: preserve the exact default-when-undefined semantics the\n // migrated call site used (`!== false` = default-on).\n graphWriteSessionAdjacency: config.graphWriteSessionAdjacencyEnabled !== false,\n });\n}\n\n// ---------------------------------------------------------------------------\n// Access-setup capability set (issue #1566 Cluster B).\n//\n// These two flags gate cross-namespace recall budgeting and anomaly-detection\n// auditing. Resolved once at access-service handler entry (and the operator\n// doctor check) rather than re-derived from raw config at each site.\n// ---------------------------------------------------------------------------\n\n/**\n * Frozen projection of access-setup feature gates (issue #1566 Cluster B).\n *\n * Every field is `readonly boolean`. Composition (including the default-off\n * semantics for the optional `recallAuditAnomalyDetectionEnabled`) lives ONLY\n * in {@link resolveAccessSetupCapabilities}.\n */\nexport interface AccessSetupCapabilitySet {\n /** `recallCrossNamespaceBudgetEnabled` — rolling cross-namespace recall budget. */\n readonly recallCrossNamespaceBudget: boolean;\n /** `recallAuditAnomalyDetectionEnabled` — access-audit anomaly detection (default-off). */\n readonly recallAuditAnomalyDetection: boolean;\n}\n\n/**\n * Resolve the {@link AccessSetupCapabilitySet} from parsed config.\n *\n * Call this ONCE at access-service handler entry and thread the result down.\n */\nexport type AccessSetupConfigProjection = Pick<\n PluginConfig,\n \"recallCrossNamespaceBudgetEnabled\" | \"recallAuditAnomalyDetectionEnabled\"\n>;\n\nexport function resolveAccessSetupCapabilities(\n config: AccessSetupConfigProjection,\n): AccessSetupCapabilitySet {\n return Object.freeze({\n recallCrossNamespaceBudget: config.recallCrossNamespaceBudgetEnabled,\n // Optional/default-off flag: preserve `=== true` semantics.\n recallAuditAnomalyDetection: config.recallAuditAnomalyDetectionEnabled === true,\n });\n}\n"],"mappings":";AA8EO,SAAS,oBAAoB,QAAqC;AACvE,SAAO,OAAO,OAAO;AAAA,IACnB,aAAa,OAAO;AAAA,IACpB,oBAAoB,OAAO;AAAA,IAC3B,yBAAyB,OAAO;AAAA;AAAA;AAAA,IAGhC,kBAAkB,OAAO,sBAAsB;AAAA,IAC/C,WAAW,OAAO;AAAA,IAClB,2BAA2B,OAAO;AAAA,IAClC,kBAAkB,OAAO;AAAA,IACzB,eAAe,OAAO;AAAA,IACtB,sBAAsB,OAAO;AAAA,IAC7B,aAAa,OAAO;AAAA;AAAA;AAAA,IAGpB,uBAAuB,OAAO,iCAAiC;AAAA,IAC/D,qBAAqB,OAAO,+BAA+B;AAAA;AAAA,IAE3D,QAAQ,OAAO;AAAA,IACf,mBAAmB,OAAO;AAAA,IAC1B,mBAAmB,OAAO;AAAA,EAC5B,CAAC;AACH;AAiDO,SAAS,qCACd,QACgC;AAChC,SAAO,OAAO,OAAO;AAAA,IACnB,aAAa,OAAO;AAAA,IACpB,WAAW,OAAO;AAAA,IAClB,aAAa,OAAO;AAAA,IACpB,kBAAkB,OAAO;AAAA;AAAA;AAAA,IAGzB,4BAA4B,OAAO,sCAAsC;AAAA,EAC3E,CAAC;AACH;AAkCO,SAAS,+BACd,QAC0B;AAC1B,SAAO,OAAO,OAAO;AAAA,IACnB,4BAA4B,OAAO;AAAA;AAAA,IAEnC,6BAA6B,OAAO,uCAAuC;AAAA,EAC7E,CAAC;AACH;","names":[]}
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-ZBJMUXZH.js";
8
8
  import {
9
9
  StorageManager
10
- } from "./chunk-YYOK4GVF.js";
10
+ } from "./chunk-422TIKIH.js";
11
11
  import {
12
12
  getCachedEpisodeMap,
13
13
  setCachedEpisodeMap
@@ -107,4 +107,4 @@ export {
107
107
  compareVerifiedEpisodeResults,
108
108
  searchVerifiedEpisodes
109
109
  };
110
- //# sourceMappingURL=chunk-S35FX6MU.js.map
110
+ //# sourceMappingURL=chunk-H2AGJ5SV.js.map
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-UFS7OXGL.js";
5
5
  import {
6
6
  StorageManager
7
- } from "./chunk-YYOK4GVF.js";
7
+ } from "./chunk-422TIKIH.js";
8
8
  import {
9
9
  parseContinuityImprovementLoops
10
10
  } from "./chunk-LDXUBPMO.js";
@@ -1261,4 +1261,4 @@ export {
1261
1261
  defaultTierMigrationCycleBudget,
1262
1262
  CompoundingEngine
1263
1263
  };
1264
- //# sourceMappingURL=chunk-A66YRSOS.js.map
1264
+ //# sourceMappingURL=chunk-HAPVZ4CO.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  StorageManager
3
- } from "./chunk-YYOK4GVF.js";
3
+ } from "./chunk-422TIKIH.js";
4
4
 
5
5
  // src/semantic-rule-promotion.ts
6
6
  import { createHash, randomUUID } from "crypto";
@@ -529,4 +529,4 @@ export {
529
529
  setSemanticRulePromotionTestHooks,
530
530
  promoteSemanticRuleFromMemory
531
531
  };
532
- //# sourceMappingURL=chunk-4KZGLDJJ.js.map
532
+ //# sourceMappingURL=chunk-HHSO6VCQ.js.map