@remnic/core 9.3.653 → 9.3.655

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 (273) hide show
  1. package/dist/access-cli.js +24 -24
  2. package/dist/access-http.d.ts +4 -4
  3. package/dist/access-http.js +17 -17
  4. package/dist/access-mcp.d.ts +4 -4
  5. package/dist/access-mcp.js +16 -16
  6. package/dist/access-schema.d.ts +12 -12
  7. package/dist/{access-service-CdJFd3_b.d.ts → access-service-BEJvriUt.d.ts} +11 -2
  8. package/dist/access-service.d.ts +4 -4
  9. package/dist/access-service.js +15 -15
  10. package/dist/action-confidence.d.ts +1 -1
  11. package/dist/active-memory-bridge.d.ts +1 -1
  12. package/dist/active-recall.d.ts +1 -1
  13. package/dist/active-recall.js +1 -1
  14. package/dist/behavior-learner.d.ts +1 -1
  15. package/dist/behavior-signals.d.ts +1 -1
  16. package/dist/bootstrap.d.ts +3 -3
  17. package/dist/briefing.d.ts +1 -1
  18. package/dist/briefing.js +3 -3
  19. package/dist/buffer-surprise-report.d.ts +1 -1
  20. package/dist/buffer.d.ts +1 -1
  21. package/dist/calibration.d.ts +1 -1
  22. package/dist/causal-behavior.d.ts +1 -1
  23. package/dist/causal-consolidation.d.ts +1 -1
  24. package/dist/causal-consolidation.js +4 -4
  25. package/dist/{chunk-GI45G4BK.js → chunk-2RCGZ67B.js} +4 -4
  26. package/dist/{chunk-BEMWL2FZ.js → chunk-54LOUIBE.js} +2 -2
  27. package/dist/{chunk-E3J6O6N7.js → chunk-55ZMNKMQ.js} +20 -9
  28. package/dist/{chunk-E3J6O6N7.js.map → chunk-55ZMNKMQ.js.map} +1 -1
  29. package/dist/{chunk-7WEB3FLJ.js → chunk-5PLUC5OB.js} +2 -2
  30. package/dist/{chunk-SPMZZUEJ.js → chunk-5QD3QD76.js} +2684 -401
  31. package/dist/chunk-5QD3QD76.js.map +1 -0
  32. package/dist/{chunk-WLGE6KEO.js → chunk-67G4T7KI.js} +3 -3
  33. package/dist/{chunk-JX2RINDR.js → chunk-6G5JEN55.js} +2 -2
  34. package/dist/{chunk-R3PQUPQ4.js → chunk-6IMKOIZ6.js} +85 -3
  35. package/dist/chunk-6IMKOIZ6.js.map +1 -0
  36. package/dist/{chunk-KJDKZVF3.js → chunk-A3Y37UWI.js} +3 -3
  37. package/dist/{chunk-CFOCZPIQ.js → chunk-BGKXTVNG.js} +2 -2
  38. package/dist/{chunk-QQHIQ7JD.js → chunk-COVZLGMR.js} +87 -18
  39. package/dist/chunk-COVZLGMR.js.map +1 -0
  40. package/dist/{chunk-JVRPJ7D4.js → chunk-EKQMQQ3U.js} +48 -12
  41. package/dist/chunk-EKQMQQ3U.js.map +1 -0
  42. package/dist/{chunk-H3PHZLMF.js → chunk-GKKAXVAJ.js} +20 -11
  43. package/dist/chunk-GKKAXVAJ.js.map +1 -0
  44. package/dist/{chunk-JBHXMCYN.js → chunk-GRYAECRV.js} +2 -2
  45. package/dist/{chunk-EHQLDFSH.js → chunk-IQ53ZSXV.js} +2 -2
  46. package/dist/{chunk-C63WC454.js → chunk-KOI765XP.js} +125 -1
  47. package/dist/chunk-KOI765XP.js.map +1 -0
  48. package/dist/{chunk-IVYSVAC6.js → chunk-KZZ4YAEC.js} +2 -2
  49. package/dist/{chunk-2DGQLOOM.js → chunk-M3VYPE2H.js} +1 -1
  50. package/dist/{chunk-2DGQLOOM.js.map → chunk-M3VYPE2H.js.map} +1 -1
  51. package/dist/{chunk-JF7SFXTG.js → chunk-NCSJKK23.js} +2 -2
  52. package/dist/{chunk-XMN6MMTU.js → chunk-NRBGRZW4.js} +2 -2
  53. package/dist/{chunk-NOBL7OUP.js → chunk-OKW6F5S5.js} +12 -5
  54. package/dist/{chunk-NOBL7OUP.js.map → chunk-OKW6F5S5.js.map} +1 -1
  55. package/dist/{chunk-BNFRL6QW.js → chunk-PTMJ2FH2.js} +2 -2
  56. package/dist/{chunk-KWM33SPU.js → chunk-PVE7KSQP.js} +2 -2
  57. package/dist/{chunk-EW52H5EM.js → chunk-QDVQ4AN2.js} +12 -5
  58. package/dist/chunk-QDVQ4AN2.js.map +1 -0
  59. package/dist/{chunk-PYWNNF2I.js → chunk-QRSKPI62.js} +99 -66
  60. package/dist/chunk-QRSKPI62.js.map +1 -0
  61. package/dist/{chunk-YM3LR4LS.js → chunk-SSSXWIBP.js} +5 -5
  62. package/dist/{chunk-C43KEWEV.js → chunk-TDZSSJV4.js} +1 -1
  63. package/dist/chunk-TDZSSJV4.js.map +1 -0
  64. package/dist/{chunk-Y7NWBBHV.js → chunk-TEO46GMM.js} +2 -2
  65. package/dist/{chunk-AJE7FJVE.js → chunk-UCEABZZN.js} +2 -2
  66. package/dist/{chunk-IENGGY2C.js → chunk-UCEDY5M7.js} +2 -2
  67. package/dist/{chunk-PRQXUSQV.js → chunk-UYNFWZWG.js} +2 -2
  68. package/dist/{chunk-V4UDXYGG.js → chunk-WDTUYOLS.js} +2 -2
  69. package/dist/{chunk-RZOBQ23O.js → chunk-XOFXKASO.js} +2 -2
  70. package/dist/chunk-XRKQOQLY.js +212 -0
  71. package/dist/chunk-XRKQOQLY.js.map +1 -0
  72. package/dist/{chunk-WTI35CVJ.js → chunk-YYN3LIYA.js} +5 -5
  73. package/dist/{cli-DDo7Qgs-.d.ts → cli-BGahB_d3.d.ts} +3 -3
  74. package/dist/cli.d.ts +5 -5
  75. package/dist/cli.js +29 -29
  76. package/dist/compounding/engine.d.ts +1 -1
  77. package/dist/compounding/engine.js +3 -3
  78. package/dist/compounding/preference-consolidator.d.ts +1 -1
  79. package/dist/compression-optimizer.d.ts +1 -1
  80. package/dist/config.d.ts +1 -1
  81. package/dist/config.js +1 -1
  82. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  83. package/dist/connectors/codex-materialize-runner.js +3 -3
  84. package/dist/connectors/codex-materialize.d.ts +1 -1
  85. package/dist/connectors/index.d.ts +1 -1
  86. package/dist/connectors/index.js +3 -3
  87. package/dist/consolidation-provenance-check.d.ts +1 -1
  88. package/dist/consolidation-undo.d.ts +1 -1
  89. package/dist/contradiction/index.d.ts +19 -1
  90. package/dist/contradiction/index.js +1 -1
  91. package/dist/conversation-index/backend.d.ts +1 -1
  92. package/dist/conversation-index/chunker.d.ts +1 -1
  93. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  94. package/dist/conversation-index/indexer.d.ts +1 -1
  95. package/dist/conversation-index/search.d.ts +1 -1
  96. package/dist/day-summary.d.ts +1 -1
  97. package/dist/delinearize.d.ts +1 -1
  98. package/dist/direct-answer-wiring.d.ts +1 -1
  99. package/dist/direct-answer.d.ts +1 -1
  100. package/dist/embedding-fallback.d.ts +1 -1
  101. package/dist/enrichment/index.d.ts +1 -1
  102. package/dist/entity-retrieval.d.ts +1 -1
  103. package/dist/entity-retrieval.js +3 -3
  104. package/dist/entity-schema.d.ts +1 -1
  105. package/dist/explicit-capture.d.ts +3 -3
  106. package/dist/explicit-capture.js +1 -1
  107. package/dist/extraction-judge-telemetry.d.ts +1 -1
  108. package/dist/extraction-judge-training.d.ts +1 -1
  109. package/dist/extraction-judge.d.ts +1 -1
  110. package/dist/extraction.d.ts +1 -1
  111. package/dist/fallback-llm.d.ts +1 -1
  112. package/dist/identity-continuity.d.ts +1 -1
  113. package/dist/importance.d.ts +1 -1
  114. package/dist/index.d.ts +8 -8
  115. package/dist/index.js +37 -35
  116. package/dist/index.js.map +1 -1
  117. package/dist/intent.d.ts +1 -1
  118. package/dist/lcm/engine.d.ts +1 -1
  119. package/dist/lcm/index.d.ts +1 -1
  120. package/dist/lcm/tools.d.ts +1 -1
  121. package/dist/lifecycle.d.ts +1 -1
  122. package/dist/live-connectors-runner.d.ts +1 -1
  123. package/dist/local-llm.d.ts +1 -1
  124. package/dist/maintenance/memory-governance.d.ts +1 -1
  125. package/dist/maintenance/memory-governance.js +3 -3
  126. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
  127. package/dist/maintenance/rebuild-memory-projection.js +4 -4
  128. package/dist/mcp-memory-inspector-app.d.ts +4 -4
  129. package/dist/memory-action-policy.d.ts +1 -1
  130. package/dist/memory-cache.d.ts +1 -1
  131. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  132. package/dist/memory-projection-store.d.ts +1 -1
  133. package/dist/memory-provenance.d.ts +1 -1
  134. package/dist/memory-worth-outcomes.d.ts +1 -1
  135. package/dist/models-json.d.ts +1 -1
  136. package/dist/namespaces/migrate.d.ts +1 -1
  137. package/dist/namespaces/migrate.js +11 -11
  138. package/dist/namespaces/principal.d.ts +1 -1
  139. package/dist/namespaces/search.d.ts +15 -4
  140. package/dist/namespaces/search.js +7 -7
  141. package/dist/namespaces/storage.d.ts +52 -3
  142. package/dist/namespaces/storage.js +9 -5
  143. package/dist/native-knowledge.d.ts +1 -1
  144. package/dist/operator-toolkit.d.ts +1 -1
  145. package/dist/operator-toolkit.js +14 -14
  146. package/dist/{orchestrator-8fTZsa0y.d.ts → orchestrator-BgzZlWxH.d.ts} +500 -3
  147. package/dist/orchestrator.d.ts +3 -3
  148. package/dist/orchestrator.js +20 -20
  149. package/dist/patterns-cli.d.ts +1 -1
  150. package/dist/policy-runtime.d.ts +1 -1
  151. package/dist/qmd-recall-cache.d.ts +1 -1
  152. package/dist/qmd.d.ts +5 -1
  153. package/dist/qmd.js +2 -2
  154. package/dist/recall-disclosure-escalation.d.ts +1 -1
  155. package/dist/recall-explain-renderer.d.ts +1 -1
  156. package/dist/recall-explain-renderer.js +3 -3
  157. package/dist/recall-planner-llm.d.ts +1 -1
  158. package/dist/recall-state.d.ts +1 -1
  159. package/dist/recall-tag-filter.d.ts +1 -1
  160. package/dist/recall-xray-cli.d.ts +1 -1
  161. package/dist/recall-xray-cli.js +4 -4
  162. package/dist/recall-xray-renderer.d.ts +1 -1
  163. package/dist/recall-xray-renderer.js +3 -3
  164. package/dist/recall-xray.d.ts +1 -1
  165. package/dist/recall-xray.js +2 -2
  166. package/dist/{resolution-3SAP4SH2.js → resolution-IDTEBJFS.js} +2 -2
  167. package/dist/resolve-auth-token.d.ts +1 -1
  168. package/dist/resume-bundles.js +2 -2
  169. package/dist/retrieval-agents.d.ts +1 -1
  170. package/dist/retrieval-tiers.d.ts +1 -1
  171. package/dist/routing/engine.d.ts +1 -1
  172. package/dist/routing/store.d.ts +1 -1
  173. package/dist/schemas.d.ts +22 -22
  174. package/dist/search/embed-helper.d.ts +1 -1
  175. package/dist/search/factory.d.ts +1 -1
  176. package/dist/search/factory.js +6 -6
  177. package/dist/search/index.d.ts +1 -1
  178. package/dist/search/index.js +6 -6
  179. package/dist/search/lancedb-backend.d.ts +1 -1
  180. package/dist/search/lancedb-backend.js +2 -2
  181. package/dist/search/meilisearch-backend.d.ts +1 -1
  182. package/dist/search/meilisearch-backend.js +2 -2
  183. package/dist/search/noop-backend.d.ts +1 -1
  184. package/dist/search/orama-backend.d.ts +1 -1
  185. package/dist/search/orama-backend.js +2 -2
  186. package/dist/search/port.d.ts +17 -1
  187. package/dist/search/port.js +1 -1
  188. package/dist/search/remote-backend.d.ts +1 -1
  189. package/dist/{semantic-consolidation-DKdYzQOg.d.ts → semantic-consolidation-Z8d_uMq8.d.ts} +1 -1
  190. package/dist/semantic-consolidation.d.ts +2 -2
  191. package/dist/semantic-consolidation.js +4 -4
  192. package/dist/semantic-rule-promotion.js +3 -3
  193. package/dist/semantic-rule-verifier.d.ts +1 -1
  194. package/dist/semantic-rule-verifier.js +3 -3
  195. package/dist/session-observer-bands.d.ts +1 -1
  196. package/dist/session-observer-state.d.ts +1 -1
  197. package/dist/shared-context/manager.d.ts +1 -1
  198. package/dist/signal.d.ts +1 -1
  199. package/dist/storage.d.ts +1 -1
  200. package/dist/storage.js +2 -2
  201. package/dist/summarizer.d.ts +1 -1
  202. package/dist/summary-snapshot.d.ts +1 -1
  203. package/dist/temporal-supersession.d.ts +1 -1
  204. package/dist/temporal-validity.d.ts +1 -1
  205. package/dist/threading.d.ts +1 -1
  206. package/dist/tier-migration.d.ts +1 -1
  207. package/dist/tier-routing.d.ts +1 -1
  208. package/dist/topics.d.ts +1 -1
  209. package/dist/transcript.d.ts +1 -1
  210. package/dist/transfer/types.d.ts +12 -12
  211. package/dist/{types-D8yUmSik.d.ts → types-2OPlQWJG.d.ts} +23 -0
  212. package/dist/types.d.ts +1 -1
  213. package/dist/types.js +1 -1
  214. package/dist/utility-runtime.d.ts +1 -1
  215. package/dist/verified-recall.js +3 -3
  216. package/package.json +1 -1
  217. package/src/access-http.ts +7 -0
  218. package/src/access-mcp.ts +7 -0
  219. package/src/access-service.ts +12 -0
  220. package/src/cli.ts +104 -0
  221. package/src/config.test.ts +109 -0
  222. package/src/config.ts +164 -0
  223. package/src/contradiction/contradiction.test.ts +284 -0
  224. package/src/contradiction/resolution.ts +151 -4
  225. package/src/explicit-capture.ts +31 -10
  226. package/src/index.ts +10 -0
  227. package/src/maintenance/namespace-planner.test.ts +1120 -0
  228. package/src/maintenance/namespace-planner.ts +893 -0
  229. package/src/namespaces/catalog.test.ts +3356 -0
  230. package/src/namespaces/catalog.ts +2123 -0
  231. package/src/namespaces/search.test.ts +130 -2
  232. package/src/namespaces/search.ts +71 -10
  233. package/src/namespaces/storage.ts +210 -30
  234. package/src/orchestrator-flush.test.ts +720 -0
  235. package/src/orchestrator.ts +881 -239
  236. package/src/qmd-client.test.ts +59 -0
  237. package/src/qmd.ts +124 -84
  238. package/src/search/port.ts +16 -0
  239. package/src/types.ts +23 -0
  240. package/dist/chunk-C43KEWEV.js.map +0 -1
  241. package/dist/chunk-C63WC454.js.map +0 -1
  242. package/dist/chunk-EW52H5EM.js.map +0 -1
  243. package/dist/chunk-H3PHZLMF.js.map +0 -1
  244. package/dist/chunk-JVRPJ7D4.js.map +0 -1
  245. package/dist/chunk-ORGWWNJG.js +0 -131
  246. package/dist/chunk-ORGWWNJG.js.map +0 -1
  247. package/dist/chunk-PYWNNF2I.js.map +0 -1
  248. package/dist/chunk-QQHIQ7JD.js.map +0 -1
  249. package/dist/chunk-R3PQUPQ4.js.map +0 -1
  250. package/dist/chunk-SPMZZUEJ.js.map +0 -1
  251. /package/dist/{chunk-GI45G4BK.js.map → chunk-2RCGZ67B.js.map} +0 -0
  252. /package/dist/{chunk-BEMWL2FZ.js.map → chunk-54LOUIBE.js.map} +0 -0
  253. /package/dist/{chunk-7WEB3FLJ.js.map → chunk-5PLUC5OB.js.map} +0 -0
  254. /package/dist/{chunk-WLGE6KEO.js.map → chunk-67G4T7KI.js.map} +0 -0
  255. /package/dist/{chunk-JX2RINDR.js.map → chunk-6G5JEN55.js.map} +0 -0
  256. /package/dist/{chunk-KJDKZVF3.js.map → chunk-A3Y37UWI.js.map} +0 -0
  257. /package/dist/{chunk-CFOCZPIQ.js.map → chunk-BGKXTVNG.js.map} +0 -0
  258. /package/dist/{chunk-JBHXMCYN.js.map → chunk-GRYAECRV.js.map} +0 -0
  259. /package/dist/{chunk-EHQLDFSH.js.map → chunk-IQ53ZSXV.js.map} +0 -0
  260. /package/dist/{chunk-IVYSVAC6.js.map → chunk-KZZ4YAEC.js.map} +0 -0
  261. /package/dist/{chunk-JF7SFXTG.js.map → chunk-NCSJKK23.js.map} +0 -0
  262. /package/dist/{chunk-XMN6MMTU.js.map → chunk-NRBGRZW4.js.map} +0 -0
  263. /package/dist/{chunk-BNFRL6QW.js.map → chunk-PTMJ2FH2.js.map} +0 -0
  264. /package/dist/{chunk-KWM33SPU.js.map → chunk-PVE7KSQP.js.map} +0 -0
  265. /package/dist/{chunk-YM3LR4LS.js.map → chunk-SSSXWIBP.js.map} +0 -0
  266. /package/dist/{chunk-Y7NWBBHV.js.map → chunk-TEO46GMM.js.map} +0 -0
  267. /package/dist/{chunk-AJE7FJVE.js.map → chunk-UCEABZZN.js.map} +0 -0
  268. /package/dist/{chunk-IENGGY2C.js.map → chunk-UCEDY5M7.js.map} +0 -0
  269. /package/dist/{chunk-PRQXUSQV.js.map → chunk-UYNFWZWG.js.map} +0 -0
  270. /package/dist/{chunk-V4UDXYGG.js.map → chunk-WDTUYOLS.js.map} +0 -0
  271. /package/dist/{chunk-RZOBQ23O.js.map → chunk-XOFXKASO.js.map} +0 -0
  272. /package/dist/{chunk-WTI35CVJ.js.map → chunk-YYN3LIYA.js.map} +0 -0
  273. /package/dist/{resolution-3SAP4SH2.js.map → resolution-IDTEBJFS.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveEnsureCollectionArgs
3
- } from "./chunk-2DGQLOOM.js";
3
+ } from "./chunk-M3VYPE2H.js";
4
4
  import {
5
5
  launchProcess
6
6
  } from "./chunk-O75CRYGF.js";
