@remnic/core 10.0.138 → 10.0.140

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 (164) hide show
  1. package/dist/access-admin-ops-surface.js +41 -41
  2. package/dist/access-cli.js +41 -41
  3. package/dist/access-extraction-force-flush-preempt.js +41 -41
  4. package/dist/access-extraction-force-flush.js +41 -41
  5. package/dist/access-http-briefing.js +41 -41
  6. package/dist/access-http-query.js +41 -41
  7. package/dist/access-http.js +41 -41
  8. package/dist/access-identity-continuity-surface.js +41 -41
  9. package/dist/access-lcm-surface.js +41 -41
  10. package/dist/access-mcp.js +41 -41
  11. package/dist/access-observe-write-surface.js +41 -41
  12. package/dist/access-operations-batch.js +41 -41
  13. package/dist/access-operations.js +41 -41
  14. package/dist/access-recall-concurrency.js +41 -41
  15. package/dist/access-recall-response.js +41 -41
  16. package/dist/access-recall-surface.js +41 -41
  17. package/dist/access-service.js +41 -41
  18. package/dist/active-recall.js +4 -4
  19. package/dist/briefing.js +5 -5
  20. package/dist/buffer.js +4 -4
  21. package/dist/causal-consolidation.js +6 -6
  22. package/dist/{chunk-PQ5FYNY2.js → chunk-4R3X4BLB.js} +2 -2
  23. package/dist/{chunk-EEY326VH.js → chunk-63JPXUFA.js} +2 -2
  24. package/dist/{chunk-LEH4FVBJ.js → chunk-6G5ZEXI5.js} +2 -2
  25. package/dist/{chunk-OFMK76LD.js → chunk-6WV76JHC.js} +2 -2
  26. package/dist/{chunk-VRWQUUZ7.js → chunk-BYWNF25B.js} +2 -2
  27. package/dist/{chunk-YDOLJQ55.js → chunk-CCSPY45A.js} +5 -5
  28. package/dist/{chunk-A33VT7GC.js → chunk-DF7EPUCC.js} +2 -2
  29. package/dist/{chunk-GOYLBPSW.js → chunk-EIZUL6JC.js} +2 -2
  30. package/dist/{chunk-YMNFHNZH.js → chunk-F476AJQJ.js} +2 -2
  31. package/dist/{chunk-OJJ73HLA.js → chunk-FLR5FAHU.js} +3 -3
  32. package/dist/{chunk-CKG7T4AD.js → chunk-FNWS44MG.js} +2 -2
  33. package/dist/{chunk-MXE42X3I.js → chunk-G52CORLA.js} +3 -3
  34. package/dist/{chunk-KCVPKFDG.js → chunk-G7ANQMRQ.js} +2 -2
  35. package/dist/{chunk-KCLHHANX.js → chunk-GAZ27LFM.js} +2 -2
  36. package/dist/{chunk-PNT3SZRY.js → chunk-GHKXRFZU.js} +7 -7
  37. package/dist/{chunk-N7IJEGSE.js → chunk-GNIMBEOK.js} +2 -2
  38. package/dist/{chunk-POB7N5UM.js → chunk-JZASJEUM.js} +2 -2
  39. package/dist/{chunk-LT35JWKZ.js → chunk-K5V3DUX6.js} +2 -2
  40. package/dist/{chunk-JEAMQL63.js → chunk-LCLEHOQK.js} +3 -3
  41. package/dist/{chunk-3BRHOVRU.js → chunk-LPDOCXHH.js} +2 -2
  42. package/dist/{chunk-66MBMBSH.js → chunk-LR7C3PFW.js} +2 -2
  43. package/dist/{chunk-NOZDET3Q.js → chunk-M63MTDNV.js} +3 -3
  44. package/dist/{chunk-JG6AHBJW.js → chunk-MFJTK5Y7.js} +2 -2
  45. package/dist/{chunk-JY327EH4.js → chunk-MLULTM2D.js} +2 -2
  46. package/dist/{chunk-OI3UMEW3.js → chunk-PA7HHYVC.js} +2 -2
  47. package/dist/{chunk-SRW4IKHM.js → chunk-QF3FP3ME.js} +2 -2
  48. package/dist/{chunk-MP6V4CLP.js → chunk-QYMVUGXI.js} +2 -2
  49. package/dist/{chunk-PKV3NNM2.js → chunk-RHASUJOS.js} +2 -2
  50. package/dist/{chunk-VSZEV7HG.js → chunk-RRPGUW65.js} +2 -2
  51. package/dist/{chunk-N6JGLQV7.js → chunk-SYG4QNWA.js} +2 -2
  52. package/dist/{chunk-F4DXTUHY.js → chunk-SZ6QV3DY.js} +2 -2
  53. package/dist/{chunk-DI2QWY6J.js → chunk-TBHKV75U.js} +7 -7
  54. package/dist/{chunk-U3GJUARA.js → chunk-USVA4XWY.js} +2 -2
  55. package/dist/{chunk-K4DBE5MH.js → chunk-UWSTOIQS.js} +2 -2
  56. package/dist/{chunk-2DWTO7XP.js → chunk-VH4UCI3R.js} +92 -38
  57. package/dist/chunk-VH4UCI3R.js.map +1 -0
  58. package/dist/{chunk-JCWI43TO.js → chunk-VRBGYSSQ.js} +2 -2
  59. package/dist/{chunk-LUDXM7MD.js → chunk-WBOJMAAV.js} +78 -25
  60. package/dist/chunk-WBOJMAAV.js.map +1 -0
  61. package/dist/{chunk-QZ5JZNXN.js → chunk-WVBXQ54A.js} +36 -36
  62. package/dist/{chunk-NB2BKYUS.js → chunk-XVWAI42Q.js} +2 -2
  63. package/dist/{chunk-VF3EVRUN.js → chunk-XVZ55TNZ.js} +2 -2
  64. package/dist/{chunk-HOSS72UP.js → chunk-Y5BD6FSI.js} +2 -2
  65. package/dist/{chunk-AV6R66KO.js → chunk-Y5TTSJJQ.js} +2 -2
  66. package/dist/cli.js +41 -41
  67. package/dist/coding/export-okf-codegraph.js +4 -4
  68. package/dist/compounding/engine.js +6 -6
  69. package/dist/config.js +4 -4
  70. package/dist/connectors/codex-materialize-runner.js +5 -5
  71. package/dist/connectors/index.js +5 -5
  72. package/dist/convergence-refresh.js +7 -7
  73. package/dist/corpus-watermark.js +7 -7
  74. package/dist/entity-retrieval.js +5 -5
  75. package/dist/explicit-capture.js +41 -41
  76. package/dist/extraction.js +9 -9
  77. package/dist/harmonic-retrieval.js +5 -5
  78. package/dist/index.js +41 -41
  79. package/dist/location/index.js +6 -6
  80. package/dist/maintenance/memory-governance.js +5 -5
  81. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +5 -5
  82. package/dist/maintenance/rebuild-memory-projection-runner.js +7 -7
  83. package/dist/maintenance/rebuild-memory-projection.js +6 -6
  84. package/dist/memory-browse.js +4 -4
  85. package/dist/namespaces/migrate.js +6 -6
  86. package/dist/namespaces/search.js +3 -3
  87. package/dist/namespaces/storage.js +5 -5
  88. package/dist/operator-doctor-corpus.js +8 -8
  89. package/dist/operator-toolkit.js +11 -11
  90. package/dist/orchestration/backlog-scheduler.js +42 -42
  91. package/dist/orchestration/buffer-drain-runner.js +42 -42
  92. package/dist/orchestration/maintenance.js +13 -13
  93. package/dist/orchestrator.js +41 -41
  94. package/dist/qmd.d.ts +15 -0
  95. package/dist/qmd.d.ts.map +1 -1
  96. package/dist/qmd.js +3 -1
  97. package/dist/recall-navigation.js +41 -41
  98. package/dist/recall-state-view-admission.js +4 -4
  99. package/dist/recall-why-service.js +4 -4
  100. package/dist/rerank.d.ts +8 -8
  101. package/dist/rerank.d.ts.map +1 -1
  102. package/dist/rerank.js +11 -3
  103. package/dist/resume-bundles.js +4 -4
  104. package/dist/search/factory.js +2 -2
  105. package/dist/search/index.js +2 -2
  106. package/dist/semantic-consolidation.js +6 -6
  107. package/dist/semantic-rule-promotion.js +5 -5
  108. package/dist/semantic-rule-verifier.js +5 -5
  109. package/dist/source-agent-qualifier.js +8 -8
  110. package/dist/standup/build.js +5 -5
  111. package/dist/storage.js +4 -4
  112. package/dist/transfer/export-okf.js +5 -5
  113. package/dist/verified-recall.js +5 -5
  114. package/dist/who-knows-cli.js +6 -6
  115. package/dist/who-knows.js +5 -5
  116. package/package.json +2 -2
  117. package/src/qmd-client.test.ts +26 -15
  118. package/src/qmd-daemon-congestion.test.ts +233 -0
  119. package/src/qmd-mcp-cancel.test.ts +3 -3
  120. package/src/qmd.ts +149 -45
  121. package/src/rerank.test.ts +162 -25
  122. package/src/rerank.ts +102 -24
  123. package/dist/chunk-2DWTO7XP.js.map +0 -1
  124. package/dist/chunk-LUDXM7MD.js.map +0 -1
  125. /package/dist/{chunk-PQ5FYNY2.js.map → chunk-4R3X4BLB.js.map} +0 -0
  126. /package/dist/{chunk-EEY326VH.js.map → chunk-63JPXUFA.js.map} +0 -0
  127. /package/dist/{chunk-LEH4FVBJ.js.map → chunk-6G5ZEXI5.js.map} +0 -0
  128. /package/dist/{chunk-OFMK76LD.js.map → chunk-6WV76JHC.js.map} +0 -0
  129. /package/dist/{chunk-VRWQUUZ7.js.map → chunk-BYWNF25B.js.map} +0 -0
  130. /package/dist/{chunk-YDOLJQ55.js.map → chunk-CCSPY45A.js.map} +0 -0
  131. /package/dist/{chunk-A33VT7GC.js.map → chunk-DF7EPUCC.js.map} +0 -0
  132. /package/dist/{chunk-GOYLBPSW.js.map → chunk-EIZUL6JC.js.map} +0 -0
  133. /package/dist/{chunk-YMNFHNZH.js.map → chunk-F476AJQJ.js.map} +0 -0
  134. /package/dist/{chunk-OJJ73HLA.js.map → chunk-FLR5FAHU.js.map} +0 -0
  135. /package/dist/{chunk-CKG7T4AD.js.map → chunk-FNWS44MG.js.map} +0 -0
  136. /package/dist/{chunk-MXE42X3I.js.map → chunk-G52CORLA.js.map} +0 -0
  137. /package/dist/{chunk-KCVPKFDG.js.map → chunk-G7ANQMRQ.js.map} +0 -0
  138. /package/dist/{chunk-KCLHHANX.js.map → chunk-GAZ27LFM.js.map} +0 -0
  139. /package/dist/{chunk-PNT3SZRY.js.map → chunk-GHKXRFZU.js.map} +0 -0
  140. /package/dist/{chunk-N7IJEGSE.js.map → chunk-GNIMBEOK.js.map} +0 -0
  141. /package/dist/{chunk-POB7N5UM.js.map → chunk-JZASJEUM.js.map} +0 -0
  142. /package/dist/{chunk-LT35JWKZ.js.map → chunk-K5V3DUX6.js.map} +0 -0
  143. /package/dist/{chunk-JEAMQL63.js.map → chunk-LCLEHOQK.js.map} +0 -0
  144. /package/dist/{chunk-3BRHOVRU.js.map → chunk-LPDOCXHH.js.map} +0 -0
  145. /package/dist/{chunk-66MBMBSH.js.map → chunk-LR7C3PFW.js.map} +0 -0
  146. /package/dist/{chunk-NOZDET3Q.js.map → chunk-M63MTDNV.js.map} +0 -0
  147. /package/dist/{chunk-JG6AHBJW.js.map → chunk-MFJTK5Y7.js.map} +0 -0
  148. /package/dist/{chunk-JY327EH4.js.map → chunk-MLULTM2D.js.map} +0 -0
  149. /package/dist/{chunk-OI3UMEW3.js.map → chunk-PA7HHYVC.js.map} +0 -0
  150. /package/dist/{chunk-SRW4IKHM.js.map → chunk-QF3FP3ME.js.map} +0 -0
  151. /package/dist/{chunk-MP6V4CLP.js.map → chunk-QYMVUGXI.js.map} +0 -0
  152. /package/dist/{chunk-PKV3NNM2.js.map → chunk-RHASUJOS.js.map} +0 -0
  153. /package/dist/{chunk-VSZEV7HG.js.map → chunk-RRPGUW65.js.map} +0 -0
  154. /package/dist/{chunk-N6JGLQV7.js.map → chunk-SYG4QNWA.js.map} +0 -0
  155. /package/dist/{chunk-F4DXTUHY.js.map → chunk-SZ6QV3DY.js.map} +0 -0
  156. /package/dist/{chunk-DI2QWY6J.js.map → chunk-TBHKV75U.js.map} +0 -0
  157. /package/dist/{chunk-U3GJUARA.js.map → chunk-USVA4XWY.js.map} +0 -0
  158. /package/dist/{chunk-K4DBE5MH.js.map → chunk-UWSTOIQS.js.map} +0 -0
  159. /package/dist/{chunk-JCWI43TO.js.map → chunk-VRBGYSSQ.js.map} +0 -0
  160. /package/dist/{chunk-QZ5JZNXN.js.map → chunk-WVBXQ54A.js.map} +0 -0
  161. /package/dist/{chunk-NB2BKYUS.js.map → chunk-XVWAI42Q.js.map} +0 -0
  162. /package/dist/{chunk-VF3EVRUN.js.map → chunk-XVZ55TNZ.js.map} +0 -0
  163. /package/dist/{chunk-HOSS72UP.js.map → chunk-Y5BD6FSI.js.map} +0 -0
  164. /package/dist/{chunk-AV6R66KO.js.map → chunk-Y5TTSJJQ.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  rebuildMemoryProjection,
3
3
  watchProjectionRebuildParent
4
- } from "./chunk-NOZDET3Q.js";
4
+ } from "./chunk-M63MTDNV.js";
5
5
  import {
6
6
  initLogger,
7
7
  log
@@ -77,4 +77,4 @@ if (invokedAsRunner) {
77
77
  export {
78
78
  PROJECTION_REBUILD_RUNNER_FLAG
79
79
  };
80
- //# sourceMappingURL=chunk-LT35JWKZ.js.map
80
+ //# sourceMappingURL=chunk-K5V3DUX6.js.map
@@ -8,11 +8,11 @@ import {
8
8
  } from "./chunk-5CO5G4MN.js";
9
9
  import {
10
10
  resolveDefaultNamespaceRoot
11
- } from "./chunk-MP6V4CLP.js";
11
+ } from "./chunk-QYMVUGXI.js";
12
12
  import {
13
13
  StorageManager,
14
14
  readRawMemoryDocument
15
- } from "./chunk-LEH4FVBJ.js";
15
+ } from "./chunk-6G5ZEXI5.js";
16
16
  import {
17
17
  parseContinuityImprovementLoops
18
18
  } from "./chunk-LDXUBPMO.js";
