@remnic/core 9.3.660 → 9.3.662

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 (180) hide show
  1. package/dist/access-cli.js +10 -10
  2. package/dist/access-http.d.ts +5 -5
  3. package/dist/access-http.js +10 -10
  4. package/dist/access-mcp.d.ts +5 -5
  5. package/dist/access-mcp.js +9 -9
  6. package/dist/{access-service-D_nbpexW.d.ts → access-service-D0SLB4MH.d.ts} +2 -2
  7. package/dist/access-service.d.ts +5 -5
  8. package/dist/access-service.js +8 -8
  9. package/dist/action-confidence.d.ts +1 -1
  10. package/dist/active-memory-bridge.d.ts +1 -1
  11. package/dist/active-recall.d.ts +1 -1
  12. package/dist/behavior-learner.d.ts +1 -1
  13. package/dist/behavior-signals.d.ts +1 -1
  14. package/dist/bootstrap.d.ts +3 -3
  15. package/dist/briefing.d.ts +1 -1
  16. package/dist/buffer-surprise-report.d.ts +1 -1
  17. package/dist/buffer.d.ts +1 -1
  18. package/dist/calibration.d.ts +1 -1
  19. package/dist/causal-behavior.d.ts +1 -1
  20. package/dist/causal-consolidation.d.ts +1 -1
  21. package/dist/{chunk-7H7J3ZWN.js → chunk-2KDQI363.js} +2 -2
  22. package/dist/{chunk-R2EBP6CM.js → chunk-35HP3TGR.js} +5 -5
  23. package/dist/{chunk-FWIROLS6.js → chunk-44VFF3BB.js} +18 -16
  24. package/dist/chunk-44VFF3BB.js.map +1 -0
  25. package/dist/{chunk-OYXVENIS.js → chunk-4KDLCMLK.js} +3 -3
  26. package/dist/{chunk-MO77TWPS.js → chunk-5AYAZN45.js} +2 -2
  27. package/dist/{chunk-7PCZGNG2.js → chunk-6RHNCKHG.js} +113 -24
  28. package/dist/chunk-6RHNCKHG.js.map +1 -0
  29. package/dist/{chunk-RP2U54GG.js → chunk-DFAXGZKI.js} +2 -2
  30. package/dist/{chunk-6G5JEN55.js → chunk-FZC2WSDB.js} +2 -2
  31. package/dist/{chunk-2EVZ5EN6.js → chunk-HSCJYHYV.js} +6 -6
  32. package/dist/{chunk-B57QYSWN.js → chunk-TGOOJCGA.js} +109 -16
  33. package/dist/chunk-TGOOJCGA.js.map +1 -0
  34. package/dist/{chunk-UNLHHTKN.js → chunk-WOQIHC67.js} +10 -2
  35. package/dist/chunk-WOQIHC67.js.map +1 -0
  36. package/dist/{chunk-5PLUC5OB.js → chunk-WSQG37DV.js} +2 -2
  37. package/dist/{chunk-M3VYPE2H.js → chunk-YNQ6DFSV.js} +1 -1
  38. package/dist/chunk-YNQ6DFSV.js.map +1 -0
  39. package/dist/{chunk-256W7AXC.js → chunk-YYQRVNSV.js} +2 -2
  40. package/dist/{chunk-GRYAECRV.js → chunk-ZJH723NM.js} +2 -2
  41. package/dist/{cli-aYxSuPvP.d.ts → cli-C6twwe84.d.ts} +3 -3
  42. package/dist/cli.d.ts +5 -5
  43. package/dist/cli.js +13 -13
  44. package/dist/compounding/engine.d.ts +1 -1
  45. package/dist/compounding/preference-consolidator.d.ts +1 -1
  46. package/dist/compression-optimizer.d.ts +1 -1
  47. package/dist/config.d.ts +1 -1
  48. package/dist/connectors/codex-materialize-runner.d.ts +1 -1
  49. package/dist/connectors/codex-materialize.d.ts +1 -1
  50. package/dist/connectors/index.d.ts +1 -1
  51. package/dist/consolidation-provenance-check.d.ts +1 -1
  52. package/dist/consolidation-undo.d.ts +1 -1
  53. package/dist/contradiction/index.d.ts +1 -1
  54. package/dist/conversation-index/backend.d.ts +1 -1
  55. package/dist/conversation-index/chunker.d.ts +1 -1
  56. package/dist/conversation-index/faiss-adapter.d.ts +1 -1
  57. package/dist/conversation-index/indexer.d.ts +1 -1
  58. package/dist/conversation-index/search.d.ts +1 -1
  59. package/dist/day-summary.d.ts +1 -1
  60. package/dist/delinearize.d.ts +1 -1
  61. package/dist/direct-answer-wiring.d.ts +1 -1
  62. package/dist/direct-answer.d.ts +1 -1
  63. package/dist/embedding-fallback.d.ts +1 -1
  64. package/dist/enrichment/index.d.ts +1 -1
  65. package/dist/entity-retrieval.d.ts +1 -1
  66. package/dist/entity-schema.d.ts +1 -1
  67. package/dist/explicit-capture.d.ts +3 -3
  68. package/dist/extraction-judge-telemetry.d.ts +1 -1
  69. package/dist/extraction-judge-training.d.ts +1 -1
  70. package/dist/extraction-judge.d.ts +1 -1
  71. package/dist/extraction.d.ts +1 -1
  72. package/dist/fallback-llm.d.ts +1 -1
  73. package/dist/identity-continuity.d.ts +1 -1
  74. package/dist/importance.d.ts +1 -1
  75. package/dist/index.d.ts +8 -8
  76. package/dist/index.js +15 -15
  77. package/dist/intent.d.ts +1 -1
  78. package/dist/lcm/engine.d.ts +1 -1
  79. package/dist/lcm/index.d.ts +1 -1
  80. package/dist/lcm/tools.d.ts +1 -1
  81. package/dist/lifecycle.d.ts +1 -1
  82. package/dist/live-connectors-runner.d.ts +1 -1
  83. package/dist/local-llm.d.ts +1 -1
  84. package/dist/maintenance/memory-governance.d.ts +1 -1
  85. package/dist/mcp-memory-inspector-app.d.ts +5 -5
  86. package/dist/memory-action-policy.d.ts +1 -1
  87. package/dist/memory-cache.d.ts +1 -1
  88. package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
  89. package/dist/memory-projection-store.d.ts +1 -1
  90. package/dist/memory-provenance.d.ts +1 -1
  91. package/dist/memory-worth-outcomes.d.ts +1 -1
  92. package/dist/models-json.d.ts +1 -1
  93. package/dist/namespaces/migrate.d.ts +1 -1
  94. package/dist/namespaces/migrate.js +8 -8
  95. package/dist/namespaces/principal.d.ts +1 -1
  96. package/dist/namespaces/search.d.ts +1 -1
  97. package/dist/namespaces/search.js +7 -7
  98. package/dist/namespaces/storage.d.ts +1 -1
  99. package/dist/native-knowledge.d.ts +1 -1
  100. package/dist/operator-toolkit.d.ts +1 -1
  101. package/dist/operator-toolkit.js +9 -9
  102. package/dist/{orchestrator-D1wcmPNj.d.ts → orchestrator-Cg1UkvmO.d.ts} +2 -2
  103. package/dist/orchestrator.d.ts +3 -3
  104. package/dist/orchestrator.js +9 -9
  105. package/dist/patterns-cli.d.ts +1 -1
  106. package/dist/policy-runtime.d.ts +1 -1
  107. package/dist/qmd-recall-cache.d.ts +1 -1
  108. package/dist/qmd.d.ts +50 -2
  109. package/dist/qmd.js +8 -2
  110. package/dist/recall-disclosure-escalation.d.ts +1 -1
  111. package/dist/recall-explain-renderer.d.ts +2 -1
  112. package/dist/recall-planner-llm.d.ts +1 -1
  113. package/dist/recall-state.d.ts +17 -1
  114. package/dist/recall-state.js +1 -1
  115. package/dist/recall-tag-filter.d.ts +1 -1
  116. package/dist/recall-xray-cli.d.ts +1 -1
  117. package/dist/recall-xray-renderer.d.ts +1 -1
  118. package/dist/recall-xray.d.ts +1 -1
  119. package/dist/resolve-auth-token.d.ts +1 -1
  120. package/dist/retrieval-agents.d.ts +1 -1
  121. package/dist/retrieval-tiers.d.ts +1 -1
  122. package/dist/routing/engine.d.ts +1 -1
  123. package/dist/routing/store.d.ts +1 -1
  124. package/dist/search/embed-helper.d.ts +1 -1
  125. package/dist/search/factory.d.ts +1 -1
  126. package/dist/search/factory.js +6 -6
  127. package/dist/search/index.d.ts +1 -1
  128. package/dist/search/index.js +6 -6
  129. package/dist/search/lancedb-backend.d.ts +1 -1
  130. package/dist/search/lancedb-backend.js +2 -2
  131. package/dist/search/meilisearch-backend.d.ts +1 -1
  132. package/dist/search/meilisearch-backend.js +2 -2
  133. package/dist/search/noop-backend.d.ts +1 -1
  134. package/dist/search/orama-backend.d.ts +1 -1
  135. package/dist/search/orama-backend.js +2 -2
  136. package/dist/search/port.d.ts +21 -2
  137. package/dist/search/port.js +1 -1
  138. package/dist/search/remote-backend.d.ts +1 -1
  139. package/dist/{semantic-consolidation-MWOdNtSE.d.ts → semantic-consolidation-BICZvQ3C.d.ts} +1 -1
  140. package/dist/semantic-consolidation.d.ts +2 -2
  141. package/dist/semantic-rule-verifier.d.ts +1 -1
  142. package/dist/session-observer-bands.d.ts +1 -1
  143. package/dist/session-observer-state.d.ts +1 -1
  144. package/dist/shared-context/manager.d.ts +1 -1
  145. package/dist/signal.d.ts +1 -1
  146. package/dist/storage.d.ts +1 -1
  147. package/dist/summarizer.d.ts +1 -1
  148. package/dist/summary-snapshot.d.ts +1 -1
  149. package/dist/temporal-supersession.d.ts +1 -1
  150. package/dist/temporal-validity.d.ts +1 -1
  151. package/dist/threading.d.ts +1 -1
  152. package/dist/tier-migration.d.ts +1 -1
  153. package/dist/tier-routing.d.ts +1 -1
  154. package/dist/topics.d.ts +1 -1
  155. package/dist/transcript.d.ts +1 -1
  156. package/dist/{types-CgcCpUrf.d.ts → types-D96bCB3C.d.ts} +1 -1
  157. package/dist/types.d.ts +1 -1
  158. package/dist/utility-runtime.d.ts +1 -1
  159. package/package.json +3 -2
  160. package/scripts/build-with-heap.mjs +25 -0
  161. package/src/namespaces/search.ts +16 -0
  162. package/src/orchestrator.ts +144 -3
  163. package/src/qmd.ts +137 -18
  164. package/src/recall-state.ts +47 -21
  165. package/src/search/port.ts +25 -0
  166. package/dist/chunk-7PCZGNG2.js.map +0 -1
  167. package/dist/chunk-B57QYSWN.js.map +0 -1
  168. package/dist/chunk-FWIROLS6.js.map +0 -1
  169. package/dist/chunk-M3VYPE2H.js.map +0 -1
  170. package/dist/chunk-UNLHHTKN.js.map +0 -1
  171. /package/dist/{chunk-7H7J3ZWN.js.map → chunk-2KDQI363.js.map} +0 -0
  172. /package/dist/{chunk-R2EBP6CM.js.map → chunk-35HP3TGR.js.map} +0 -0
  173. /package/dist/{chunk-OYXVENIS.js.map → chunk-4KDLCMLK.js.map} +0 -0
  174. /package/dist/{chunk-MO77TWPS.js.map → chunk-5AYAZN45.js.map} +0 -0
  175. /package/dist/{chunk-RP2U54GG.js.map → chunk-DFAXGZKI.js.map} +0 -0
  176. /package/dist/{chunk-6G5JEN55.js.map → chunk-FZC2WSDB.js.map} +0 -0
  177. /package/dist/{chunk-2EVZ5EN6.js.map → chunk-HSCJYHYV.js.map} +0 -0
  178. /package/dist/{chunk-5PLUC5OB.js.map → chunk-WSQG37DV.js.map} +0 -0
  179. /package/dist/{chunk-256W7AXC.js.map → chunk-YYQRVNSV.js.map} +0 -0
  180. /package/dist/{chunk-GRYAECRV.js.map → chunk-ZJH723NM.js.map} +0 -0
