@remnic/core 9.3.732 → 9.3.734

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 (294) hide show
  1. package/dist/access-boundary.d.ts +10 -10
  2. package/dist/access-boundary.js +9 -9
  3. package/dist/access-cli.js +25 -23
  4. package/dist/access-cli.js.map +1 -1
  5. package/dist/access-http.d.ts +10 -10
  6. package/dist/access-http.js +14 -14
  7. package/dist/access-mcp.d.ts +10 -10
  8. package/dist/access-mcp.js +13 -13
  9. package/dist/access-operations-batch.js +11 -11
  10. package/dist/access-operations.d.ts +10 -10
  11. package/dist/access-operations.js +12 -12
  12. package/dist/{access-service-Byoe3HsT.d.ts → access-service-rjFfmfKB.d.ts} +4 -4
  13. package/dist/access-service.d.ts +10 -10
  14. package/dist/access-service.js +8 -8
  15. package/dist/access-surface-catalog.d.ts +10 -10
  16. package/dist/action-confidence.d.ts +1 -1
  17. package/dist/active-memory-bridge.d.ts +1 -1
  18. package/dist/active-memory-bridge.js +3 -2
  19. package/dist/active-recall.d.ts +1 -1
  20. package/dist/behavior-learner.d.ts +1 -1
  21. package/dist/behavior-signals.d.ts +1 -1
  22. package/dist/bootstrap.d.ts +9 -9
  23. package/dist/briefing.d.ts +1 -1
  24. package/dist/buffer-surprise-report.d.ts +1 -1
  25. package/dist/buffer.d.ts +1 -1
  26. package/dist/calibration.d.ts +1 -1
  27. package/dist/capabilities.d.ts +97 -2
  28. package/dist/capabilities.js +11 -3
  29. package/dist/{catalog-DM1nk7cM.d.ts → catalog-DHYXzM4-.d.ts} +2 -2
  30. package/dist/causal-behavior.d.ts +1 -1
  31. package/dist/causal-consolidation.d.ts +1 -1
  32. package/dist/causal-trajectory-graph.d.ts +1 -1
  33. package/dist/{chunk-24D66MMN.js → chunk-2L5RTVMO.js} +7 -4
  34. package/dist/chunk-2L5RTVMO.js.map +1 -0
  35. package/dist/{chunk-KQYGNGON.js → chunk-3QETM5NG.js} +6 -3
  36. package/dist/chunk-3QETM5NG.js.map +1 -0
  37. package/dist/{chunk-ZQUAVZNG.js → chunk-54RCE5Z3.js} +7 -4
  38. package/dist/chunk-54RCE5Z3.js.map +1 -0
  39. package/dist/{chunk-NOU77OHX.js → chunk-5DIKZKOD.js} +2 -2
  40. package/dist/{chunk-CGPHMNL4.js → chunk-5OYHJIJN.js} +10 -6
  41. package/dist/chunk-5OYHJIJN.js.map +1 -0
  42. package/dist/{chunk-LUCARK4W.js → chunk-6U7TES2M.js} +29 -28
  43. package/dist/chunk-6U7TES2M.js.map +1 -0
  44. package/dist/{chunk-FFUCCKPN.js → chunk-7FPJFCXL.js} +10 -7
  45. package/dist/chunk-7FPJFCXL.js.map +1 -0
  46. package/dist/{chunk-PMAQRUN4.js → chunk-CILX2XW7.js} +5 -2
  47. package/dist/chunk-CILX2XW7.js.map +1 -0
  48. package/dist/{chunk-ZVHRSR2R.js → chunk-ET5HXSQL.js} +6 -3
  49. package/dist/chunk-ET5HXSQL.js.map +1 -0
  50. package/dist/{chunk-KSJCXXOU.js → chunk-FAGERSH2.js} +6 -3
  51. package/dist/chunk-FAGERSH2.js.map +1 -0
  52. package/dist/{chunk-FYWUNVFZ.js → chunk-IDIXGGDN.js} +6 -6
  53. package/dist/{chunk-CX77GNMB.js → chunk-IWMGBNXY.js} +6 -3
  54. package/dist/chunk-IWMGBNXY.js.map +1 -0
  55. package/dist/{chunk-GGL34GCW.js → chunk-IZLTOS5L.js} +7 -4
  56. package/dist/chunk-IZLTOS5L.js.map +1 -0
  57. package/dist/{chunk-HHNSLPX7.js → chunk-K7PAILHO.js} +10 -9
  58. package/dist/chunk-K7PAILHO.js.map +1 -0
  59. package/dist/{chunk-UZYLX7M6.js → chunk-LV32K4OP.js} +9 -6
  60. package/dist/chunk-LV32K4OP.js.map +1 -0
  61. package/dist/{chunk-HJWQJUKQ.js → chunk-NDYQIN6C.js} +3 -3
  62. package/dist/{chunk-DKT3X5C3.js → chunk-PEF2XOIV.js} +7 -4
  63. package/dist/chunk-PEF2XOIV.js.map +1 -0
  64. package/dist/{chunk-646B5ERJ.js → chunk-PKO5NJ65.js} +51 -48
  65. package/dist/chunk-PKO5NJ65.js.map +1 -0
  66. package/dist/{chunk-QZHF4BWN.js → chunk-Q5LGXWNG.js} +6 -6
  67. package/dist/{chunk-ESF7TRYJ.js → chunk-SHJGBAIW.js} +37 -2
  68. package/dist/{chunk-ESF7TRYJ.js.map → chunk-SHJGBAIW.js.map} +1 -1
  69. package/dist/{chunk-O4ZIBPIW.js → chunk-T7CGPTFU.js} +3 -3
  70. package/dist/{chunk-PLBIPT6I.js → chunk-TJSQHO4Q.js} +7 -4
  71. package/dist/chunk-TJSQHO4Q.js.map +1 -0
  72. package/dist/{chunk-6TUWSUUD.js → chunk-UF3N7IRP.js} +26 -24
  73. package/dist/chunk-UF3N7IRP.js.map +1 -0
  74. package/dist/{chunk-P3VJCTVE.js → chunk-UH3NYOHN.js} +4 -3
  75. package/dist/chunk-UH3NYOHN.js.map +1 -0
  76. package/dist/{chunk-J6BH2OBA.js → chunk-UK6U5C3N.js} +8 -5
  77. package/dist/chunk-UK6U5C3N.js.map +1 -0
  78. package/dist/{chunk-OTQE66IX.js → chunk-V5OVSGB6.js} +6 -3
  79. package/dist/chunk-V5OVSGB6.js.map +1 -0
  80. package/dist/{chunk-H3MB3F62.js → chunk-WHQ2JB35.js} +4 -3
  81. package/dist/chunk-WHQ2JB35.js.map +1 -0
  82. package/dist/{chunk-NIZQH6AU.js → chunk-WTTVFSCO.js} +8 -7
  83. package/dist/chunk-WTTVFSCO.js.map +1 -0
  84. package/dist/{chunk-OUITHS6V.js → chunk-Z7J3OAPR.js} +357 -325
  85. package/dist/chunk-Z7J3OAPR.js.map +1 -0
  86. package/dist/{cli-Dt-tuiYH.d.ts → cli-XVpmSoQs.d.ts} +3 -3
  87. package/dist/cli.d.ts +11 -11
  88. package/dist/cli.js +20 -20
  89. package/dist/compounding/engine.d.ts +3 -2
  90. package/dist/compounding/engine.js +2 -1
  91. package/dist/compounding/preference-consolidator.d.ts +1 -1
  92. package/dist/compression-optimizer.d.ts +1 -1
  93. package/dist/config.d.ts +1 -1
  94. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  95. package/dist/connectors/codex-materialize.d.ts +1 -1
  96. package/dist/connectors/index.d.ts +1 -1
  97. package/dist/consolidation-provenance-check.d.ts +1 -1
  98. package/dist/consolidation-undo.d.ts +1 -1
  99. package/dist/contradiction/index.d.ts +2 -2
  100. package/dist/contradiction/index.js +2 -1
  101. package/dist/{contradiction-scan-HWGEOUDS.js → contradiction-scan-OUHMCUBT.js} +3 -2
  102. package/dist/conversation-index/backend.d.ts +1 -1
  103. package/dist/conversation-index/chunker.d.ts +1 -1
  104. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  105. package/dist/conversation-index/indexer.d.ts +1 -1
  106. package/dist/conversation-index/search.d.ts +1 -1
  107. package/dist/day-summary.d.ts +1 -1
  108. package/dist/delinearize.d.ts +1 -1
  109. package/dist/direct-answer-wiring.d.ts +1 -1
  110. package/dist/direct-answer.d.ts +1 -1
  111. package/dist/embedding-fallback.d.ts +1 -1
  112. package/dist/embedding-fallback.js +2 -2
  113. package/dist/enrichment/index.d.ts +1 -1
  114. package/dist/entity-retrieval.d.ts +1 -1
  115. package/dist/entity-retrieval.js +2 -1
  116. package/dist/entity-schema.d.ts +1 -1
  117. package/dist/explicit-capture.d.ts +9 -9
  118. package/dist/explicit-capture.js +2 -1
  119. package/dist/extraction-faithfulness.d.ts +1 -1
  120. package/dist/extraction-judge-telemetry.d.ts +1 -1
  121. package/dist/extraction-judge-training.d.ts +1 -1
  122. package/dist/extraction-judge.d.ts +1 -1
  123. package/dist/extraction.d.ts +1 -1
  124. package/dist/extraction.js +3 -3
  125. package/dist/fallback-llm.d.ts +1 -1
  126. package/dist/{first-start-migration-OOR57AYR.js → first-start-migration-W4U6XDKI.js} +7 -6
  127. package/dist/first-start-migration-W4U6XDKI.js.map +1 -0
  128. package/dist/graph-dashboard-diff.d.ts +1 -1
  129. package/dist/graph-dashboard-key.d.ts +1 -1
  130. package/dist/graph-dashboard-parser.d.ts +1 -1
  131. package/dist/graph-edge-reinforcement.d.ts +1 -1
  132. package/dist/graph-snapshot.d.ts +1 -1
  133. package/dist/graph.d.ts +1 -1
  134. package/dist/identity-continuity.d.ts +1 -1
  135. package/dist/importance.d.ts +1 -1
  136. package/dist/index.d.ts +12 -12
  137. package/dist/index.js +43 -43
  138. package/dist/intent.d.ts +1 -1
  139. package/dist/lcm/engine.d.ts +1 -1
  140. package/dist/lcm/index.d.ts +1 -1
  141. package/dist/lcm/tools.d.ts +1 -1
  142. package/dist/lifecycle.d.ts +1 -1
  143. package/dist/live-connectors-runner.d.ts +1 -1
  144. package/dist/local-llm.d.ts +1 -1
  145. package/dist/local-llm.js +2 -1
  146. package/dist/local-model-endpoint.d.ts +1 -1
  147. package/dist/maintenance/memory-governance.d.ts +1 -1
  148. package/dist/mcp-memory-inspector-app.d.ts +10 -10
  149. package/dist/memory-action-policy.d.ts +1 -1
  150. package/dist/memory-cache.d.ts +1 -1
  151. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  152. package/dist/memory-projection-store.d.ts +1 -1
  153. package/dist/memory-provenance.d.ts +1 -1
  154. package/dist/memory-worth-outcomes.d.ts +1 -1
  155. package/dist/models-json.d.ts +1 -1
  156. package/dist/namespaces/migrate.d.ts +2 -2
  157. package/dist/namespaces/migrate.js +6 -6
  158. package/dist/namespaces/principal.d.ts +1 -1
  159. package/dist/namespaces/principal.js +2 -1
  160. package/dist/namespaces/search.d.ts +1 -1
  161. package/dist/namespaces/search.js +4 -4
  162. package/dist/namespaces/storage.d.ts +2 -2
  163. package/dist/namespaces/storage.js +2 -1
  164. package/dist/native-knowledge.d.ts +1 -1
  165. package/dist/operator-toolkit.d.ts +1 -1
  166. package/dist/operator-toolkit.js +11 -11
  167. package/dist/orchestration/compression-guideline-coordinator.d.ts +1 -1
  168. package/dist/orchestration/maintenance.d.ts +2 -2
  169. package/dist/orchestration/maintenance.js +6 -5
  170. package/dist/{orchestrator-B4KjaOtY.d.ts → orchestrator-BXi-gadS.d.ts} +66 -5
  171. package/dist/orchestrator.d.ts +5 -5
  172. package/dist/orchestrator.js +20 -18
  173. package/dist/patterns-cli.d.ts +1 -1
  174. package/dist/policy-runtime.d.ts +1 -1
  175. package/dist/provenance.d.ts +1 -1
  176. package/dist/qmd-recall-cache.d.ts +1 -1
  177. package/dist/qmd.d.ts +1 -1
  178. package/dist/recall-disclosure-escalation.d.ts +1 -1
  179. package/dist/recall-explain-renderer.d.ts +1 -1
  180. package/dist/recall-planner-llm.d.ts +1 -1
  181. package/dist/recall-state.d.ts +1 -1
  182. package/dist/recall-tag-filter.d.ts +1 -1
  183. package/dist/recall-xray-cli.d.ts +1 -1
  184. package/dist/recall-xray-renderer.d.ts +1 -1
  185. package/dist/recall-xray.d.ts +1 -1
  186. package/dist/resolve-auth-token.d.ts +1 -1
  187. package/dist/retrieval-agents.d.ts +1 -1
  188. package/dist/retrieval-tiers.d.ts +1 -1
  189. package/dist/routing/engine.d.ts +1 -1
  190. package/dist/routing/store.d.ts +1 -1
  191. package/dist/schemas.d.ts +22 -22
  192. package/dist/search/embed-helper.d.ts +1 -1
  193. package/dist/search/embed-helper.js +2 -2
  194. package/dist/search/factory.d.ts +1 -1
  195. package/dist/search/factory.js +3 -3
  196. package/dist/search/index.d.ts +1 -1
  197. package/dist/search/index.js +3 -3
  198. package/dist/search/lancedb-backend.d.ts +1 -1
  199. package/dist/search/meilisearch-backend.d.ts +1 -1
  200. package/dist/search/noop-backend.d.ts +1 -1
  201. package/dist/search/orama-backend.d.ts +1 -1
  202. package/dist/search/port.d.ts +1 -1
  203. package/dist/search/remote-backend.d.ts +1 -1
  204. package/dist/{semantic-SLAa_prH.d.ts → semantic-DJR8_DMQ.d.ts} +1 -1
  205. package/dist/{semantic-consolidation-CstTvHPo.d.ts → semantic-consolidation-DeL5grLx.d.ts} +1 -1
  206. package/dist/semantic-consolidation.d.ts +2 -2
  207. package/dist/semantic-rule-verifier.d.ts +1 -1
  208. package/dist/session-observer-bands.d.ts +1 -1
  209. package/dist/session-observer-state.d.ts +1 -1
  210. package/dist/shared-context/manager.d.ts +1 -1
  211. package/dist/signal.d.ts +1 -1
  212. package/dist/storage.d.ts +1 -1
  213. package/dist/summarizer.d.ts +1 -1
  214. package/dist/summarizer.js +3 -2
  215. package/dist/summary-snapshot.d.ts +1 -1
  216. package/dist/temporal-supersession.d.ts +1 -1
  217. package/dist/temporal-validity.d.ts +1 -1
  218. package/dist/threading.d.ts +1 -1
  219. package/dist/tier-migration.d.ts +1 -1
  220. package/dist/tier-routing.d.ts +1 -1
  221. package/dist/{tier-stats-3LYQ3VV5.js → tier-stats-LSM35HZY.js} +5 -2
  222. package/dist/tier-stats-LSM35HZY.js.map +1 -0
  223. package/dist/topics.d.ts +1 -1
  224. package/dist/transcript.d.ts +1 -1
  225. package/dist/transfer/types.d.ts +12 -12
  226. package/dist/trust-score-stage.d.ts +1 -1
  227. package/dist/trust-score.d.ts +1 -1
  228. package/dist/{types-VkxElCHR.d.ts → types-CpFz51Pv.d.ts} +1 -1
  229. package/dist/types.d.ts +1 -1
  230. package/dist/utility-runtime.d.ts +1 -1
  231. package/package.json +2 -2
  232. package/src/access-service.ts +42 -37
  233. package/src/active-memory-bridge.ts +2 -1
  234. package/src/admin/admin-surfaces.ts +2 -1
  235. package/src/capabilities.test.ts +178 -0
  236. package/src/capabilities.ts +197 -0
  237. package/src/cli.ts +13 -9
  238. package/src/compounding/engine.ts +4 -3
  239. package/src/contradiction/contradiction-scan.ts +4 -3
  240. package/src/embedding-fallback.ts +5 -2
  241. package/src/entity-retrieval.ts +3 -2
  242. package/src/explicit-capture.ts +2 -1
  243. package/src/extraction.ts +6 -3
  244. package/src/local-llm.ts +4 -3
  245. package/src/maintenance/first-start-migration.ts +6 -3
  246. package/src/maintenance/namespace-maintenance-fanout.ts +2 -1
  247. package/src/maintenance/namespace-planner.ts +4 -3
  248. package/src/maintenance/tier-stats.ts +2 -1
  249. package/src/namespaces/catalog.ts +2 -1
  250. package/src/namespaces/migrate.ts +2 -1
  251. package/src/namespaces/principal.ts +6 -5
  252. package/src/namespaces/scope-profiles.ts +2 -1
  253. package/src/namespaces/search.ts +2 -1
  254. package/src/namespaces/storage.ts +4 -3
  255. package/src/operator-toolkit.ts +19 -18
  256. package/src/orchestration/maintenance.ts +8 -4
  257. package/src/orchestration/semantic-consolidation-coordinator.ts +454 -0
  258. package/src/orchestration/tier-migration-coordinator.ts +5 -4
  259. package/src/orchestrator.ts +78 -417
  260. package/src/scopes/scope-plan.ts +3 -2
  261. package/src/search/embed-helper.ts +5 -2
  262. package/src/search/factory.ts +9 -6
  263. package/src/summarizer.ts +3 -2
  264. package/dist/chunk-24D66MMN.js.map +0 -1
  265. package/dist/chunk-646B5ERJ.js.map +0 -1
  266. package/dist/chunk-6TUWSUUD.js.map +0 -1
  267. package/dist/chunk-CGPHMNL4.js.map +0 -1
  268. package/dist/chunk-CX77GNMB.js.map +0 -1
  269. package/dist/chunk-DKT3X5C3.js.map +0 -1
  270. package/dist/chunk-FFUCCKPN.js.map +0 -1
  271. package/dist/chunk-GGL34GCW.js.map +0 -1
  272. package/dist/chunk-H3MB3F62.js.map +0 -1
  273. package/dist/chunk-HHNSLPX7.js.map +0 -1
  274. package/dist/chunk-J6BH2OBA.js.map +0 -1
  275. package/dist/chunk-KQYGNGON.js.map +0 -1
  276. package/dist/chunk-KSJCXXOU.js.map +0 -1
  277. package/dist/chunk-LUCARK4W.js.map +0 -1
  278. package/dist/chunk-NIZQH6AU.js.map +0 -1
  279. package/dist/chunk-OTQE66IX.js.map +0 -1
  280. package/dist/chunk-OUITHS6V.js.map +0 -1
  281. package/dist/chunk-P3VJCTVE.js.map +0 -1
  282. package/dist/chunk-PLBIPT6I.js.map +0 -1
  283. package/dist/chunk-PMAQRUN4.js.map +0 -1
  284. package/dist/chunk-UZYLX7M6.js.map +0 -1
  285. package/dist/chunk-ZQUAVZNG.js.map +0 -1
  286. package/dist/chunk-ZVHRSR2R.js.map +0 -1
  287. package/dist/first-start-migration-OOR57AYR.js.map +0 -1
  288. package/dist/tier-stats-3LYQ3VV5.js.map +0 -1
  289. /package/dist/{chunk-NOU77OHX.js.map → chunk-5DIKZKOD.js.map} +0 -0
  290. /package/dist/{chunk-FYWUNVFZ.js.map → chunk-IDIXGGDN.js.map} +0 -0
  291. /package/dist/{chunk-HJWQJUKQ.js.map → chunk-NDYQIN6C.js.map} +0 -0
  292. /package/dist/{chunk-QZHF4BWN.js.map → chunk-Q5LGXWNG.js.map} +0 -0
  293. /package/dist/{chunk-O4ZIBPIW.js.map → chunk-T7CGPTFU.js.map} +0 -0
  294. /package/dist/{contradiction-scan-HWGEOUDS.js.map → contradiction-scan-OUHMCUBT.js.map} +0 -0