@@ -1869,4 +1869,4 @@ export {
1869
1869
  defaultTierMigrationCycleBudget,
1870
1870
  CompoundingEngine
1871
1871
  };
1872
- //# sourceMappingURL=chunk-JEAMQL63.js.map
1872
+ //# sourceMappingURL=chunk-LCLEHOQK.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isGenericRecallExcludedPath
3
- } from "./chunk-YMNFHNZH.js";
3
+ } from "./chunk-F476AJQJ.js";
4
4
  import {
5
5
  normalizeProjectionPreview
6
6
  } from "./chunk-SCU65EZI.js";
@@ -209,4 +209,4 @@ export {
209
209
  browsePatternMatches,
210
210
  runMemoryBrowse
211
211
  };
212
- //# sourceMappingURL=chunk-3BRHOVRU.js.map
212
+ //# sourceMappingURL=chunk-LPDOCXHH.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ExtractionDeadlineError
3
- } from "./chunk-VRWQUUZ7.js";
3
+ } from "./chunk-BYWNF25B.js";
4
4
  import {
5
5
  BufferAdmissionRefusedError,
6
6
  BufferSessionTurnRefusedError,
@@ -941,4 +941,4 @@ var SmartBuffer = class {
941
941
  export {
942
942
  SmartBuffer
943
943
  };
944
- //# sourceMappingURL=chunk-66MBMBSH.js.map
944
+ //# sourceMappingURL=chunk-LR7C3PFW.js.map
@@ -4,13 +4,13 @@ import {
4
4
  import {
5
5
  listMemoryGovernanceRuns,
6
6
  readMemoryGovernanceRunArtifact
7
- } from "./chunk-VF3EVRUN.js";
7
+ } from "./chunk-XVZ55TNZ.js";
8
8
  import {
9
9
  loadPersistedNativeKnowledgeChunks
10
10
  } from "./chunk-2DQ2XREU.js";
11
11
  import {
12
12
  StorageManager
13
- } from "./chunk-LEH4FVBJ.js";
13
+ } from "./chunk-6G5ZEXI5.js";
14
14
  import {
15
15
  normalizeProjectionPreview,
16
16
  normalizeProjectionTags
@@ -1156,4 +1156,4 @@ export {
1156
1156
  verifyMemoryProjection,
1157
1157
  repairMemoryProjection
1158
1158
  };
1159
- //# sourceMappingURL=chunk-NOZDET3Q.js.map
1159
+ //# sourceMappingURL=chunk-M63MTDNV.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  rebuildMemoryProjection
3
- } from "./chunk-NOZDET3Q.js";
3
+ } from "./chunk-M63MTDNV.js";
4
4
 