@@ -6,10 +6,10 @@ import {
6
6
  } from "./chunk-7WV3F5DQ.js";
7
7
  import {
8
8
  EngramMcpServer
9
- } from "./chunk-7H7J3ZWN.js";
9
+ } from "./chunk-2KDQI363.js";
10
10
  import {
11
11
  EngramAccessInputError
12
- } from "./chunk-RP2U54GG.js";
12
+ } from "./chunk-DFAXGZKI.js";
13
13
  import {
14
14
  projectTagProjectId
15
15
  } from "./chunk-GYSYLGNE.js";
@@ -2030,4 +2030,4 @@ function positiveIntQueryParam(value, label) {
2030
2030
  export {
2031
2031
  EngramAccessHttpServer
2032
2032
  };
2033
- //# sourceMappingURL=chunk-OYXVENIS.js.map
2033
+ //# sourceMappingURL=chunk-4KDLCMLK.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  listNamespaces
3
- } from "./chunk-256W7AXC.js";
3
+ } from "./chunk-YYQRVNSV.js";
4
4
  import {
5
5
  runConsolidationProvenanceCheck
6
6
  } from "./chunk-AL4RAJL5.js";
@@ -1336,4 +1336,4 @@ export {
1336
1336
  runBenchmarkRecall,
1337
1337
  runOperatorRepair
1338
1338
  };
