@remnic/core 10.0.161 → 10.0.163

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 (246) hide show
  1. package/dist/access-admin-ops-surface.js +68 -68
  2. package/dist/access-cli.js +68 -68
  3. package/dist/access-extraction-force-flush-preempt.js +68 -68
  4. package/dist/access-extraction-force-flush.js +68 -68
  5. package/dist/access-http-briefing.js +68 -68
  6. package/dist/access-http-query.js +68 -68
  7. package/dist/access-http.js +68 -68
  8. package/dist/access-identity-continuity-surface.js +68 -68
  9. package/dist/access-lcm-surface.js +68 -68
  10. package/dist/access-mcp.js +68 -68
  11. package/dist/access-observe-write-category.js +5 -5
  12. package/dist/access-observe-write-surface.js +68 -68
  13. package/dist/access-operations-batch.js +68 -68
  14. package/dist/access-operations.js +68 -68
  15. package/dist/access-recall-concurrency.js +68 -68
  16. package/dist/access-recall-diagnostics.js +2 -2
  17. package/dist/access-recall-response.js +68 -68
  18. package/dist/access-recall-surface.js +68 -68
  19. package/dist/access-schema.js +4 -4
  20. package/dist/access-service.js +68 -68
  21. package/dist/active-recall.js +10 -10
  22. package/dist/briefing.js +9 -9
  23. package/dist/buffer.js +2 -2
  24. package/dist/{capsule-crypto-YO5QJ6L3.js → capsule-crypto-GWVG7LGC.js} +2 -2
  25. package/dist/causal-consolidation.js +10 -10
  26. package/dist/{chunk-HIPHLFIQ.js → chunk-22VXXA67.js} +2 -2
  27. package/dist/{chunk-IFFCHE3O.js → chunk-2S3M2GLC.js} +8 -2
  28. package/dist/{chunk-IFFCHE3O.js.map → chunk-2S3M2GLC.js.map} +1 -1
  29. package/dist/{chunk-VGCK2RV3.js → chunk-3QLAOYBL.js} +2 -2
  30. package/dist/{chunk-6NPLVV6M.js → chunk-4HKK5HUI.js} +2 -2
  31. package/dist/{chunk-XTAGZXOM.js → chunk-4LPTSB5V.js} +2 -2
  32. package/dist/{chunk-HKOGDSNS.js → chunk-4NBUHYUV.js} +2 -2
  33. package/dist/{chunk-VVVFT435.js → chunk-5D4NBANY.js} +5 -5
  34. package/dist/{chunk-VVVFT435.js.map → chunk-5D4NBANY.js.map} +1 -1
  35. package/dist/{chunk-K3KSTSGM.js → chunk-5LTXYM7D.js} +2 -2
  36. package/dist/{chunk-M7BCA43N.js → chunk-5MXKS25U.js} +5 -5
  37. package/dist/{chunk-KTZNXQWL.js → chunk-6ARSFTLD.js} +2 -2
  38. package/dist/{chunk-773QSFFN.js → chunk-6TPWIPE3.js} +2 -2
  39. package/dist/{chunk-L2DACC2T.js → chunk-ARJ3KCX4.js} +2 -2
  40. package/dist/{chunk-6PVS6JET.js → chunk-AU6AEUFD.js} +2 -2
  41. package/dist/{chunk-R45L4TV6.js → chunk-BUKK5SWA.js} +6 -6
  42. package/dist/{chunk-JUYTXFDV.js → chunk-CGOPDXLK.js} +2 -2
  43. package/dist/{chunk-TGH7AU5U.js → chunk-DBVSU3HE.js} +8 -8
  44. package/dist/{chunk-3UKPFFMS.js → chunk-E5RJPLNL.js} +2 -2
  45. package/dist/{chunk-TLJV42SZ.js → chunk-EDA6CDBT.js} +2 -2
  46. package/dist/{chunk-ZWSSUWKO.js → chunk-EI2M2CFJ.js} +2 -2
  47. package/dist/{chunk-V24YLFJW.js → chunk-FNV6ZPCY.js} +6 -4
  48. package/dist/chunk-FNV6ZPCY.js.map +1 -0
  49. package/dist/{chunk-BDFOBNLX.js → chunk-FSI45NUK.js} +2 -2
  50. package/dist/{chunk-BFJQBCDL.js → chunk-GDAFI6HH.js} +239 -156
  51. package/dist/chunk-GDAFI6HH.js.map +1 -0
  52. package/dist/{chunk-DFK6AQWM.js → chunk-IC35ZYLM.js} +2 -2
  53. package/dist/{chunk-PJFSSXXY.js → chunk-JJEQRSYU.js} +2 -2
  54. package/dist/{chunk-5UE45DLK.js → chunk-JVIWVJ2A.js} +2 -2
  55. package/dist/{chunk-BNQJKWWZ.js → chunk-K3FH3LAQ.js} +4 -4
  56. package/dist/{chunk-UADAXWUJ.js → chunk-KR6PEAM4.js} +7 -7
  57. package/dist/{chunk-YKAQKIPR.js → chunk-L6BLTV4D.js} +2 -2
  58. package/dist/{chunk-2YJYBAR3.js → chunk-OAGTKS73.js} +2 -2
  59. package/dist/{chunk-BXLOS5AJ.js → chunk-OWHERGF2.js} +2 -2
  60. package/dist/{chunk-CA7XVRHZ.js → chunk-PCUDFWX5.js} +2 -2
  61. package/dist/{chunk-I6IKSDUO.js → chunk-PRE7R3RQ.js} +2 -2
  62. package/dist/{chunk-MWEJL436.js → chunk-QBREZ4QL.js} +2 -2
  63. package/dist/{chunk-TFA6HPOA.js → chunk-QCP75JGO.js} +5 -5
  64. package/dist/{chunk-MZETCZJF.js → chunk-QFPNWSVH.js} +5 -5
  65. package/dist/{chunk-52EM4UQU.js → chunk-QUC4S2D2.js} +10 -9
  66. package/dist/chunk-QUC4S2D2.js.map +1 -0
  67. package/dist/{chunk-7PCWJZXG.js → chunk-RDO6AMDL.js} +2 -2
  68. package/dist/{chunk-QDY4TSKK.js → chunk-RH6XWXMA.js} +3 -3
  69. package/dist/{chunk-BT5TAOXG.js → chunk-SBU5GDOT.js} +3 -3
  70. package/dist/{chunk-KJ3Z7JHF.js → chunk-SOGOHLWN.js} +1 -1
  71. package/dist/chunk-SOGOHLWN.js.map +1 -0
  72. package/dist/{chunk-TBOCVPXL.js → chunk-SRN5M4LQ.js} +3 -3
  73. package/dist/{chunk-NBHMEYM4.js → chunk-TFNZXOXK.js} +2 -2
  74. package/dist/{chunk-O7CHKXSF.js → chunk-UGQEJWR3.js} +2 -2
  75. package/dist/{chunk-DQEMWVMT.js → chunk-UVYI6VIX.js} +1 -1
  76. package/dist/{chunk-H6OTEBPK.js → chunk-V6M6N3EE.js} +2 -2
  77. package/dist/{chunk-AQ6GV5MU.js → chunk-VXMWTRQX.js} +2 -2
  78. package/dist/{chunk-PCCNK3RX.js → chunk-VXUO5JZC.js} +11 -13
  79. package/dist/chunk-VXUO5JZC.js.map +1 -0
  80. package/dist/{chunk-UR6COSJN.js → chunk-WAJL65KW.js} +3 -3
  81. package/dist/{chunk-V3D2OOVE.js → chunk-WRAK5LLB.js} +2 -2
  82. package/dist/{chunk-BTCZVBV3.js → chunk-XE4UYWW3.js} +3 -3
  83. package/dist/{chunk-VXKPZ6BO.js → chunk-Y7HLGKKU.js} +2 -2
  84. package/dist/{chunk-YAFMWQRL.js → chunk-YMC4AYJK.js} +4 -4
  85. package/dist/chunk-YMC4AYJK.js.map +1 -0
  86. package/dist/{chunk-B7F2G57I.js → chunk-YWPCDR3I.js} +2 -2
  87. package/dist/{chunk-NFTFMMKT.js → chunk-Z3SXC3MP.js} +2 -2
  88. package/dist/{chunk-DS24H6M4.js → chunk-ZRLTQ2Y7.js} +2 -2
  89. package/dist/cli.js +68 -68
  90. package/dist/coding/export-okf-codegraph.js +8 -8
  91. package/dist/compounding/engine.js +10 -10
  92. package/dist/config.js +10 -10
  93. package/dist/connectors/codex-materialize-runner.js +9 -9
  94. package/dist/connectors/index.js +9 -9
  95. package/dist/convergence-refresh.js +11 -11
  96. package/dist/conversation-index/backend.js +2 -2
  97. package/dist/corpus-watermark.js +11 -11
  98. package/dist/deep-recall-http-glue.js +5 -5
  99. package/dist/entity-retrieval.js +9 -9
  100. package/dist/explicit-capture.js +68 -68
  101. package/dist/extraction-error-classification.d.ts +11 -2
  102. package/dist/extraction-error-classification.d.ts.map +1 -1
  103. package/dist/extraction-error-classification.js +3 -1
  104. package/dist/extraction-reply-diagnostic.d.ts +4 -2
  105. package/dist/extraction-reply-diagnostic.d.ts.map +1 -1
  106. package/dist/extraction-reply-diagnostic.js +1 -1
  107. package/dist/extraction.js +14 -14
  108. package/dist/harmonic-retrieval.js +9 -9
  109. package/dist/index.js +74 -74
  110. package/dist/lcm/engine.js +2 -2
  111. package/dist/lcm/index.js +2 -2
  112. package/dist/location/index.js +10 -10
  113. package/dist/maintenance/memory-governance.js +9 -9
  114. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +9 -9
  115. package/dist/maintenance/rebuild-memory-projection-runner.js +11 -11
  116. package/dist/maintenance/rebuild-memory-projection.js +10 -10
  117. package/dist/namespaces/migrate.js +10 -10
  118. package/dist/namespaces/search.js +6 -6
  119. package/dist/namespaces/storage.js +9 -9
  120. package/dist/operator-doctor-corpus.js +12 -12
  121. package/dist/operator-toolkit.js +17 -17
  122. package/dist/orchestration/backlog-scheduler.js +69 -69
  123. package/dist/orchestration/buffer-drain-runner.js +69 -69
  124. package/dist/orchestration/extraction-drain.d.ts.map +1 -1
  125. package/dist/orchestration/extraction-run-helpers.d.ts +7 -0
  126. package/dist/orchestration/extraction-run-helpers.d.ts.map +1 -1
  127. package/dist/orchestration/extraction-run.d.ts.map +1 -1
  128. package/dist/orchestration/maintenance.js +17 -17
  129. package/dist/orchestration/orchestrator-init.d.ts +28 -1
  130. package/dist/orchestration/orchestrator-init.d.ts.map +1 -1
  131. package/dist/orchestrator.d.ts +13 -9
  132. package/dist/orchestrator.d.ts.map +1 -1
  133. package/dist/orchestrator.js +68 -68
  134. package/dist/recall-explain-renderer.js +3 -3
  135. package/dist/recall-navigate-access.js +2 -2
  136. package/dist/recall-navigate-disclosure.js +2 -2
  137. package/dist/recall-navigate.js +2 -2
  138. package/dist/recall-navigation.js +68 -68
  139. package/dist/recall-xray-cli.js +4 -4
  140. package/dist/recall-xray-renderer.js +3 -3
  141. package/dist/recall-xray.js +2 -2
  142. package/dist/resume-bundles.js +11 -11
  143. package/dist/search/factory.js +5 -5
  144. package/dist/search/index.js +9 -9
  145. package/dist/semantic-consolidation.js +10 -10
  146. package/dist/semantic-rule-promotion.js +9 -9
  147. package/dist/semantic-rule-verifier.js +9 -9
  148. package/dist/source-agent-qualifier.js +11 -11
  149. package/dist/standup/build.js +9 -9
  150. package/dist/storage.js +8 -8
  151. package/dist/transfer/autodetect.js +1 -1
  152. package/dist/transfer/backup.js +2 -2
  153. package/dist/transfer/capsule-export.js +3 -3
  154. package/dist/transfer/capsule-import.js +2 -2
  155. package/dist/transfer/export-okf.js +9 -9
  156. package/dist/types-extraction-failure.d.ts +12 -0
  157. package/dist/types-extraction-failure.d.ts.map +1 -0
  158. package/dist/types-extraction-failure.js +1 -0
  159. package/dist/types-extraction-failure.js.map +1 -0
  160. package/dist/types.d.ts +3 -9
  161. package/dist/types.d.ts.map +1 -1
  162. package/dist/types.js +1 -1
  163. package/dist/verified-recall.js +9 -9
  164. package/dist/who-knows-cli.js +10 -10
  165. package/dist/who-knows.js +9 -9
  166. package/package.json +2 -2
  167. package/src/access-observe-replay-durability.test.ts +23 -3
  168. package/src/buffer-admission-idempotency.test.ts +1 -1
  169. package/src/buffer-ingress-invariant.test.ts +1 -1
  170. package/src/config.test.ts +3 -2
  171. package/src/config.ts +1 -1
  172. package/src/extraction-error-classification.ts +13 -2
  173. package/src/extraction-queue-concurrency-default.test.ts +107 -0
  174. package/src/extraction-reply-diagnostic-wiring.test.ts +4 -4
  175. package/src/extraction-reply-diagnostic.test.ts +3 -1
  176. package/src/extraction-reply-diagnostic.ts +9 -1
  177. package/src/extraction.ts +6 -6
  178. package/src/orchestration/extraction-drain-parts.test.ts +33 -0
  179. package/src/orchestration/extraction-drain.ts +7 -1
  180. package/src/orchestration/extraction-queue-coordinator.ts +1 -1
  181. package/src/orchestration/extraction-run-helpers.ts +14 -0
  182. package/src/orchestration/extraction-run.test.ts +28 -5
  183. package/src/orchestration/extraction-run.ts +11 -13
  184. package/src/orchestration/orchestrator-init.ts +259 -111
  185. package/src/orchestrator-extraction-queue.test.ts +3 -3
  186. package/src/orchestrator-flush.test.ts +43 -34
  187. package/src/orchestrator-init.test.ts +66 -3
  188. package/src/orchestrator-startup-ready-path.test.ts +506 -0
  189. package/src/orchestrator.ts +18 -9
  190. package/src/storage.ts +1 -1
  191. package/src/types-extraction-failure.ts +11 -0
  192. package/src/types.ts +3 -9
  193. package/dist/chunk-52EM4UQU.js.map +0 -1
  194. package/dist/chunk-BFJQBCDL.js.map +0 -1
  195. package/dist/chunk-KJ3Z7JHF.js.map +0 -1
  196. package/dist/chunk-PCCNK3RX.js.map +0 -1
  197. package/dist/chunk-V24YLFJW.js.map +0 -1
  198. package/dist/chunk-YAFMWQRL.js.map +0 -1
  199. /package/dist/{capsule-crypto-YO5QJ6L3.js.map → capsule-crypto-GWVG7LGC.js.map} +0 -0
  200. /package/dist/{chunk-HIPHLFIQ.js.map → chunk-22VXXA67.js.map} +0 -0
  201. /package/dist/{chunk-VGCK2RV3.js.map → chunk-3QLAOYBL.js.map} +0 -0
  202. /package/dist/{chunk-6NPLVV6M.js.map → chunk-4HKK5HUI.js.map} +0 -0
  203. /package/dist/{chunk-XTAGZXOM.js.map → chunk-4LPTSB5V.js.map} +0 -0
  204. /package/dist/{chunk-HKOGDSNS.js.map → chunk-4NBUHYUV.js.map} +0 -0
  205. /package/dist/{chunk-K3KSTSGM.js.map → chunk-5LTXYM7D.js.map} +0 -0
  206. /package/dist/{chunk-M7BCA43N.js.map → chunk-5MXKS25U.js.map} +0 -0
  207. /package/dist/{chunk-KTZNXQWL.js.map → chunk-6ARSFTLD.js.map} +0 -0
  208. /package/dist/{chunk-773QSFFN.js.map → chunk-6TPWIPE3.js.map} +0 -0
  209. /package/dist/{chunk-L2DACC2T.js.map → chunk-ARJ3KCX4.js.map} +0 -0
  210. /package/dist/{chunk-6PVS6JET.js.map → chunk-AU6AEUFD.js.map} +0 -0
  211. /package/dist/{chunk-R45L4TV6.js.map → chunk-BUKK5SWA.js.map} +0 -0
  212. /package/dist/{chunk-JUYTXFDV.js.map → chunk-CGOPDXLK.js.map} +0 -0
  213. /package/dist/{chunk-TGH7AU5U.js.map → chunk-DBVSU3HE.js.map} +0 -0
  214. /package/dist/{chunk-3UKPFFMS.js.map → chunk-E5RJPLNL.js.map} +0 -0
  215. /package/dist/{chunk-TLJV42SZ.js.map → chunk-EDA6CDBT.js.map} +0 -0
  216. /package/dist/{chunk-ZWSSUWKO.js.map → chunk-EI2M2CFJ.js.map} +0 -0
  217. /package/dist/{chunk-BDFOBNLX.js.map → chunk-FSI45NUK.js.map} +0 -0
  218. /package/dist/{chunk-DFK6AQWM.js.map → chunk-IC35ZYLM.js.map} +0 -0
  219. /package/dist/{chunk-PJFSSXXY.js.map → chunk-JJEQRSYU.js.map} +0 -0
  220. /package/dist/{chunk-5UE45DLK.js.map → chunk-JVIWVJ2A.js.map} +0 -0
  221. /package/dist/{chunk-BNQJKWWZ.js.map → chunk-K3FH3LAQ.js.map} +0 -0
  222. /package/dist/{chunk-UADAXWUJ.js.map → chunk-KR6PEAM4.js.map} +0 -0
  223. /package/dist/{chunk-YKAQKIPR.js.map → chunk-L6BLTV4D.js.map} +0 -0
  224. /package/dist/{chunk-2YJYBAR3.js.map → chunk-OAGTKS73.js.map} +0 -0
  225. /package/dist/{chunk-BXLOS5AJ.js.map → chunk-OWHERGF2.js.map} +0 -0
  226. /package/dist/{chunk-CA7XVRHZ.js.map → chunk-PCUDFWX5.js.map} +0 -0
  227. /package/dist/{chunk-I6IKSDUO.js.map → chunk-PRE7R3RQ.js.map} +0 -0
  228. /package/dist/{chunk-MWEJL436.js.map → chunk-QBREZ4QL.js.map} +0 -0
  229. /package/dist/{chunk-TFA6HPOA.js.map → chunk-QCP75JGO.js.map} +0 -0
  230. /package/dist/{chunk-MZETCZJF.js.map → chunk-QFPNWSVH.js.map} +0 -0
  231. /package/dist/{chunk-7PCWJZXG.js.map → chunk-RDO6AMDL.js.map} +0 -0
  232. /package/dist/{chunk-QDY4TSKK.js.map → chunk-RH6XWXMA.js.map} +0 -0
  233. /package/dist/{chunk-BT5TAOXG.js.map → chunk-SBU5GDOT.js.map} +0 -0
  234. /package/dist/{chunk-TBOCVPXL.js.map → chunk-SRN5M4LQ.js.map} +0 -0
  235. /package/dist/{chunk-NBHMEYM4.js.map → chunk-TFNZXOXK.js.map} +0 -0
  236. /package/dist/{chunk-O7CHKXSF.js.map → chunk-UGQEJWR3.js.map} +0 -0
  237. /package/dist/{chunk-DQEMWVMT.js.map → chunk-UVYI6VIX.js.map} +0 -0
  238. /package/dist/{chunk-H6OTEBPK.js.map → chunk-V6M6N3EE.js.map} +0 -0
  239. /package/dist/{chunk-AQ6GV5MU.js.map → chunk-VXMWTRQX.js.map} +0 -0
  240. /package/dist/{chunk-UR6COSJN.js.map → chunk-WAJL65KW.js.map} +0 -0
  241. /package/dist/{chunk-V3D2OOVE.js.map → chunk-WRAK5LLB.js.map} +0 -0
  242. /package/dist/{chunk-BTCZVBV3.js.map → chunk-XE4UYWW3.js.map} +0 -0
  243. /package/dist/{chunk-VXKPZ6BO.js.map → chunk-Y7HLGKKU.js.map} +0 -0
  244. /package/dist/{chunk-B7F2G57I.js.map → chunk-YWPCDR3I.js.map} +0 -0
  245. /package/dist/{chunk-NFTFMMKT.js.map → chunk-Z3SXC3MP.js.map} +0 -0
  246. /package/dist/{chunk-DS24H6M4.js.map → chunk-ZRLTQ2Y7.js.map} +0 -0