5
5
  // src/convergence-refresh.ts
6
6
  async function refreshConvergedNamespaces(namespaces, namespaceSearchRouter, getStorage, searchEnabled) {
@@ -32,4 +32,4 @@ async function refreshConvergedNamespaces(namespaces, namespaceSearchRouter, get
32
32
  export {
33
33
  refreshConvergedNamespaces
34
34
  };
35
- //# sourceMappingURL=chunk-JG6AHBJW.js.map
35
+ //# sourceMappingURL=chunk-MFJTK5Y7.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runPostConsolidationMaterialize
3
- } from "./chunk-AV6R66KO.js";
3
+ } from "./chunk-Y5TTSJJQ.js";
4
4
  import {
5
5
  discoverMemoryExtensions,
6
6
  renderExtensionsBlock,
@@ -220,4 +220,4 @@ export {
220
220
  buildExtensionsBlockForConsolidation,
221
221
  materializeAfterSemanticConsolidation
222
222
  };
223
- //# sourceMappingURL=chunk-JY327EH4.js.map
223
+ //# sourceMappingURL=chunk-MLULTM2D.js.map
@@ -36,7 +36,7 @@ import {
36
36
  } from "./chunk-2DQ2XREU.js";
37
37
  import {
38
38
  compareEntityTimestamps
39
- } from "./chunk-LEH4FVBJ.js";
39
+ } from "./chunk-6G5ZEXI5.js";
40
40
  import {
41
41
  normalizeEntityText,
42
42
  resolveRequestedEntitySectionKeys
@@ -877,4 +877,4 @@ export {
877
877
  entityIndexVersion,
878
878
  entityRecentTranscriptLookbackHours
879
879
  };
880
- //# sourceMappingURL=chunk-OI3UMEW3.js.map
880
+ //# sourceMappingURL=chunk-PA7HHYVC.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  listNamespaces
3
- } from "./chunk-OJJ73HLA.js";
3
+ } from "./chunk-FLR5FAHU.js";
4
4
  import {
5
5
  corpusScanWorker
6
6
  } from "./chunk-4LZ7SVKM.js";