1339
- //# sourceMappingURL=chunk-MO77TWPS.js.map
1339
+ //# sourceMappingURL=chunk-5AYAZN45.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveEnsureCollectionArgs
3
- } from "./chunk-M3VYPE2H.js";
3
+ } from "./chunk-YNQ6DFSV.js";
4
4
  import {
5
5
  launchProcess
6
6
  } from "./chunk-O75CRYGF.js";
@@ -832,6 +832,7 @@ async function releaseSharedDaemonSession(session) {
832
832
  return;
833
833
  }
834
834
  }
835
+ var sharedDaemonSessionCountForTest = () => SHARED_DAEMON_SESSIONS.size;
835
836
  var QmdClient = class _QmdClient {
836
837
  constructor(collection, maxResults, opts) {
837
838
  this.collection = collection;
@@ -1421,7 +1422,10 @@ var QmdClient = class _QmdClient {
1421
1422
  const trimmed = query.trim();
1422
1423
  if (!trimmed) return [];
1423
1424
  await this.maybeProbeDaemon();
1424
- if (!this.isAvailable()) return [];
1425
+ if (!this.isAvailable()) {
1426
+ this.notifyDegradation(execution?.onDegradation, "backend_unavailable");
1427
+ return [];
1428
+ }
1425
1429
  const col = collection ?? this.collection;
1426
1430
  const n = maxResults ?? this.maxResults;
1427
1431
  const searchOptions = this.resolveSearchOptions(options);
@@ -1450,22 +1454,40 @@ var QmdClient = class _QmdClient {
1450
1454
  setCachedQmdSearch(cacheKey, results);
1451
1455
  return results;
1452
1456
  }
1453
- log.debug("QMD daemon search timed out/failed; skipping subprocess (daemon-only mode)");
1457
+ log.warn("QMD daemon search timed out/failed; skipping subprocess (daemon-only mode)");
1458
+ this.notifyDegradation(execution?.onDegradation, "daemon_timeout");
1454
1459
  return [];
1455
1460
  }
1456
1461
  if (this.daemonSession?.isLoading()) {
1457
1462
  log.debug("QMD search: daemon loading, skipping subprocess");
1463
+ this.notifyDegradation(execution?.onDegradation, "daemon_loading");
1458
1464
  return [];
1459
1465
  }
1460
- const subprocessResults = await this.searchViaSubprocess(trimmed, col, n, searchOptions, execution?.signal);
1461
- setCachedQmdSearch(cacheKey, subprocessResults);
1466
+ let subprocessDegraded = false;
1467
+ const subprocessResults = await this.searchViaSubprocess(
1468
+ trimmed,
1469
+ col,
1470
+ n,
1471
+ searchOptions,
1472
+ execution?.signal,
1473
+ (degradation) => {
1474
+ subprocessDegraded = true;
1475
+ this.notifyDegradation(execution?.onDegradation, degradation.code, degradation.detail);
1476
+ }
1477
+ );
1478
+ if (!subprocessDegraded) {
1479
+ setCachedQmdSearch(cacheKey, subprocessResults);
1480
+ }
1462
1481
  return subprocessResults;
1463
1482
  }
1464
1483
  async searchGlobal(query, maxResults, execution) {
1465
1484
  const trimmed = query.trim();
1466
1485
  if (!trimmed) return [];
1467
1486
  await this.maybeProbeDaemon();
1468
- if (!this.isAvailable()) return [];
1487
+ if (!this.isAvailable()) {
1488
+ this.notifyDegradation(execution?.onDegradation, "backend_unavailable");
1489
+ return [];
1490
+ }
1469
1491
  const n = maxResults ?? 6;
1470
1492
  const searchOptions = this.resolveSearchOptions();
1471
1493
  if (this.daemonAvailable) {
@@ -1484,14 +1506,22 @@ var QmdClient = class _QmdClient {
1484
1506
  }
1485
1507
  return results;
1486
1508
  }
1487
- log.debug("QMD daemon global search timed out/failed; skipping subprocess (daemon-only mode)");
1509
+ log.warn("QMD daemon global search timed out/failed; skipping subprocess (daemon-only mode)");
1510
+ this.notifyDegradation(execution?.onDegradation, "daemon_timeout");
1488
1511
  return [];
1489
1512
  }
1490
1513
  if (this.daemonSession?.isLoading()) {
1491
1514
  log.debug("QMD searchGlobal: daemon loading, skipping subprocess");
1515
+ this.notifyDegradation(execution?.onDegradation, "daemon_loading");
1492
1516
  return [];
1493
1517
  }
1494
- return this.searchGlobalViaSubprocess(trimmed, n, searchOptions, execution?.signal);
1518
+ return this.searchGlobalViaSubprocess(
1519
+ trimmed,
1520
+ n,
1521
+ searchOptions,
1522
+ execution?.signal,
1523
+ execution?.onDegradation
1524
+ );
1495
1525
  }
