@remnic/core 9.69.38 → 9.69.40
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.
- package/dist/access-admin-ops-surface.d.ts +16 -14
- package/dist/access-admin-ops-surface.js +39 -39
- package/dist/access-authorization-probe.d.ts +16 -14
- package/dist/access-authorization-probe.js +40 -40
- package/dist/access-boundary.d.ts +16 -14
- package/dist/access-boundary.js +39 -39
- package/dist/access-cli.js +107 -105
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +1 -1
- package/dist/access-extraction-force-flush.d.ts +16 -14
- package/dist/access-extraction-force-flush.js +39 -39
- package/dist/access-health-types.d.ts +1 -1
- package/dist/access-http-briefing.d.ts +16 -14
- package/dist/access-http-briefing.js +40 -40
- package/dist/access-http-lcm-compaction.d.ts +16 -14
- package/dist/access-http-lifecycle-flush.d.ts +16 -14
- package/dist/access-http-offline-stream.d.ts +16 -14
- package/dist/access-http-query.d.ts +2 -2
- package/dist/access-http-query.js +41 -41
- package/dist/access-http.d.ts +17 -15
- package/dist/access-http.js +58 -58
- package/dist/access-identity-continuity-surface.d.ts +13 -12
- package/dist/access-identity-continuity-surface.js +39 -39
- package/dist/access-lcm-surface.d.ts +16 -14
- package/dist/access-lcm-surface.js +39 -39
- package/dist/access-mcp.d.ts +16 -14
- package/dist/access-mcp.js +47 -47
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-DY4z6L5X.d.ts → access-namespace-preflight-CKBumJ8W.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +39 -39
- package/dist/access-observe-transcript.d.ts +13 -12
- package/dist/access-observe-write-category.d.ts +1 -1
- package/dist/access-observe-write-category.js +2 -2
- package/dist/access-observe-write-surface.d.ts +16 -14
- package/dist/access-observe-write-surface.js +39 -39
- package/dist/access-offline-manifest.d.ts +37 -13
- package/dist/access-offline-manifest.js +7 -3
- package/dist/access-operations-batch.js +41 -41
- package/dist/access-operations.d.ts +16 -14
- package/dist/access-operations.js +46 -46
- package/dist/access-recall-concurrency.d.ts +16 -14
- package/dist/access-recall-concurrency.js +39 -39
- package/dist/access-recall-response.d.ts +16 -14
- package/dist/access-recall-response.js +39 -39
- package/dist/access-recall-surface.d.ts +16 -14
- package/dist/access-recall-surface.js +39 -39
- package/dist/access-schema.d.ts +5 -3
- package/dist/access-schema.js +1 -1
- package/dist/{access-service-gBcdRUHY.d.ts → access-service-DJ3qogNt.d.ts} +8 -8
- package/dist/access-service-helpers.d.ts +16 -14
- package/dist/access-service.d.ts +16 -14
- package/dist/access-service.js +39 -39
- package/dist/access-surface-catalog.d.ts +16 -14
- package/dist/access-surface-catalog.js +41 -41
- package/dist/access-wearables-meetings-surface.d.ts +6 -5
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +6 -5
- package/dist/active-recall.js.map +1 -1
- package/dist/activity/digest.d.ts +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/ambient-provenance.d.ts +1 -1
- package/dist/artifact-search.d.ts +1 -1
- package/dist/{auto-sync-RP4C6ZPF.js → auto-sync-D6BAPIJV.js} +5 -5
- package/dist/background-generation-config.d.ts +1 -1
- package/dist/background-generation-config.js +3 -1
- package/dist/background-generation.d.ts +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +13 -12
- package/dist/briefing-window.d.ts +2 -2
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +16 -16
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer-turn-helpers.d.ts +1 -1
- package/dist/buffer.d.ts +2 -2
- package/dist/buffer.js +5 -5
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +3 -2
- package/dist/calibration.js +2 -2
- package/dist/capabilities.d.ts +1 -1
- package/dist/{catalog-CW87xGx8.d.ts → catalog-BHXkBVhg.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +20 -19
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-B36GUU6T.js → chunk-23HFXQ5J.js} +36 -3
- package/dist/chunk-23HFXQ5J.js.map +1 -0
- package/dist/{chunk-YFTNZMGR.js → chunk-27NO2KVB.js} +31 -8
- package/dist/chunk-27NO2KVB.js.map +1 -0
- package/dist/{chunk-T32B72QX.js → chunk-2SKMZUOW.js} +2 -2
- package/dist/{chunk-VHOSM5G4.js → chunk-2SNCQHJZ.js} +2 -2
- package/dist/{chunk-VV4ZVUE6.js → chunk-3QEVOQF5.js} +2 -2
- package/dist/{chunk-3N3PBBEH.js → chunk-3XPN7AVY.js} +2 -2
- package/dist/{chunk-XN6XT6GR.js → chunk-46Z3VGWF.js} +2 -2
- package/dist/{chunk-2PTNJTBE.js → chunk-4CMXI55L.js} +2 -2
- package/dist/{chunk-2MT4ADLQ.js → chunk-5LYSEZOF.js} +18 -9
- package/dist/chunk-5LYSEZOF.js.map +1 -0
- package/dist/{chunk-XWLLFKHM.js → chunk-62HFZNCJ.js} +19 -12
- package/dist/chunk-62HFZNCJ.js.map +1 -0
- package/dist/{chunk-VELCIWJZ.js → chunk-6L2II3KS.js} +22 -11
- package/dist/chunk-6L2II3KS.js.map +1 -0
- package/dist/{chunk-A6CKMIPK.js → chunk-7D6SER6A.js} +8 -8
- package/dist/{chunk-4B3HBIFX.js → chunk-7Z54NXVS.js} +2 -2
- package/dist/{chunk-X2NFFBTO.js → chunk-A7GQBJP5.js} +4 -4
- package/dist/{chunk-ACY4ZPF7.js → chunk-AEOOGXMQ.js} +10 -5
- package/dist/chunk-AEOOGXMQ.js.map +1 -0
- package/dist/{chunk-NWMUSKED.js → chunk-BGRTZOJB.js} +3 -3
- package/dist/{chunk-ZEGL7YCC.js → chunk-BXIJSPCL.js} +2 -2
- package/dist/{chunk-MLWMR2GE.js → chunk-BYQX4IOG.js} +2 -2
- package/dist/{chunk-ULDBGA5W.js → chunk-C5R73BON.js} +2 -2
- package/dist/{chunk-BD7JTBYP.js → chunk-D7MAYFQP.js} +2 -2
- package/dist/{chunk-V6G2PSXA.js → chunk-DAZANIYU.js} +251 -297
- package/dist/chunk-DAZANIYU.js.map +1 -0
- package/dist/{chunk-BRZWWUCJ.js → chunk-DFVSJFHK.js} +2 -2
- package/dist/{chunk-DPMTLJCT.js → chunk-ES5BUPYB.js} +2 -2
- package/dist/{chunk-MVAQ2WM3.js → chunk-G2XZFGYN.js} +6 -2
- package/dist/chunk-G2XZFGYN.js.map +1 -0
- package/dist/{chunk-TNSCIPBQ.js → chunk-G6NQ3L4T.js} +2 -2
- package/dist/{chunk-5N4MZLEH.js → chunk-GO5LOHCD.js} +2 -2
- package/dist/{chunk-AECJY3GJ.js → chunk-GSSDHAYH.js} +2 -2
- package/dist/{chunk-JA2QJOAX.js → chunk-HJUP3K6L.js} +2 -2
- package/dist/{chunk-ZKZFFWLV.js → chunk-ICNJ6J46.js} +2 -2
- package/dist/{chunk-6EHM2AV7.js → chunk-IMBQFHRV.js} +2 -2
- package/dist/{chunk-6PRY6CLC.js → chunk-IOPIGX7Y.js} +1 -1
- package/dist/{chunk-TRHBQVVO.js → chunk-IS2IDFJP.js} +14 -14
- package/dist/{chunk-R4VAUNNC.js → chunk-J4WGTN2N.js} +2 -2
- package/dist/{chunk-JPOX2AJB.js → chunk-J7FVMLBR.js} +2 -2
- package/dist/{chunk-BYZKLEWG.js → chunk-JAJIMTFB.js} +6 -6
- package/dist/{chunk-OKO57IXB.js → chunk-JOP7W24J.js} +11 -11
- package/dist/{chunk-YUW66UAH.js → chunk-JUDT33RX.js} +2 -2
- package/dist/{chunk-QHT7MOUF.js → chunk-K4A6UVPB.js} +22 -11
- package/dist/chunk-K4A6UVPB.js.map +1 -0
- package/dist/{chunk-UQNYPK7G.js → chunk-K4JKAXMO.js} +2 -2
- package/dist/{chunk-BV4ZKIZH.js → chunk-K75A5XWU.js} +3 -2
- package/dist/{chunk-3CBI2ZSA.js → chunk-KG2OOAFF.js} +20 -12
- package/dist/chunk-KG2OOAFF.js.map +1 -0
- package/dist/{chunk-M6HBPLBA.js → chunk-KOTG3RXE.js} +2 -2
- package/dist/{chunk-CWTCMZGE.js → chunk-KTOXQMW3.js} +119 -3
- package/dist/chunk-KTOXQMW3.js.map +1 -0
- package/dist/{chunk-OB3XMWX5.js → chunk-KVO2BTA4.js} +2 -2
- package/dist/{chunk-CBFYCDYO.js → chunk-KY236SP5.js} +3 -3
- package/dist/{chunk-4BCHFSC7.js → chunk-LFVZD5EC.js} +3 -3
- package/dist/{chunk-GGAXFTNH.js → chunk-LKFVVN7R.js} +2 -2
- package/dist/{chunk-IYKZJVL5.js → chunk-MDIEES23.js} +1 -1
- package/dist/chunk-MDIEES23.js.map +1 -0
- package/dist/{chunk-4RX5O34R.js → chunk-MJC7UKH7.js} +2 -2
- package/dist/{chunk-7S53BPTU.js → chunk-MVG3KXON.js} +69 -22
- package/dist/chunk-MVG3KXON.js.map +1 -0
- package/dist/chunk-NETQXOPY.js +221 -0
- package/dist/chunk-NETQXOPY.js.map +1 -0
- package/dist/{chunk-UZZ7SQT3.js → chunk-NVVZPBKI.js} +2 -2
- package/dist/{chunk-BLDBT6HZ.js → chunk-PJRKLB4Z.js} +18 -2
- package/dist/chunk-PJRKLB4Z.js.map +1 -0
- package/dist/{chunk-TTSJ7WUC.js → chunk-PKUJNICO.js} +2 -2
- package/dist/{chunk-QMWKENNK.js → chunk-Q4AUIFUA.js} +4 -4
- package/dist/{chunk-G43PMSME.js → chunk-QE6YVNP5.js} +7 -7
- package/dist/{chunk-WKDFJXW5.js → chunk-QM2SPLKQ.js} +1 -1
- package/dist/chunk-QM2SPLKQ.js.map +1 -0
- package/dist/{chunk-GT4ZHOKT.js → chunk-QPVNK2VE.js} +2 -2
- package/dist/{chunk-K5DA5TRG.js → chunk-QS5Q5RBV.js} +2 -2
- package/dist/{chunk-BX4EOMKT.js → chunk-RDLPFM7I.js} +2 -2
- package/dist/{chunk-EY5JAWZC.js → chunk-RJQAP333.js} +2 -2
- package/dist/{chunk-5AERZWJD.js → chunk-RLU2Y5GV.js} +4 -4
- package/dist/chunk-RLU2Y5GV.js.map +1 -0
- package/dist/{chunk-2OGTN37H.js → chunk-ROEFLU37.js} +4 -4
- package/dist/{chunk-62QIQEUC.js → chunk-SFHLQPBF.js} +25 -25
- package/dist/chunk-SK7D34OL.js +68 -0
- package/dist/chunk-SK7D34OL.js.map +1 -0
- package/dist/{chunk-HVS7TH2Y.js → chunk-SUEOG2S4.js} +2 -2
- package/dist/{chunk-74AHCL56.js → chunk-TEMKBSV6.js} +2 -2
- package/dist/{chunk-LQNRVPTV.js → chunk-THTF2W7M.js} +151 -118
- package/dist/chunk-THTF2W7M.js.map +1 -0
- package/dist/{chunk-KDFDXEXZ.js → chunk-TO36VPZI.js} +2 -2
- package/dist/{chunk-BJEJUOGM.js → chunk-TZ44E732.js} +44 -6
- package/dist/chunk-TZ44E732.js.map +1 -0
- package/dist/{chunk-JXN77SGO.js → chunk-U2VDCFXW.js} +1 -1
- package/dist/chunk-U2VDCFXW.js.map +1 -0
- package/dist/{chunk-3OYSIVOO.js → chunk-UZ6JYPJ6.js} +611 -289
- package/dist/chunk-UZ6JYPJ6.js.map +1 -0
- package/dist/{chunk-M3MYMWXG.js → chunk-V2ZA4YWE.js} +2 -2
- package/dist/{chunk-UIOIDW3L.js → chunk-VHKXRYQN.js} +2 -2
- package/dist/{chunk-GAS7KYC7.js → chunk-VKWFNPBH.js} +2 -2
- package/dist/{chunk-6H2G7RFT.js → chunk-VNQRRUNS.js} +11 -10
- package/dist/chunk-VNQRRUNS.js.map +1 -0
- package/dist/{chunk-XGRXQR6T.js → chunk-VQWBUPSJ.js} +2 -2
- package/dist/{chunk-TUKGXQ5T.js → chunk-VQYWKCDR.js} +2 -2
- package/dist/{chunk-PPQEP4OH.js → chunk-W23JARAQ.js} +2 -2
- package/dist/{chunk-YQNNHLCG.js → chunk-WPGR3RW4.js} +2 -2
- package/dist/{chunk-474DL7UB.js → chunk-WZYHPAG5.js} +3 -3
- package/dist/{chunk-5HYUUFMQ.js → chunk-XCPNH2MG.js} +259 -10
- package/dist/chunk-XCPNH2MG.js.map +1 -0
- package/dist/{chunk-GQQVEH6V.js → chunk-XM46Y66S.js} +2 -2
- package/dist/{chunk-JNSENHV5.js → chunk-YRIFXXMI.js} +3 -3
- package/dist/{chunk-TRLOFIQC.js → chunk-YTK5MVNF.js} +2 -2
- package/dist/{chunk-VMNCZ627.js → chunk-YTZN2UZO.js} +2 -2
- package/dist/chunk-Z4GUX2M6.js +94 -0
- package/dist/chunk-Z4GUX2M6.js.map +1 -0
- package/dist/{chunk-6ZMNTRU3.js → chunk-ZAEPD4C2.js} +2 -2
- package/dist/{chunk-KQW3YGEN.js → chunk-ZRMMXWYI.js} +2 -2
- package/dist/{chunk-P4ZAEYKG.js → chunk-ZX3AYNNV.js} +6 -3
- package/dist/chunk-ZX3AYNNV.js.map +1 -0
- package/dist/{chunk-MCRVQ5YQ.js → chunk-ZZCR2QYL.js} +2 -2
- package/dist/{cli-BNg-TAlz.d.ts → cli-BWri5-am.d.ts} +5 -5
- package/dist/cli.d.ts +18 -16
- package/dist/cli.js +80 -79
- package/dist/coding/export-okf-codegraph.d.ts +1 -1
- package/dist/coding/export-okf-codegraph.js +15 -15
- package/dist/coding/pre-action-gate.d.ts +1 -1
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +16 -16
- package/dist/compounding/preference-consolidator.d.ts +1 -1
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +6 -5
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +16 -16
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +16 -16
- package/dist/consolidation-provenance-check.d.ts +2 -2
- package/dist/consolidation-undo.d.ts +2 -2
- package/dist/contradiction/index.d.ts +6 -5
- package/dist/converge-config.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +2 -2
- package/dist/convergence-refresh.js +18 -18
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/corpus-watermark.d.ts +1 -1
- package/dist/corpus-watermark.js +18 -18
- package/dist/cross-lingual-recall.d.ts +1 -1
- package/dist/day-summary.d.ts +1 -1
- package/dist/deep-recall-http-glue.d.ts +16 -14
- package/dist/deep-recall-http-glue.js +2 -2
- package/dist/deep-recall-mcp-tools.d.ts +16 -14
- package/dist/deep-recall-policy-llm.d.ts +4 -3
- package/dist/deep-recall-policy-llm.js +3 -3
- package/dist/deep-recall-seeds.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/dependency-propagation-config.d.ts +1 -1
- package/dist/{dependency-propagation-delivery-Cq1ekOwV.d.ts → dependency-propagation-delivery-ueZlKTQB.d.ts} +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-origin-fields.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +2 -2
- package/dist/entity-retrieval.js +16 -16
- package/dist/entity-schema.d.ts +1 -1
- package/dist/episodic-context.d.ts +1 -1
- package/dist/eval-trajectory-contracts.d.ts +1 -1
- package/dist/eval-trajectory-store.d.ts +1 -1
- package/dist/eval-trajectory.d.ts +1 -1
- package/dist/explicit-capture.d.ts +13 -12
- package/dist/external-wiki-access.d.ts +16 -14
- package/dist/external-wiki-access.js +40 -40
- package/dist/external-wiki-collection-registration.d.ts +1 -1
- package/dist/external-wiki-collection.d.ts +1 -1
- package/dist/external-wiki-mcp-tools.d.ts +16 -14
- package/dist/extraction-error-classification.d.ts +14 -3
- package/dist/extraction-error-classification.js +5 -3
- package/dist/extraction-faithfulness.d.ts +4 -3
- package/dist/extraction-faithfulness.js +3 -3
- package/dist/extraction-judge-telemetry.d.ts +4 -3
- package/dist/extraction-judge-training.d.ts +4 -3
- package/dist/extraction-judge.d.ts +4 -3
- package/dist/extraction-judge.js +3 -3
- package/dist/extraction-liveness.d.ts +1 -1
- package/dist/extraction-normalization.d.ts +1 -1
- package/dist/extraction-prompt.d.ts +1 -1
- package/dist/extraction-source-grounding-rules.d.ts +1 -1
- package/dist/extraction-source-grounding.d.ts +1 -1
- package/dist/extraction-span-config.d.ts +1 -1
- package/dist/extraction-span-materialize.d.ts +1 -1
- package/dist/extraction.d.ts +4 -4
- package/dist/extraction.js +26 -24
- package/dist/fallback-llm-codex-subscription.d.ts +52 -7
- package/dist/fallback-llm-codex-subscription.js +17 -1
- package/dist/fallback-llm.d.ts +25 -28
- package/dist/fallback-llm.js +4 -3
- package/dist/{generic-recall-paths-BcySh_f9.d.ts → generic-recall-paths-CpyVmA88.d.ts} +1 -1
- package/dist/graph-append-error.d.ts +1 -1
- package/dist/graph-dashboard-diff.d.ts +1 -1
- package/dist/graph-dashboard-key.d.ts +1 -1
- package/dist/graph-dashboard-parser.d.ts +1 -1
- package/dist/graph-edge-reinforcement.d.ts +1 -1
- package/dist/graph-jsonl.d.ts +1 -1
- package/dist/graph-path-reconstruction.d.ts +1 -1
- package/dist/graph-path-scoring.d.ts +1 -1
- package/dist/graph-snapshot.d.ts +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/importers/index.d.ts +1 -1
- package/dist/importers/test-utils.d.ts +1 -1
- package/dist/in-flight-reads.d.ts +1 -1
- package/dist/{index-DWOb4wz9.d.ts → index-BvUA4S7M.d.ts} +3 -3
- package/dist/index.d.ts +80 -40
- package/dist/index.js +140 -115
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +7 -7
- package/dist/lcm/tools.d.ts +1 -1
- package/dist/lifecycle.d.ts +1 -1
- package/dist/live-connectors-runner.d.ts +1 -1
- package/dist/local-llm-BsJGulur.d.ts +247 -0
- package/dist/local-llm-config.d.ts +4 -1
- package/dist/local-llm-config.js +4 -2
- package/dist/local-llm-helpers.d.ts +18 -69
- package/dist/local-llm-helpers.js +1 -1
- package/dist/local-llm.d.ts +3 -170
- package/dist/local-llm.js +2 -2
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/location/index.d.ts +3 -3
- package/dist/location/index.js +18 -18
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +16 -16
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +16 -16
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +17 -17
- package/dist/{maintenance-CW9wCzMP.d.ts → maintenance-CYubtIRr.d.ts} +9 -3
- package/dist/mcp-memory-inspector-app.d.ts +16 -14
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-controller.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-snapshot.d.ts +1 -1
- package/dist/memory-subject-cli.d.ts +16 -14
- package/dist/memory-subject.d.ts +16 -14
- package/dist/memory-worth-outcomes.d.ts +2 -2
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +3 -3
- package/dist/namespaces/migrate.js +17 -17
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +12 -1
- package/dist/namespaces/search.js +9 -9
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +16 -16
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/offline-sync-impression-drain.d.ts +1 -1
- package/dist/operator-doctor-corpus.d.ts +1 -1
- package/dist/operator-doctor-corpus.js +19 -19
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +30 -29
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +27 -27
- package/dist/{orchestrator-DocO0_hw.d.ts → orchestrator-BWDRJ_0d.d.ts} +37 -13
- package/dist/orchestrator.d.ts +13 -12
- package/dist/orchestrator.js +110 -106
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-CiYcqqhl.d.ts → pipeline-7JMn2yMH.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/proactive-contention.d.ts +2 -2
- package/dist/provenance.d.ts +1 -1
- package/dist/{public-http-C0FoTiL_.d.ts → public-http-CJWs3mo9.d.ts} +1 -1
- package/dist/{qmd-qXD4vatU.d.ts → qmd-CxCH9G9m.d.ts} +2 -2
- package/dist/qmd-preflight.d.ts +2 -2
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +2 -2
- package/dist/qmd.js +2 -2
- package/dist/recall-concurrency-config.d.ts +1 -1
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +1 -1
- package/dist/recall-navigate-access.d.ts +1 -1
- package/dist/recall-navigate-access.js +2 -2
- package/dist/recall-navigate-disclosure.d.ts +1 -1
- package/dist/recall-navigate-disclosure.js +1 -1
- package/dist/recall-navigate.d.ts +1 -1
- package/dist/recall-navigate.js +2 -2
- package/dist/recall-planner-llm.d.ts +3 -2
- package/dist/recall-planner-llm.js +4 -3
- package/dist/recall-planner-llm.js.map +1 -1
- package/dist/recall-state-view-admission.d.ts +13 -3
- package/dist/recall-state-view-admission.js +8 -8
- package/dist/recall-state-view-anchors.d.ts +85 -0
- package/dist/recall-state-view-anchors.js +21 -0
- package/dist/recall-state-view-anchors.js.map +1 -0
- package/dist/recall-state-view-inject.js +2 -2
- package/dist/recall-state-view-render.js +2 -2
- package/dist/recall-state-view-widen.js +2 -2
- package/dist/recall-state-view-wire.js +3 -3
- package/dist/recall-state-view.d.ts +38 -1
- package/dist/recall-state-view.js +11 -3
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.d.ts +1 -1
- package/dist/recall-timings.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +1 -1
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/cursor.d.ts +1 -1
- package/dist/reconcile/manifest.d.ts +1 -1
- package/dist/reconcile/plan.d.ts +1 -1
- package/dist/replay/normalizers/chatgpt.d.ts +1 -1
- package/dist/replay/normalizers/claude.d.ts +1 -1
- package/dist/replay/normalizers/openclaw.d.ts +1 -1
- package/dist/replay/normalizers/shared.d.ts +1 -1
- package/dist/replay/runner.d.ts +1 -1
- package/dist/replay/types.d.ts +1 -1
- package/dist/replica-divergence.d.ts +1 -1
- package/dist/replica-peers-config.d.ts +1 -1
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/resume-bundles.js +7 -6
- package/dist/retrieval-agents.d.ts +2 -2
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +1 -1
- package/dist/routing/store.d.ts +1 -1
- package/dist/salvage-envelope.d.ts +1 -1
- package/dist/{scope-profiles-BT9rqC3w.d.ts → scope-profiles-BGAUqhBR.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +8 -8
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +12 -12
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +2 -2
- package/dist/search/port.js +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/search/remote-backend.js +2 -2
- package/dist/{semantic-consolidation-CmZi7thY.d.ts → semantic-consolidation-CCeRD9pV.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +17 -17
- package/dist/semantic-rule-promotion.js +16 -16
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +16 -16
- package/dist/{service-CLkA7AQB.d.ts → service-BwpzRduk.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +1 -1
- package/dist/signal.d.ts +1 -1
- package/dist/source-agent-qualifier.d.ts +1 -1
- package/dist/source-agent-qualifier.js +19 -19
- package/dist/standup/build.js +16 -16
- package/dist/{storage-wvX01lht.d.ts → storage-BprAGBG0.d.ts} +2 -1
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +15 -15
- package/dist/subject-config.d.ts +1 -1
- package/dist/summarizer.d.ts +1 -1
- package/dist/summarizer.js +5 -5
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/support-passport/index.d.ts +18 -17
- package/dist/support-passport/index.js +42 -42
- package/dist/task-llm-config.d.ts +16 -0
- package/dist/task-llm-config.js +12 -0
- package/dist/task-llm-config.js.map +1 -0
- package/dist/temporal-supersession.d.ts +2 -2
- package/dist/temporal-timeline-recall.d.ts +1 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +1 -1
- package/dist/tier-migration.d.ts +2 -2
- package/dist/tier-routing.d.ts +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transfer/export-okf.d.ts +1 -1
- package/dist/transfer/export-okf.js +16 -16
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-Cyr32ABj.d.ts → types-nJV23pa3.d.ts} +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +16 -16
- package/dist/who-knows-cli.d.ts +16 -14
- package/dist/who-knows-cli.js +17 -17
- package/dist/who-knows.d.ts +16 -14
- package/dist/who-knows.js +16 -16
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -2
- package/src/access-category-alias.test.ts +93 -0
- package/src/access-offline-manifest.ts +52 -2
- package/src/access-schema.ts +9 -4
- package/src/activity/config.test.ts +61 -0
- package/src/activity/config.ts +40 -1
- package/src/activity/timeline/analysis-provider.ts +8 -2
- package/src/activity/timeline/analysis-run.test.ts +82 -0
- package/src/activity/timeline/publish-cli.test.ts +30 -0
- package/src/activity/timeline/publish-cli.ts +7 -0
- package/src/activity/timeline/query.ts +8 -1
- package/src/activity/timeline/regenerate.test.ts +82 -2
- package/src/activity/timeline/regenerate.ts +7 -1
- package/src/activity/vault-frontmatter.test.ts +99 -1
- package/src/activity/vault-frontmatter.ts +131 -0
- package/src/activity/vault-publish.ts +6 -0
- package/src/activity/vault-publisher.test.ts +172 -0
- package/src/activity/vault-publisher.ts +69 -15
- package/src/activity/vault-region.test.ts +7 -2
- package/src/activity/vault-region.ts +7 -3
- package/src/background-generation-config.ts +32 -6
- package/src/background-generation.test.ts +10 -1
- package/src/cli/timeline-publish-commands.ts +9 -0
- package/src/config.test.ts +170 -43
- package/src/config.ts +17 -5
- package/src/extraction-error-classification.ts +36 -1
- package/src/extraction-timeout.test.ts +110 -1
- package/src/extraction.test.ts +19 -1
- package/src/extraction.ts +23 -21
- package/src/fallback-llm-codex-subscription.ts +193 -7
- package/src/fallback-llm-parse-failure.test.ts +156 -0
- package/src/fallback-llm.test.ts +58 -0
- package/src/fallback-llm.ts +187 -186
- package/src/index.ts +1 -0
- package/src/local-llm-config.ts +11 -10
- package/src/local-llm-headers-timeout.test.ts +30 -0
- package/src/local-llm-helpers.ts +28 -0
- package/src/local-llm.ts +8 -19
- package/src/namespaces/search.test.ts +51 -1
- package/src/namespaces/search.ts +48 -3
- package/src/orchestration/extraction-persist-promotion.test.ts +228 -2
- package/src/orchestration/extraction-persist-promotion.ts +17 -14
- package/src/orchestration/orchestrator-helpers.test.ts +104 -0
- package/src/orchestration/orchestrator-init.ts +366 -106
- package/src/orchestration/recall-internal.ts +85 -74
- package/src/orchestration/recall-rerank-coordinator.ts +41 -4
- package/src/orchestration/recall-search-pipeline.ts +25 -18
- package/src/orchestration/recall-state-view-pipeline.test.ts +89 -0
- package/src/orchestration/semantic-merge-promotion-payload.ts +62 -6
- package/src/orchestration/startup-collection-checks.ts +85 -0
- package/src/orchestrator-flush.test.ts +7 -0
- package/src/orchestrator-init.test.ts +1539 -0
- package/src/orchestrator.ts +7 -0
- package/src/qmd.ts +21 -10
- package/src/recall-rerank-coordinator.test.ts +153 -0
- package/src/recall-state-view-admission.ts +11 -1
- package/src/recall-state-view-anchors.ts +163 -0
- package/src/recall-state-view-cron-intent.test.ts +268 -0
- package/src/recall-state-view-widen.test.ts +14 -5
- package/src/recall-state-view-widen.ts +29 -8
- package/src/recall-state-view-zero-diff.test.ts +30 -0
- package/src/recall-state-view.test.ts +161 -0
- package/src/recall-state-view.ts +211 -37
- package/src/reconcile-identity-cache.test.ts +82 -1
- package/src/search/port.ts +1 -1
- package/src/storage/cas-revision-store.test.ts +4 -0
- package/src/storage/cas-revision-store.ts +104 -12
- package/src/storage-frontmatter-cas.test.ts +19 -17
- package/src/summarizer.ts +5 -1
- package/src/task-llm-config.test.ts +124 -0
- package/src/task-llm-config.ts +88 -0
- package/src/testing/subjects/startup-discovery-lifecycle.test.ts +273 -0
- package/src/trust-score-recall-paths.test.ts +1 -1
- package/src/types.ts +1 -0
- package/dist/chunk-255PC37A.js +0 -120
- package/dist/chunk-255PC37A.js.map +0 -1
- package/dist/chunk-2MT4ADLQ.js.map +0 -1
- package/dist/chunk-3CBI2ZSA.js.map +0 -1
- package/dist/chunk-3OYSIVOO.js.map +0 -1
- package/dist/chunk-5AERZWJD.js.map +0 -1
- package/dist/chunk-5HYUUFMQ.js.map +0 -1
- package/dist/chunk-6H2G7RFT.js.map +0 -1
- package/dist/chunk-7S53BPTU.js.map +0 -1
- package/dist/chunk-ACY4ZPF7.js.map +0 -1
- package/dist/chunk-B36GUU6T.js.map +0 -1
- package/dist/chunk-BJEJUOGM.js.map +0 -1
- package/dist/chunk-BLDBT6HZ.js.map +0 -1
- package/dist/chunk-CWTCMZGE.js.map +0 -1
- package/dist/chunk-IYKZJVL5.js.map +0 -1
- package/dist/chunk-JXN77SGO.js.map +0 -1
- package/dist/chunk-LQNRVPTV.js.map +0 -1
- package/dist/chunk-MVAQ2WM3.js.map +0 -1
- package/dist/chunk-P4ZAEYKG.js.map +0 -1
- package/dist/chunk-QHT7MOUF.js.map +0 -1
- package/dist/chunk-V6G2PSXA.js.map +0 -1
- package/dist/chunk-VELCIWJZ.js.map +0 -1
- package/dist/chunk-WKDFJXW5.js.map +0 -1
- package/dist/chunk-XWLLFKHM.js.map +0 -1
- package/dist/chunk-YFTNZMGR.js.map +0 -1
- /package/dist/{auto-sync-RP4C6ZPF.js.map → auto-sync-D6BAPIJV.js.map} +0 -0
- /package/dist/{chunk-T32B72QX.js.map → chunk-2SKMZUOW.js.map} +0 -0
- /package/dist/{chunk-VHOSM5G4.js.map → chunk-2SNCQHJZ.js.map} +0 -0
- /package/dist/{chunk-VV4ZVUE6.js.map → chunk-3QEVOQF5.js.map} +0 -0
- /package/dist/{chunk-3N3PBBEH.js.map → chunk-3XPN7AVY.js.map} +0 -0
- /package/dist/{chunk-XN6XT6GR.js.map → chunk-46Z3VGWF.js.map} +0 -0
- /package/dist/{chunk-2PTNJTBE.js.map → chunk-4CMXI55L.js.map} +0 -0
- /package/dist/{chunk-A6CKMIPK.js.map → chunk-7D6SER6A.js.map} +0 -0
- /package/dist/{chunk-4B3HBIFX.js.map → chunk-7Z54NXVS.js.map} +0 -0
- /package/dist/{chunk-X2NFFBTO.js.map → chunk-A7GQBJP5.js.map} +0 -0
- /package/dist/{chunk-NWMUSKED.js.map → chunk-BGRTZOJB.js.map} +0 -0
- /package/dist/{chunk-ZEGL7YCC.js.map → chunk-BXIJSPCL.js.map} +0 -0
- /package/dist/{chunk-MLWMR2GE.js.map → chunk-BYQX4IOG.js.map} +0 -0
- /package/dist/{chunk-ULDBGA5W.js.map → chunk-C5R73BON.js.map} +0 -0
- /package/dist/{chunk-BD7JTBYP.js.map → chunk-D7MAYFQP.js.map} +0 -0
- /package/dist/{chunk-BRZWWUCJ.js.map → chunk-DFVSJFHK.js.map} +0 -0
- /package/dist/{chunk-DPMTLJCT.js.map → chunk-ES5BUPYB.js.map} +0 -0
- /package/dist/{chunk-TNSCIPBQ.js.map → chunk-G6NQ3L4T.js.map} +0 -0
- /package/dist/{chunk-5N4MZLEH.js.map → chunk-GO5LOHCD.js.map} +0 -0
- /package/dist/{chunk-AECJY3GJ.js.map → chunk-GSSDHAYH.js.map} +0 -0
- /package/dist/{chunk-JA2QJOAX.js.map → chunk-HJUP3K6L.js.map} +0 -0
- /package/dist/{chunk-ZKZFFWLV.js.map → chunk-ICNJ6J46.js.map} +0 -0
- /package/dist/{chunk-6EHM2AV7.js.map → chunk-IMBQFHRV.js.map} +0 -0
- /package/dist/{chunk-6PRY6CLC.js.map → chunk-IOPIGX7Y.js.map} +0 -0
- /package/dist/{chunk-TRHBQVVO.js.map → chunk-IS2IDFJP.js.map} +0 -0
- /package/dist/{chunk-R4VAUNNC.js.map → chunk-J4WGTN2N.js.map} +0 -0
- /package/dist/{chunk-JPOX2AJB.js.map → chunk-J7FVMLBR.js.map} +0 -0
- /package/dist/{chunk-BYZKLEWG.js.map → chunk-JAJIMTFB.js.map} +0 -0
- /package/dist/{chunk-OKO57IXB.js.map → chunk-JOP7W24J.js.map} +0 -0
- /package/dist/{chunk-YUW66UAH.js.map → chunk-JUDT33RX.js.map} +0 -0
- /package/dist/{chunk-UQNYPK7G.js.map → chunk-K4JKAXMO.js.map} +0 -0
- /package/dist/{chunk-BV4ZKIZH.js.map → chunk-K75A5XWU.js.map} +0 -0
- /package/dist/{chunk-M6HBPLBA.js.map → chunk-KOTG3RXE.js.map} +0 -0
- /package/dist/{chunk-OB3XMWX5.js.map → chunk-KVO2BTA4.js.map} +0 -0
- /package/dist/{chunk-CBFYCDYO.js.map → chunk-KY236SP5.js.map} +0 -0
- /package/dist/{chunk-4BCHFSC7.js.map → chunk-LFVZD5EC.js.map} +0 -0
- /package/dist/{chunk-GGAXFTNH.js.map → chunk-LKFVVN7R.js.map} +0 -0
- /package/dist/{chunk-4RX5O34R.js.map → chunk-MJC7UKH7.js.map} +0 -0
- /package/dist/{chunk-UZZ7SQT3.js.map → chunk-NVVZPBKI.js.map} +0 -0
- /package/dist/{chunk-TTSJ7WUC.js.map → chunk-PKUJNICO.js.map} +0 -0
- /package/dist/{chunk-QMWKENNK.js.map → chunk-Q4AUIFUA.js.map} +0 -0
- /package/dist/{chunk-G43PMSME.js.map → chunk-QE6YVNP5.js.map} +0 -0
- /package/dist/{chunk-GT4ZHOKT.js.map → chunk-QPVNK2VE.js.map} +0 -0
- /package/dist/{chunk-K5DA5TRG.js.map → chunk-QS5Q5RBV.js.map} +0 -0
- /package/dist/{chunk-BX4EOMKT.js.map → chunk-RDLPFM7I.js.map} +0 -0
- /package/dist/{chunk-EY5JAWZC.js.map → chunk-RJQAP333.js.map} +0 -0
- /package/dist/{chunk-2OGTN37H.js.map → chunk-ROEFLU37.js.map} +0 -0
- /package/dist/{chunk-62QIQEUC.js.map → chunk-SFHLQPBF.js.map} +0 -0
- /package/dist/{chunk-HVS7TH2Y.js.map → chunk-SUEOG2S4.js.map} +0 -0
- /package/dist/{chunk-74AHCL56.js.map → chunk-TEMKBSV6.js.map} +0 -0
- /package/dist/{chunk-KDFDXEXZ.js.map → chunk-TO36VPZI.js.map} +0 -0
- /package/dist/{chunk-M3MYMWXG.js.map → chunk-V2ZA4YWE.js.map} +0 -0
- /package/dist/{chunk-UIOIDW3L.js.map → chunk-VHKXRYQN.js.map} +0 -0
- /package/dist/{chunk-GAS7KYC7.js.map → chunk-VKWFNPBH.js.map} +0 -0
- /package/dist/{chunk-XGRXQR6T.js.map → chunk-VQWBUPSJ.js.map} +0 -0
- /package/dist/{chunk-TUKGXQ5T.js.map → chunk-VQYWKCDR.js.map} +0 -0
- /package/dist/{chunk-PPQEP4OH.js.map → chunk-W23JARAQ.js.map} +0 -0
- /package/dist/{chunk-YQNNHLCG.js.map → chunk-WPGR3RW4.js.map} +0 -0
- /package/dist/{chunk-474DL7UB.js.map → chunk-WZYHPAG5.js.map} +0 -0
- /package/dist/{chunk-GQQVEH6V.js.map → chunk-XM46Y66S.js.map} +0 -0
- /package/dist/{chunk-JNSENHV5.js.map → chunk-YRIFXXMI.js.map} +0 -0
- /package/dist/{chunk-TRLOFIQC.js.map → chunk-YTK5MVNF.js.map} +0 -0
- /package/dist/{chunk-VMNCZ627.js.map → chunk-YTZN2UZO.js.map} +0 -0
- /package/dist/{chunk-6ZMNTRU3.js.map → chunk-ZAEPD4C2.js.map} +0 -0
- /package/dist/{chunk-KQW3YGEN.js.map → chunk-ZRMMXWYI.js.map} +0 -0
- /package/dist/{chunk-MCRVQ5YQ.js.map → chunk-ZZCR2QYL.js.map} +0 -0
|
@@ -46,11 +46,13 @@ import { TranscriptManager } from "../transcript.js";
|
|
|
46
46
|
import type { PluginConfig } from "../types.js";
|
|
47
47
|
import { type UtilityRuntimeValues, loadUtilityRuntimeValues } from "../utility-runtime.js";
|
|
48
48
|
import { WearablesService } from "../wearables/service.js";
|
|
49
|
+
import { startupDiscoveryWithTimeout } from "./startup-collection-checks.js";
|
|
49
50
|
import type { MeetingsService } from "../meetings/service.js";
|
|
50
51
|
import {
|
|
51
52
|
COMPACTION_SIGNAL_MAX_AGE_MS,
|
|
52
53
|
defaultWorkspaceDir,
|
|
53
54
|
qmdStartupCollectionCheckWithTimeout,
|
|
55
|
+
qmdStartupCollectionChecksWithTimeout,
|
|
54
56
|
} from "../orchestrator.js";
|
|
55
57
|
|
|
56
58
|
export interface OrchestratorInitDeps {
|
|
@@ -98,19 +100,204 @@ export interface OrchestratorInitDeps {
|
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
export class OrchestratorInitCoordinator {
|
|
103
|
+
private nextStartupEpoch = 0;
|
|
104
|
+
private activeStartupEpoch: number | null = null;
|
|
105
|
+
private startupClosed = false;
|
|
106
|
+
private maintenanceNamespacesFlight:
|
|
107
|
+
| { epoch: number; promise: Promise<string[]> }
|
|
108
|
+
| undefined;
|
|
109
|
+
private correctionCatalogFlight:
|
|
110
|
+
| { epoch: number; promise: Promise<Awaited<ReturnType<NamespaceCatalog["listNamespaces"]>>> }
|
|
111
|
+
| undefined;
|
|
112
|
+
private recoveredCorrectionNamespaces = new Set<string>();
|
|
113
|
+
private correctionRecoveryChain: Promise<void> = Promise.resolve();
|
|
114
|
+
private startupEpochAbort:
|
|
115
|
+
| { epoch: number; controller: AbortController }
|
|
116
|
+
| undefined;
|
|
117
|
+
|
|
101
118
|
constructor(
|
|
102
119
|
private readonly deps: OrchestratorInitDeps,
|
|
103
120
|
) {}
|
|
104
121
|
|
|
122
|
+
/** Retire the current lifecycle without constructing a lazy coordinator. */
|
|
123
|
+
retireStartupEpoch(): void {
|
|
124
|
+
this.startupEpochAbort?.controller.abort();
|
|
125
|
+
this.startupEpochAbort = undefined;
|
|
126
|
+
this.startupClosed = true;
|
|
127
|
+
this.activeStartupEpoch = null;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
private beginStartupEpoch(): number {
|
|
131
|
+
this.startupEpochAbort?.controller.abort();
|
|
132
|
+
this.startupEpochAbort = undefined;
|
|
133
|
+
// A replacement lifecycle owns new deferred work. Abort the previous
|
|
134
|
+
// controller before replacing it so stale warmup/cache/cron phases cannot
|
|
135
|
+
// continue after a same-instance re-initialize.
|
|
136
|
+
this.deps.deferredInitAbort?.abort();
|
|
137
|
+
this.deps.deferredInitAbort = null;
|
|
138
|
+
this.deps.deferredSyncSucceeded = false;
|
|
139
|
+
const epoch = ++this.nextStartupEpoch;
|
|
140
|
+
this.startupEpochAbort = { epoch, controller: new AbortController() };
|
|
141
|
+
this.activeStartupEpoch = epoch;
|
|
142
|
+
this.startupClosed = false;
|
|
143
|
+
this.maintenanceNamespacesFlight = undefined;
|
|
144
|
+
this.correctionCatalogFlight = undefined;
|
|
145
|
+
this.recoveredCorrectionNamespaces = new Set<string>();
|
|
146
|
+
this.correctionRecoveryChain = Promise.resolve();
|
|
147
|
+
return epoch;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
private currentOrNewStartupEpoch(): number | null {
|
|
151
|
+
if (this.startupClosed) return null;
|
|
152
|
+
return this.activeStartupEpoch ?? this.beginStartupEpoch();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
private isCurrentStartupEpoch(epoch: number): boolean {
|
|
156
|
+
return !this.startupClosed && this.activeStartupEpoch === epoch;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
private startupEpochSignal(epoch: number): AbortSignal | undefined {
|
|
160
|
+
return this.startupEpochAbort?.epoch === epoch
|
|
161
|
+
? this.startupEpochAbort.controller.signal
|
|
162
|
+
: undefined;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
private linkedEpochAbortController(
|
|
166
|
+
epoch: number,
|
|
167
|
+
externalSignal?: AbortSignal,
|
|
168
|
+
): { controller: AbortController; dispose(): void } {
|
|
169
|
+
const controller = new AbortController();
|
|
170
|
+
const signals = [this.startupEpochSignal(epoch), externalSignal]
|
|
171
|
+
.filter((signal): signal is AbortSignal => signal !== undefined);
|
|
172
|
+
const abort = () => controller.abort();
|
|
173
|
+
for (const signal of signals) {
|
|
174
|
+
if (signal.aborted) abort();
|
|
175
|
+
else signal.addEventListener("abort", abort, { once: true });
|
|
176
|
+
}
|
|
177
|
+
return {
|
|
178
|
+
controller,
|
|
179
|
+
dispose: () => {
|
|
180
|
+
for (const signal of signals) signal.removeEventListener("abort", abort);
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
private async probeForStartupEpoch(
|
|
186
|
+
epoch: number,
|
|
187
|
+
externalSignal?: AbortSignal,
|
|
188
|
+
): Promise<boolean> {
|
|
189
|
+
const abort = this.linkedEpochAbortController(epoch, externalSignal);
|
|
190
|
+
try {
|
|
191
|
+
if (!this.isCurrentStartupEpoch(epoch) || abort.controller.signal.aborted) return false;
|
|
192
|
+
return await this.deps.qmd.probe({ signal: abort.controller.signal });
|
|
193
|
+
} finally {
|
|
194
|
+
abort.dispose();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
private maintenanceNamespacesFlightFor(epoch: number): Promise<string[]> {
|
|
199
|
+
if (this.maintenanceNamespacesFlight?.epoch === epoch) {
|
|
200
|
+
return this.maintenanceNamespacesFlight.promise;
|
|
201
|
+
}
|
|
202
|
+
const promise = Promise.resolve().then(() => {
|
|
203
|
+
if (!this.isCurrentStartupEpoch(epoch)) return [];
|
|
204
|
+
return this.deps.maintenanceNamespaces();
|
|
205
|
+
});
|
|
206
|
+
this.maintenanceNamespacesFlight = { epoch, promise };
|
|
207
|
+
void promise.catch(() => {
|
|
208
|
+
if (
|
|
209
|
+
this.isCurrentStartupEpoch(epoch) &&
|
|
210
|
+
this.maintenanceNamespacesFlight?.epoch === epoch &&
|
|
211
|
+
this.maintenanceNamespacesFlight.promise === promise
|
|
212
|
+
) {
|
|
213
|
+
this.maintenanceNamespacesFlight = undefined;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
return promise;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
private correctionCatalogFlightFor(
|
|
220
|
+
epoch: number,
|
|
221
|
+
): Promise<Awaited<ReturnType<NamespaceCatalog["listNamespaces"]>>> {
|
|
222
|
+
if (!this.isCurrentStartupEpoch(epoch)) {
|
|
223
|
+
return Promise.resolve([]);
|
|
224
|
+
}
|
|
225
|
+
if (this.correctionCatalogFlight?.epoch === epoch) {
|
|
226
|
+
return this.correctionCatalogFlight.promise;
|
|
227
|
+
}
|
|
228
|
+
const promise = Promise.resolve().then(() => {
|
|
229
|
+
if (!this.isCurrentStartupEpoch(epoch)) return [];
|
|
230
|
+
return this.deps.namespaceCatalog.listNamespaces();
|
|
231
|
+
});
|
|
232
|
+
this.correctionCatalogFlight = { epoch, promise };
|
|
233
|
+
return promise;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
private enqueueCorrectionRecovery(epoch: number, namespaces: Iterable<string>): Promise<void> {
|
|
237
|
+
if (!this.isCurrentStartupEpoch(epoch)) return Promise.resolve();
|
|
238
|
+
const unrecovered = [...new Set(namespaces)].filter(
|
|
239
|
+
(namespace) => !this.recoveredCorrectionNamespaces.has(namespace),
|
|
240
|
+
);
|
|
241
|
+
if (unrecovered.length === 0) return this.correctionRecoveryChain;
|
|
242
|
+
for (const namespace of unrecovered) this.recoveredCorrectionNamespaces.add(namespace);
|
|
243
|
+
|
|
244
|
+
this.correctionRecoveryChain = this.correctionRecoveryChain.then(async () => {
|
|
245
|
+
if (!this.isCurrentStartupEpoch(epoch)) return;
|
|
246
|
+
try {
|
|
247
|
+
const recovered = await this.deps.passiveCorrectionService().recoverStaleApplyingPlans(
|
|
248
|
+
unrecovered,
|
|
249
|
+
);
|
|
250
|
+
if (recovered > 0) {
|
|
251
|
+
log.info(`correction: recovered ${recovered} stale applying plan(s) on startup`);
|
|
252
|
+
}
|
|
253
|
+
} catch (staleErr) {
|
|
254
|
+
log.debug(`correction: stale-plan recovery skipped: ${staleErr instanceof Error ? staleErr.message : String(staleErr)}`);
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
return this.correctionRecoveryChain;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
private async startupNamespaces(epoch: number): Promise<{ namespaces: string[]; complete: boolean }> {
|
|
261
|
+
if (!this.isCurrentStartupEpoch(epoch)) {
|
|
262
|
+
return { namespaces: this.deps.configuredNamespaceList(), complete: false };
|
|
263
|
+
}
|
|
264
|
+
if (!resolveNamespaceCapabilities(this.deps.config).namespaces) {
|
|
265
|
+
return { namespaces: [this.deps.config.defaultNamespace], complete: true };
|
|
266
|
+
}
|
|
267
|
+
const discovery = await startupDiscoveryWithTimeout(
|
|
268
|
+
() => this.maintenanceNamespacesFlightFor(epoch),
|
|
269
|
+
this.deps.configuredNamespaceList(),
|
|
270
|
+
);
|
|
271
|
+
return { namespaces: discovery.value, complete: discovery.complete };
|
|
272
|
+
}
|
|
273
|
+
|
|
105
274
|
async initialize(): Promise<void> {
|
|
275
|
+
const epoch = this.beginStartupEpoch();
|
|
106
276
|
// Recreate the deferred-ready gate on every initialize() call.
|
|
107
277
|
// The same Orchestrator instance may be reused across stop/start cycles
|
|
108
278
|
// (src/index.ts does this). Without this reset, the second cycle's
|
|
109
279
|
// `await orchestrator.deferredReady` resolves immediately (already settled
|
|
110
280
|
// from the first cycle) while the new deferredInitialize() is still running.
|
|
281
|
+
let resolveDeferred: (() => void) | undefined;
|
|
111
282
|
this.deps.deferredReady = new Promise<void>((resolve) => {
|
|
112
|
-
|
|
283
|
+
resolveDeferred = () => resolve();
|
|
284
|
+
this.deps.resolveDeferredReady = resolveDeferred;
|
|
113
285
|
});
|
|
286
|
+
const settleOwnDeferredReady = () => {
|
|
287
|
+
if (this.deps.resolveDeferredReady === resolveDeferred) {
|
|
288
|
+
this.deps.resolveDeferredReady = null;
|
|
289
|
+
}
|
|
290
|
+
resolveDeferred?.();
|
|
291
|
+
};
|
|
292
|
+
const exitIfStale = () => {
|
|
293
|
+
if (this.isCurrentStartupEpoch(epoch)) return false;
|
|
294
|
+
if (this.startupClosed && this.deps.resolveInit) {
|
|
295
|
+
this.deps.resolveInit();
|
|
296
|
+
this.deps.resolveInit = null;
|
|
297
|
+
}
|
|
298
|
+
settleOwnDeferredReady();
|
|
299
|
+
return true;
|
|
300
|
+
};
|
|
114
301
|
|
|
115
302
|
try {
|
|
116
303
|
await migrateFromEngram({
|
|
@@ -148,30 +335,40 @@ export class OrchestratorInitCoordinator {
|
|
|
148
335
|
await this.deps.namespaceCatalog.registerConfiguredNamespaces().catch(() => undefined);
|
|
149
336
|
}
|
|
150
337
|
// #1713 Item 2: recover stale `applying` correction plans left behind
|
|
151
|
-
// by a process that died mid-apply.
|
|
152
|
-
//
|
|
153
|
-
//
|
|
338
|
+
// by a process that died mid-apply. The raw catalog flight is per-startup
|
|
339
|
+
// epoch: fallback recovery stays bounded, while a guarded late result can
|
|
340
|
+
// recover dynamic plans without restarting any QMD work.
|
|
154
341
|
try {
|
|
155
|
-
// #1713 Item 2 + P2 (cursor): sweep ALL known namespaces — configured
|
|
156
|
-
// + catalog-discovered — so stale applying plans in derived namespaces
|
|
157
|
-
// (coding-scoped, session-derived) are also recovered.
|
|
158
342
|
const correctionNamespaces = new Set(this.deps.configuredNamespaceList());
|
|
159
343
|
if (this.deps.namespaceCatalog.enabled) {
|
|
160
344
|
try {
|
|
161
|
-
|
|
345
|
+
const catalogFlight = this.correctionCatalogFlightFor(epoch);
|
|
346
|
+
const catalogDiscovery = await startupDiscoveryWithTimeout(
|
|
347
|
+
() => catalogFlight,
|
|
348
|
+
[],
|
|
349
|
+
);
|
|
350
|
+
for (const rec of catalogDiscovery.value) {
|
|
162
351
|
correctionNamespaces.add(rec.namespace);
|
|
163
352
|
}
|
|
353
|
+
if (!catalogDiscovery.complete) {
|
|
354
|
+
void catalogFlight.then(
|
|
355
|
+
(records) => {
|
|
356
|
+
if (!this.isCurrentStartupEpoch(epoch)) return;
|
|
357
|
+
void this.enqueueCorrectionRecovery(
|
|
358
|
+
epoch,
|
|
359
|
+
records.map((record) => record.namespace),
|
|
360
|
+
);
|
|
361
|
+
},
|
|
362
|
+
() => undefined,
|
|
363
|
+
);
|
|
364
|
+
}
|
|
164
365
|
} catch { /* best-effort */ }
|
|
165
366
|
}
|
|
166
|
-
|
|
167
|
-
[...correctionNamespaces],
|
|
168
|
-
);
|
|
169
|
-
if (recovered > 0) {
|
|
170
|
-
log.info(`correction: recovered ${recovered} stale applying plan(s) on startup`);
|
|
171
|
-
}
|
|
367
|
+
await this.enqueueCorrectionRecovery(epoch, correctionNamespaces);
|
|
172
368
|
} catch (staleErr) {
|
|
173
369
|
log.debug(`correction: stale-plan recovery skipped: ${staleErr instanceof Error ? staleErr.message : String(staleErr)}`);
|
|
174
370
|
}
|
|
371
|
+
if (exitIfStale()) return;
|
|
175
372
|
await this.deps.relevance.load();
|
|
176
373
|
await this.deps.negatives.load();
|
|
177
374
|
await this.deps.lastRecall.load();
|
|
@@ -253,7 +450,7 @@ export class OrchestratorInitCoordinator {
|
|
|
253
450
|
// this.deps.qmd while it's still the real client, then get errors when
|
|
254
451
|
// deferredInitialize() swaps it to NoopSearchBackend mid-query.
|
|
255
452
|
try {
|
|
256
|
-
const available = await this.
|
|
453
|
+
const available = await this.probeForStartupEpoch(epoch);
|
|
257
454
|
if (available) {
|
|
258
455
|
log.info(`Search backend: available ${this.deps.qmd.debugStatus()}`);
|
|
259
456
|
// Ensure collections at startup for the catalog-union namespace set, not
|
|
@@ -263,55 +460,69 @@ export class OrchestratorInitCoordinator {
|
|
|
263
460
|
// after a restart. `registerConfiguredNamespaces()` already seeded the
|
|
264
461
|
// catalog above, so `maintenanceNamespaces()` is readable here; it falls
|
|
265
462
|
// back to the configured set on any catalog read failure.
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
)
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
463
|
+
const namespaceCapabilities = resolveNamespaceCapabilities(this.deps.config).namespaces;
|
|
464
|
+
const discovery = await this.startupNamespaces(epoch);
|
|
465
|
+
if (!this.isCurrentStartupEpoch(epoch)) {
|
|
466
|
+
log.debug("startup collection check skipped for a retired startup epoch");
|
|
467
|
+
} else {
|
|
468
|
+
const checks = discovery.namespaces.map(async (namespace) => {
|
|
469
|
+
const epochAbort = this.linkedEpochAbortController(epoch);
|
|
470
|
+
try {
|
|
471
|
+
const state = await qmdStartupCollectionCheckWithTimeout(
|
|
472
|
+
namespaceCapabilities
|
|
473
|
+
? this.deps.namespaceSearchRouter.ensureNamespaceCollection(
|
|
474
|
+
namespace,
|
|
475
|
+
{ signal: epochAbort.controller.signal },
|
|
476
|
+
)
|
|
477
|
+
: this.deps.qmd.ensureCollection(
|
|
478
|
+
this.deps.config.memoryDir,
|
|
479
|
+
this.deps.config.qmdCollection,
|
|
480
|
+
{ signal: epochAbort.controller.signal },
|
|
481
|
+
),
|
|
482
|
+
epochAbort.controller,
|
|
483
|
+
namespace,
|
|
484
|
+
);
|
|
485
|
+
return { namespace, state };
|
|
486
|
+
} finally {
|
|
487
|
+
epochAbort.dispose();
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
const states = await qmdStartupCollectionChecksWithTimeout(checks, discovery.namespaces);
|
|
491
|
+
if (!this.isCurrentStartupEpoch(epoch)) {
|
|
492
|
+
log.debug("startup collection-check batch completed for a retired startup epoch");
|
|
493
|
+
} else {
|
|
494
|
+
const defaultState =
|
|
495
|
+
states.find(
|
|
496
|
+
(entry) => entry.namespace === this.deps.config.defaultNamespace,
|
|
497
|
+
)?.state ?? "unknown";
|
|
498
|
+
if (defaultState === "missing") {
|
|
499
|
+
await this.deps.disposeSearchBackendIfNeeded();
|
|
500
|
+
if (!this.isCurrentStartupEpoch(epoch)) {
|
|
501
|
+
log.debug("startup collection-check disposal completed for a retired startup epoch");
|
|
502
|
+
} else {
|
|
503
|
+
this.deps.qmd = new NoopSearchBackend();
|
|
504
|
+
log.warn(
|
|
505
|
+
"Search collection missing for Remnic memory store; disabling search retrieval for this runtime (fallback retrieval remains enabled)",
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
} else if (defaultState === "unknown") {
|
|
311
509
|
log.warn(
|
|
312
|
-
|
|
510
|
+
"Search collection check unavailable; keeping search retrieval enabled for fail-open behavior",
|
|
511
|
+
);
|
|
512
|
+
} else if (defaultState === "skipped") {
|
|
513
|
+
log.debug(
|
|
514
|
+
"Search collection check skipped (remote or daemon-only mode)",
|
|
313
515
|
);
|
|
314
516
|
}
|
|
517
|
+
for (const entry of states) {
|
|
518
|
+
if (entry.namespace === this.deps.config.defaultNamespace) continue;
|
|
519
|
+
if (entry.state === "missing") {
|
|
520
|
+
log.warn(
|
|
521
|
+
`Search collection missing for namespace '${entry.namespace}'; namespace retrieval will fail open to non-search paths`,
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
315
526
|
}
|
|
316
527
|
} else if (this.deps.qmd instanceof NoopSearchBackend) {
|
|
317
528
|
log.debug(`Search backend: noop (search intentionally disabled)`);
|
|
@@ -321,6 +532,7 @@ export class OrchestratorInitCoordinator {
|
|
|
321
532
|
} catch (err) {
|
|
322
533
|
log.error(`QMD probe/collection check failed (non-fatal): ${err}`);
|
|
323
534
|
}
|
|
535
|
+
if (exitIfStale()) return;
|
|
324
536
|
|
|
325
537
|
// Open the init gate — essential state (storage, aliases, relevance,
|
|
326
538
|
// transcript, summarizer, buffer) is loaded AND QMD state is finalized
|
|
@@ -344,15 +556,16 @@ export class OrchestratorInitCoordinator {
|
|
|
344
556
|
// overwrite this.deps.resolveDeferredReady before .finally() runs — that would
|
|
345
557
|
// cause the first cycle's .finally() to resolve the *second* cycle's
|
|
346
558
|
// promise prematurely while leaving the first cycle's promise pending.
|
|
347
|
-
|
|
348
|
-
|
|
559
|
+
if (this.deps.resolveDeferredReady === resolveDeferred) {
|
|
560
|
+
this.deps.resolveDeferredReady = null;
|
|
561
|
+
}
|
|
349
562
|
this.deps.deferredInitAbort = new AbortController();
|
|
350
563
|
this.deps.deferredInitialize(this.deps.deferredInitAbort.signal)
|
|
351
564
|
.catch((err) => {
|
|
352
565
|
log.error(`deferred initialization failed (non-fatal): ${err}`);
|
|
353
566
|
})
|
|
354
567
|
.finally(() => {
|
|
355
|
-
|
|
568
|
+
settleOwnDeferredReady();
|
|
356
569
|
});
|
|
357
570
|
} catch (err) {
|
|
358
571
|
// Resolve both gates so callers never hang on permanently-pending promises
|
|
@@ -364,19 +577,18 @@ export class OrchestratorInitCoordinator {
|
|
|
364
577
|
//
|
|
365
578
|
// - deferredReady: CLI callers await this for full QMD readiness. Without
|
|
366
579
|
// resolution it hangs forever since deferredInitialize() never ran.
|
|
367
|
-
if (this.deps.resolveInit) {
|
|
580
|
+
if ((this.isCurrentStartupEpoch(epoch) || this.startupClosed) && this.deps.resolveInit) {
|
|
368
581
|
this.deps.resolveInit();
|
|
369
582
|
this.deps.resolveInit = null;
|
|
370
583
|
}
|
|
371
|
-
|
|
372
|
-
this.deps.resolveDeferredReady();
|
|
373
|
-
this.deps.resolveDeferredReady = null;
|
|
374
|
-
}
|
|
584
|
+
settleOwnDeferredReady();
|
|
375
585
|
throw err;
|
|
376
586
|
}
|
|
377
587
|
}
|
|
378
588
|
|
|
379
589
|
async deferredInitialize(signal: AbortSignal): Promise<void> {
|
|
590
|
+
const epoch = this.currentOrNewStartupEpoch();
|
|
591
|
+
if (epoch === null) return;
|
|
380
592
|
const lifecycleCaps = resolveMemoryLifecycleCapabilities(this.deps.config);
|
|
381
593
|
|
|
382
594
|
// Sync QMD index with current disk state so recall finds recently-written
|
|
@@ -387,20 +599,28 @@ export class OrchestratorInitCoordinator {
|
|
|
387
599
|
if (this.deps.qmd.isAvailable() && resolveQmdCapabilities(this.deps.config).qmdMaintenance) {
|
|
388
600
|
try {
|
|
389
601
|
log.info("QMD startup sync: updating index to match current disk state");
|
|
602
|
+
const discovery = await this.startupNamespaces(epoch);
|
|
603
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
390
604
|
if (resolveNamespaceCapabilities(this.deps.config).namespaces) {
|
|
391
605
|
// Cover cataloged dynamic namespaces at startup too (NHZEV, codex P2):
|
|
392
606
|
// a dynamic namespace written before a daemon restart must be synced on
|
|
393
607
|
// boot, not only by the debounced runQmdMaintenance() path. Same union +
|
|
394
608
|
// catalog-read-failure fallback as runQmdMaintenance.
|
|
395
609
|
await this.deps.namespaceSearchRouter.updateNamespaces(
|
|
396
|
-
|
|
610
|
+
discovery.namespaces,
|
|
397
611
|
{ signal },
|
|
398
612
|
);
|
|
399
613
|
} else {
|
|
400
614
|
await this.deps.qmd.update({ signal });
|
|
401
615
|
}
|
|
616
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
402
617
|
log.info("QMD startup sync: complete");
|
|
403
|
-
|
|
618
|
+
if (discovery.complete) {
|
|
619
|
+
this.deps.deferredSyncSucceeded = true;
|
|
620
|
+
} else {
|
|
621
|
+
this.deps.deferredSyncSucceeded = false;
|
|
622
|
+
log.warn("QMD startup sync used configured namespace fallback; retry remains armed");
|
|
623
|
+
}
|
|
404
624
|
} catch (err) {
|
|
405
625
|
log.warn(`QMD startup sync failed (non-fatal): ${err}`);
|
|
406
626
|
// deferredSyncSucceeded stays false — server retry will attempt sync
|
|
@@ -412,7 +632,7 @@ export class OrchestratorInitCoordinator {
|
|
|
412
632
|
this.deps.deferredSyncSucceeded = true;
|
|
413
633
|
}
|
|
414
634
|
|
|
415
|
-
if (signal.aborted) return;
|
|
635
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
416
636
|
|
|
417
637
|
// Warmup: run cheap searches to pre-load QMD embedding models and the
|
|
418
638
|
// embedding-fallback JSON index so the first real recall is fast.
|
|
@@ -446,7 +666,7 @@ export class OrchestratorInitCoordinator {
|
|
|
446
666
|
);
|
|
447
667
|
}
|
|
448
668
|
await Promise.all(warmupPromises);
|
|
449
|
-
if (signal.aborted) return;
|
|
669
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
450
670
|
|
|
451
671
|
// Pre-warm knowledge index, memory, and entity caches.
|
|
452
672
|
// Awaited so callers of `deferredReady` can rely on warmups being complete
|
|
@@ -468,11 +688,12 @@ export class OrchestratorInitCoordinator {
|
|
|
468
688
|
cacheWarmups.push(this.deps.storage.readAllMemories().then(() => {}).catch(() => {}));
|
|
469
689
|
cacheWarmups.push(this.deps.storage.readAllEntityFiles().then(() => {}).catch(() => {}));
|
|
470
690
|
await Promise.all(cacheWarmups);
|
|
471
|
-
if (signal.aborted) return;
|
|
691
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
472
692
|
|
|
473
693
|
if (resolveIndexingCapabilities(this.deps.config).conversationIndex && this.deps.conversationIndexBackend) {
|
|
474
694
|
try {
|
|
475
695
|
const init = await this.deps.conversationIndexBackend.initialize();
|
|
696
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
476
697
|
if (!init.enabled) {
|
|
477
698
|
this.deps.config.conversationIndexEnabled = false;
|
|
478
699
|
}
|
|
@@ -484,12 +705,13 @@ export class OrchestratorInitCoordinator {
|
|
|
484
705
|
log.debug(init.message);
|
|
485
706
|
}
|
|
486
707
|
} catch (err) {
|
|
708
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
487
709
|
log.error(`Conversation index initialization failed (non-fatal): ${err}`);
|
|
488
710
|
this.deps.config.conversationIndexEnabled = false;
|
|
489
711
|
}
|
|
490
712
|
}
|
|
491
713
|
|
|
492
|
-
if (signal.aborted) return;
|
|
714
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
493
715
|
|
|
494
716
|
if (resolveLocalLlmCapabilities(this.deps.config).localLlm) {
|
|
495
717
|
try {
|
|
@@ -499,7 +721,7 @@ export class OrchestratorInitCoordinator {
|
|
|
499
721
|
}
|
|
500
722
|
}
|
|
501
723
|
|
|
502
|
-
if (signal.aborted) return;
|
|
724
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
503
725
|
|
|
504
726
|
// Await cron auto-registration so callers that `await deferredReady` can
|
|
505
727
|
// rely on cron jobs being registered when it resolves. Without this, the
|
|
@@ -515,11 +737,12 @@ export class OrchestratorInitCoordinator {
|
|
|
515
737
|
// touched by the lifecycle policy, run a one-time rate-limited demotion
|
|
516
738
|
// sweep (capped at 50 demotions) so the hot tier isn't flooded on the
|
|
517
739
|
// first real cron pass. Non-fatal — a failure here must not break init.
|
|
518
|
-
if (signal.aborted) return;
|
|
740
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
519
741
|
if (lifecycleCaps.lifecyclePolicy && resolveQmdCapabilities(this.deps.config).qmdTierMigration) {
|
|
520
742
|
try {
|
|
521
743
|
const { runFirstStartMigration } = await import("../maintenance/first-start-migration.js"
|
|
522
744
|
);
|
|
745
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
523
746
|
const result = await runFirstStartMigration({
|
|
524
747
|
storage: this.deps.storage,
|
|
525
748
|
config: this.deps.config,
|
|
@@ -548,7 +771,7 @@ export class OrchestratorInitCoordinator {
|
|
|
548
771
|
// The timer is unref'd, so one-shot CLI runs exit naturally without
|
|
549
772
|
// ever ticking; idempotent across stop/start cycles via the handle
|
|
550
773
|
// guard. Non-fatal: a failure to start must not break init.
|
|
551
|
-
if (signal.aborted) return;
|
|
774
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
552
775
|
if (
|
|
553
776
|
!this.deps.wearablesAutoSyncHandle &&
|
|
554
777
|
this.deps.config.wearables.enabled &&
|
|
@@ -562,7 +785,7 @@ export class OrchestratorInitCoordinator {
|
|
|
562
785
|
// starting now would leave a live interval on a destroyed
|
|
563
786
|
// orchestrator (Cursor review on PR #1464). Handle creation
|
|
564
787
|
// below is synchronous, so no further window exists.
|
|
565
|
-
if (signal.aborted) return;
|
|
788
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
566
789
|
this.deps.wearablesAutoSyncHandle = startWearablesAutoSync(
|
|
567
790
|
{
|
|
568
791
|
intervalMinutes: this.deps.config.wearables.autoSyncIntervalMinutes,
|
|
@@ -612,11 +835,13 @@ export class OrchestratorInitCoordinator {
|
|
|
612
835
|
*/
|
|
613
836
|
async startupSearchSync(signal?: AbortSignal): Promise<boolean> {
|
|
614
837
|
if (signal?.aborted) return false;
|
|
838
|
+
const epoch = this.currentOrNewStartupEpoch();
|
|
839
|
+
if (epoch === null) return false;
|
|
615
840
|
|
|
616
|
-
const available = await this.
|
|
841
|
+
const available = await this.probeForStartupEpoch(epoch, signal);
|
|
617
842
|
if (!available) return false;
|
|
618
|
-
if (signal?.aborted) {
|
|
619
|
-
log.debug("startupSearchSync: aborted after probe");
|
|
843
|
+
if (signal?.aborted || !this.isCurrentStartupEpoch(epoch)) {
|
|
844
|
+
log.debug("startupSearchSync: aborted or retired after probe");
|
|
620
845
|
return false;
|
|
621
846
|
}
|
|
622
847
|
|
|
@@ -635,27 +860,49 @@ export class OrchestratorInitCoordinator {
|
|
|
635
860
|
// re-synced here too, otherwise after a backend-was-unavailable-at-boot
|
|
636
861
|
// recovery its collection stays stale. Falls back to the configured set on any
|
|
637
862
|
// catalog read failure.
|
|
638
|
-
const
|
|
639
|
-
|
|
640
|
-
:
|
|
863
|
+
const discovery = await this.startupNamespaces(epoch);
|
|
864
|
+
if (signal?.aborted || !this.isCurrentStartupEpoch(epoch)) {
|
|
865
|
+
log.debug("startupSearchSync: aborted or retired after namespace discovery");
|
|
866
|
+
return false;
|
|
867
|
+
}
|
|
868
|
+
const namespaces = discovery.namespaces;
|
|
641
869
|
|
|
642
870
|
const states = await Promise.all(
|
|
643
|
-
namespaces.map(async (namespace) =>
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
871
|
+
namespaces.map(async (namespace) => {
|
|
872
|
+
const epochAbort = this.linkedEpochAbortController(epoch, signal);
|
|
873
|
+
try {
|
|
874
|
+
return {
|
|
875
|
+
namespace,
|
|
876
|
+
state: resolveNamespaceCapabilities(this.deps.config).namespaces
|
|
877
|
+
? await this.deps.namespaceSearchRouter.ensureNamespaceCollection(
|
|
878
|
+
namespace,
|
|
879
|
+
{ signal: epochAbort.controller.signal },
|
|
880
|
+
)
|
|
881
|
+
: await this.deps.qmd.ensureCollection(
|
|
882
|
+
this.deps.config.memoryDir,
|
|
883
|
+
this.deps.config.qmdCollection,
|
|
884
|
+
{ signal: epochAbort.controller.signal },
|
|
885
|
+
),
|
|
886
|
+
};
|
|
887
|
+
} finally {
|
|
888
|
+
epochAbort.dispose();
|
|
889
|
+
}
|
|
890
|
+
}),
|
|
649
891
|
);
|
|
650
892
|
|
|
651
|
-
if (signal?.aborted) {
|
|
652
|
-
log.debug("startupSearchSync: aborted after ensureCollection");
|
|
893
|
+
if (signal?.aborted || !this.isCurrentStartupEpoch(epoch)) {
|
|
894
|
+
log.debug("startupSearchSync: aborted or retired after ensureCollection");
|
|
653
895
|
return false;
|
|
654
896
|
}
|
|
655
897
|
|
|
656
898
|
const defaultState =
|
|
657
899
|
states.find((e) => e.namespace === this.deps.config.defaultNamespace)?.state ?? "unknown";
|
|
658
900
|
if (defaultState === "missing") {
|
|
901
|
+
await this.deps.disposeSearchBackendIfNeeded();
|
|
902
|
+
if (signal?.aborted || !this.isCurrentStartupEpoch(epoch)) {
|
|
903
|
+
log.debug("startupSearchSync: aborted or retired while disposing a missing backend");
|
|
904
|
+
return false;
|
|
905
|
+
}
|
|
659
906
|
// Reset the real backend's available flag before replacing it with noop.
|
|
660
907
|
// probe() set available=true earlier in this call; without this reset,
|
|
661
908
|
// any code that captured a reference to the old backend (e.g. a concurrent
|
|
@@ -664,7 +911,6 @@ export class OrchestratorInitCoordinator {
|
|
|
664
911
|
if ("available" in this.deps.qmd) {
|
|
665
912
|
(this.deps.qmd as any).available = false;
|
|
666
913
|
}
|
|
667
|
-
await this.deps.disposeSearchBackendIfNeeded();
|
|
668
914
|
this.deps.qmd = new NoopSearchBackend();
|
|
669
915
|
log.warn("startupSearchSync: search collection missing; disabling search (fallback retrieval remains enabled)");
|
|
670
916
|
return false;
|
|
@@ -687,17 +933,22 @@ export class OrchestratorInitCoordinator {
|
|
|
687
933
|
(this.deps.qmd as any).resetUpdateThrottles();
|
|
688
934
|
}
|
|
689
935
|
log.info("startupSearchSync: updating index to match current disk state");
|
|
936
|
+
const updateAbort = this.linkedEpochAbortController(epoch, signal);
|
|
690
937
|
let namespacesUpdated = 0;
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
938
|
+
try {
|
|
939
|
+
if (resolveNamespaceCapabilities(this.deps.config).namespaces) {
|
|
940
|
+
namespacesUpdated = await this.deps.namespaceSearchRouter.updateNamespaces(
|
|
941
|
+
namespaces,
|
|
942
|
+
{ signal: updateAbort.controller.signal },
|
|
943
|
+
);
|
|
944
|
+
} else {
|
|
945
|
+
await this.deps.qmd.update({ signal: updateAbort.controller.signal });
|
|
946
|
+
}
|
|
947
|
+
} finally {
|
|
948
|
+
updateAbort.dispose();
|
|
698
949
|
}
|
|
699
|
-
if (signal?.aborted) {
|
|
700
|
-
log.debug("startupSearchSync: aborted after update");
|
|
950
|
+
if (signal?.aborted || !this.isCurrentStartupEpoch(epoch)) {
|
|
951
|
+
log.debug("startupSearchSync: aborted or retired after update");
|
|
701
952
|
return false;
|
|
702
953
|
}
|
|
703
954
|
const failTsAfter = "lastUpdateFailedAtMs" in this.deps.qmd
|
|
@@ -728,15 +979,24 @@ export class OrchestratorInitCoordinator {
|
|
|
728
979
|
}
|
|
729
980
|
|
|
730
981
|
// Warmup search to pre-load embedding models
|
|
731
|
-
if (!signal?.aborted) {
|
|
982
|
+
if (!signal?.aborted && this.isCurrentStartupEpoch(epoch)) {
|
|
983
|
+
const warmupAbort = this.linkedEpochAbortController(epoch, signal);
|
|
732
984
|
try {
|
|
733
|
-
await this.deps.qmd.search(
|
|
985
|
+
await this.deps.qmd.search(
|
|
986
|
+
"warmup",
|
|
987
|
+
this.deps.config.defaultNamespace,
|
|
988
|
+
1,
|
|
989
|
+
undefined,
|
|
990
|
+
{ signal: warmupAbort.controller.signal },
|
|
991
|
+
);
|
|
734
992
|
log.info("startupSearchSync: warmup complete");
|
|
735
993
|
} catch (err) {
|
|
736
994
|
log.debug(`startupSearchSync: warmup search failed (non-fatal): ${err}`);
|
|
995
|
+
} finally {
|
|
996
|
+
warmupAbort.dispose();
|
|
737
997
|
}
|
|
738
998
|
}
|
|
739
999
|
|
|
740
|
-
return
|
|
1000
|
+
return discovery.complete;
|
|
741
1001
|
}
|
|
742
1002
|
}
|