@@ -292,4 +292,4 @@ export {
292
292
  computeServiceCorpusWatermarks,
293
293
  computeServiceCorpusCensus
294
294
  };
295
- //# sourceMappingURL=chunk-SRW4IKHM.js.map
295
+ //# sourceMappingURL=chunk-QF3FP3ME.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  StorageManager
3
- } from "./chunk-LEH4FVBJ.js";
3
+ } from "./chunk-6G5ZEXI5.js";
4
4
  import {
5
5
  keyring_exports,
6
6
  secureStoreDir
@@ -416,4 +416,4 @@ export {
416
416
  resolveNamespaceStorageRoot,
417
417
  NamespaceStorageRouter
418
418
  };
419
- //# sourceMappingURL=chunk-MP6V4CLP.js.map
419
+ //# sourceMappingURL=chunk-QYMVUGXI.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-KJTKLXTH.js";
4
4
  import {
5
5
  StorageManager
6
- } from "./chunk-LEH4FVBJ.js";
6
+ } from "./chunk-6G5ZEXI5.js";
7
7
  import {
8
8
  assertInjectedStorageRooted
9
9
  } from "./chunk-BNZAR6PO.js";
@@ -260,4 +260,4 @@ export {
260
260
  backupExistingLedger,
261
261
  rebuildMemoryLifecycleLedger
262
262
  };