@@ -11,16 +11,16 @@ import {
11
11
  processChatMessage,
12
12
  sessionBelongsToPrincipal,
13
13
  subscribeChatTranscript
14
- } from "./chunk-O4ZIBPIW.js";
14
+ } from "./chunk-T7CGPTFU.js";
15
15
  import {
16
16
  validateRequest
17
17
  } from "./chunk-FVZ2ISIX.js";
18
18
  import {
19
19
  getOperation
20
- } from "./chunk-NOU77OHX.js";
20
+ } from "./chunk-5DIKZKOD.js";
21
21
  import {
22
22
  EngramAccessInputError
23
- } from "./chunk-646B5ERJ.js";
23
+ } from "./chunk-PKO5NJ65.js";
24
24
  import {
25
25
  CorrectionContractError
26
26
  } from "./chunk-WNGXQMRI.js";
@@ -29,7 +29,7 @@ import {
29
29
  } from "./chunk-JGSKJHF7.js";
30
30
  import {
31
31
  projectTagProjectId
32
- } from "./chunk-J6BH2OBA.js";
32
+ } from "./chunk-UK6U5C3N.js";
33
33
  import {
34
34
  subscribeGraphEvents
35
35
  } from "./chunk-DEUNUKTD.js";
@@ -1769,7 +1769,7 @@ var EngramAccessHttpServer = class {
1769
1769
  if (req.method === "POST" && pathname === "/engram/v1/contradiction-scan") {
1770
1770
  void getOperation("contradiction_scan_run");
1771
1771
  const body = await this.readJsonBody(req);
1772
- const { runContradictionScan } = await import("./contradiction-scan-HWGEOUDS.js");
1772
+ const { runContradictionScan } = await import("./contradiction-scan-OUHMCUBT.js");
1773
1773
  const principal = this.resolveRequestPrincipal(req);
1774
1774
  const result = await runContradictionScan({
1775
1775
  storage: this.service.storageRef,
@@ -2629,4 +2629,4 @@ function positiveIntQueryParam(value, label) {
2629
2629
  export {
2630
2630
  EngramAccessHttpServer
2631
2631
  };
2632
- //# sourceMappingURL=chunk-QZHF4BWN.js.map
2632
+ //# sourceMappingURL=chunk-Q5LGXWNG.js.map
@@ -70,6 +70,37 @@ function resolveCreationMemoryCapabilities(config) {
70
70
  commitmentLifecycle: config.commitmentLifecycleEnabled
71
71
  });
72
72
  }
73
+ function resolveNamespaceCapabilities(config) {
74
+ return Object.freeze({
75
+ namespaces: config.namespacesEnabled
76
+ });
77
+ }
78
+ function resolveQmdCapabilities(config) {
79
+ return Object.freeze({
80
+ qmd: config.qmdEnabled,
81
+ qmdTierMigration: config.qmdTierMigrationEnabled,
82
+ qmdTierAutoBackfill: config.qmdTierAutoBackfillEnabled,
83
+ qmdAutoEmbed: config.qmdAutoEmbedEnabled,
84
+ qmdMaintenance: config.qmdMaintenanceEnabled,
85
+ qmdColdTier: config.qmdColdTierEnabled === true,
86
+ qmdDaemon: config.qmdDaemonEnabled,
87
+ qmdTierParityGraph: config.qmdTierParityGraphEnabled,
88
+ qmdQueryRerank: config.qmdQueryRerankEnabled,
89
+ qmdIntentHints: config.qmdIntentHintsEnabled,
90
+ qmdExplain: config.qmdExplainEnabled,
91
+ qmdAutoUpgrade: config.qmdAutoUpgradeEnabled
92
+ });
93
+ }
94
+ function resolveIdentityContinuityCapabilities(config) {
95
+ return Object.freeze({
96
+ identityContinuity: config.identityContinuityEnabled
97
+ });
98
+ }
99
+ function resolveLocalLlmCapabilities(config) {
100
+ return Object.freeze({
101
+ localLlm: config.localLlmEnabled
102
+ });
103
+ }
73
104
 
74
105
  export {
75
106
  resolveCapabilities,
@@ -77,6 +108,10 @@ export {
77
108
  resolveAccessSetupCapabilities,
78
109
  resolveMemoryLifecycleCapabilities,
79
110
  resolveIndexingCapabilities,
80
- resolveCreationMemoryCapabilities
111
+ resolveCreationMemoryCapabilities,
112
+ resolveNamespaceCapabilities,
113
+ resolveQmdCapabilities,
114
+ resolveIdentityContinuityCapabilities,
115
+ resolveLocalLlmCapabilities
81
116
  };
82
- //# sourceMappingURL=chunk-ESF7TRYJ.js.map
117
+ //# sourceMappingURL=chunk-SHJGBAIW.js.map
@@ -1 +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\n// ---------------------------------------------------------------------------\n// Memory-lifecycle capability set (issue #1523 batch 3).\n//\n// The flags below gate memory WRITE/EXTRACTION (extraction judge, scope\n// classification, dedupe, telemetry prefilter), temporal supersession of\n// stored facts, and the lifecycle policy pass (promotion / decay / stale\n// filtering). They are read on the persistExtraction write path, the recall\n// candidate-filter path, and the maintenance / lifecycle-pass path — so, like\n// the graph-construction set above, they get their own projection resolved\n// ONCE at each operation entry that reads them (never re-derived from raw\n// config mid-operation — the gate-divergence defect class #1523 targets).\n//\n// Every field projects from an already-resolved PluginConfig boolean (defaults\n// are applied at the config-parse boundary, rule 36), so the resolver is a\n// pure projection — no `!== false` / `=== true` re-coercion here.\n// ---------------------------------------------------------------------------\n\n/**\n * Frozen projection of memory-lifecycle feature gates (issue #1523 batch 3).\n *\n * Resolved once per write / recall-filter / maintenance operation and threaded\n * down. Composition lives ONLY in {@link resolveMemoryLifecycleCapabilities}.\n */\nexport interface MemoryLifecycleCapabilitySet {\n /** `temporalSupersessionEnabled` — supersede stale structured facts on write, filter on recall. */\n readonly temporalSupersession: boolean;\n /** `temporalMemoryTreeEnabled` — temporal-memory-tree build + recall tier. */\n readonly temporalMemoryTree: boolean;\n /** `lifecyclePolicyEnabled` — lifecycle promotion / decay metadata pass. */\n readonly lifecyclePolicy: boolean;\n /** `lifecycleFilterStaleEnabled` — filter stale-lifecycle memories from recall. */\n readonly lifecycleFilterStale: boolean;\n /** `lifecycleMetricsEnabled` — emit lifecycle-pass metrics. */\n readonly lifecycleMetrics: boolean;\n /** `extractionScopeClassificationEnabled` — LLM classifies each fact's scope. */\n readonly extractionScopeClassification: boolean;\n /** `extractionJudgeEnabled` — LLM-as-judge fact-worthiness gate. */\n readonly extractionJudge: boolean;\n /** `extractionDedupeEnabled` — dedupe against recent extractions. */\n readonly extractionDedupe: boolean;\n /** `extractionTelemetryPrefilterEnabled` — skip mechanical-telemetry transcripts. */\n readonly extractionTelemetryPrefilter: boolean;\n /** `extractionJudgeTelemetryEnabled` — collect judge verdict telemetry. */\n readonly extractionJudgeTelemetry: boolean;\n /** `embeddingFallbackEnabled` — semantic-dedup / archive-search embedding fallback. */\n readonly embeddingFallback: boolean;\n}\n\n/**\n * Config projection consumed by {@link resolveMemoryLifecycleCapabilities}.\n */\nexport type MemoryLifecycleConfigProjection = Pick<\n PluginConfig,\n | \"temporalSupersessionEnabled\"\n | \"temporalMemoryTreeEnabled\"\n | \"lifecyclePolicyEnabled\"\n | \"lifecycleFilterStaleEnabled\"\n | \"lifecycleMetricsEnabled\"\n | \"extractionScopeClassificationEnabled\"\n | \"extractionJudgeEnabled\"\n | \"extractionDedupeEnabled\"\n | \"extractionTelemetryPrefilterEnabled\"\n | \"extractionJudgeTelemetryEnabled\"\n | \"embeddingFallbackEnabled\"\n>;\n\n/**\n * Resolve the {@link MemoryLifecycleCapabilitySet} from parsed config.\n *\n * Call this ONCE per write / recall-filter / maintenance operation entry and\n * thread the result down — exactly the pattern {@link resolveCapabilities}\n * established for recall.\n */\nexport function resolveMemoryLifecycleCapabilities(\n config: MemoryLifecycleConfigProjection,\n): MemoryLifecycleCapabilitySet {\n return Object.freeze({\n temporalSupersession: config.temporalSupersessionEnabled,\n temporalMemoryTree: config.temporalMemoryTreeEnabled,\n lifecyclePolicy: config.lifecyclePolicyEnabled,\n lifecycleFilterStale: config.lifecycleFilterStaleEnabled,\n lifecycleMetrics: config.lifecycleMetricsEnabled,\n extractionScopeClassification: config.extractionScopeClassificationEnabled,\n extractionJudge: config.extractionJudgeEnabled,\n extractionDedupe: config.extractionDedupeEnabled,\n extractionTelemetryPrefilter: config.extractionTelemetryPrefilterEnabled,\n extractionJudgeTelemetry: config.extractionJudgeTelemetryEnabled,\n embeddingFallback: config.embeddingFallbackEnabled,\n });\n}\n\n// ---------------------------------------------------------------------------\n// Indexing capability set (issue #1523 batch 4).\n//\n// The flags below gate query-aware indexing (temporal/tag index build +\n// prefilter) and the conversation index (QMD/FAISS backend selection). They\n// are read on the recall path, the extraction/persist path, and the\n// maintenance/invalidation path — so they get their own projection resolved\n// ONCE at each operation entry that reads them.\n//\n// Every field projects from an already-resolved PluginConfig boolean (defaults\n// applied at the parse boundary), so the resolver is a pure projection.\n// ---------------------------------------------------------------------------\n\n/**\n * Frozen projection of indexing feature gates (issue #1523 batch 4).\n *\n * Resolved once per recall / extraction / maintenance operation and threaded\n * down. Composition lives ONLY in {@link resolveIndexingCapabilities}.\n */\nexport interface IndexingCapabilitySet {\n /** `queryAwareIndexingEnabled` — build + use temporal/tag index for recall prefilter. */\n readonly queryAwareIndexing: boolean;\n /** `conversationIndexEnabled` — conversation-index backend (QMD / FAISS). */\n readonly conversationIndex: boolean;\n}\n\n/**\n * Config projection consumed by {@link resolveIndexingCapabilities}.\n */\nexport type IndexingConfigProjection = Pick<\n PluginConfig,\n \"queryAwareIndexingEnabled\" | \"conversationIndexEnabled\"\n>;\n\n/**\n * Resolve the {@link IndexingCapabilitySet} from parsed config.\n *\n * Call this ONCE per recall / extraction / maintenance operation entry and\n * thread the result down — exactly the pattern {@link resolveCapabilities}\n * established for recall.\n */\nexport function resolveIndexingCapabilities(\n config: IndexingConfigProjection,\n): IndexingCapabilitySet {\n return Object.freeze({\n queryAwareIndexing: config.queryAwareIndexingEnabled,\n conversationIndex: config.conversationIndexEnabled,\n });\n}\n\n// ---------------------------------------------------------------------------\n// Creation-memory capability set (issue #1523 batch 4).\n//\n// The flags below gate the creation-memory subsystem: resume-bundle handoff,\n// commitment ledger, commitment lifecycle, and the master creation-memory\n// switch. They are read on the extraction/persist path, the recall\n// enrichment path, and the CLI command surface — so they get their own\n// projection resolved ONCE at each operation entry that reads them.\n//\n// Every field projects from an already-resolved PluginConfig boolean (defaults\n// applied at the parse boundary), so the resolver is a pure projection.\n// ---------------------------------------------------------------------------\n\n/**\n * Frozen projection of creation-memory feature gates (issue #1523 batch 4).\n *\n * Resolved once per creation-memory operation (CLI command, extraction,\n * recall enrichment) and threaded down. Composition lives ONLY in\n * {@link resolveCreationMemoryCapabilities}.\n */\nexport interface CreationMemoryCapabilitySet {\n /** `creationMemoryEnabled` — master switch for creation-memory subsystem. */\n readonly creationMemory: boolean;\n /** `commitmentLedgerEnabled` — commitment-ledger read/write. */\n readonly commitmentLedger: boolean;\n /** `resumeBundlesEnabled` — resume-bundle handoff bundles. */\n readonly resumeBundles: boolean;\n /** `commitmentLifecycleEnabled` — commitment lifecycle (promotion / decay). */\n readonly commitmentLifecycle: boolean;\n}\n\n/**\n * Config projection consumed by {@link resolveCreationMemoryCapabilities}.\n */\nexport type CreationMemoryConfigProjection = Pick<\n PluginConfig,\n | \"creationMemoryEnabled\"\n | \"commitmentLedgerEnabled\"\n | \"resumeBundlesEnabled\"\n | \"commitmentLifecycleEnabled\"\n>;\n\n/**\n * Resolve the {@link CreationMemoryCapabilitySet} from parsed config.\n *\n * Call this ONCE per creation-memory operation entry and thread the result\n * down — exactly the pattern {@link resolveCapabilities} established for\n * recall.\n */\nexport function resolveCreationMemoryCapabilities(\n config: CreationMemoryConfigProjection,\n): CreationMemoryCapabilitySet {\n return Object.freeze({\n creationMemory: config.creationMemoryEnabled,\n commitmentLedger: config.commitmentLedgerEnabled,\n resumeBundles: config.resumeBundlesEnabled,\n commitmentLifecycle: config.commitmentLifecyc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OAAO;AAAA,IACjC,mBAAmB,OAAO;AAAA,EAC5B,CAAC;AACH;AA2CO,SAAS,4BACd,QACuB;AACvB,SAAO,OAAO,OAAO;AAAA,IACnB,oBAAoB,OAAO;AAAA,IAC3B,mBAAmB,OAAO;AAAA,EAC5B,CAAC;AACH;AAmDO,SAAS,kCACd,QAC6B;AAC7B,SAAO,OAAO,OAAO;AAAA,IACnB,gBAAgB,OAAO;AAAA,IACvB,kBAAkB,OAAO;AAAA,IACzB,eAAe,OAAO;AAAA,IACtB,qBAAqB,OAAO;AAAA,EAC9B,CAAC;AACH;","names":[]}
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\n// ---------------------------------------------------------------------------\n// Memory-lifecycle capability set (issue #1523 batch 3).\n//\n// The flags below gate memory WRITE/EXTRACTION (extraction judge, scope\n// classification, dedupe, telemetry prefilter), temporal supersession of\n// stored facts, and the lifecycle policy pass (promotion / decay / stale\n// filtering). They are read on the persistExtraction write path, the recall\n// candidate-filter path, and the maintenance / lifecycle-pass path — so, like\n// the graph-construction set above, they get their own projection resolved\n// ONCE at each operation entry that reads them (never re-derived from raw\n// config mid-operation — the gate-divergence defect class #1523 targets).\n//\n// Every field projects from an already-resolved PluginConfig boolean (defaults\n// are applied at the config-parse boundary, rule 36), so the resolver is a\n// pure projection — no `!== false` / `=== true` re-coercion here.\n// ---------------------------------------------------------------------------\n\n/**\n * Frozen projection of memory-lifecycle feature gates (issue #1523 batch 3).\n *\n * Resolved once per write / recall-filter / maintenance operation and threaded\n * down. Composition lives ONLY in {@link resolveMemoryLifecycleCapabilities}.\n */\nexport interface MemoryLifecycleCapabilitySet {\n /** `temporalSupersessionEnabled` — supersede stale structured facts on write, filter on recall. */\n readonly temporalSupersession: boolean;\n /** `temporalMemoryTreeEnabled` — temporal-memory-tree build + recall tier. */\n readonly temporalMemoryTree: boolean;\n /** `lifecyclePolicyEnabled` — lifecycle promotion / decay metadata pass. */\n readonly lifecyclePolicy: boolean;\n /** `lifecycleFilterStaleEnabled` — filter stale-lifecycle memories from recall. */\n readonly lifecycleFilterStale: boolean;\n /** `lifecycleMetricsEnabled` — emit lifecycle-pass metrics. */\n readonly lifecycleMetrics: boolean;\n /** `extractionScopeClassificationEnabled` — LLM classifies each fact's scope. */\n readonly extractionScopeClassification: boolean;\n /** `extractionJudgeEnabled` — LLM-as-judge fact-worthiness gate. */\n readonly extractionJudge: boolean;\n /** `extractionDedupeEnabled` — dedupe against recent extractions. */\n readonly extractionDedupe: boolean;\n /** `extractionTelemetryPrefilterEnabled` — skip mechanical-telemetry transcripts. */\n readonly extractionTelemetryPrefilter: boolean;\n /** `extractionJudgeTelemetryEnabled` — collect judge verdict telemetry. */\n readonly extractionJudgeTelemetry: boolean;\n /** `embeddingFallbackEnabled` — semantic-dedup / archive-search embedding fallback. */\n readonly embeddingFallback: boolean;\n}\n\n/**\n * Config projection consumed by {@link resolveMemoryLifecycleCapabilities}.\n */\nexport type MemoryLifecycleConfigProjection = Pick<\n PluginConfig,\n | \"temporalSupersessionEnabled\"\n | \"temporalMemoryTreeEnabled\"\n | \"lifecyclePolicyEnabled\"\n | \"lifecycleFilterStaleEnabled\"\n | \"lifecycleMetricsEnabled\"\n | \"extractionScopeClassificationEnabled\"\n | \"extractionJudgeEnabled\"\n | \"extractionDedupeEnabled\"\n | \"extractionTelemetryPrefilterEnabled\"\n | \"extractionJudgeTelemetryEnabled\"\n | \"embeddingFallbackEnabled\"\n>;\n\n/**\n * Resolve the {@link MemoryLifecycleCapabilitySet} from parsed config.\n *\n * Call this ONCE per write / recall-filter / maintenance operation entry and\n * thread the result down — exactly the pattern {@link resolveCapabilities}\n * established for recall.\n */\nexport function resolveMemoryLifecycleCapabilities(\n config: MemoryLifecycleConfigProjection,\n): MemoryLifecycleCapabilitySet {\n return Object.freeze({\n temporalSupersession: config.temporalSupersessionEnabled,\n temporalMemoryTree: config.temporalMemoryTreeEnabled,\n lifecyclePolicy: config.lifecyclePolicyEnabled,\n lifecycleFilterStale: config.lifecycleFilterStaleEnabled,\n lifecycleMetrics: config.lifecycleMetricsEnabled,\n extractionScopeClassification: config.extractionScopeClassificationEnabled,\n extractionJudge: config.extractionJudgeEnabled,\n extractionDedupe: config.extractionDedupeEnabled,\n extractionTelemetryPrefilter: config.extractionTelemetryPrefilterEnabled,\n extractionJudgeTelemetry: config.extractionJudgeTelemetryEnabled,\n embeddingFallback: config.embeddingFallbackEnabled,\n });\n}\n\n// ---------------------------------------------------------------------------\n// Indexing capability set (issue #1523 batch 4).\n//\n// The flags below gate query-aware indexing (temporal/tag index build +\n// prefilter) and the conversation index (QMD/FAISS backend selection). They\n// are read on the recall path, the extraction/persist path, and the\n// maintenance/invalidation path — so they get their own projection resolved\n// ONCE at each operation entry that reads them.\n//\n// Every field projects from an already-resolved PluginConfig boolean (defaults\n// applied at the parse boundary), so the resolver is a pure projection.\n// ---------------------------------------------------------------------------\n\n/**\n * Frozen projection of indexing feature gates (issue #1523 batch 4).\n *\n * Resolved once per recall / extraction / maintenance operation and threaded\n * down. Composition lives ONLY in {@link resolveIndexingCapabilities}.\n */\nexport interface IndexingCapabilitySet {\n /** `queryAwareIndexingEnabled` — build + use temporal/tag index for recall prefilter. */\n readonly queryAwareIndexing: boolean;\n /** `conversationIndexEnabled` — conversation-index backend (QMD / FAISS). */\n readonly conversationIndex: boolean;\n}\n\n/**\n * Config projection consumed by {@link resolveIndexingCapabilities}.\n */\nexport type IndexingConfigProjection = Pick<\n PluginConfig,\n \"queryAwareIndexingEnabled\" | \"conversationIndexEnabled\"\n>;\n\n/**\n * Resolve the {@link IndexingCapabilitySet} from parsed config.\n *\n * Call this ONCE per recall / extraction / maintenance operation entry and\n * thread the result down — exactly the pattern {@link resolveCapabilities}\n * established for recall.\n */\nexport function resolveIndexingCapabilities(\n config: IndexingConfigProjection,\n): IndexingCapabilitySet {\n return Object.freeze({\n queryAwareIndexing: config.queryAwareIndexingEnabled,\n conversationIndex: config.conversationIndexEnabled,\n });\n}\n\n// ---------------------------------------------------------------------------\n// Creation-memory capability set (issue #1523 batch 4).\n//\n// The flags below gate the creation-memory subsystem: resume-bundle handoff,\n// commitment ledger, commitment lifecycle, and the master creation-memory\n// switch. They are read on the extraction/persist path, the recall\n// enrichment path, and the CLI command surface — so they get their own\n// projection resolved ONCE at each operation entry that reads them.\n//\n// Every field projects from an already-resolved PluginConfig boolean (defaults\n// applied at the parse boundary), so the resolver is a pure projection.\n// ---------------------------------------------------------------------------\n\n/**\n * Frozen projection of creation-memory feature gates (issue #1523 batch 4).\n *\n * Resolved once per creation-memory operation (CLI command, extraction,\n * recall enrichment) and threaded down. Composition lives ONLY in\n * {@link resolveCreationMemoryCapabilities}.\n */\nexport interface CreationMemoryCapabilitySet {\n /** `creationMemoryEnabled` — master switch for creation-memory subsystem. */\n readonly creationMemory: boolean;\n /** `commitmentLedgerEnabled` — commitment-ledger read/write. */\n readonly commitmentLedger: boolean;\n /** `resumeBundlesEnabled` — resume-bundle handoff bundles. */\n readonly resumeBundles: boolean;\n /** `commitmentLifecycleEnabled` — commitment lifecycle (promotion / decay). */\n readonly commitmentLifecycle: boolean;\n}\n\n/**\n * Config projection consumed by {@link resolveCreationMemoryCapabilities}.\n */\nexport type CreationMemoryConfigProjection = Pick<\n PluginConfig,\n | \"creationMemoryEnabled\"\n | \"commitmentLedgerEnabled\"\n | \"resumeBundlesEnabled\"\n | \"commitmentLifecycleEnabled\"\n>;\n\n/**\n * Resolve the {@link CreationMemoryCapabilitySet} from parsed config.\n *\n * Call this ONCE per creation-memory operation entry and thread the result\n * down — exactly the pattern {@link resolveCapabilities} established for\n * recall.\n */\nexport function resolveCreationMemoryCapabilities(\n config: CreationMemoryConfigProjection,\n): CreationMemoryCapabilitySet {\n return Object.freeze({\n creationMemory: config.creationMemoryEnabled,\n commitmentLedger: config.commitmentLedgerEnabled,\n resumeBundles: config.resumeBundlesEnabled,\n commitmentLifecycle: config.commitmentLifecycleEnabled,\n });\n}\n\n// ---------------------------------------------------------------------------\n// Namespace capability set (issue #1523 batch 5).\n//\n// `namespacesEnabled` is the single most-scattered config flag in the codebase\n// (101 read sites outside config.ts across 18 files — orchestrator, access-service,\n// namespace modules, maintenance, CLI, admin). It gates whether the multi-namespace\n// system is active at all: every namespace resolution, storage path, recall budget,\n// and maintenance fanout checks it. Like the other projections above it gets its own\n// resolver invoked ONCE per operation entry rather than re-derived at each site.\n//\n// The field is a non-optional boolean in PluginConfig, so no coercion is needed.\n// ---------------------------------------------------------------------------\n\n/**\n * Frozen projection of namespace feature gates (issue #1523 batch 5).\n *\n * Every field is `readonly boolean`. Composition lives ONLY in\n * {@link resolveNamespaceCapabilities}.\n */\nexport interface NamespaceCapabilitySet {\n /** `namespacesEnabled` — multi-namespace system master switch. */\n readonly namespaces: boolean;\n}\n\n/**\n * Config projection consumed by {@link resolveNamespaceCapabilities}.\n */\nexport type NamespaceConfigProjection = Pick<PluginConfig, \"namespacesEnabled\">;\n\n/**\n * Resolve the {@link NamespaceCapabilitySet} from parsed config.\n *\n * Call this ONCE at operation entry and thread the result down. The flag is a\n * non-optional boolean so the projection is a pure pass-through.\n */\nexport function resolveNamespaceCapabilities(\n config: NamespaceConfigProjection,\n): NamespaceCapabilitySet {\n return Object.freeze({\n namespaces: config.namespacesEnabled,\n });\n}\n\n// ---------------------------------------------------------------------------\n// QMD capability set (issue #1523 batch 6).\n//\n// The twelve QMD (query-managed database) flags are the largest remaining\n// scattered cluster after batch 5. They gate every aspect of the tiered\n// memory system: master switch, tier migration, cold tier, daemon, auto-embed,\n// maintenance, query rerank, intent hints, explain, auto-upgrade, and parity\n// graph. Read sites span orchestrator, operator-toolkit, access-service, and\n// search/factory. All flags are non-optional booleans on PluginConfig (defaults\n// resolved at the parse boundary), so the projection is pure pass-through.\n// ---------------------------------------------------------------------------\n\n/**\n * Frozen projection of QMD feature gates (issue #1523 batch 6).\n *\n * Every field is `readonly boolean`. Composition lives ONLY in\n * {@link resolveQmdCapabilities}.\n */\nexport interface QmdCapabilitySet {\n /** `qmdEnabled` — QMD tiered-memory master switch. */\n readonly qmd: boolean;\n /** `qmdTierMigrationEnabled` — automatic tier promotion/demotion. */\n readonly qmdTierMigration: boolean;\n /** `qmdTierAutoBackfillEnabled` — backfill stale tier entries. */\n readonly qmdTierAutoBackfill: boolean;\n /** `qmdAutoEmbedEnabled` — auto-embed documents on write. */\n readonly qmdAutoEmbed: boolean;\n /** `qmdMaintenanceEnabled` — QMD maintenance pass runner. */\n readonly qmdMaintenance: boolean;\n /** `qmdColdTierEnabled` — cold-tier storage. */\n readonly qmdColdTier: boolean;\n /** `qmdDaemonEnabled` — background QMD daemon. */\n readonly qmdDaemon: boolean;\n /** `qmdTierParityGraphEnabled` — tier parity graph. */\n readonly qmdTierParityGraph: boolean;\n /** `qmdQueryRerankEnabled` — QMD query reranking. */\n readonly qmdQueryRerank: boolean;\n /** `qmdIntentHintsEnabled` — QMD intent hint extraction. */\n readonly qmdIntentHints: boolean;\n /** `qmdExplainEnabled` — QMD explain output. */\n readonly qmdExplain: boolean;\n /** `qmdAutoUpgradeEnabled` — QMD auto-upgrade tiers. */\n readonly qmdAutoUpgrade: boolean;\n}\n\n/**\n * Config projection consumed by {@link resolveQmdCapabilities}.\n */\nexport type QmdConfigProjection = Pick<\n PluginConfig,\n | \"qmdEnabled\"\n | \"qmdTierMigrationEnabled\"\n | \"qmdTierAutoBackfillEnabled\"\n | \"qmdAutoEmbedEnabled\"\n | \"qmdMaintenanceEnabled\"\n | \"qmdColdTierEnabled\"\n | \"qmdDaemonEnabled\"\n | \"qmdTierParityGraphEnabled\"\n | \"qmdQueryRerankEnabled\"\n | \"qmdIntentHintsEnabled\"\n | \"qmdExplainEnabled\"\n | \"qmdAutoUpgradeEnabled\"\n>;\n\n/**\n * Resolve the {@link QmdCapabilitySet} from parsed config.\n *\n * Call this ONCE at operation entry and thread the result down. Eleven flags\n * are non-optional booleans (pure pass-through); `qmdColdTierEnabled` is\n * optional and coerced with `=== true` (matching the pre-migration call sites).\n */\nexport function resolveQmdCapabilities(config: QmdConfigProjection): QmdCapabilitySet {\n return Object.freeze({\n qmd: config.qmdEnabled,\n qmdTierMigration: config.qmdTierMigrationEnabled,\n qmdTierAutoBackfill: config.qmdTierAutoBackfillEnabled,\n qmdAutoEmbed: config.qmdAutoEmbedEnabled,\n qmdMaintenance: config.qmdMaintenanceEnabled,\n qmdColdTier: config.qmdColdTierEnabled === true,\n qmdDaemon: config.qmdDaemonEnabled,\n qmdTierParityGraph: config.qmdTierParityGraphEnabled,\n qmdQueryRerank: config.qmdQueryRerankEnabled,\n qmdIntentHints: config.qmdIntentHintsEnabled,\n qmdExplain: config.qmdExplainEnabled,\n qmdAutoUpgrade: config.qmdAutoUpgradeEnabled,\n });\n}\n\n// ---------------------------------------------------------------------------\n// Identity-continuity capability set (issue #1523 batch 6).\n//\n// `identityContinuityEnabled` gates the identity/continuity system (agent\n// identity tracking, continuity incident logging). Its 13 read sites span\n// orchestrator, access-service, and CLI. The flag is a non-optional boolean\n// on PluginConfig, so the projection is a pure pass-through.\n// ---------------------------------------------------------------------------\n\n/**\n * Frozen projection of identity-continuity feature gates (issue #1523 batch 6).\n */\nexport interface IdentityContinuityCapabilitySet {\n /** `identityContinuityEnabled` — identity-continuity master switch. */\n readonly identityContinuity: boolean;\n}\n\n/**\n * Config projection consumed by {@link resolveIdentityContinuityCapabilities}.\n */\nexport type IdentityContinuityConfigProjection = Pick<PluginConfig, \"identityContinuityEnabled\">;\n\n/**\n * Resolve the {@link IdentityContinuityCapabilitySet} from parsed config.\n */\nexport function resolveIdentityContinuityCapabilities(\n config: IdentityContinuityConfigProjection,\n): IdentityContinuityCapabilitySet {\n return Object.freeze({\n identityContinuity: config.identityContinuityEnabled,\n });\n}\n\n// ---------------------------------------------------------------------------\n// Local-LLM capability set (issue #1523 batch 6).\n//\n// `localLlmEnabled` gates whether a local (on-device) LLM is used for\n// summarization, embedding fallback, extraction, and search. Its 11 read\n// sites span orchestrator, extraction, embedding-fallback, local-llm,\n// search/embed-helper, and summarizer. The flag is a non-optional boolean.\n// ---------------------------------------------------------------------------\n\n/**\n * Frozen projection of local-LLM feature gates (issue #1523 batch 6).\n */\nexport interface LocalLlmCapabilitySet {\n /** `localLlmEnabled` — local (on-device) LLM master switch. */\n readonly localLlm: boolean;\n}\n\n/**\n * Config projection consumed by {@link resolveLocalLlmCapabilities}.\n */\nexport type LocalLlmConfigProjection = Pick<PluginConfig, \"localLlmEnabled\">;\n\n/**\n * Resolve the {@link LocalLlmCapabilitySet} from parsed config.\n */\nexport function resolveLocalLlmCapabilities(\n config: LocalLlmConfigProjection,\n): LocalLlmCapabilitySet {\n return Object.freeze({\n localLlm: config.localLlmEnabled,\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,CA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gBAAgB,OAAO;AAAA,IACvB,YAAY,OAAO;AAAA,IACnB,gBAAgB,OAAO;AAAA,EACzB,CAAC;AACH;AA2BO,SAAS,sCACd,QACiC;AACjC,SAAO,OAAO,OAAO;AAAA,IACnB,oBAAoB,OAAO;AAAA,EAC7B,CAAC;AACH;AA2BO,SAAS,4BACd,QACuB;AACvB,SAAO,OAAO,OAAO;AAAA,IACnB,UAAU,OAAO;AAAA,EACnB,CAAC;AACH;","names":[]}
@@ -12,10 +12,10 @@ import {
12
12
  } from "./chunk-FVZ2ISIX.js";
13
13
  import {
14
14
  getOperation
15
- } from "./chunk-NOU77OHX.js";
15
+ } from "./chunk-5DIKZKOD.js";
16
16
  import {
17
17
  EngramAccessInputError
18
- } from "./chunk-646B5ERJ.js";
18
+ } from "./chunk-PKO5NJ65.js";
19
19
  import {
20
20
  readEnvVar
21
21
  } from "./chunk-JUC24CTX.js";
@@ -3619,4 +3619,4 @@ export {
3619
3619
  processChatMessage,
3620
3620
  EngramMcpServer
3621
3621
  };
3622
- //# sourceMappingURL=chunk-O4ZIBPIW.js.map
3622
+ //# sourceMappingURL=chunk-T7CGPTFU.js.map
@@ -10,6 +10,9 @@ import {
10
10
  import {
11
11
  extractJsonCandidates
12
12
  } from "./chunk-RGMVMVMF.js";
13
+ import {
14
+ resolveNamespaceCapabilities
15
+ } from "./chunk-SHJGBAIW.js";
13
16
  import {
14
17
  log
15
18
  } from "./chunk-NU3CSQ4H.js";
@@ -236,7 +239,7 @@ async function runContradictionScan(deps) {
236
239
  return { scanned: 0, candidates: 0, judged: 0, queued: 0, cooledDown: 0, elapsedMs: 0 };
237
240
  }
238
241
  const { storage: scanStorage, namespace } = await resolveScanStorage(deps, requestedNamespace);
239
- if (config.namespacesEnabled && namespace !== void 0 && isDefaultNamespaceScan(config, requestedNamespace, namespace)) {
242
+ if (resolveNamespaceCapabilities(config).namespaces && namespace !== void 0 && isDefaultNamespaceScan(config, requestedNamespace, namespace)) {
240
243
  const migrated = migrateUnscopedPairsToNamespace(memoryDir, namespace, { cooldownDays: scanConfig.cooldownDays });
241
244
  if (migrated > 0) {
242
245
  log.info("[contradiction-scan] migrated %d legacy unscoped review pairs to namespace %s", migrated, namespace);
@@ -433,7 +436,7 @@ function normalizeScanNamespace(namespace) {
433
436
  return trimmed ? trimmed : void 0;
434
437
  }
435
438
  async function resolveScanStorage(deps, namespace) {
436
- if (!deps.config.namespacesEnabled) {
439
+ if (!resolveNamespaceCapabilities(deps.config).namespaces) {
437
440
  const defaultNamespace = normalizeScanNamespace(deps.config.defaultNamespace);
438
441
  if (namespace && namespace !== defaultNamespace) {
439
442
  throw new Error(`unsupported namespace: ${namespace}`);
@@ -473,7 +476,7 @@ function isStorageManagerLike(value) {
473
476
  }
474
477
  function fallbackResolvedNamespace(deps, namespace) {
475
478
  if (namespace) return namespace;
476
- return deps.config.namespacesEnabled ? deps.config.defaultNamespace : void 0;
479
+ return resolveNamespaceCapabilities(deps.config).namespaces ? deps.config.defaultNamespace : void 0;
477
480
  }
478
481
  function isDefaultNamespaceScan(config, requestedNamespace, resolvedNamespace) {
479
482
  if (requestedNamespace === void 0) return true;
@@ -543,4 +546,4 @@ export {
543
546
  ACTIVE_STATUSES,
544
547
  runContradictionScan
545
548
  };
546
- //# sourceMappingURL=chunk-PLBIPT6I.js.map
549
+ //# sourceMappingURL=chunk-TJSQHO4Q.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/contradiction/contradiction-judge.ts","../src/contradiction/contradiction-scan.ts"],"sourcesContent":["/**\n * Contradiction Judge — LLM-as-judge for semantic contradiction detection (issue #520).\n *\n * Pairs semantically-similar memories and classifies their relationship.\n * Reuses the extraction-judge adapter pattern but with a contradiction-specific\n * prompt and verdict taxonomy.\n *\n * Design constraints:\n * - Default verdict on any failure is \"needs-user\" (rule 48: least-privileged default).\n * - Never auto-resolve; all verdicts enter the review queue.\n * - Content-hash caching avoids redundant LLM calls across runs.\n */\n\nimport { createHash } from \"node:crypto\";\nimport { log } from \"../logger.js\";\nimport type { PluginConfig } from \"../types.js\";\nimport type { LocalLlmClient } from \"../local-llm.js\";\nimport type { FallbackLlmClient } from \"../fallback-llm.js\";\nimport { extractJsonCandidates } from \"../json-extract.js\";\n\n// ── Types ──────────────────────────────────────────────────────────────────────\n\nexport type ContradictionVerdict =\n | \"contradicts\"\n | \"independent\"\n | \"duplicates\"\n | \"needs-user\";\n\nexport interface ContradictionJudgeInput {\n /** Memory ID of the first fact. */\n memoryIdA: string;\n /** Memory ID of the second fact. */\n memoryIdB: string;\n /** Content text of the first fact. */\n textA: string;\n /** Content text of the second fact. */\n textB: string;\n /** Category of the first fact (optional context). */\n categoryA?: string;\n /** Category of the second fact (optional context). */\n categoryB?: string;\n}\n\nexport interface ContradictionJudgeResult {\n /** Memory IDs of the pair. */\n memoryIdA: string;\n memoryIdB: string;\n /** Verdict from the judge. */\n verdict: ContradictionVerdict;\n /** Human-readable rationale. */\n rationale: string;\n /** Confidence in [0, 1]. */\n confidence: number;\n}\n\nexport interface ContradictionJudgeBatchResult {\n /** Results keyed by pair key (\"idA:idB\"). */\n results: Map<string, ContradictionJudgeResult>;\n /** Number served from cache. */\n cached: number;\n /** Number produced by LLM call. */\n judged: number;\n /** Total wall-clock time in ms. */\n elapsed: number;\n}\n\n// ── Prompt ─────────────────────────────────────────────────────────────────────\n\nconst CONTRADICTION_JUDGE_PROMPT = `You are a memory contradiction classifier. You will receive pairs of stored memories and must classify their semantic relationship.\n\nFor each pair, respond with a JSON array where each element has:\n- \"pairKey\": the pairKey provided in the input\n- \"verdict\": one of \"contradicts\", \"independent\", \"duplicates\", \"needs-user\"\n- \"rationale\": one sentence explaining why\n- \"confidence\": number between 0 and 1\n\nVERDICT DEFINITIONS:\n- \"contradicts\": The two memories make claims that cannot both be true. One must be wrong or outdated.\n- \"duplicates\": The two memories convey essentially the same information (near-paraphrase).\n- \"independent\": The memories are topically similar but do not conflict or duplicate.\n- \"needs-user\": Cannot determine with sufficient confidence; requires human review.\n\nIMPORTANT:\n- Be conservative. When in doubt, prefer \"needs-user\" over a wrong classification.\n- Two memories about the same entity/topic are NOT necessarily contradictory.\n- Temporal changes (\"Joshua uses pnpm\" vs \"Joshua switched to npm\") ARE contradictions.\n- Different aspects of the same entity (\"Joshua uses pnpm\" vs \"Joshua works on Remnic\") are \"independent\".`;\n\n// ── Cache ──────────────────────────────────────────────────────────────────────\n\n/** Module-level fallback cache — only used when caller does not supply one. */\nlet defaultVerdictCache: Map<string, ContradictionJudgeResult> = new Map();\nconst CACHE_MAX = 10_000;\n\nfunction pairKey(idA: string, idB: string): string {\n const sorted = [idA, idB].sort();\n return `${sorted[0]}:${sorted[1]}`;\n}\n\nfunction contentHash(a: ContradictionJudgeInput): string {\n // Sort each side pair to be order-independent (matching pairKey behavior)\n const sides = [\n { text: a.textA.trim(), category: (a.categoryA ?? \"\").trim() },\n { text: a.textB.trim(), category: (a.categoryB ?? \"\").trim() },\n ].sort((left, right) => {\n const leftKey = JSON.stringify(left);\n const rightKey = JSON.stringify(right);\n return leftKey.localeCompare(rightKey);\n });\n const normalized = JSON.stringify(sides);\n return createHash(\"sha256\").update(normalized).digest(\"hex\").slice(0, 16);\n}\n\nexport function createVerdictCache(): Map<string, ContradictionJudgeResult> {\n return new Map();\n}\n\nexport function clearVerdictCache(): void {\n defaultVerdictCache.clear();\n}\n\nexport function verdictCacheSize(): number {\n return defaultVerdictCache.size;\n}\n\n// ── Public API ──────────────────────────────────────────────────────────────────\n\n/**\n * Judge a batch of memory pairs for contradiction.\n *\n * Uses content-hash caching to skip pairs already judged in a prior run.\n * On any LLM failure, all unresolved pairs default to \"needs-user\".\n */\nexport async function judgeContradictionPairs(\n pairs: ContradictionJudgeInput[],\n config: PluginConfig,\n localLlm: LocalLlmClient | null,\n fallbackLlm: FallbackLlmClient | null,\n cache?: Map<string, ContradictionJudgeResult>,\n): Promise<ContradictionJudgeBatchResult> {\n const startTime = Date.now();\n const results = new Map<string, ContradictionJudgeResult>();\n const activeCache = cache ?? defaultVerdictCache;\n let cached = 0;\n let judged = 0;\n\n // Partition into cached vs needs-judging\n const toJudge: ContradictionJudgeInput[] = [];\n for (const pair of pairs) {\n const key = pairKey(pair.memoryIdA, pair.memoryIdB);\n const hash = contentHash(pair);\n const cachedResult = activeCache.get(hash);\n if (cachedResult) {\n results.set(key, { ...cachedResult, memoryIdA: pair.memoryIdA, memoryIdB: pair.memoryIdB });\n cached++;\n } else {\n toJudge.push(pair);\n }\n }\n\n if (toJudge.length === 0) {\n return { results, cached, judged, elapsed: Date.now() - startTime };\n }\n\n // Build the prompt with all pairs\n const pairDescriptions = toJudge.map((p, i) => {\n const pk = pairKey(p.memoryIdA, p.memoryIdB);\n const catA = p.categoryA ? ` [${p.categoryA}]` : \"\";\n const catB = p.categoryB ? ` [${p.categoryB}]` : \"\";\n return `Pair ${i + 1} (pairKey: \"${pk}\"):${catA} \"${p.textA}\"${catB} \"${p.textB}\"`;\n });\n\n const userMessage = `Classify these ${toJudge.length} memory pair(s):\\n\\n${pairDescriptions.join(\"\\n\\n\")}`;\n\n // Try LLM call\n let llmResponse: string | null = null;\n\n if (localLlm) {\n try {\n llmResponse = await callLlm(localLlm, config, userMessage);\n } catch (err) {\n log.warn(\"[contradiction-judge] local LLM call failed: %s\", err instanceof Error ? err.message : err);\n }\n }\n\n if (!llmResponse && fallbackLlm) {\n try {\n llmResponse = await callLlm(fallbackLlm, config, userMessage);\n } catch (err) {\n log.warn(\"[contradiction-judge] fallback LLM call failed: %s\", err instanceof Error ? err.message : err);\n }\n }\n\n // Parse response or default to needs-user\n if (llmResponse) {\n const candidates = extractJsonCandidates(llmResponse);\n const parsed = parseJudgeResponse(candidates, toJudge);\n\n for (const result of parsed) {\n const key = pairKey(result.memoryIdA, result.memoryIdB);\n results.set(key, result);\n\n // Update cache\n const input = toJudge.find(\n (p) => pairKey(p.memoryIdA, p.memoryIdB) === key,\n );\n if (input) {\n const hash = contentHash(input);\n if (activeCache.size >= CACHE_MAX) {\n const firstKey = activeCache.keys().next().value;\n if (firstKey !== undefined) activeCache.delete(firstKey);\n }\n activeCache.set(hash, result);\n }\n judged++;\n }\n } else {\n // All unresolved → needs-user (rule 48)\n for (const pair of toJudge) {\n const key = pairKey(pair.memoryIdA, pair.memoryIdB);\n const result: ContradictionJudgeResult = {\n memoryIdA: pair.memoryIdA,\n memoryIdB: pair.memoryIdB,\n verdict: \"needs-user\",\n rationale: \"LLM call failed; requires manual review\",\n confidence: 0,\n };\n results.set(key, result);\n judged++;\n }\n }\n\n return { results, cached, judged, elapsed: Date.now() - startTime };\n}\n\n// ── Internals ──────────────────────────────────────────────────────────────────\n\nasync function callLlm(\n client: LocalLlmClient | FallbackLlmClient,\n config: PluginConfig,\n userMessage: string,\n): Promise<string> {\n const messages: Array<{ role: \"user\" | \"assistant\" | \"system\"; content: string }> = [\n { role: \"system\", content: CONTRADICTION_JUDGE_PROMPT },\n { role: \"user\", content: userMessage },\n ];\n if (\"chatCompletion\" in client && typeof client.chatCompletion === \"function\") {\n const result = await client.chatCompletion(messages, {\n temperature: 0.1,\n maxTokens: 4096,\n operation: \"contradiction-judge\",\n });\n return result?.content ?? \"\";\n }\n // FallbackLlmClient — try OpenAI-compatible chat completions\n if (\"complete\" in client && typeof (client as Record<string, unknown>).complete === \"function\") {\n const result = await (client as { complete: (msg: Array<{ role: string; content: string }>) => Promise<{ content: string }> }).complete(messages);\n return result.content ?? \"\";\n }\n return \"\";\n}\n\nfunction parseJudgeResponse(\n candidates: string[],\n inputs: ContradictionJudgeInput[],\n): ContradictionJudgeResult[] {\n const VALID_VERDICTS: ContradictionVerdict[] = [\"contradicts\", \"independent\", \"duplicates\", \"needs-user\"];\n let conservativeFallback: ContradictionJudgeResult[] | null = null;\n\n for (const candidate of candidates) {\n try {\n const parsed = JSON.parse(candidate);\n const items = Array.isArray(parsed) ? parsed : [parsed];\n const results: ContradictionJudgeResult[] = [];\n const matchedKeys = new Set<string>();\n\n for (const item of items) {\n if (!item || typeof item !== \"object\") continue;\n\n const verdict = typeof item.verdict === \"string\" && VALID_VERDICTS.includes(item.verdict as ContradictionVerdict)\n ? (item.verdict as ContradictionVerdict)\n : \"needs-user\";\n\n const pairKeyVal = typeof item.pairKey === \"string\" && item.pairKey.length > 0\n ? item.pairKey\n : null;\n const input = pairKeyVal\n ? inputs.find((p) => pairKey(p.memoryIdA, p.memoryIdB) === pairKeyVal)\n : null;\n\n if (!input) continue;\n\n matchedKeys.add(pairKey(input.memoryIdA, input.memoryIdB));\n\n const confidence = typeof item.confidence === \"number\"\n ? Math.min(1, Math.max(0, item.confidence))\n : 0.5;\n\n results.push({\n memoryIdA: input.memoryIdA,\n memoryIdB: input.memoryIdB,\n verdict,\n rationale: typeof item.rationale === \"string\" ? item.rationale : \"No rationale provided\",\n confidence,\n });\n }\n\n // Backfill any inputs the LLM omitted with needs-user\n for (const inp of inputs) {\n const key = pairKey(inp.memoryIdA, inp.memoryIdB);\n if (!matchedKeys.has(key)) {\n results.push({\n memoryIdA: inp.memoryIdA,\n memoryIdB: inp.memoryIdB,\n verdict: \"needs-user\",\n rationale: \"LLM response omitted this pair\",\n confidence: 0,\n });\n }\n }\n\n if (matchedKeys.size > 0) return results;\n if (results.length > 0 && conservativeFallback === null) {\n conservativeFallback = results;\n }\n } catch {\n continue;\n }\n }\n\n if (conservativeFallback !== null) return conservativeFallback;\n\n // All parse attempts failed → needs-user for every input\n return inputs.map((p) => ({\n memoryIdA: p.memoryIdA,\n memoryIdB: p.memoryIdB,\n verdict: \"needs-user\" as ContradictionVerdict,\n rationale: \"Failed to parse judge response\",\n confidence: 0,\n }));\n}\n\nexport { pairKey as _pairKey, contentHash as _contentHash };\n","/**\n * Contradiction Scan — pair generator + scan driver (issue #520).\n *\n * Nightly cron that pairs semantically-similar active memories within\n * the same namespace, sends candidate pairs to the LLM-as-judge\n * contradiction classifier, and drops contradicting pairs into a\n * review queue for user resolution.\n *\n * Pair generation (cheap pre-filter):\n * 1. Find candidate peers via embedding cosine >= similarityFloor.\n * 2. Restrict to pairs sharing at least one entityRef OR overlapping\n * topic tokens >= topicOverlapFloor.\n * 3. Skip pairs already judged independent/both-valid within cooldown.\n * 4. Cap per-run work at maxPairsPerRun.\n */\n\nimport { resolveNamespaceCapabilities } from \"../capabilities.js\";\nimport type { StorageManager } from \"../storage.js\";\nimport type { PluginConfig, MemoryFile, MemoryStatus } from \"../types.js\";\nimport type { SemanticDedupLookup } from \"../dedup/semantic.js\";\nimport { log } from \"../logger.js\";\nimport { judgeContradictionPairs, type ContradictionJudgeInput } from \"./contradiction-judge.js\";\nimport {\n writePairs,\n readPair,\n isCoolingDown,\n memoryHashesChanged,\n computeMemoryContentHash,\n computePairId,\n migrateUnscopedPairsToNamespace,\n type ContradictionPair,\n} from \"./contradiction-review.js\";\nimport type { LocalLlmClient } from \"../local-llm.js\";\nimport type { FallbackLlmClient } from \"../fallback-llm.js\";\n\n// ── Types ──────────────────────────────────────────────────────────────────────\n\n/** The set of statuses that represent \"live\" memories eligible for scanning. */\nexport const ACTIVE_STATUSES: Set<MemoryStatus> = new Set([\"active\"]);\n\n/** High-value taxonomy buckets to scan. */\nconst SCAN_CATEGORIES = new Set([\n \"decision\",\n \"principle\",\n \"rule\",\n \"entity\",\n \"fact\",\n \"preference\",\n]);\n\nexport interface ScanResult {\n /** Total active memories scanned. */\n scanned: number;\n /** Candidate pairs generated by the pre-filter. */\n candidates: number;\n /** Pairs sent to judge. */\n judged: number;\n /** Pairs written to review queue. */\n queued: number;\n /** Pairs skipped due to cooldown. */\n cooledDown: number;\n /** Total wall-clock time in ms. */\n elapsedMs: number;\n}\n\nexport interface ScanStorageResolution {\n storage: StorageManager;\n namespace?: string;\n}\n\nexport interface ScanDependencies {\n storage: StorageManager;\n config: PluginConfig;\n memoryDir: string;\n /** Pre-built embedding lookup. When provided, used as-is for Strategy 3. */\n embeddingLookup?: SemanticDedupLookup;\n /**\n * Factory to build a namespace-scoped embedding lookup.\n * When provided, takes precedence over `embeddingLookup`.\n * The scan driver passes its own `storage` so the lookup queries the correct index.\n */\n embeddingLookupFactory?: (storage: StorageManager) => SemanticDedupLookup | undefined;\n /** Resolver for namespace-scoped storage. Required for scans when namespaces are enabled. */\n storageForNamespace?: (\n namespace: string | undefined,\n ) => StorageManager | ScanStorageResolution | Promise<StorageManager | ScanStorageResolution>;\n localLlm: LocalLlmClient | null;\n fallbackLlm: FallbackLlmClient | null;\n namespace?: string;\n}\n\n// ── Main scan driver ───────────────────────────────────────────────────────────\n\n/**\n * Run a contradiction scan over the memory corpus.\n *\n * This is the entry point called by the nightly cron and by the CLI.\n */\nexport async function runContradictionScan(deps: ScanDependencies): Promise<ScanResult> {\n const startTime = Date.now();\n const { config, memoryDir, embeddingLookup, embeddingLookupFactory, localLlm, fallbackLlm } = deps;\n const requestedNamespace = normalizeScanNamespace(deps.namespace);\n const scanConfig = config.contradictionScan;\n\n if (!scanConfig.enabled) {\n log.info(\"[contradiction-scan] disabled by config\");\n return { scanned: 0, candidates: 0, judged: 0, queued: 0, cooledDown: 0, elapsedMs: 0 };\n }\n\n const { storage: scanStorage, namespace } = await resolveScanStorage(deps, requestedNamespace);\n if (resolveNamespaceCapabilities(config).namespaces && namespace !== undefined && isDefaultNamespaceScan(config, requestedNamespace, namespace)) {\n const migrated = migrateUnscopedPairsToNamespace(memoryDir, namespace, { cooldownDays: scanConfig.cooldownDays });\n if (migrated > 0) {\n log.info(\"[contradiction-scan] migrated %d legacy unscoped review pairs to namespace %s\", migrated, namespace);\n }\n }\n\n // Prefer the factory (which uses the scan's own storage for correct namespace scoping)\n // over a pre-built lookup (which may use default-namespace storage).\n const scopedEmbeddingLookup = embeddingLookupFactory\n ? embeddingLookupFactory(scanStorage)\n : embeddingLookup;\n\n // 1. Load active memories in scan categories\n const memories = await loadEligibleMemories(scanStorage);\n log.info(\"[contradiction-scan] loaded %d eligible memories\", memories.length);\n\n if (memories.length < 2) {\n return { scanned: memories.length, candidates: 0, judged: 0, queued: 0, cooledDown: 0, elapsedMs: Date.now() - startTime };\n }\n\n // 2. Prepare exact existing-pair lookup for cooldown checking.\n // Pair IDs are deterministic, so lookup the candidate's file directly instead\n // of paging through the review queue and risking a bounded-list miss.\n const existingPairCache = new Map<string, ContradictionPair | undefined>();\n const getExistingPair = (pairId: string): ContradictionPair | undefined => {\n if (!existingPairCache.has(pairId)) {\n existingPairCache.set(pairId, readPair(memoryDir, pairId) ?? undefined);\n }\n return existingPairCache.get(pairId);\n };\n\n // 3. Generate candidate pairs\n const candidates = await generatePairs(memories, getExistingPair, scanConfig, namespace, scopedEmbeddingLookup);\n const cooledDown = candidates.skipped;\n log.info(\"[contradiction-scan] generated %d candidates (%d cooled down)\", candidates.pairs.length, cooledDown);\n\n if (candidates.pairs.length === 0) {\n return {\n scanned: memories.length,\n candidates: 0,\n judged: 0,\n queued: 0,\n cooledDown,\n elapsedMs: Date.now() - startTime,\n };\n }\n\n // 4. Build judge inputs. Candidate generation already preserves strategy\n // priority and caps work at maxPairsPerRun.\n const judgeInputs: ContradictionJudgeInput[] = candidates.pairs.map((pair) => ({\n memoryIdA: pair.idA,\n memoryIdB: pair.idB,\n textA: pair.textA,\n textB: pair.textB,\n categoryA: pair.categoryA,\n categoryB: pair.categoryB,\n }));\n\n // 6. Send to judge (per-scan cache avoids module-level singleton leak)\n const scanCache = new Map<string, import(\"./contradiction-judge.js\").ContradictionJudgeResult>();\n const judgeResult = await judgeContradictionPairs(judgeInputs, config, localLlm, fallbackLlm, scanCache);\n log.info(\"[contradiction-scan] judge completed: %d judged, %d cached in %dms\", judgeResult.judged, judgeResult.cached, judgeResult.elapsed);\n\n // 7. Write to review queue\n const queueEntries: Array<Omit<ContradictionPair, \"pairId\"> & { memoryIds: [string, string] }> = [];\n const currentMemoryHashes = memoryContentHashMap(memories);\n for (const [key, result] of judgeResult.results) {\n queueEntries.push({\n memoryIds: [result.memoryIdA, result.memoryIdB],\n verdict: result.verdict,\n rationale: result.rationale,\n confidence: result.confidence,\n detectedAt: new Date().toISOString(),\n // Set lastReviewedAt for non-actionable verdicts so cooldown prevents re-judging\n lastReviewedAt: result.verdict === \"independent\" ? new Date().toISOString() : undefined,\n memoryContentHashes: pairMemoryContentHashes(result.memoryIdA, result.memoryIdB, currentMemoryHashes),\n namespace,\n });\n }\n\n const written = writePairs(memoryDir, queueEntries, { cooldownDays: scanConfig.cooldownDays });\n const elapsed = Date.now() - startTime;\n log.info(\"[contradiction-scan] complete: %d queued in %dms\", written.length, elapsed);\n\n return {\n scanned: memories.length,\n candidates: candidates.pairs.length,\n judged: judgeResult.judged,\n queued: written.length,\n cooledDown,\n elapsedMs: elapsed,\n };\n}\n\n// ── Pair generation ────────────────────────────────────────────────────────────\n\ninterface CandidatePair {\n idA: string;\n idB: string;\n textA: string;\n textB: string;\n categoryA?: string;\n categoryB?: string;\n}\n\ninterface PairGenResult {\n pairs: CandidatePair[];\n skipped: number;\n}\n\nasync function generatePairs(\n memories: MemoryFile[],\n getExistingPair: (pairId: string) => ContradictionPair | undefined,\n scanConfig: PluginConfig[\"contradictionScan\"],\n namespace: string | undefined,\n embeddingLookup?: SemanticDedupLookup,\n): Promise<PairGenResult> {\n const pairs: CandidatePair[] = [];\n let skipped = 0;\n const seen = new Set<string>();\n const maxPairs = Math.max(0, Math.floor(scanConfig.maxPairsPerRun));\n if (maxPairs === 0) return { pairs, skipped };\n\n const orderedMemories = [...memories].sort(compareMemoryId);\n const currentMemoryHashes = memoryContentHashMap(orderedMemories);\n\n const pushCandidate = (pair: CandidatePair): void => {\n if (pairs.length < maxPairs) pairs.push(pair);\n };\n\n const hasCapacity = (): boolean => pairs.length < maxPairs;\n const isSkippedByCooldown = (existing: ContradictionPair | undefined): boolean => {\n if (!existing || !isCoolingDown(existing, scanConfig.cooldownDays)) return false;\n return !memoryHashesChanged(\"\", existing, (memoryId) => currentMemoryHashes.get(memoryId) ?? null);\n };\n\n // Build index by entityRef for fast lookup\n const byEntity = new Map<string, MemoryFile[]>();\n for (const mem of orderedMemories) {\n const entity = mem.frontmatter.entityRef;\n if (entity) {\n const existing = byEntity.get(entity) ?? [];\n existing.push(mem);\n byEntity.set(entity, existing);\n }\n }\n\n // Strategy 1: Entity-ref based pairing (high precision)\n entityPairs:\n for (const entity of [...byEntity.keys()].sort()) {\n const group = byEntity.get(entity) ?? [];\n if (group.length < 2) continue;\n for (let i = 0; i < group.length; i++) {\n for (let j = i + 1; j < group.length; j++) {\n if (!hasCapacity()) break entityPairs;\n const a = group[i];\n const b = group[j];\n const pairId = computePairId(a.frontmatter.id!, b.frontmatter.id!, namespace);\n\n if (seen.has(pairId)) continue;\n seen.add(pairId);\n\n // Check cooldown\n const existing = getExistingPair(pairId);\n if (isSkippedByCooldown(existing)) {\n skipped++;\n continue;\n }\n\n pushCandidate({\n idA: a.frontmatter.id!,\n idB: b.frontmatter.id!,\n textA: a.content,\n textB: b.content,\n categoryA: a.frontmatter.category as string | undefined,\n categoryB: b.frontmatter.category as string | undefined,\n });\n }\n }\n }\n\n // Strategy 2: Tag/topic overlap for memories without a shared entityRef\n topicPairs:\n for (let i = 0; i < orderedMemories.length; i++) {\n for (let j = i + 1; j < orderedMemories.length; j++) {\n if (!hasCapacity()) break topicPairs;\n const a = orderedMemories[i];\n const b = orderedMemories[j];\n if (shareEntityRef(a, b)) continue;\n const overlap = jaccardOverlap(\n (a.frontmatter.tags as string[]) ?? [],\n (b.frontmatter.tags as string[]) ?? [],\n );\n\n if (overlap < scanConfig.topicOverlapFloor) continue;\n\n const pairId = computePairId(a.frontmatter.id!, b.frontmatter.id!, namespace);\n if (seen.has(pairId)) continue;\n seen.add(pairId);\n\n const existing = getExistingPair(pairId);\n if (isSkippedByCooldown(existing)) {\n skipped++;\n continue;\n }\n\n pushCandidate({\n idA: a.frontmatter.id!,\n idB: b.frontmatter.id!,\n textA: a.content,\n textB: b.content,\n categoryA: a.frontmatter.category as string | undefined,\n categoryB: b.frontmatter.category as string | undefined,\n });\n }\n }\n\n // Strategy 3: Embedding cosine similarity (enforces similarityFloor config)\n if (embeddingLookup && hasCapacity()) {\n const memoryById = new Map(orderedMemories.map((m) => [m.frontmatter.id!, m]));\n embeddingPairs:\n for (const mem of orderedMemories) {\n if (!hasCapacity()) break;\n const id = mem.frontmatter.id!;\n try {\n const hits = (await embeddingLookup(mem.content, 20)).sort((a, b) =>\n b.score - a.score || a.id.localeCompare(b.id),\n );\n for (const hit of hits) {\n if (!hasCapacity()) break embeddingPairs;\n if (hit.score < scanConfig.similarityFloor) continue;\n if (hit.id === id) continue;\n const peer = memoryById.get(hit.id);\n if (!peer) continue;\n\n const pairId = computePairId(id, hit.id, namespace);\n if (seen.has(pairId)) continue;\n seen.add(pairId);\n\n const existing = getExistingPair(pairId);\n if (isSkippedByCooldown(existing)) {\n skipped++;\n continue;\n }\n\n pushCandidate({\n idA: id,\n idB: hit.id,\n textA: mem.content,\n textB: peer.content,\n categoryA: mem.frontmatter.category as string | undefined,\n categoryB: peer.frontmatter.category as string | undefined,\n });\n }\n } catch {\n // Embedding backend unavailable — skip, entity-ref/tag strategies already covered\n }\n }\n }\n\n return { pairs, skipped };\n}\n\n// ── Helpers ────────────────────────────────────────────────────────────────────\n\nfunction normalizeScanNamespace(namespace: string | undefined): string | undefined {\n const trimmed = namespace?.trim();\n return trimmed ? trimmed : undefined;\n}\n\nasync function resolveScanStorage(\n deps: ScanDependencies,\n namespace: string | undefined,\n): Promise<ScanStorageResolution> {\n if (!resolveNamespaceCapabilities(deps.config).namespaces) {\n const defaultNamespace = normalizeScanNamespace(deps.config.defaultNamespace);\n if (namespace && namespace !== defaultNamespace) {\n throw new Error(`unsupported namespace: ${namespace}`);\n }\n return { storage: deps.storage, namespace: undefined };\n }\n\n if (deps.storageForNamespace) {\n const resolved = await deps.storageForNamespace(namespace);\n if (isScanStorageResolution(resolved)) {\n return {\n storage: resolved.storage,\n namespace: normalizeScanNamespace(resolved.namespace) ?? fallbackResolvedNamespace(deps, namespace),\n };\n }\n if (!isStorageManagerLike(resolved)) {\n throw new Error(\"storageForNamespace must return a StorageManager or { storage: StorageManager, namespace?: string }\");\n }\n return {\n storage: resolved,\n namespace: fallbackResolvedNamespace(deps, namespace),\n };\n }\n\n throw new Error(\n \"contradiction scans require storageForNamespace when namespaces are enabled so callers can enforce namespace access\",\n );\n}\n\nfunction isScanStorageResolution(value: StorageManager | ScanStorageResolution): value is ScanStorageResolution {\n if (isStorageManagerLike(value)) return false;\n if (typeof value !== \"object\" || value === null) return false;\n const candidate = value as { storage?: unknown };\n return isStorageManagerLike(candidate.storage);\n}\n\nfunction isStorageManagerLike(value: unknown): value is StorageManager {\n if (typeof value !== \"object\" || value === null) return false;\n const candidate = value as { readAllMemories?: unknown };\n return typeof candidate.readAllMemories === \"function\";\n}\n\nfunction fallbackResolvedNamespace(deps: ScanDependencies, namespace: string | undefined): string | undefined {\n if (namespace) return namespace;\n return resolveNamespaceCapabilities(deps.config).namespaces ? deps.config.defaultNamespace : undefined;\n}\n\nfunction isDefaultNamespaceScan(\n config: PluginConfig,\n requestedNamespace: string | undefined,\n resolvedNamespace: string,\n): boolean {\n if (requestedNamespace === undefined) return true;\n return requestedNamespace === config.defaultNamespace || resolvedNamespace === config.defaultNamespace;\n}\n\nasync function loadEligibleMemories(storage: StorageManager): Promise<MemoryFile[]> {\n let all: MemoryFile[];\n try {\n all = await storage.readAllMemories();\n } catch {\n return [];\n }\n\n return all.filter((mem) => {\n const fm = mem.frontmatter;\n // Only active memories (rule 53: explicit ACTIVE_STATUSES set)\n const status = (fm.status as MemoryStatus) ?? \"active\";\n if (!ACTIVE_STATUSES.has(status)) return false;\n\n // Only scan high-value categories\n const category = fm.category as string | undefined;\n if (category && !SCAN_CATEGORIES.has(category)) return false;\n\n // Must have content\n if (!mem.content || mem.content.trim().length === 0) return false;\n\n // Must have an ID\n if (!fm.id) return false;\n\n return true;\n });\n}\n\nfunction jaccardOverlap(a: string[], b: string[]): number {\n if (a.length === 0 && b.length === 0) return 0;\n const setA = new Set(a.map((t) => t.toLowerCase()));\n const setB = new Set(b.map((t) => t.toLowerCase()));\n let intersection = 0;\n for (const item of setA) {\n if (setB.has(item)) intersection++;\n }\n const union = setA.size + setB.size - intersection;\n return union === 0 ? 0 : intersection / union;\n}\n\nfunction shareEntityRef(a: MemoryFile, b: MemoryFile): boolean {\n const entityA = a.frontmatter.entityRef?.trim();\n const entityB = b.frontmatter.entityRef?.trim();\n return Boolean(entityA && entityB && entityA === entityB);\n}\n\nfunction compareMemoryId(a: MemoryFile, b: MemoryFile): number {\n return (a.frontmatter.id ?? \"\").localeCompare(b.frontmatter.id ?? \"\");\n}\n\nfunction memoryContentHashMap(memories: MemoryFile[]): Map<string, string> {\n const hashes = new Map<string, string>();\n for (const memory of memories) {\n const id = memory.frontmatter.id;\n if (!id) continue;\n hashes.set(id, computeMemoryContentHash(memory.content, memory.frontmatter.category as string | undefined));\n }\n return hashes;\n}\n\nfunction pairMemoryContentHashes(\n memoryIdA: string,\n memoryIdB: string,\n currentMemoryHashes: Map<string, string>,\n): Record<string, string> | undefined {\n const hashA = currentMemoryHashes.get(memoryIdA);\n const hashB = currentMemoryHashes.get(memoryIdB);\n if (!hashA || !hashB) return undefined;\n return {\n [memoryIdA]: hashA,\n [memoryIdB]: hashB,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAaA,SAAS,kBAAkB;AAuD3B,IAAM,6BAA6B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBnC,IAAI,sBAA6D,oBAAI,IAAI;AACzE,IAAM,YAAY;AAElB,SAAS,QAAQ,KAAa,KAAqB;AACjD,QAAM,SAAS,CAAC,KAAK,GAAG,EAAE,KAAK;AAC/B,SAAO,GAAG,OAAO,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC;AAClC;AAEA,SAAS,YAAY,GAAoC;AAEvD,QAAM,QAAQ;AAAA,IACZ,EAAE,MAAM,EAAE,MAAM,KAAK,GAAG,WAAW,EAAE,aAAa,IAAI,KAAK,EAAE;AAA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AE,YAAY,CAAC,CAAC;AAClD,MAAI,eAAe;AACnB,aAAW,QAAQ,MAAM;AACvB,QAAI,KAAK,IAAI,IAAI,EAAG;AAAA,EACtB;AACA,QAAM,QAAQ,KAAK,OAAO,KAAK,OAAO;AACtC,SAAO,UAAU,IAAI,IAAI,eAAe;AAC1C;AAEA,SAAS,eAAe,GAAe,GAAwB;AAC7D,QAAM,UAAU,EAAE,YAAY,WAAW,KAAK;AAC9C,QAAM,UAAU,EAAE,YAAY,WAAW,KAAK;AAC9C,SAAO,QAAQ,WAAW,WAAW,YAAY,OAAO;AAC1D;AAEA,SAAS,gBAAgB,GAAe,GAAuB;AAC7D,UAAQ,EAAE,YAAY,MAAM,IAAI,cAAc,EAAE,YAAY,MAAM,EAAE;AACtE;AAEA,SAAS,qBAAqB,UAA6C;AACzE,QAAM,SAAS,oBAAI,IAAoB;AACvC,aAAW,UAAU,UAAU;AAC7B,UAAM,KAAK,OAAO,YAAY;AAC9B,QAAI,CAAC,GAAI;AACT,WAAO,IAAI,IAAI,yBAAyB,OAAO,SAAS,OAAO,YAAY,QAA8B,CAAC;AAAA,EAC5G;AACA,SAAO;AACT;AAEA,SAAS,wBACP,WACA,WACA,qBACoC;AACpC,QAAM,QAAQ,oBAAoB,IAAI,SAAS;AAC/C,QAAM,QAAQ,oBAAoB,IAAI,SAAS;AAC/C,MAAI,CAAC,SAAS,CAAC,MAAO,QAAO;AAC7B,SAAO;AAAA,IACL,CAAC,SAAS,GAAG;AAAA,IACb,CAAC,SAAS,GAAG;AAAA,EACf;AACF;","names":[]}
@@ -98,12 +98,12 @@ import {
98
98
  runOperatorInventory,
99
99
  runOperatorRepair,
100
100
  runOperatorSetup
101
- } from "./chunk-LUCARK4W.js";
101
+ } from "./chunk-6U7TES2M.js";
102
102
  import {
103
103
  listNamespaces,
104
104
  runNamespaceMigration,
105
105
  verifyNamespaces
106
- } from "./chunk-GGL34GCW.js";
106
+ } from "./chunk-IZLTOS5L.js";
107
107
  import {
108
108
  GraphDashboardServer
109
109
  } from "./chunk-EZ25VE3G.js";
@@ -145,7 +145,7 @@ import {
145
145
  } from "./chunk-33JBK2XP.js";
146
146
  import {
147
147
  formatNamespaceMaintenanceHealthText
148
- } from "./chunk-KSJCXXOU.js";
148
+ } from "./chunk-FAGERSH2.js";
149
149
  import {
150
150
  analyzeSessionIntegrity,
151
151
  applySessionRepair,
@@ -215,7 +215,7 @@ import {
215
215
  } from "./chunk-OADWQ5CR.js";
216
216
  import {
217
217
  EngramAccessHttpServer
218
- } from "./chunk-QZHF4BWN.js";
218
+ } from "./chunk-Q5LGXWNG.js";
219
219
  import {
220
220
  WearablesInputError
221
221
  } from "./chunk-7WV3F5DQ.js";
@@ -228,10 +228,10 @@ import {
228
228
  createProductionChatLlmAdapter,
229
229
  loadChatSession,
230
230
  sessionBelongsToPrincipal
231
- } from "./chunk-O4ZIBPIW.js";
231
+ } from "./chunk-T7CGPTFU.js";
232
232
  import {
233
233
  EngramAccessService
234
- } from "./chunk-646B5ERJ.js";
234
+ } from "./chunk-PKO5NJ65.js";
235
235
  import {
236
236
  WorkStorage
237
237
  } from "./chunk-GDB4J2H3.js";
@@ -258,12 +258,6 @@ import {
258
258
  import {
259
259
  getObjectiveStateStoreStatus
260
260
  } from "./chunk-6HMYUWXR.js";
261
- import {
262
- resolveCapabilities,
263
- resolveCreationMemoryCapabilities,
264
- resolveGraphConstructionCapabilities,
265
- resolveMemoryLifecycleCapabilities
266
- } from "./chunk-ESF7TRYJ.js";
267
261
  import {
268
262
  getCausalTrajectoryStoreStatus
269
263
  } from "./chunk-SQNED75R.js";
@@ -285,6 +279,14 @@ import {
285
279
  evaluateActionConfidence,
286
280
  renderActionConfidenceText
287
281
  } from "./chunk-Z2YFLXHU.js";
282
+ import {
283
+ resolveCapabilities,
284
+ resolveCreationMemoryCapabilities,
285
+ resolveGraphConstructionCapabilities,
286
+ resolveIdentityContinuityCapabilities,
287
+ resolveMemoryLifecycleCapabilities,
288
+ resolveNamespaceCapabilities
289
+ } from "./chunk-SHJGBAIW.js";
288
290
  import {
289
291
  selectRouteRule,
290
292
  validateRouteTarget
@@ -2429,7 +2431,7 @@ function hasDestructivePurgeFailures(errors) {
2429
2431
  }
2430
2432
  function resolvePolicySignalNamespaces(orchestrator) {
2431
2433
  const names = /* @__PURE__ */ new Set([orchestrator.config.defaultNamespace]);
2432
- if (orchestrator.config.namespacesEnabled) {
2434
+ if (resolveNamespaceCapabilities(orchestrator.config).namespaces) {
2433
2435
  names.add(orchestrator.config.sharedNamespace);
2434
2436
  for (const policy of orchestrator.config.namespacePolicies) {
2435
2437
  if (policy?.name) names.add(policy.name);
@@ -2552,7 +2554,7 @@ function resolveAuditNamespaces(orchestrator, namespace) {
2552
2554
  return [namespace];
2553
2555
  }
2554
2556
  const names = /* @__PURE__ */ new Set([orchestrator.config.defaultNamespace]);
2555
- if (orchestrator.config.namespacesEnabled) {
2557
+ if (resolveNamespaceCapabilities(orchestrator.config).namespaces) {
2556
2558
  names.add(orchestrator.config.sharedNamespace);
2557
2559
  for (const policy of orchestrator.config.namespacePolicies) {
2558
2560
  if (policy?.name) names.add(policy.name);
@@ -3149,7 +3151,7 @@ async function resolveMemoryDirForNamespace(orchestrator, namespace, options) {
3149
3151
  const ns = (namespace ?? "").trim();
3150
3152
  if (!ns) return orchestrator.config.memoryDir;
3151
3153
  assertSafeNamespaceSegment(ns);
3152
- if (!orchestrator.config.namespacesEnabled) {
3154
+ if (!resolveNamespaceCapabilities(orchestrator.config).namespaces) {
3153
3155
  if (options?.rejectUnsupportedOverride && ns !== orchestrator.config.defaultNamespace) {
3154
3156
  throw new Error(`namespaces are disabled; cannot target namespace: ${ns}`);
3155
3157
  }
@@ -3536,7 +3538,7 @@ function registerCli(api, orchestrator, registerOptions = {}) {
3536
3538
  );
3537
3539
  tierCmd.command("list").description("Summarize tier distribution across all memories").option("--json", "Emit machine-readable JSON only").action(async (...args) => {
3538
3540
  const options = args[0] ?? {};
3539
- const { summarizeTiers, formatTierSummaryText } = await import("./tier-stats-3LYQ3VV5.js");
3541
+ const { summarizeTiers, formatTierSummaryText } = await import("./tier-stats-LSM35HZY.js");
3540
3542
  const summary = await summarizeTiers(orchestrator.storage);
3541
3543
  if (reportHasMachineReadableOutput(options)) {
3542
3544
  console.log(JSON.stringify(summary, null, 2));
@@ -3547,7 +3549,7 @@ function registerCli(api, orchestrator, registerOptions = {}) {
3547
3549
  tierCmd.command("explain").description("Explain the tier-transition decision for a single memory").argument("<id>", "Memory id to explain").option("--json", "Emit machine-readable JSON only").action(async (...args) => {
3548
3550
  const idArg = typeof args[0] === "string" ? args[0] : "";
3549
3551
  const options = args[1] ?? {};
3550
- const { explainTierForMemory, formatTierExplainText } = await import("./tier-stats-3LYQ3VV5.js");
3552
+ const { explainTierForMemory, formatTierExplainText } = await import("./tier-stats-LSM35HZY.js");
3551
3553
  try {
3552
3554
  const explain = await explainTierForMemory(
3553
3555
  orchestrator.storage,
@@ -6282,7 +6284,7 @@ Semantic consolidation complete. clusters=${result.clustersFound}, consolidated=
6282
6284
  });
6283
6285
  const continuityCmd = cmd.command("continuity").description("Identity continuity incident workflow commands");
6284
6286
  continuityCmd.command("incidents").description("List continuity incidents").option("--state <state>", "Filter by state: open|closed|all", "open").option("--limit <number>", "Maximum incidents to list", "25").action(async (...args) => {
6285
- if (!orchestrator.config.identityContinuityEnabled) {
6287
+ if (!resolveIdentityContinuityCapabilities(orchestrator.config).identityContinuity) {
6286
6288
  console.log("Identity continuity is disabled.");
6287
6289
  return;
6288
6290
  }
@@ -6303,7 +6305,7 @@ Semantic consolidation complete. clusters=${result.clustersFound}, consolidated=
6303
6305
  }
6304
6306
  });
6305
6307
  continuityCmd.command("incident-open").description("Open a continuity incident").option("--symptom <text>", "Required symptom description").option("--trigger-window <window>", "Optional incident trigger window").option("--suspected-cause <text>", "Optional suspected cause").action(async (...args) => {
6306
- if (!orchestrator.config.identityContinuityEnabled) {
6308
+ if (!resolveIdentityContinuityCapabilities(orchestrator.config).identityContinuity) {
6307
6309
  console.log("Identity continuity is disabled.");
6308
6310
  return;
6309
6311
  }
@@ -6326,7 +6328,7 @@ Semantic consolidation complete. clusters=${result.clustersFound}, consolidated=
6326
6328
  console.log(formatContinuityIncidentCli(created));
6327
6329
  });
6328
6330
  continuityCmd.command("incident-close").description("Close a continuity incident").option("--id <id>", "Required incident ID").option("--fix-applied <text>", "Required fix description").option("--verification-result <text>", "Required verification result").option("--preventive-rule <text>", "Optional preventive rule").action(async (...args) => {
6329
- if (!orchestrator.config.identityContinuityEnabled) {
6331
+ if (!resolveIdentityContinuityCapabilities(orchestrator.config).identityContinuity) {
6330
6332
  console.log("Identity continuity is disabled.");
6331
6333
  return;
6332
6334
  }
@@ -6768,7 +6770,7 @@ Semantic consolidation complete. clusters=${result.clustersFound}, consolidated=
6768
6770
  mergedContent: cmdOpts.mergedContent,
6769
6771
  storageForNamespace: (namespace) => {
6770
6772
  const requested = namespace?.trim();
6771
- if (!orchestrator.config.namespacesEnabled) {
6773
+ if (!resolveNamespaceCapabilities(orchestrator.config).namespaces) {
6772
6774
  if (requested && requested !== orchestrator.config.defaultNamespace) {
6773
6775
  throw new Error(`unsupported namespace: ${requested}`);
6774
6776
  }
@@ -6790,7 +6792,7 @@ Semantic consolidation complete. clusters=${result.clustersFound}, consolidated=
6790
6792
  });
6791
6793
  reviewCmd.command("scan").description("Run an on-demand contradiction scan").option("--namespace <ns>", "Namespace to scan").action(async (...args) => {
6792
6794
  const options = args[0] ?? {};
6793
- const { runContradictionScan } = await import("./contradiction-scan-HWGEOUDS.js");
6795
+ const { runContradictionScan } = await import("./contradiction-scan-OUHMCUBT.js");
6794
6796
  console.log("Running contradiction scan...");
6795
6797
  const result = await runContradictionScan({
6796
6798
  storage: orchestrator.storage,
@@ -6807,7 +6809,7 @@ Semantic consolidation complete. clusters=${result.clustersFound}, consolidated=
6807
6809
  };
6808
6810
  },
6809
6811
  storageForNamespace: async (namespace) => {
6810
- const resolvedNamespace = namespace?.trim() || (orchestrator.config.namespacesEnabled ? orchestrator.config.defaultNamespace : void 0);
6812
+ const resolvedNamespace = namespace?.trim() || (resolveNamespaceCapabilities(orchestrator.config).namespaces ? orchestrator.config.defaultNamespace : void 0);
6811
6813
  const storage = await orchestrator.getStorageForNamespace(resolvedNamespace);
6812
6814
  return { storage, namespace: resolvedNamespace };
6813
6815
  },
@@ -7510,4 +7512,4 @@ export {
7510
7512
  listMemoryMarkdownFilePaths,
7511
7513
  registerCli
7512
7514
  };
7513
- //# sourceMappingURL=chunk-6TUWSUUD.js.map
7515
+ //# sourceMappingURL=chunk-UF3N7IRP.js.map