@@ -379,7 +379,7 @@ test("flushSession waits for queued extraction task completion", async () => {
379
379
  return [makeTurn("thread-a", "remember alpha")];
380
380
  },
381
381
  };
382
- orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator();
382
+ orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator(1);
383
383
  orchestrator.runExtraction = async () => {
384
384
  extractionStarted = true;
385
385
  await new Promise<void>((resolve) => {
@@ -475,7 +475,7 @@ test("flushSession flushes the pending debounced buffer save before extraction,
475
475
  assert.equal(entryTurns[0]?.content, "remember alpha");
476
476
  });
477
477
  test("queued extraction settles immediately when its caller aborts while waiting", async () => {
478
- const queue = new ExtractionQueueCoordinator();
478
+ const queue = new ExtractionQueueCoordinator(1);
479
479
  let extractionStarted = false;
480
480
  let releaseExtraction!: () => void;
481
481
  // SAFETY: fixture deps stub — only the queued-extraction path fields are exercised.
@@ -658,7 +658,7 @@ test("flushSession rejects and skips extraction when the durable buffer save fai
658
658
  test("ingestBulkImportBatch rejects when the extraction deadline expires in the queue", async () => {
659
659
  const orchestrator = Object.create(Orchestrator.prototype) as any;
660
660
  orchestrator.config = parseConfig({});
661
- orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator();
661
+ orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator(1);
662
662
  orchestrator.extractionQueueCoordinator.setProcessingForTest(true);
663
663
  let runExtractionCalls = 0;
664
664
  orchestrator.runExtraction = async () => {
@@ -709,7 +709,7 @@ test("ingestBulkImportBatch rejects when the extraction deadline expires in the
709
709
  test("queued extraction clamps long deadline timers to the Node setTimeout limit", async () => {
710
710
  const orchestrator = Object.create(Orchestrator.prototype) as any;
711
711
  orchestrator.config = parseConfig({});
712
- orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator();
712
+ orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator(1);
713
713
  orchestrator.extractionQueueCoordinator.setProcessingForTest(true);
714
714
  orchestrator.runExtraction = async () => ({
715
715
  status: "completed",
@@ -742,7 +742,7 @@ test("queued extraction clamps long deadline timers to the Node setTimeout limit
742
742
  test("ingestBulkImportBatch does not report queue wait timeout after extraction starts", async () => {
743
743
  const orchestrator = Object.create(Orchestrator.prototype) as any;
744
744
  orchestrator.config = parseConfig({});
745
- orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator();
745
+ orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator(1);
746
746
  let runExtractionCalls = 0;
747
747
  orchestrator.runExtraction = async () => {
748
748
  runExtractionCalls += 1;
@@ -777,7 +777,7 @@ test("ingestBulkImportBatch does not report queue wait timeout after extraction
777
777
  test("ingestBulkImportBatch reports post-persist metadata failures separately", async () => {
778
778
  const orchestrator = Object.create(Orchestrator.prototype) as any;
779
779
  orchestrator.config = parseConfig({});
780
- orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator();
780
+ orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator(1);
781
781
  orchestrator.runExtraction = async () => ({
782
782
  status: "completed",
783
783
  persistedCount: 1,
@@ -809,7 +809,7 @@ test("ingestBulkImportBatch reports post-persist metadata failures separately",
809
809
  test("ingestBulkImportBatch can disable source-valid-at replay context", async () => {
810
810
  const orchestrator = Object.create(Orchestrator.prototype) as any;
811
811
  orchestrator.config = parseConfig({});
812
- orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator();
812
+ orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator(1);
813
813
  const capturedSlices: BufferTurn[][] = [];
814
814
  orchestrator.runExtraction = async (turns: BufferTurn[]) => {
815
815
  capturedSlices.push(turns);
@@ -862,7 +862,7 @@ test("ingestBulkImportBatch can disable source-valid-at replay context", async (
862
862
  test("ingestBulkImportBatch skips LCM observation for flush-plan recovery batches (issue #2457)", async () => {
863
863
  const orchestrator = Object.create(Orchestrator.prototype) as unknown as BulkImportTestDouble;
864
864
  orchestrator.config = parseConfig({});
865
- orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator();
865
+ orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator(1);
866
866
  const observedSessionKeys: string[] = [];
867
867
  orchestrator.lcmEngine = {
868
868
  enabled: true,
@@ -907,7 +907,7 @@ test("ingestBulkImportBatch skips LCM observation for flush-plan recovery batche
907
907
  test("ingestBulkImportBatch still observes ordinary bulk imports through LCM (issue #2457)", async () => {
908
908
  const orchestrator = Object.create(Orchestrator.prototype) as unknown as BulkImportTestDouble;
909
909
  orchestrator.config = parseConfig({});
910
- orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator();
910
+ orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator(1);
911
911
  const observed: { sessionKey: string; turnCount: number }[] = [];
912
912
  orchestrator.lcmEngine = {
913
913
  enabled: true,
@@ -946,7 +946,7 @@ test("ingestBulkImportBatch still observes ordinary bulk imports through LCM (is
946
946
  test("ingestBulkImportBatch observes mixed batches that contain flush-plan turns (issue #2457)", async () => {
947
947
  const orchestrator = Object.create(Orchestrator.prototype) as unknown as BulkImportTestDouble;
948
948
  orchestrator.config = parseConfig({});
949
- orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator();
949
+ orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator(1);
950
950
  const observed: number[] = [];
951
951
  orchestrator.lcmEngine = {
952
952
  enabled: true,
@@ -985,7 +985,7 @@ test("ingestBulkImportBatch observes mixed batches that contain flush-plan turns
985
985
  test("ingestBulkImportBatch preserves partial metadata failure before a later slice rejects", async () => {
986
986
  const orchestrator = Object.create(Orchestrator.prototype) as any;
987
987
  orchestrator.config = parseConfig({});
988
- orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator();
988
+ orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator(1);
989
989
  let runExtractionCalls = 0;
990
990
  orchestrator.runExtraction = async () => {
991
991
  runExtractionCalls += 1;
@@ -1047,7 +1047,7 @@ test("ingestBulkImportBatch preserves partial metadata failure before a later sl
1047
1047
  test("ingestBulkImportBatch stops after the first failed source-valid-at slice", async () => {
1048
1048
  const orchestrator = Object.create(Orchestrator.prototype) as any;
1049
1049
  orchestrator.config = parseConfig({});
1050
- orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator();
1050
+ orchestrator.extractionQueueCoordinator = new ExtractionQueueCoordinator(1);
1051
1051
  let runExtractionCalls = 0;
1052
1052
  orchestrator.runExtraction = async () => {
1053
1053
  runExtractionCalls += 1;
@@ -2871,21 +2871,20 @@ test("runExtraction still clears the session buffer after persistence even if re
2871
2871
  );
2872
2872
  });
2873
2873
 
2874
- // ── NHZEV (codex P2): the QMD STARTUP sync in deferredInitialize() must cover
2875
- // cataloged dynamic namespaces too, not only configuredNamespaces(). A dynamic
2876
- // namespace written before a daemon restart exists ONLY in the persisted catalog;
2877
- // if the boot-time "sync current disk state" pass embeds only the configured set,
2878
- // that namespace's QMD collection stays stale after restart. We drive
2879
- // deferredInitialize() with stubbed internals and abort the signal right after the
2880
- // sync (the next `if (signal.aborted) return;` bails before warmup), then assert the
2881
- // startup updateNamespaces() received the UNION of configured + cataloged namespaces.
2882
- test("deferredInitialize startup sync covers cataloged dynamic namespaces (NHZEV)", async () => {
2874
+ // ── NHZEV (codex P2): the QMD STARTUP sync must cover cataloged dynamic
2875
+ // namespaces too, not only configuredNamespaces(). A dynamic namespace written
2876
+ // before a daemon restart exists ONLY in the persisted catalog; if the boot-time
2877
+ // "sync current disk state" pass embeds only the configured set, that
2878
+ // namespace's QMD collection stays stale after restart. Since #3518 the corpus
2879
+ // update lives in startupSearchSync (the post-ready retry entry point), so we
2880
+ // drive that with stubbed internals and assert updateNamespaces() received the
2881
+ // UNION of configured + cataloged namespaces.
2882
+ test("startupSearchSync covers cataloged dynamic namespaces (NHZEV)", async () => {
2883
2883
  const orchestrator = Object.create(Orchestrator.prototype) as any;
2884
2884
  let updateArg: string[] | undefined;
2885
- const abortController = new AbortController();
2886
- // #2980 fences startup work by lifecycle epoch: deferredInitialize() now
2887
- // begins an epoch that resets the gate fields the selfDeps seam fail-fasts
2888
- // on (PR #1801 set-trap contract). Prototype fakes must declare them.
2885
+ // #2980 fences startup work by lifecycle epoch: the first sync begins an
2886
+ // epoch that resets the gate fields the selfDeps seam fail-fasts on (PR
2887
+ // #1801 set-trap contract). Prototype fakes must declare them.
2889
2888
  orchestrator.deferredInitAbort = null;
2890
2889
  orchestrator.deferredSyncSucceeded = false;
2891
2890
  const memoryDir = path.join(os.tmpdir(), "remnic-startup-maintenance-nhzev");
@@ -2907,7 +2906,10 @@ test("deferredInitialize startup sync covers cataloged dynamic namespaces (NHZEV
2907
2906
  maintenanceMaxNamespacesPerCycle: 2,
2908
2907
  };
2909
2908
  orchestrator.qmd = {
2909
+ probe: async () => true,
2910
+ debugStatus: () => "synthetic-qmd",
2910
2911
  isAvailable: () => true,
2912
+ search: async () => [],
2911
2913
  async update() {},
2912
2914
  };
2913
2915
  orchestrator.namespaceCatalog = {
@@ -2927,17 +2929,19 @@ test("deferredInitialize startup sync covers cataloged dynamic namespaces (NHZEV
2927
2929
  },
2928
2930
  };
2929
2931
  orchestrator.namespaceSearchRouter = {
2932
+ clearCache() {},
2933
+ async ensureNamespaceCollection() {
2934
+ return "present";
2935
+ },
2930
2936
  async updateNamespaces(ns: string[]) {
2931
2937
  updateArg = ns;
2932
- // Abort AFTER the startup sync records its arg so deferredInitialize bails
2933
- // at the next `if (signal.aborted) return;` before warmup/caches run.
2934
- abortController.abort();
2935
2938
  return ns.length;
2936
2939
  },
2937
2940
  };
2938
2941
 
2939
- await orchestrator.deferredInitialize(abortController.signal);
2942
+ const synced = await orchestrator.startupSearchSync();
2940
2943
 
2944
+ assert.ok(synced, "the complete discovery sync must succeed");
2941
2945
  assert.ok(updateArg, "startup updateNamespaces must be called");
2942
2946
  assert.ok(
2943
2947
  updateArg!.includes(dynamicNamespace),
@@ -2950,12 +2954,11 @@ test("deferredInitialize startup sync covers cataloged dynamic namespaces (NHZEV
2950
2954
  });
2951
2955
 
2952
2956
  // NHZEV fallback: a catalog read failure during startup sync must degrade to the
2953
- // configured set rather than breaking deferredInitialize — same failure-tolerance
2957
+ // configured set rather than breaking the sync — same failure-tolerance
2954
2958
  // contract as runQmdMaintenance (maintenanceNamespaces swallows the read error).
2955
- test("deferredInitialize startup sync falls back to configured set on catalog read failure (NHZEV)", async () => {
2959
+ test("startupSearchSync falls back to configured set on catalog read failure (NHZEV)", async () => {
2956
2960
  const orchestrator = Object.create(Orchestrator.prototype) as any;
2957
2961
  let updateArg: string[] | undefined;
2958
- const abortController = new AbortController();
2959
2962
  orchestrator.deferredInitAbort = null;
2960
2963
  orchestrator.deferredSyncSucceeded = false;
2961
2964
 
@@ -2967,7 +2970,10 @@ test("deferredInitialize startup sync falls back to configured set on catalog re
2967
2970
  qmdMaintenanceEnabled: true,
2968
2971
  };
2969
2972
  orchestrator.qmd = {
2973
+ probe: async () => true,
2974
+ debugStatus: () => "synthetic-qmd",
2970
2975
  isAvailable: () => true,
2976
+ search: async () => [],
2971
2977
  async update() {},
2972
2978
  };
2973
2979
  orchestrator.namespaceCatalog = {
@@ -2977,14 +2983,17 @@ test("deferredInitialize startup sync falls back to configured set on catalog re
2977
2983
  },
2978
2984
  };
2979
2985
  orchestrator.namespaceSearchRouter = {
2986
+ clearCache() {},
2987
+ async ensureNamespaceCollection() {
2988
+ return "present";
2989
+ },
2980
2990
  async updateNamespaces(ns: string[]) {
2981
2991
  updateArg = ns;
2982
- abortController.abort();
2983
2992
  return ns.length;
2984
2993
  },
2985
2994
  };
2986
2995
 
2987
- await orchestrator.deferredInitialize(abortController.signal);
2996
+ await orchestrator.startupSearchSync();
2988
2997
 
2989
2998
  assert.ok(updateArg, "startup updateNamespaces must be called");
2990
2999
  assert.deepEqual(
@@ -139,12 +139,16 @@ test("initialize and its init gate survive an enabled catalog planner timeout",
139
139
  (orchestrator as any).deferredReady.then(() => "settled" as const),
140
140
  );
141
141
  assert.equal(deferredResult, "settled", "deferred initialization must settle after incomplete discovery");
142
- assert.deepEqual(updatedNamespaces, [configuredNamespaces]);
142
+ assert.deepEqual(
143
+ updatedNamespaces,
144
+ [],
145
+ "the corpus update must not run in the awaited deferred path (#3518)",
146
+ );
143
147
  assert.equal((orchestrator as any).deferredSyncSucceeded, false);
144
148
 
145
149
  const retryResult = await withTestDeadline(orchestrator.startupSearchSync());
146
150
  assert.equal(retryResult, false, "incomplete discovery must leave startup retry armed");
147
- assert.deepEqual(updatedNamespaces, [configuredNamespaces, configuredNamespaces]);
151
+ assert.deepEqual(updatedNamespaces, [configuredNamespaces]);
148
152
  const fallbackEnsureCalls = [...configuredNamespaces, ...configuredNamespaces];
149
153
  assert.deepEqual(ensuredNamespaces, fallbackEnsureCalls);
150
154
 
@@ -164,7 +168,6 @@ test("initialize and its init gate survive an enabled catalog planner timeout",
164
168
  "a later complete retry must re-stage dynamic collection checks",
165
169
  );
166
170
  assert.deepEqual(updatedNamespaces, [
167
- configuredNamespaces,
168
171
  configuredNamespaces,
169
172
  completeNamespaces,
170
173
  ]);
@@ -1726,3 +1729,63 @@ test("destroy persists a buffered turn before it waits on a running fact-hash wa
1726
1729
  await rm(memoryDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 50 });
1727
1730
  }
1728
1731
  });
1732
+
1733
+ test("an unverified collection ensure does not complete the maintenance-off sync", async () => {
1734
+ const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-unknown-ensure-qmd-"));
1735
+ const orchestrator = new Orchestrator(
1736
+ parseConfig({
1737
+ memoryDir,
1738
+ workspaceDir: path.join(memoryDir, "workspace"),
1739
+ qmdEnabled: true,
1740
+ qmdMaintenanceEnabled: false,
1741
+ namespacesEnabled: true,
1742
+ namespaceCatalogEnabled: false,
1743
+ defaultNamespace: "default",
1744
+ sharedNamespace: "shared",
1745
+ namespacePolicies: [],
1746
+ embeddingFallbackEnabled: false,
1747
+ identityContinuityEnabled: false,
1748
+ transcriptEnabled: false,
1749
+ hourlySummariesEnabled: false,
1750
+ compoundingEnabled: false,
1751
+ knowledgeIndexEnabled: false,
1752
+ }),
1753
+ );
1754
+ // SAFETY: the test stubs the same private orchestrator seams the neighbouring
1755
+ // lifecycle tests do (qmd, passiveCorrectionService, maintenanceNamespaces,
1756
+ // namespaceSearchRouter, deferredReady, deferredSyncSucceeded).
1757
+ const orch = orchestrator as any;
1758
+ try {
1759
+ orch.qmd = {
1760
+ probe: async () => true,
1761
+ debugStatus: () => "fake-qmd",
1762
+ isAvailable: () => true,
1763
+ search: async () => [],
1764
+ };
1765
+ orch.passiveCorrectionService = () => ({
1766
+ recoverStaleApplyingPlans: async () => 0,
1767
+ });
1768
+ orch.maintenanceNamespaces = () => Promise.resolve(orch.configuredNamespaceList());
1769
+ orch.namespaceSearchRouter.ensureNamespaceCollection = async () => "unknown";
1770
+
1771
+ const initialized = await withTestDeadline(orchestrator.initialize().then(() => "settled" as const));
1772
+ assert.equal(initialized, "settled", "initialize must settle before the deferred stamp check");
1773
+ const deferred = await withTestDeadline(
1774
+ orch.deferredReady.then(() => "settled" as const),
1775
+ );
1776
+ assert.equal(deferred, "settled", "deferredInitialize must settle for the stamp check to run");
1777
+ assert.equal(
1778
+ orch.deferredSyncSucceeded,
1779
+ false,
1780
+ "maintenance-off must not record sync success while the default collection ensure is unverified",
1781
+ );
1782
+ assert.equal(
1783
+ await orchestrator.startupSearchReadySync(new AbortController().signal),
1784
+ false,
1785
+ "the readiness sync must re-verify an unverified collection ensure as degraded",
1786
+ );
1787
+ } finally {
1788
+ await orchestrator.destroy().catch(() => undefined);
1789
+ await rm(memoryDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 50 });
1790
+ }
1791
+ });