263
- //# sourceMappingURL=chunk-PKV3NNM2.js.map
263
+ //# sourceMappingURL=chunk-RHASUJOS.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  resolveDefaultNamespaceRoot,
3
3
  resolveNamespaceStorageRoot
4
- } from "./chunk-MP6V4CLP.js";
4
+ } from "./chunk-QYMVUGXI.js";
5
5
  import {
6
6
  getConfiguredNamespaces
7
7
  } from "./chunk-UPWOMMVU.js";
@@ -2308,4 +2308,4 @@ export {
2308
2308
  runNamespaceMaintenancePlan,
2309
2309
  runNamespaceMaintenanceBatchPlan
2310
2310
  };
2311
- //# sourceMappingURL=chunk-VSZEV7HG.js.map
2311
+ //# sourceMappingURL=chunk-RRPGUW65.js.map
@@ -2,7 +2,7 @@ import {
2
2
  WHO_KNOWS_DEFAULT_LIMIT,
3
3
  WHO_KNOWS_MAX_LIMIT,
4
4
  validateWhoKnowsInput
5
- } from "./chunk-POB7N5UM.js";
5
+ } from "./chunk-JZASJEUM.js";
6
6
 
7
7
  // src/who-knows-cli.ts
8
8
  function extractWhoKnowsRawArgs(rest) {
@@ -74,4 +74,4 @@ export {
74
74
  renderWhoKnowsText,
75
75
  renderWhoKnows
76
76
  };
77
- //# sourceMappingURL=chunk-N6JGLQV7.js.map
77
+ //# sourceMappingURL=chunk-SYG4QNWA.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-DBB5JPSL.js";
4
4
  import {
5
5
  isGenericRecallExcludedPath
6
- } from "./chunk-YMNFHNZH.js";
6
+ } from "./chunk-F476AJQJ.js";
7
7
  import {
8
8
  isChangeOrientedQuery
9
9
  } from "./chunk-EH3HNCAM.js";
@@ -69,4 +69,4 @@ export {
69
69
  filterRecentScanMemoriesForStateView,
70
70
  indexStateViewAnnotatedResults
71
71
  };
72
- //# sourceMappingURL=chunk-F4DXTUHY.js.map
72
+ //# sourceMappingURL=chunk-SZ6QV3DY.js.map
@@ -3,7 +3,7 @@ import {
3
3
  readNamespaceMaintenanceLastRanStatuses,
4
4
  readNamespaceMaintenanceStatuses,
5
5
  runNamespaceMaintenancePlan
6
- } from "./chunk-VSZEV7HG.js";
6
+ } from "./chunk-RRPGUW65.js";
7
7
  import {
8
8
  analyzeSessionIntegrity,
9
9
  applySessionRepair,
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-CMTINOFS.js";
15
15
  import {
16
16
  summarizeCorpusAndReplica
17
- } from "./chunk-KCVPKFDG.js";
17
+ } from "./chunk-G7ANQMRQ.js";
18
18
  import {
19
19
  readJudgeVerdictStats
20
20
  } from "./chunk-OZKOPQCM.js";
@@ -28,7 +28,7 @@ import {
28
28
  import {
29
29
  listMemoryGovernanceRuns,
30
30
  readMemoryGovernanceRunArtifact
31
- } from "./chunk-VF3EVRUN.js";
31
+ } from "./chunk-XVZ55TNZ.js";
32
32
  import {
33
33
  resolveCuratedIncludeFilesStatePath,
34
34
  resolveNativeKnowledgeStatePath,
@@ -36,10 +36,10 @@ import {
36
36
  } from "./chunk-2DQ2XREU.js";
37
37
  import {
38
38
  resolveCorpusNamespaceRoots
39
- } from "./chunk-SRW4IKHM.js";
39
+ } from "./chunk-QF3FP3ME.js";
40
40
  import {
41
41
  listNamespaces
42
- } from "./chunk-OJJ73HLA.js";
42
+ } from "./chunk-FLR5FAHU.js";
43
43
  import {
44
44
  runConsolidationProvenanceCheck
45
45
  } from "./chunk-QHDBKC5Z.js";
@@ -57,7 +57,7 @@ import {
57
57
  } from "./chunk-DURQZFVJ.js";
58
58
  import {
59
59
  StorageManager
60
- } from "./chunk-LEH4FVBJ.js";
60
+ } from "./chunk-6G5ZEXI5.js";
61
61
  import {
62
62
  lintWorkspaceFiles
63
63
  } from "./chunk-DM2T26WE.js";
@@ -1876,4 +1876,4 @@ export {
1876
1876
  runBenchmarkRecall,
1877
1877
  runOperatorRepair
1878
1878
  };
1879
- //# sourceMappingURL=chunk-DI2QWY6J.js.map
1879
+ //# sourceMappingURL=chunk-TBHKV75U.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createSearchBackend
3
- } from "./chunk-N7IJEGSE.js";
3
+ } from "./chunk-GNIMBEOK.js";
4
4
  import {
5
5
  reportSearchDegradation
6
6
  } from "./chunk-NWA6IXR3.js";
@@ -572,4 +572,4 @@ export {
572
572
  normalizeQmdResultPath,
573
573
  resolveNamespaceResultPath
574
574
  };