@@ -877,9 +877,14 @@ var QmdClient = class _QmdClient {
877
877
  resetUpdateThrottles() {
878
878
  this._lastUpdateFailAtMs = null;
879
879
  this.lastUpdateRunAtMs = null;
880
+ this.lastEmbedFailAtMs = null;
880
881
  const gs = getGlobalQmdState();
881
882
  gs.lastGlobalUpdateRunAtMs = null;
882
883
  gs.lastGlobalUpdateFailAtMs = null;
884
+ gs.lastGlobalEmbedRunAtMs = null;
885
+ gs.lastGlobalEmbedFailAtMs = null;
886
+ gs.lastEmbedByCollectionMs = {};
887
+ gs.lastEmbedFailByCollectionMs = {};
883
888
  }
884
889
  updateTimeoutMs;
885
890
  updateMinIntervalMs;
@@ -1814,6 +1819,13 @@ var QmdClient = class _QmdClient {
1814
1819
  execution?.signal
1815
1820
  );
1816
1821
  }
1822
+ async updateStrict(execution) {
1823
+ await this.runUpdateForCollection(
1824
+ this.collection,
1825
+ { perCollectionThrottle: false, strict: true },
1826
+ execution?.signal
1827
+ );
1828
+ }
1817
1829
  async updateCollection(collection, execution) {
1818
1830
  await this.runUpdateForCollection(
1819
1831
  collection,
@@ -1824,7 +1836,7 @@ var QmdClient = class _QmdClient {
1824
1836
  async updateCollectionStrict(collection, execution) {
1825
1837
  await this.runUpdateForCollection(
1826
1838
  collection,
1827
- { perCollectionThrottle: true, strict: true },
1839
+ { perCollectionThrottle: true, strict: true, force: true },
1828
1840
  execution?.signal
1829
1841
  );
1830
1842
  }
@@ -1847,36 +1859,43 @@ var QmdClient = class _QmdClient {
1847
1859
  }
1848
1860
  const globalState = getGlobalQmdState();
1849
1861
  const now = Date.now();
1850
- if (!options.strict && options.perCollectionThrottle) {
1862
+ if (!options.force && options.perCollectionThrottle) {
1851
1863
  if (globalState.lastGlobalUpdateFailAtMs && now - globalState.lastGlobalUpdateFailAtMs < QMD_UPDATE_BACKOFF_MS) {
1852
1864
  log.debug("QMD update: suppressed by global failure backoff");
1865
+ if (options.strict) throw new Error("QMD update skipped by global failure backoff");
1853
1866
  return;
1854
1867
  }
1855
1868
  const lastCollectionRun = globalState.lastUpdateByCollectionMs[name];
1856
1869
  if (Number.isFinite(lastCollectionRun) && now - lastCollectionRun < this.updateMinIntervalMs) {
1857
1870
  log.debug(`QMD update: suppressed by per-collection min-interval gate (${name})`);
1871
+ if (options.strict) throw new Error("QMD update skipped by per-collection min-interval gate");
1858
1872
  return;
1859
1873
  }
1860
1874
  const lastCollectionFail = globalState.lastUpdateFailByCollectionMs[name];
1861
1875
  if (Number.isFinite(lastCollectionFail) && now - lastCollectionFail < QMD_UPDATE_BACKOFF_MS) {
1862
1876
  log.debug(`QMD update: suppressed by per-collection failure backoff (${name})`);
1877
+ if (options.strict) throw new Error("QMD update skipped by per-collection failure backoff");
1863
1878
  return;
1864
1879
  }
1865
- } else if (!options.strict) {
1880
+ } else if (!options.force) {
1866
1881
  if (this.lastUpdateRunAtMs && now - this.lastUpdateRunAtMs < this.updateMinIntervalMs) {
1867
1882
  log.debug("QMD update: suppressed due to min-interval gate");
1883
+ if (options.strict) throw new Error("QMD update skipped by min-interval gate");
1868
1884
  return;
1869
1885
  }
1870
1886
  if (this._lastUpdateFailAtMs && now - this._lastUpdateFailAtMs < QMD_UPDATE_BACKOFF_MS) {
1871
1887
  log.debug("QMD update: suppressed due to recent failures (backoff)");
1888
+ if (options.strict) throw new Error("QMD update skipped by recent failure backoff");
1872
1889
  return;
1873
1890
  }
1874
1891
  if (globalState.lastGlobalUpdateRunAtMs && now - globalState.lastGlobalUpdateRunAtMs < this.updateMinIntervalMs) {
1875
1892
  log.debug("QMD update: suppressed by global min-interval gate");
1893
+ if (options.strict) throw new Error("QMD update skipped by global min-interval gate");
1876
1894
  return;
1877
1895
  }
1878
1896
  if (globalState.lastGlobalUpdateFailAtMs && now - globalState.lastGlobalUpdateFailAtMs < QMD_UPDATE_BACKOFF_MS) {
1879
1897
  log.debug("QMD update: suppressed by global failure backoff");
1898
+ if (options.strict) throw new Error("QMD update skipped by global failure backoff");
1880
1899
  return;
1881
1900
  }
1882
1901
  }
@@ -1919,98 +1938,112 @@ var QmdClient = class _QmdClient {
1919
1938
  }
1920
1939
  }
1921
1940
  async embed() {
1922
- if (this.available === false) return;
1923
- const globalState = getGlobalQmdState();
1924
- if (this.lastEmbedFailAtMs && Date.now() - this.lastEmbedFailAtMs < QMD_EMBED_BACKOFF_MS) {
1925
- log.debug("QMD embed: suppressed due to recent failures (backoff)");
1941
+ await this.runEmbedForCollection(this.collection, { perCollectionThrottle: false });
1942
+ }
1943
+ async embedStrict() {
1944
+ await this.runEmbedForCollection(this.collection, { perCollectionThrottle: false, strict: true });
1945
+ }
1946
+ async embedCollection(collection) {
1947
+ await this.runEmbedForCollection(collection, { perCollectionThrottle: true });
1948
+ }
1949
+ async embedCollectionStrict(collection) {
1950
+ await this.runEmbedForCollection(collection, { perCollectionThrottle: true, strict: true });
1951
+ }
1952
+ async runEmbedForCollection(collection, options) {
1953
+ if (this.available === false) {
1954
+ if (options.strict) throw new Error("QMD unavailable");
1926
1955
  return;
1927
1956
  }
1928
- if (globalState.lastGlobalEmbedRunAtMs && Date.now() - globalState.lastGlobalEmbedRunAtMs < this.updateMinIntervalMs) {
1929
- log.debug("QMD embed: suppressed by global min-interval gate");
1957
+ const name = collection.trim();
1958
+ if (!name) {
1959
+ if (options.strict) throw new Error("QMD collection name is required");
1930
1960
  return;
1931
1961
  }
1932
- if (globalState.lastGlobalEmbedFailAtMs && Date.now() - globalState.lastGlobalEmbedFailAtMs < QMD_EMBED_BACKOFF_MS) {
1933
- log.debug("QMD embed: suppressed by global failure backoff");
1934
- return;
1962
+ const globalState = getGlobalQmdState();
1963
+ const now = Date.now();
1964
+ if (options.perCollectionThrottle) {
1965
+ if (globalState.lastGlobalEmbedFailAtMs && now - globalState.lastGlobalEmbedFailAtMs < QMD_EMBED_BACKOFF_MS) {
1966
+ log.debug(`QMD embed: suppressed by global failure backoff (${name})`);
1967
+ if (options.strict) throw new Error("QMD embed skipped by global failure backoff");
1968
+ return;
1969
+ }
1970
+ const lastCollectionRun = globalState.lastEmbedByCollectionMs[name];
1971
+ if (Number.isFinite(lastCollectionRun) && now - lastCollectionRun < this.updateMinIntervalMs) {
1972
+ log.debug(`QMD embed: suppressed by per-collection min-interval gate (${name})`);
1973
+ if (options.strict) throw new Error("QMD embed skipped by per-collection min-interval gate");
1974
+ return;
1975
+ }
1976
+ const lastCollectionFail = globalState.lastEmbedFailByCollectionMs[name];
1977
+ if (Number.isFinite(lastCollectionFail) && now - lastCollectionFail < QMD_EMBED_BACKOFF_MS) {
1978
+ log.debug(`QMD embed: suppressed by per-collection failure backoff (${name})`);
1979
+ if (options.strict) throw new Error("QMD embed skipped by per-collection failure backoff");
1980
+ return;
1981
+ }
1982
+ } else {
1983
+ if (this.lastEmbedFailAtMs && now - this.lastEmbedFailAtMs < QMD_EMBED_BACKOFF_MS) {
1984
+ log.debug("QMD embed: suppressed due to recent failures (backoff)");
1985
+ if (options.strict) throw new Error("QMD embed skipped by recent failure backoff");
1986
+ return;
1987
+ }
1988
+ if (globalState.lastGlobalEmbedRunAtMs && now - globalState.lastGlobalEmbedRunAtMs < this.updateMinIntervalMs) {
1989
+ log.debug("QMD embed: suppressed by global min-interval gate");
1990
+ if (options.strict) throw new Error("QMD embed skipped by global min-interval gate");
1991
+ return;
1992
+ }
1993
+ if (globalState.lastGlobalEmbedFailAtMs && now - globalState.lastGlobalEmbedFailAtMs < QMD_EMBED_BACKOFF_MS) {
1994
+ log.debug("QMD embed: suppressed by global failure backoff");
1995
+ if (options.strict) throw new Error("QMD embed skipped by global failure backoff");
1996
+ return;
1997
+ }
1935
1998
  }
1936
1999
  try {
1937
2000
  const startedAtMs = Date.now();
1938
- await this.runQmdCommand(this.buildEmbedArgs(this.collection), 3e5);
2001
+ await this.runQmdCommand(this.buildEmbedArgs(name), 3e5);
1939
2002
  const durationMs = Date.now() - startedAtMs;
1940
2003
  if (this.slowLog?.enabled && durationMs >= this.slowLog.thresholdMs) {
1941
2004
  log.warn(`SLOW QMD embed: durationMs=${durationMs}`);
1942
2005
  }
1943
- globalState.lastGlobalEmbedRunAtMs = Date.now();
1944
- log.debug("QMD embed completed");
1945
- } catch (err) {
1946
- if (isVectorDimensionMismatchError(err)) {
1947
- try {
1948
- log.warn("QMD embed hit a vector dimension mismatch; retrying with force re-embed");
1949
- await this.runQmdCommand(this.buildEmbedArgs(this.collection, true), 3e5);
1950
- globalState.lastGlobalEmbedRunAtMs = Date.now();
1951
- this.lastEmbedFailAtMs = null;
1952
- globalState.lastGlobalEmbedFailAtMs = null;
1953
- log.warn("QMD embed recovered by forcing a full vector rebuild");
1954
- return;
1955
- } catch (retryErr) {
1956
- const retryMsg = retryErr instanceof Error ? retryErr.message : String(retryErr);
1957
- log.warn(`QMD force re-embed failed after dimension mismatch: ${retryMsg}`);
1958
- }
1959
- }
1960
- const now = Date.now();
1961
- this.lastEmbedFailAtMs = now;
1962
- globalState.lastGlobalEmbedFailAtMs = now;
1963
- const msg = err instanceof Error ? err.message : String(err);
1964
- log.warn(`QMD embed failed: ${msg}`);
1965
- }
1966
- }
1967
- async embedCollection(collection) {
1968
- if (this.available === false) return;
1969
- const name = collection.trim();
1970
- if (!name) return;
1971
- const globalState = getGlobalQmdState();
1972
- const now = Date.now();
1973
- if (globalState.lastGlobalEmbedFailAtMs && now - globalState.lastGlobalEmbedFailAtMs < QMD_EMBED_BACKOFF_MS) {
1974
- log.debug(`QMD embed: suppressed by global failure backoff (${name})`);
1975
- return;
1976
- }
1977
- const lastCollectionRun = globalState.lastEmbedByCollectionMs[name];
1978
- if (Number.isFinite(lastCollectionRun) && now - lastCollectionRun < this.updateMinIntervalMs) {
1979
- log.debug(`QMD embed: suppressed by per-collection min-interval gate (${name})`);
1980
- return;
1981
- }
1982
- const lastCollectionFail = globalState.lastEmbedFailByCollectionMs[name];
1983
- if (Number.isFinite(lastCollectionFail) && now - lastCollectionFail < QMD_EMBED_BACKOFF_MS) {
1984
- log.debug(`QMD embed: suppressed by per-collection failure backoff (${name})`);
1985
- return;
1986
- }
1987
- try {
1988
- await this.runQmdCommand(this.buildEmbedArgs(name), 3e5);
1989
2006
  const at = Date.now();
1990
- globalState.lastEmbedByCollectionMs[name] = at;
2007
+ if (options.perCollectionThrottle) {
2008
+ globalState.lastEmbedByCollectionMs[name] = at;
2009
+ }
1991
2010
  globalState.lastGlobalEmbedRunAtMs = at;
2011
+ log.debug(`QMD embed completed for collection=${name}`);
1992
2012
  } catch (err) {
2013
+ let failure = err;
1993
2014
  if (isVectorDimensionMismatchError(err)) {
1994
2015
  try {
1995
2016
  log.warn(`QMD embed for collection ${name} hit a vector dimension mismatch; retrying with force re-embed`);
1996
2017
  await this.runQmdCommand(this.buildEmbedArgs(name, true), 3e5);
1997
2018
  const recoveredAt = Date.now();
1998
- globalState.lastEmbedByCollectionMs[name] = recoveredAt;
2019
+ if (options.perCollectionThrottle) {
2020
+ globalState.lastEmbedByCollectionMs[name] = recoveredAt;
2021
+ delete globalState.lastEmbedFailByCollectionMs[name];
2022
+ } else {
2023
+ this.lastEmbedFailAtMs = null;
2024
+ }
1999
2025
  globalState.lastGlobalEmbedRunAtMs = recoveredAt;
2000
- delete globalState.lastEmbedFailByCollectionMs[name];
2001
2026
  globalState.lastGlobalEmbedFailAtMs = null;
2002
2027
  log.warn(`QMD embed for collection ${name} recovered by forcing a full vector rebuild`);
2003
2028
  return;
2004
2029
  } catch (retryErr) {
2030
+ failure = retryErr;
2005
2031
  const retryMsg = retryErr instanceof Error ? retryErr.message : String(retryErr);
2006
2032
  log.warn(`QMD force re-embed failed for collection ${name}: ${retryMsg}`);
2007
2033
  }
2008
2034
  }
2009
2035
  const at = Date.now();
2010
- globalState.lastEmbedFailByCollectionMs[name] = at;
2036
+ if (options.perCollectionThrottle) {
2037
+ globalState.lastEmbedFailByCollectionMs[name] = at;
2038
+ } else {
2039
+ this.lastEmbedFailAtMs = at;
2040
+ }
2011
2041
  globalState.lastGlobalEmbedFailAtMs = at;
2012
- const msg = err instanceof Error ? err.message : String(err);
2042
+ const msg = failure instanceof Error ? failure.message : String(failure);
2013
2043
  log.warn(`QMD embed failed for collection ${name}: ${msg}`);
2044
+ if (options.strict) {
2045
+ throw failure;
2046
+ }
2014
2047
  }
2015
2048
  }
2016
2049
  async checkCollection(collectionOrExecution, execution) {
@@ -2103,4 +2136,4 @@ export {
2103
2136
  getQmdCommandName,
2104
2137
  QmdClient
2105
2138
  };
2106
- //# sourceMappingURL=chunk-PYWNNF2I.js.map
2139
+ //# sourceMappingURL=chunk-QRSKPI62.js.map