1496
1526
  /**
1497
1527
  * BM25 keyword search (fast, ~0.3s). Uses `qmd search`.
@@ -1500,7 +1530,10 @@ var QmdClient = class _QmdClient {
1500
1530
  const trimmed = query.trim();
1501
1531
  if (!trimmed) return [];
1502
1532
  await this.maybeProbeDaemon();
1503
- if (!this.isAvailable()) return [];
1533
+ if (!this.isAvailable()) {
1534
+ this.notifyDegradation(execution?.onDegradation, "backend_unavailable");
1535
+ return [];
1536
+ }
1504
1537
  const col = collection ?? this.collection;
1505
1538
  const n = maxResults ?? this.maxResults;
1506
1539
  if (this.daemonAvailable && this.daemonSession) {
@@ -1519,14 +1552,16 @@ var QmdClient = class _QmdClient {
1519
1552
  }
1520
1553
  return results;
1521
1554
  }
1522
- log.debug("QMD daemon bm25 timed out/failed; skipping subprocess (daemon-only mode)");
1555
+ log.warn("QMD daemon bm25 timed out/failed; skipping subprocess (daemon-only mode)");
1556
+ this.notifyDegradation(execution?.onDegradation, "daemon_timeout");
1523
1557
  return [];
1524
1558
  }
1525
1559
  if (this.daemonSession?.isLoading()) {
1526
1560
  log.debug("QMD bm25: daemon loading, skipping subprocess");
1561
+ this.notifyDegradation(execution?.onDegradation, "daemon_loading");
1527
1562
  return [];
1528
1563
  }
1529
- return this.bm25SearchViaSubprocess(trimmed, col, n, execution?.signal);
1564
+ return this.bm25SearchViaSubprocess(trimmed, col, n, execution?.signal, execution?.onDegradation);
1530
1565
  }
1531
1566
  /**
1532
1567
  * Vector similarity search (~3-4s). Uses `qmd vsearch`.
@@ -1535,7 +1570,10 @@ var QmdClient = class _QmdClient {
1535
1570
  const trimmed = query.trim();
1536
1571
  if (!trimmed) return [];
1537
1572
  await this.maybeProbeDaemon();
1538
- if (!this.isAvailable()) return [];
1573
+ if (!this.isAvailable()) {
1574
+ this.notifyDegradation(execution?.onDegradation, "backend_unavailable");
1575
+ return [];
1576
+ }
1539
1577
  const col = collection ?? this.collection;
1540
1578
  const n = maxResults ?? this.maxResults;
1541
1579
  if (this.daemonAvailable && this.daemonSession) {
@@ -1554,14 +1592,16 @@ var QmdClient = class _QmdClient {
1554
1592
  }
1555
1593
  return results;
1556
1594
  }
1557
- log.debug("QMD daemon vsearch timed out/failed; skipping subprocess (daemon-only mode)");
1595
+ log.warn("QMD daemon vsearch timed out/failed; skipping subprocess (daemon-only mode)");
1596
+ this.notifyDegradation(execution?.onDegradation, "daemon_timeout");
1558
1597
  return [];
1559
1598
  }
1560
1599
  if (this.daemonSession?.isLoading()) {
1561
1600
  log.debug("QMD vsearch: daemon loading, skipping subprocess");
1601
+ this.notifyDegradation(execution?.onDegradation, "daemon_loading");
1562
1602
  return [];
1563
1603
  }
1564
- return this.vsearchViaSubprocess(trimmed, col, n, execution?.signal);
1604
+ return this.vsearchViaSubprocess(trimmed, col, n, execution?.signal, execution?.onDegradation);
1565
1605
  }
1566
1606
  /**
1567
1607
  * Hybrid search: runs BM25 + vector in parallel, merges/dedupes by path
@@ -1721,10 +1761,48 @@ var QmdClient = class _QmdClient {
1721
1761
  return null;
1722
1762
  }
1723
1763
  }
1724
- async searchViaSubprocess(query, collection, maxResults, options, signal) {
1764
+ /**
1765
+ * Report a backend degradation to the caller's observer (#1536): an empty
1766
+ * result caused by unavailability/loading/timeout is otherwise
1767
+ * indistinguishable from "no matches" (CLAUDE.md rule 34). Observer
1768
+ * failures are swallowed — observability must never break search.
1769
+ */
1770
+ notifyDegradation(onDegradation, code, detail) {
1771
+ if (!onDegradation) return;
1772
+ try {
1773
+ onDegradation({ backend: "qmd", code, ...detail !== void 0 ? { detail } : {} });
1774
+ } catch (err) {
1775
+ log.debug(`QMD degradation observer threw: ${err}`);
1776
+ }
1777
+ }
1778
+ /**
1779
+ * Condense an error into a degradation `detail` string that is safe to
1780
+ * serialize on LastRecallSnapshot and expose via last-recall MCP/HTTP
1781
+ * surfaces (cursor review on #1544): first line only, path-like tokens
1782
+ * redacted (absolute, home-rooted, and Windows drive paths can leak
1783
+ * usernames and filesystem layout), capped at 160 chars. The unredacted
1784
+ * error still reaches operators via the warn log at the failure site.
1785
+ */
1786
+ degradationDetail(err, sensitive) {
1787
+ let message = String(err instanceof Error ? err.message : err);
1788
+ for (const value of sensitive ?? []) {
1789
+ if (typeof value !== "string" || value.length === 0) continue;
1790
+ message = message.split(value).join("<query>");
1791
+ for (const fragment of value.split("\n")) {
1792
+ const trimmed = fragment.trim();
1793
+ if (trimmed.length >= 4) {
1794
+ message = message.split(trimmed).join("<query>");
1795
+ }
1796
+ }
1797
+ }
1798
+ const firstLine = message.split("\n")[0] ?? "";
1799
+ const redacted = firstLine.replace(/(?:~|\/|[A-Za-z]:\\)[^\s'"`]+/g, "<path>");
1800
+ return redacted.length > 160 ? `${redacted.slice(0, 159)}\u2026` : redacted;
1801
+ }
1802
+ async searchViaSubprocess(query, collection, maxResults, options, signal, onDegradation) {
1725
1803
  if (this.available === false) return [];
1726
1804
  if (this.qmdSubprocessStrategy === "search") {
1727
- return this.bm25SearchViaSubprocess(query, collection, maxResults, signal);
1805
+ return this.bm25SearchViaSubprocess(query, collection, maxResults, signal, onDegradation);
1728
1806
  }
1729
1807
  const startedAtMs = Date.now();
1730
1808
  try {
@@ -1744,11 +1822,13 @@ var QmdClient = class _QmdClient {
1744
1822
  if (isCallerCancellation(err, signal)) {
1745
1823
  throw isAbortError(err) ? err : abortError("QMD subprocess search aborted");
1746
1824
  }
1747
- log.debug(`QMD search failed: ${err}`);
1825
+ const detail = this.degradationDetail(err, [query]);
1826
+ log.warn(`QMD subprocess search failed (returning empty): ${detail}`);
1827
+ this.notifyDegradation(onDegradation, "subprocess_error", detail);
1748
1828
  return [];
1749
1829
  }
1750
1830
  }
1751
- async bm25SearchViaSubprocess(query, collection, maxResults, signal) {
1831
+ async bm25SearchViaSubprocess(query, collection, maxResults, signal, onDegradation) {
1752
1832
  if (this.available === false) return [];
1753
1833
  const startedAtMs = Date.now();
1754
1834
  try {
@@ -1762,11 +1842,13 @@ var QmdClient = class _QmdClient {
1762
1842
  if (isCallerCancellation(err, signal)) {
1763
1843
  throw isAbortError(err) ? err : abortError("QMD subprocess bm25 aborted");
1764
1844
  }
1765
- log.debug(`QMD bm25 search failed: ${err}`);
1845
+ const detail = this.degradationDetail(err, [query]);
1846
+ log.warn(`QMD bm25 subprocess search failed (returning empty): ${detail}`);
1847
+ this.notifyDegradation(onDegradation, "subprocess_error", detail);
1766
1848
  return [];
1767
1849
  }
1768
1850
  }
1769
- async vsearchViaSubprocess(query, collection, maxResults, signal) {
1851
+ async vsearchViaSubprocess(query, collection, maxResults, signal, onDegradation) {
1770
1852
  if (this.available === false) return [];
1771
1853
  const startedAtMs = Date.now();
1772
1854
  try {
@@ -1781,11 +1863,13 @@ var QmdClient = class _QmdClient {
1781
1863
  if (isCallerCancellation(err, signal)) {
1782
1864
  throw isAbortError(err) ? err : abortError("QMD subprocess vsearch aborted");
1783
1865
  }
1784
- log.debug(`QMD vsearch failed: ${err}`);
1866
+ const detail = this.degradationDetail(err, [query]);
1867
+ log.warn(`QMD vsearch subprocess failed (returning empty): ${detail}`);
1868
+ this.notifyDegradation(onDegradation, "subprocess_error", detail);
1785
1869
  return [];
1786
1870
  }
1787
1871
  }
1788
- async searchGlobalViaSubprocess(query, maxResults, options, signal) {
1872
+ async searchGlobalViaSubprocess(query, maxResults, options, signal, onDegradation) {
1789
1873
  if (this.available === false) return [];
1790
1874
  const startedAtMs = Date.now();
1791
1875
  try {
@@ -1808,7 +1892,9 @@ var QmdClient = class _QmdClient {
1808
1892
  if (isCallerCancellation(err, signal)) {
1809
1893
  throw isAbortError(err) ? err : abortError("QMD subprocess global search aborted");
1810
1894
  }
1811
- log.debug(`QMD global search failed: ${err}`);
1895
+ const detail = this.degradationDetail(err, [query]);
1896
+ log.warn(`QMD global subprocess search failed (returning empty): ${detail}`);
1897
+ this.notifyDegradation(onDegradation, "subprocess_error", detail);
1812
1898
  return [];
1813
1899
  }
1814
1900
  }
@@ -2134,6 +2220,9 @@ export {
2134
2220
  buildDefaultStructuredSearches,
2135
2221
  parseQmdExplain,
2136
2222
  getQmdCommandName,
2223
+ retainSharedDaemonSession,
2224
+ releaseSharedDaemonSession,
2225
+ sharedDaemonSessionCountForTest,
2137
2226
  QmdClient
2138
2227
  };
2139
- //# sourceMappingURL=chunk-7PCZGNG2.js.map
2228
+ //# sourceMappingURL=chunk-6RHNCKHG.js.map