575
- //# sourceMappingURL=chunk-U3GJUARA.js.map
575
+ //# sourceMappingURL=chunk-USVA4XWY.js.map
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-FNFURZBZ.js";
11
11
  import {
12
12
  StorageManager
13
- } from "./chunk-LEH4FVBJ.js";
13
+ } from "./chunk-6G5ZEXI5.js";
14
14
  import {
15
15
  normalizeEntityName
16
16
  } from "./chunk-YXZG5TVN.js";
@@ -974,4 +974,4 @@ export {
974
974
  resolveBriefingSaveDir,
975
975
  briefingFilename
976
976
  };
977
- //# sourceMappingURL=chunk-K4DBE5MH.js.map
977
+ //# sourceMappingURL=chunk-UWSTOIQS.js.map
@@ -51,6 +51,8 @@ import os from "os";
51
51
  import path from "path";
52
52
  var QMD_TIMEOUT_MS = 3e4;
53
53
  var QMD_DAEMON_TIMEOUT_MS = 6e4;
54
+ var QMD_DAEMON_SLOW_QUERY_MS = 1e4;
55
+ var QMD_DAEMON_CONGESTION_WINDOW_MS = 6e4;
54
56
  var QMD_UPDATE_BACKOFF_MS = 15 * 60 * 1e3;
55
57
  var QMD_EMBED_BACKOFF_MS = 60 * 60 * 1e3;
56
58
  var QMD_CLI_WARN_THROTTLE_MS = 15 * 60 * 1e3;
@@ -539,6 +541,13 @@ async function releaseSharedDaemonSession(session) {
539
541
  }
540
542
  }
541
543
  var sharedDaemonSessionCountForTest = () => SHARED_DAEMON_SESSIONS.size;
544
+ var DAEMON_CONGESTED_UNTIL = /* @__PURE__ */ new WeakMap();
545
+ var daemonCongestionForTest = {
546
+ get: (session) => DAEMON_CONGESTED_UNTIL.get(session) ?? 0,
547
+ set: (session, untilMs) => {
548
+ DAEMON_CONGESTED_UNTIL.set(session, untilMs);
549
+ }
550
+ };
542
551
  var QmdClient = class _QmdClient {
543
552
  constructor(collection, maxResults, opts) {
544
553
  this.collection = collection;
@@ -626,6 +635,15 @@ var QmdClient = class _QmdClient {
626
635
  daemonRecheckIntervalMs;
627
636
  /** Consecutive transient daemon failures before invalidating the session. */
628
637
  daemonTransientFailures = 0;
638
+ /** Epoch ms until which daemon searches run lex-only after a slow/timed-out query (#3476). */
639
+ daemonCongestedUntilMs() {
640
+ return this.daemonSession ? DAEMON_CONGESTED_UNTIL.get(this.daemonSession) ?? 0 : 0;
641
+ }
642
+ isDaemonCongested() {
643
+ return performance.now() < this.daemonCongestedUntilMs();
644
+ }
645
+ daemonSlowQueryMs = QMD_DAEMON_SLOW_QUERY_MS;
646
+ daemonCongestionWindowMs = QMD_DAEMON_CONGESTION_WINDOW_MS;
629
647
  static DAEMON_MAX_TRANSIENT_FAILURES = 3;
630
648
  qmdPath = "qmd";
631
649
  buildRuntimeEnv(opts) {
@@ -1074,6 +1092,19 @@ var QmdClient = class _QmdClient {
1074
1092
  recordDaemonSuccess() {
1075
1093
  this.daemonTransientFailures = 0;
1076
1094
  }
1095
+ /**
1096
+ * Open the congestion window (#3476): while set, daemon searches run the
1097
+ * lex-only plan instead of lex+vec+hyde so a saturated embedding backend
1098
+ * cannot stall every recall stage serially.
1099
+ */
1100
+ markDaemonCongested(durationMs, reason) {
1101
+ if (this.daemonSession) {
1102
+ DAEMON_CONGESTED_UNTIL.set(this.daemonSession, performance.now() + this.daemonCongestionWindowMs);
1103
+ }
1104
+ log.info(
1105
+ `QMD daemon congested (${reason}, ${durationMs}ms): lex-only searches for ${this.daemonCongestionWindowMs}ms`
1106
+ );
1107
+ }
1077
1108
  /**
1078
1109
  * Handle a non-timeout, non-cancellation daemon error.
1079
1110
  * Tolerates up to DAEMON_MAX_TRANSIENT_FAILURES consecutive failures
@@ -1228,16 +1259,17 @@ var QmdClient = class _QmdClient {
1228
1259
  const searchOptions = this.resolveSearchOptions(options);
1229
1260
  const optionsFingerprint = searchOptions ? JSON.stringify(searchOptions) : "";
1230
1261
  const strategyFingerprint = `${this.qmdSearchStrategy}:${this.qmdSubprocessStrategy}`;
1231
- const cacheKey = createHash("sha256").update(`${strategyFingerprint}:${col}:${n}:${optionsFingerprint}:${trimmed}`).digest("hex");
1262
+ const makeCacheKey = (planFingerprint) => createHash("sha256").update(`${strategyFingerprint}:${planFingerprint}:${col}:${n}:${optionsFingerprint}:${trimmed}`).digest("hex");
1263
+ const cacheKey = makeCacheKey(this.isDaemonCongested() ? "deg" : "std");
1232
1264
  const cached = getCachedQmdSearch(cacheKey);
1233
1265
  if (cached) {
1234
1266
  log.debug(`QMD search cache hit (${cached.length} results)`);
1235
1267
  return cached;
1236
1268
  }
1237
1269
  if (this.daemonAvailable) {
1238
- let results;
1270
+ let outcome;
1239
1271
  try {
1240
- results = await this.daemonSearchJoiner.join(
1272
+ outcome = await this.daemonSearchJoiner.join(
1241
1273
  cacheKey,
1242
1274
  execution?.signal,
1243
1275
  (sharedSignal) => this.searchViaDaemon(trimmed, col, n, searchOptions, sharedSignal)
@@ -1248,11 +1280,12 @@ var QmdClient = class _QmdClient {
1248
1280
  }
1249
1281
  throw err;
1250
1282
  }
1251
- if (results !== null) {
1283
+ if (outcome !== null) {
1284
+ const { results, degraded } = outcome;
1252
1285
  if (results.length === 0) {
1253
1286
  log.debug("QMD daemon search returned 0 results; skipping subprocess");
1254
1287
  }
1255
- setCachedQmdSearch(cacheKey, results);
1288
+ setCachedQmdSearch(makeCacheKey(degraded ? "deg" : "std"), results);
1256
1289
  return results;
1257
1290
  }
1258
1291
  log.warn("QMD daemon search timed out/failed; skipping subprocess (daemon-only mode)");
@@ -1292,20 +1325,20 @@ var QmdClient = class _QmdClient {
1292
1325
  const n = maxResults ?? 6;
1293
1326
  const searchOptions = this.resolveSearchOptions();
1294
1327
  if (this.daemonAvailable) {
1295
- let results;
1328
+ let outcome;
1296
1329
  try {
1297
- results = await this.searchViaDaemon(trimmed, void 0, n, searchOptions, execution?.signal);
1330
+ outcome = await this.searchViaDaemon(trimmed, void 0, n, searchOptions, execution?.signal);
1298
1331
  } catch (err) {
1299
1332
  if (isCallerCancellation(err, execution?.signal)) {
1300
1333
  throw isAbortError(err) ? err : abortError("QMD daemon global search aborted");
1301
1334
  }
1302
1335
  throw err;
1303
1336
  }
1304
- if (results !== null) {
1305
- if (results.length === 0) {
1337
+ if (outcome !== null) {
1338
+ if (outcome.results.length === 0) {
1306
1339
  log.debug("QMD daemon global search returned 0 results; skipping subprocess");
1307
1340
  }
1308
- return results;
1341
+ return outcome.results;
1309
1342
  }
1310
1343
  log.warn("QMD daemon global search timed out/failed; skipping subprocess (daemon-only mode)");
1311
1344
  this.notifyDegradation(execution?.onDegradation, "daemon_timeout");
@@ -1425,7 +1458,11 @@ var QmdClient = class _QmdClient {
1425
1458
  }
1426
1459
  async searchViaDaemon(query, collection, maxResults, options, signal) {
1427
1460
  if (!this.daemonSession || !this.daemonAvailable) return null;
1428
- const startedAtMs = Date.now();
1461
+ if (this.isDaemonCongested()) {
1462
+ const degraded = await this.bm25SearchViaDaemon(query, collection, maxResults, signal, options);
1463
+ return degraded === null ? null : { results: degraded, degraded: true };
1464
+ }
1465
+ const startedAtMs = performance.now();
1429
1466
  const v2 = this.isQmdV2();
1430
1467
  try {
1431
1468
  let args;
@@ -1444,23 +1481,30 @@ var QmdClient = class _QmdClient {
1444
1481
  this.addResolvedSearchOptionsToMcpArgs(args, options);
1445
1482
  }
1446
1483
  const result = await this.daemonSession.callTool("query", args, this.daemonTimeoutMs, signal);
1447
- const durationMs = Date.now() - startedAtMs;
1484
+ const durationMs = performance.now() - startedAtMs;
1448
1485
  if (this.slowLog?.enabled && durationMs >= this.slowLog.thresholdMs) {
1449
1486
  log.warn(
1450
1487
  `SLOW QMD daemon query: durationMs=${durationMs} collection=${collection ?? "global"} maxResults=${maxResults} queryChars=${query.length} v2=${v2}`
1451
1488
  );
1452
1489
  }
1453
1490
  const results = parseMcpSearchResult(result, "daemon");
1491
+ if (durationMs >= this.daemonSlowQueryMs) {
1492
+ this.markDaemonCongested(durationMs, "slow query");
1493
+ }
1454
1494
  log.debug(`QMD daemon search: ${results.length} results in ${durationMs}ms (v2=${v2})`);
1455
1495
  this.recordDaemonSuccess();
1456
- return results;
1496
+ return { results, degraded: false };
1457
1497
  } catch (err) {
1458
- const durationMs = Date.now() - startedAtMs;
1498
+ const durationMs = performance.now() - startedAtMs;
1459
1499
  if (isCallerCancellation(err, signal)) {
1500
+ if (durationMs >= this.daemonSlowQueryMs) {
1501
+ this.markDaemonCongested(durationMs, "slow query");
1502
+ }
1460
1503
  log.debug(`QMD daemon search aborted/cancelled after ${durationMs}ms`);
1461
1504
  throw isAbortError(err) ? err : abortError("QMD daemon search aborted");
1462
1505
  }
1463
1506
  if (isDaemonTimeoutError(err)) {
1507
+ this.markDaemonCongested(durationMs, "timeout");
1464
1508
  log.debug(`QMD daemon search timed out after ${durationMs}ms, falling back to subprocess`);
1465
1509
  return null;
1466
1510
  }
@@ -1468,38 +1512,37 @@ var QmdClient = class _QmdClient {
1468
1512
  return null;
1469
1513
  }
1470
1514
  }
1471
- async bm25SearchViaDaemon(query, collection, maxResults, signal) {
1515
+ async bm25SearchViaDaemon(query, collection, maxResults, signal, options) {
1472
1516
  if (!this.daemonSession || !this.daemonAvailable) return null;
1473
- const startedAtMs = Date.now();
1517
+ const startedAtMs = performance.now();
1474
1518
  const v2 = this.isQmdV2();
1475
1519
  try {
1476
1520
  let result;
1477
1521
  if (v2) {
1478
- result = await this.daemonSession.callTool(
1479
- "query",
1480
- {
1481
- searches: [{ type: "lex", query }],
1482
- collections: [collection],
1483
- limit: maxResults
1484
- },
1485
- this.daemonTimeoutMs,
1486
- signal
1487
- );
1522
+ const args = {
1523
+ searches: [{ type: "lex", query }],
1524
+ limit: maxResults
1525
+ };
1526
+ if (collection) {
1527
+ args.collections = [collection];
1528
+ }
1529
+ this.addResolvedSearchOptionsToMcpArgs(args, options);
1530
+ args.rerank = false;
1531
+ result = await this.daemonSession.callTool("query", args, this.daemonTimeoutMs, signal);
1488
1532
  } else {
1489
- result = await this.daemonSession.callTool(
1490
- "search",
1491
- { query, limit: maxResults, collection },
1492
- this.daemonTimeoutMs,
1493
- signal
1494
- );
1533
+ const args = { query, limit: maxResults };
1534
+ if (collection) {
1535
+ args.collection = collection;
1536
+ }
1537
+ result = await this.daemonSession.callTool("search", args, this.daemonTimeoutMs, signal);
1495
1538
  }
1496
- const durationMs = Date.now() - startedAtMs;
1539
+ const durationMs = performance.now() - startedAtMs;
1497
1540
  const results = parseMcpSearchResult(result);
1498
1541
  log.debug(`QMD daemon bm25: ${results.length} results in ${durationMs}ms (v2=${v2})`);
1499
1542
  this.recordDaemonSuccess();
1500
1543
  return results;
1501
1544
  } catch (err) {
1502
- const durationMs = Date.now() - startedAtMs;
1545
+ const durationMs = performance.now() - startedAtMs;
1503
1546
  if (isCallerCancellation(err, signal)) {
1504
1547
  log.debug(`QMD daemon bm25 aborted/cancelled after ${durationMs}ms`);
1505
1548
  throw isAbortError(err) ? err : abortError("QMD daemon bm25 aborted");
@@ -1514,7 +1557,10 @@ var QmdClient = class _QmdClient {
1514
1557
  }
1515
1558
  async vsearchViaDaemon(query, collection, maxResults, signal) {
1516
1559
  if (!this.daemonSession || !this.daemonAvailable) return null;
1517
- const startedAtMs = Date.now();
1560
+ if (this.isDaemonCongested()) {
1561
+ return this.bm25SearchViaDaemon(query, collection, maxResults, signal);
1562
+ }
1563
+ const startedAtMs = performance.now();
1518
1564
  const v2 = this.isQmdV2();
1519
1565
  try {
1520
1566
  let result;
@@ -1537,18 +1583,25 @@ var QmdClient = class _QmdClient {
1537
1583
  signal
1538
1584
  );
1539
1585
  }
1540
- const durationMs = Date.now() - startedAtMs;
1586
+ const durationMs = performance.now() - startedAtMs;
1541
1587
  const results = parseMcpSearchResult(result);
1588
+ if (durationMs >= this.daemonSlowQueryMs) {
1589
+ this.markDaemonCongested(durationMs, "slow query");
1590
+ }
1542
1591
  log.debug(`QMD daemon vsearch: ${results.length} results in ${durationMs}ms (v2=${v2})`);
1543
1592
  this.recordDaemonSuccess();
1544
1593
  return results;
1545
1594
  } catch (err) {
1546
- const durationMs = Date.now() - startedAtMs;
1595
+ const durationMs = performance.now() - startedAtMs;
1547
1596
  if (isCallerCancellation(err, signal)) {
1597
+ if (durationMs >= this.daemonSlowQueryMs) {
1598
+ this.markDaemonCongested(durationMs, "slow query");
1599
+ }
1548
1600
  log.debug(`QMD daemon vsearch aborted/cancelled after ${durationMs}ms`);
1549
1601
  throw isAbortError(err) ? err : abortError("QMD daemon vsearch aborted");
1550
1602
  }
1551
1603
  if (isDaemonTimeoutError(err)) {
1604
+ this.markDaemonCongested(durationMs, "timeout");
1552
1605
  log.debug(`QMD daemon vsearch timed out after ${durationMs}ms, falling back to subprocess`);
1553
1606
  return null;
1554
1607
  }
@@ -2028,6 +2081,7 @@ export {
2028
2081
  retainSharedDaemonSession,
2029
2082
  releaseSharedDaemonSession,
2030
2083
  sharedDaemonSessionCountForTest,
2084
+ daemonCongestionForTest,
2031
2085
  QmdClient
2032
2086
  };
2033
- //# sourceMappingURL=chunk-2DWTO7XP.js.map
2087
+ //# sourceMappingURL=chunk-VH4UCI3R.js.map