@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
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
loadSyncState,
|
|
7
7
|
syncWearableSource,
|
|
8
8
|
wearableSourceLabel
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VKWFNPBH.js";
|
|
10
10
|
import {
|
|
11
11
|
CompressionGuidelineCoordinator
|
|
12
12
|
} from "./chunk-UXREWVW4.js";
|
|
13
13
|
import {
|
|
14
14
|
ActivityStore,
|
|
15
15
|
MaintenanceScheduler
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-62HFZNCJ.js";
|
|
17
17
|
import {
|
|
18
18
|
runPeerProfileReasoner
|
|
19
19
|
} from "./chunk-I74SUMNI.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./chunk-VZAKYDMJ.js";
|
|
23
23
|
import {
|
|
24
24
|
LcmEngine
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-A7GQBJP5.js";
|
|
26
26
|
import {
|
|
27
27
|
chunkTranscriptEntries
|
|
28
28
|
} from "./chunk-TECVW3JP.js";
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import {
|
|
33
33
|
CompoundingEngine,
|
|
34
34
|
defaultTierMigrationCycleBudget
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-46Z3VGWF.js";
|
|
36
36
|
import {
|
|
37
37
|
SharedContextManager
|
|
38
38
|
} from "./chunk-CARRTDKC.js";
|
|
@@ -47,6 +47,9 @@ import {
|
|
|
47
47
|
import {
|
|
48
48
|
extractTopics
|
|
49
49
|
} from "./chunk-KVDUKH5E.js";
|
|
50
|
+
import {
|
|
51
|
+
buildTemporalTimelineRecallSection
|
|
52
|
+
} from "./chunk-2NKY7OC6.js";
|
|
50
53
|
import {
|
|
51
54
|
CODEX_THREAD_KEY_PREFIX
|
|
52
55
|
} from "./chunk-4EX5WZ4M.js";
|
|
@@ -63,9 +66,6 @@ import {
|
|
|
63
66
|
buildTargetedFactRecallSection,
|
|
64
67
|
shouldRecallTargetedFactEvidence
|
|
65
68
|
} from "./chunk-T67LUYCR.js";
|
|
66
|
-
import {
|
|
67
|
-
buildTemporalTimelineRecallSection
|
|
68
|
-
} from "./chunk-2NKY7OC6.js";
|
|
69
69
|
import {
|
|
70
70
|
SessionObserverState
|
|
71
71
|
} from "./chunk-ODZKV2F7.js";
|
|
@@ -109,13 +109,17 @@ import {
|
|
|
109
109
|
rerankLocalOrNoop
|
|
110
110
|
} from "./chunk-LUDXM7MD.js";
|
|
111
111
|
import {
|
|
112
|
-
filterRecentScanMemoriesForStateView,
|
|
113
112
|
indexStateViewAnnotatedResults,
|
|
114
113
|
resolveRecallStateViewActive
|
|
115
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-RLU2Y5GV.js";
|
|
116
115
|
import {
|
|
117
116
|
applyRecallStateViews
|
|
118
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-DFVSJFHK.js";
|
|
118
|
+
import {
|
|
119
|
+
StateViewAnchorTracker,
|
|
120
|
+
filterRecentScanMemories,
|
|
121
|
+
stateViewPacketActive
|
|
122
|
+
} from "./chunk-Z4GUX2M6.js";
|
|
119
123
|
import {
|
|
120
124
|
dedupeResultsByNamespace,
|
|
121
125
|
hasMemoryForResult,
|
|
@@ -162,7 +166,7 @@ import {
|
|
|
162
166
|
} from "./chunk-OH7QLI6W.js";
|
|
163
167
|
import {
|
|
164
168
|
ExtractionEngine
|
|
165
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-K4A6UVPB.js";
|
|
166
170
|
import {
|
|
167
171
|
parseMemoryActionEligibilityContext
|
|
168
172
|
} from "./chunk-JHU4EYDV.js";
|
|
@@ -175,7 +179,7 @@ import {
|
|
|
175
179
|
getVerdictKind,
|
|
176
180
|
judgeFactDurability,
|
|
177
181
|
validateProcedureExtraction
|
|
178
|
-
} from "./chunk-
|
|
182
|
+
} from "./chunk-JUDT33RX.js";
|
|
179
183
|
import {
|
|
180
184
|
buildEventOrderRecallSection
|
|
181
185
|
} from "./chunk-645WOU5I.js";
|
|
@@ -193,7 +197,7 @@ import {
|
|
|
193
197
|
buildEntityRecallSection,
|
|
194
198
|
entityRecentTranscriptLookbackHours,
|
|
195
199
|
readRecentEntityTranscriptEntries
|
|
196
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-QS5Q5RBV.js";
|
|
197
201
|
import {
|
|
198
202
|
planEpisodeWindowsWithFallback
|
|
199
203
|
} from "./chunk-T3GIETKV.js";
|
|
@@ -208,7 +212,7 @@ import {
|
|
|
208
212
|
} from "./chunk-LVXBC6YB.js";
|
|
209
213
|
import {
|
|
210
214
|
refreshConvergedNamespaces
|
|
211
|
-
} from "./chunk-
|
|
215
|
+
} from "./chunk-4CMXI55L.js";
|
|
212
216
|
import {
|
|
213
217
|
builtInConnectorPackageSpecifier,
|
|
214
218
|
ensureBuiltInWearableConnectors,
|
|
@@ -217,7 +221,7 @@ import {
|
|
|
217
221
|
runTimelinePublishCli,
|
|
218
222
|
screenCandidateFact,
|
|
219
223
|
summarizeVaultPublish
|
|
220
|
-
} from "./chunk-
|
|
224
|
+
} from "./chunk-DAZANIYU.js";
|
|
221
225
|
import {
|
|
222
226
|
normalizeReplaySessionKey
|
|
223
227
|
} from "./chunk-AJVLDJU6.js";
|
|
@@ -227,14 +231,14 @@ import {
|
|
|
227
231
|
import {
|
|
228
232
|
compareVerifiedEpisodeResults,
|
|
229
233
|
searchVerifiedEpisodes
|
|
230
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-ICNJ6J46.js";
|
|
231
235
|
import {
|
|
232
236
|
ThreadingManager
|
|
233
237
|
} from "./chunk-OJP3N7UK.js";
|
|
234
238
|
import {
|
|
235
239
|
compareVerifiedSemanticRuleResults,
|
|
236
240
|
searchVerifiedSemanticRules
|
|
237
|
-
} from "./chunk-
|
|
241
|
+
} from "./chunk-ZAEPD4C2.js";
|
|
238
242
|
import {
|
|
239
243
|
searchWorkProductLedgerEntries
|
|
240
244
|
} from "./chunk-G7NYVKD6.js";
|
|
@@ -247,10 +251,10 @@ import {
|
|
|
247
251
|
import {
|
|
248
252
|
runNamespaceMaintenanceFanout,
|
|
249
253
|
summarizeNamespaceMaintenanceHealth
|
|
250
|
-
} from "./chunk-
|
|
254
|
+
} from "./chunk-7D6SER6A.js";
|
|
251
255
|
import {
|
|
252
256
|
planNamespaceMaintenance
|
|
253
|
-
} from "./chunk-
|
|
257
|
+
} from "./chunk-WZYHPAG5.js";
|
|
254
258
|
import {
|
|
255
259
|
isAboveImportanceThreshold,
|
|
256
260
|
scoreImportance
|
|
@@ -272,7 +276,7 @@ import {
|
|
|
272
276
|
} from "./chunk-NHLLKEKK.js";
|
|
273
277
|
import {
|
|
274
278
|
SmartBuffer
|
|
275
|
-
} from "./chunk-
|
|
279
|
+
} from "./chunk-MJC7UKH7.js";
|
|
276
280
|
import {
|
|
277
281
|
buildConsolidationPrompt,
|
|
278
282
|
buildExtensionsBlockForConsolidation,
|
|
@@ -282,7 +286,7 @@ import {
|
|
|
282
286
|
materializeAfterSemanticConsolidation,
|
|
283
287
|
parseConsolidationResponse,
|
|
284
288
|
parseOperatorAwareConsolidationResponse
|
|
285
|
-
} from "./chunk-
|
|
289
|
+
} from "./chunk-YTZN2UZO.js";
|
|
286
290
|
import {
|
|
287
291
|
buildBehaviorSignalsForMemory,
|
|
288
292
|
dedupeBehaviorSignalsByMemoryAndHash
|
|
@@ -310,7 +314,7 @@ import {
|
|
|
310
314
|
detectMeetings,
|
|
311
315
|
embeddingsFromCosineHits,
|
|
312
316
|
normalizeConnectorScope
|
|
313
|
-
} from "./chunk-
|
|
317
|
+
} from "./chunk-5LYSEZOF.js";
|
|
314
318
|
import {
|
|
315
319
|
compileCorrectionRule,
|
|
316
320
|
correctionsFilePath,
|
|
@@ -321,7 +325,7 @@ import {
|
|
|
321
325
|
isAnalysisFailureKind,
|
|
322
326
|
resolveJournalSource,
|
|
323
327
|
resolveVaultNotePath
|
|
324
|
-
} from "./chunk-
|
|
328
|
+
} from "./chunk-XCPNH2MG.js";
|
|
325
329
|
import {
|
|
326
330
|
AMBIENT_CAPTURE_PROMPT_RULE,
|
|
327
331
|
isHighImpactPersonalFact
|
|
@@ -334,7 +338,7 @@ import {
|
|
|
334
338
|
} from "./chunk-MI2OTWV5.js";
|
|
335
339
|
import {
|
|
336
340
|
MeetingsInputError
|
|
337
|
-
} from "./chunk-
|
|
341
|
+
} from "./chunk-IS2IDFJP.js";
|
|
338
342
|
import {
|
|
339
343
|
WearablesInputError,
|
|
340
344
|
describeErrorForOperator
|
|
@@ -352,14 +356,14 @@ import {
|
|
|
352
356
|
} from "./chunk-DGS34QSY.js";
|
|
353
357
|
import {
|
|
354
358
|
NamespaceCatalog
|
|
355
|
-
} from "./chunk-
|
|
359
|
+
} from "./chunk-W23JARAQ.js";
|
|
356
360
|
import {
|
|
357
361
|
RecallResultFormatter,
|
|
358
362
|
SessionContextCoordinator,
|
|
359
363
|
capturePassiveCorrections,
|
|
360
364
|
clusterByKey,
|
|
361
365
|
detectPassiveCorrections
|
|
362
|
-
} from "./chunk-
|
|
366
|
+
} from "./chunk-SFHLQPBF.js";
|
|
363
367
|
import {
|
|
364
368
|
importCapsule
|
|
365
369
|
} from "./chunk-ZHXSOMYH.js";
|
|
@@ -379,7 +383,7 @@ import {
|
|
|
379
383
|
} from "./chunk-ROBHL3GL.js";
|
|
380
384
|
import {
|
|
381
385
|
HourlySummarizer
|
|
382
|
-
} from "./chunk-
|
|
386
|
+
} from "./chunk-AEOOGXMQ.js";
|
|
383
387
|
import {
|
|
384
388
|
LastRecallStore,
|
|
385
389
|
RecallHandleHistoryStore,
|
|
@@ -392,17 +396,17 @@ import {
|
|
|
392
396
|
isTopLevelArchivePath,
|
|
393
397
|
journalPath,
|
|
394
398
|
writeJournalFile
|
|
395
|
-
} from "./chunk-
|
|
399
|
+
} from "./chunk-NVVZPBKI.js";
|
|
396
400
|
import {
|
|
397
401
|
buildXraySnapshot
|
|
398
|
-
} from "./chunk-
|
|
402
|
+
} from "./chunk-BXIJSPCL.js";
|
|
399
403
|
import {
|
|
400
404
|
objectiveStateStoreOverrideForNamespace,
|
|
401
405
|
searchObjectiveStateSnapshots
|
|
402
406
|
} from "./chunk-HM7RHKS4.js";
|
|
403
407
|
import {
|
|
404
408
|
searchHarmonicRetrieval
|
|
405
|
-
} from "./chunk-
|
|
409
|
+
} from "./chunk-IOPIGX7Y.js";
|
|
406
410
|
import {
|
|
407
411
|
ProfilingCollector
|
|
408
412
|
} from "./chunk-NLE6TSLG.js";
|
|
@@ -411,7 +415,7 @@ import {
|
|
|
411
415
|
} from "./chunk-WLZYGLJ4.js";
|
|
412
416
|
import {
|
|
413
417
|
LocalLlmClient
|
|
414
|
-
} from "./chunk-
|
|
418
|
+
} from "./chunk-G2XZFGYN.js";
|
|
415
419
|
import {
|
|
416
420
|
contentMatchesRedactionRules,
|
|
417
421
|
loadRedactionRules
|
|
@@ -429,7 +433,7 @@ import {
|
|
|
429
433
|
} from "./chunk-7ZNJN5WZ.js";
|
|
430
434
|
import {
|
|
431
435
|
NamespaceStorageRouter
|
|
432
|
-
} from "./chunk-
|
|
436
|
+
} from "./chunk-2SNCQHJZ.js";
|
|
433
437
|
import {
|
|
434
438
|
pruneOrphanCueAnchors
|
|
435
439
|
} from "./chunk-BMWN7B3Y.js";
|
|
@@ -443,7 +447,7 @@ import {
|
|
|
443
447
|
ExtractionDeadlineError,
|
|
444
448
|
ExtractionRunCoordinator,
|
|
445
449
|
classifyExtractionOrigin
|
|
446
|
-
} from "./chunk-
|
|
450
|
+
} from "./chunk-IMBQFHRV.js";
|
|
447
451
|
import {
|
|
448
452
|
ARTIFACT_STATUS_CACHE_TTL_MS,
|
|
449
453
|
BulkImportBatchPartialFailureError,
|
|
@@ -468,6 +472,7 @@ import {
|
|
|
468
472
|
parseGraphRecallRankedResults,
|
|
469
473
|
parseMemoryIntentSnapshot,
|
|
470
474
|
parseQmdRecallResults,
|
|
475
|
+
qmdStartupCollectionCheckTimeoutMs,
|
|
471
476
|
qmdStartupCollectionCheckWithTimeout,
|
|
472
477
|
raceRecallAbort,
|
|
473
478
|
resolvePersistedMemoryRelativePath,
|
|
@@ -482,7 +487,7 @@ import {
|
|
|
482
487
|
throwIfRecallAborted,
|
|
483
488
|
tokenizeRecallQuery,
|
|
484
489
|
utcDateKeysForLocalDay
|
|
485
|
-
} from "./chunk-
|
|
490
|
+
} from "./chunk-K75A5XWU.js";
|
|
486
491
|
import {
|
|
487
492
|
inferIntentFromText,
|
|
488
493
|
intentCompatibilityScore,
|
|
@@ -491,10 +496,11 @@ import {
|
|
|
491
496
|
} from "./chunk-CSAKJVXW.js";
|
|
492
497
|
import {
|
|
493
498
|
buildChainFollowupGenerator
|
|
494
|
-
} from "./chunk-
|
|
499
|
+
} from "./chunk-VQYWKCDR.js";
|
|
495
500
|
import {
|
|
496
501
|
QmdResultResolver,
|
|
497
502
|
StorageManager,
|
|
503
|
+
canonicalSemanticFileText,
|
|
498
504
|
compareEntityTimestamps,
|
|
499
505
|
composeFusionDayMeta,
|
|
500
506
|
composeMeetingRecord,
|
|
@@ -510,7 +516,10 @@ import {
|
|
|
510
516
|
reconstructFusionInputs,
|
|
511
517
|
selfDeps,
|
|
512
518
|
serializeFusionDay
|
|
513
|
-
} from "./chunk-
|
|
519
|
+
} from "./chunk-MVG3KXON.js";
|
|
520
|
+
import {
|
|
521
|
+
buildRetiredFactTombstoneInputs
|
|
522
|
+
} from "./chunk-46WM6JX2.js";
|
|
514
523
|
import {
|
|
515
524
|
bodyIsEscaped,
|
|
516
525
|
decodeTranscriptBody,
|
|
@@ -521,18 +530,15 @@ import {
|
|
|
521
530
|
saveSpeakerRegistry,
|
|
522
531
|
speakerRegistryKey
|
|
523
532
|
} from "./chunk-UHVXE24Y.js";
|
|
524
|
-
import {
|
|
525
|
-
buildRetiredFactTombstoneInputs
|
|
526
|
-
} from "./chunk-46WM6JX2.js";
|
|
527
533
|
import {
|
|
528
534
|
NamespaceSearchRouter,
|
|
529
535
|
namespaceCollectionName
|
|
530
|
-
} from "./chunk-
|
|
536
|
+
} from "./chunk-TZ44E732.js";
|
|
531
537
|
import {
|
|
532
538
|
createConversationIndexRuntime,
|
|
533
539
|
createSearchBackend,
|
|
534
540
|
isSearchBackendEnabled
|
|
535
|
-
} from "./chunk-
|
|
541
|
+
} from "./chunk-JOP7W24J.js";
|
|
536
542
|
import {
|
|
537
543
|
NoopSearchBackend
|
|
538
544
|
} from "./chunk-CYEPCZN5.js";
|
|
@@ -546,7 +552,7 @@ import {
|
|
|
546
552
|
} from "./chunk-S2V7RUCL.js";
|
|
547
553
|
import {
|
|
548
554
|
confidenceTier
|
|
549
|
-
} from "./chunk-
|
|
555
|
+
} from "./chunk-MDIEES23.js";
|
|
550
556
|
import {
|
|
551
557
|
lintWorkspaceFiles,
|
|
552
558
|
rotateMarkdownFileToArchive
|
|
@@ -555,7 +561,7 @@ import {
|
|
|
555
561
|
applyFaithfulnessVerdict,
|
|
556
562
|
createFaithfulnessCounters,
|
|
557
563
|
runFaithfulnessGateBatch
|
|
558
|
-
} from "./chunk-
|
|
564
|
+
} from "./chunk-3XPN7AVY.js";
|
|
559
565
|
import {
|
|
560
566
|
casCommittedRevisionOf
|
|
561
567
|
} from "./chunk-SHEHQBCG.js";
|
|
@@ -614,9 +620,15 @@ import {
|
|
|
614
620
|
} from "./chunk-42JKGUFJ.js";
|
|
615
621
|
import {
|
|
616
622
|
FallbackLlmClient,
|
|
617
|
-
fallbackLlmRuntimeContextFromConfig,
|
|
618
623
|
gatewayTaskChainOptions
|
|
619
|
-
} from "./chunk-
|
|
624
|
+
} from "./chunk-THTF2W7M.js";
|
|
625
|
+
import {
|
|
626
|
+
fallbackLlmRuntimeContextFromConfig
|
|
627
|
+
} from "./chunk-KTOXQMW3.js";
|
|
628
|
+
import {
|
|
629
|
+
capStateViewPackets,
|
|
630
|
+
reconcileStateViewPairs
|
|
631
|
+
} from "./chunk-NETQXOPY.js";
|
|
620
632
|
import {
|
|
621
633
|
assertExternalWikiRootOutsideMemoryDirCanonical
|
|
622
634
|
} from "./chunk-JV3C2MNQ.js";
|
|
@@ -812,7 +824,7 @@ import {
|
|
|
812
824
|
|
|
813
825
|
// src/orchestrator.ts
|
|
814
826
|
import path21 from "path";
|
|
815
|
-
import { createHash as
|
|
827
|
+
import { createHash as createHash9 } from "crypto";
|
|
816
828
|
|
|
817
829
|
// src/orchestration/tier-migration-coordinator.ts
|
|
818
830
|
import path from "path";
|
|
@@ -2554,9 +2566,9 @@ var RecallRerankCoordinator = class _RecallRerankCoordinator {
|
|
|
2554
2566
|
return results;
|
|
2555
2567
|
}
|
|
2556
2568
|
}
|
|
2557
|
-
diversifyRecallResultsWithHeadroom(sectionId, results, limit, retrievalQuery, caps = resolveCapabilities(this.getConfig())) {
|
|
2569
|
+
diversifyRecallResultsWithHeadroom(sectionId, results, limit, retrievalQuery, caps = resolveCapabilities(this.getConfig()), stateViewActive) {
|
|
2558
2570
|
const safeLimit = typeof limit === "number" && Number.isFinite(limit) ? Math.max(0, Math.floor(limit)) : 0;
|
|
2559
|
-
const candidates = Array.isArray(results) ? results : [];
|
|
2571
|
+
const candidates = stateViewActive === true && Array.isArray(results) ? reconcileStateViewPairs(results) : Array.isArray(results) ? results : [];
|
|
2560
2572
|
let orderedPool;
|
|
2561
2573
|
const resolveOrderedPool = () => {
|
|
2562
2574
|
if (orderedPool) return orderedPool;
|
|
@@ -2567,24 +2579,40 @@ var RecallRerankCoordinator = class _RecallRerankCoordinator {
|
|
|
2567
2579
|
orderedPool = this.applyMmrToQmdResults(sectionId, boosted, caps);
|
|
2568
2580
|
return orderedPool;
|
|
2569
2581
|
};
|
|
2582
|
+
let appliedCache;
|
|
2583
|
+
const resolveApplied = () => {
|
|
2584
|
+
if (appliedCache) return appliedCache;
|
|
2585
|
+
if (safeLimit === 0 || candidates.length === 0) {
|
|
2586
|
+
appliedCache = [];
|
|
2587
|
+
return appliedCache;
|
|
2588
|
+
}
|
|
2589
|
+
const ordered = resolveOrderedPool();
|
|
2590
|
+
appliedCache = stateViewActive === true ? capStateViewPackets(ordered, safeLimit) : ordered.slice(0, safeLimit);
|
|
2591
|
+
return appliedCache;
|
|
2592
|
+
};
|
|
2570
2593
|
return {
|
|
2571
2594
|
get appliedResults() {
|
|
2572
|
-
|
|
2573
|
-
return resolveOrderedPool().slice(0, safeLimit);
|
|
2595
|
+
return resolveApplied().slice();
|
|
2574
2596
|
},
|
|
2575
2597
|
get headroomResults() {
|
|
2576
2598
|
if (candidates.length === 0) return [];
|
|
2577
|
-
|
|
2599
|
+
const ordered = resolveOrderedPool();
|
|
2600
|
+
if (stateViewActive === true) {
|
|
2601
|
+
const applied = new Set(resolveApplied());
|
|
2602
|
+
return ordered.filter((row) => !applied.has(row));
|
|
2603
|
+
}
|
|
2604
|
+
return ordered.slice(safeLimit);
|
|
2578
2605
|
}
|
|
2579
2606
|
};
|
|
2580
2607
|
}
|
|
2581
|
-
diversifyAndLimitRecallResults(sectionId, results, limit, retrievalQuery, caps = resolveCapabilities(this.getConfig())) {
|
|
2608
|
+
diversifyAndLimitRecallResults(sectionId, results, limit, retrievalQuery, caps = resolveCapabilities(this.getConfig()), stateViewActive) {
|
|
2582
2609
|
return this.diversifyRecallResultsWithHeadroom(
|
|
2583
2610
|
sectionId,
|
|
2584
2611
|
results,
|
|
2585
2612
|
limit,
|
|
2586
2613
|
retrievalQuery,
|
|
2587
|
-
caps
|
|
2614
|
+
caps,
|
|
2615
|
+
stateViewActive
|
|
2588
2616
|
).appliedResults;
|
|
2589
2617
|
}
|
|
2590
2618
|
/**
|
|
@@ -4924,6 +4952,8 @@ async function decideSemanticDedup(content, lookup, options) {
|
|
|
4924
4952
|
}
|
|
4925
4953
|
|
|
4926
4954
|
// src/orchestration/semantic-merge-promotion-payload.ts
|
|
4955
|
+
import { createHash as createHash3 } from "crypto";
|
|
4956
|
+
import { readFile as readFile2 } from "fs/promises";
|
|
4927
4957
|
async function buildMergedTargetPromotionPayload(storage, merge) {
|
|
4928
4958
|
if (!merge.provenancePatched) {
|
|
4929
4959
|
log.warn(
|
|
@@ -4948,6 +4978,7 @@ async function buildMergedTargetPromotionPayload(storage, merge) {
|
|
|
4948
4978
|
}
|
|
4949
4979
|
const fm = committed.frontmatter;
|
|
4950
4980
|
const snapshotDigest = typeof storage.readDurableFileDigest === "function" ? await storage.readDurableFileDigest(committed.path).catch(() => null) : null;
|
|
4981
|
+
const snapshotSemanticFingerprint = await readDurableSemanticFingerprint(committed.path);
|
|
4951
4982
|
const receipt = await readPromotionReceiptStatus(storage, committed.path);
|
|
4952
4983
|
if (!receipt.available) {
|
|
4953
4984
|
log.warn(
|
|
@@ -4955,7 +4986,13 @@ async function buildMergedTargetPromotionPayload(storage, merge) {
|
|
|
4955
4986
|
);
|
|
4956
4987
|
return { payload: null, readFailed: true };
|
|
4957
4988
|
}
|
|
4958
|
-
if (receipt.
|
|
4989
|
+
if (receipt.committedSemanticFingerprint !== void 0 && snapshotSemanticFingerprint !== receipt.committedSemanticFingerprint) {
|
|
4990
|
+
log.warn(
|
|
4991
|
+
snapshotSemanticFingerprint == null ? `semantic-merge: merged-target promotion refused for ${merge.targetId} \u2014 the semantic snapshot fingerprint is unavailable while the CAS receipt carries ${receipt.committedSemanticFingerprint}; promotion and reconciliation retry on the next merge` : `semantic-merge: merged-target promotion refused for ${merge.targetId} \u2014 record semantic fingerprint (${snapshotSemanticFingerprint}) does not match committed receipt fingerprint (${receipt.committedSemanticFingerprint}); record metadata was mutated concurrently`
|
|
4992
|
+
);
|
|
4993
|
+
return { payload: null, readFailed: true };
|
|
4994
|
+
}
|
|
4995
|
+
if (receipt.committedSemanticFingerprint === void 0 && receipt.committedDigest !== void 0 && snapshotDigest !== receipt.committedDigest) {
|
|
4959
4996
|
log.warn(
|
|
4960
4997
|
snapshotDigest == null ? `semantic-merge: merged-target promotion refused for ${merge.targetId} \u2014 the record snapshot digest is unavailable while the CAS receipt carries committed digest ${receipt.committedDigest}; promotion and reconciliation retry on the next merge` : `semantic-merge: merged-target promotion refused for ${merge.targetId} \u2014 record snapshot digest (${snapshotDigest}) does not match committed receipt digest (${receipt.committedDigest}); record metadata was mutated concurrently`
|
|
4961
4998
|
);
|
|
@@ -4987,11 +5024,19 @@ async function buildMergedTargetPromotionPayload(storage, merge) {
|
|
|
4987
5024
|
...fm.toolScoped === true ? { toolScoped: true } : {},
|
|
4988
5025
|
...fm.sourceConnector !== void 0 ? { sourceConnector: fm.sourceConnector } : {},
|
|
4989
5026
|
...receipt.revision !== void 0 ? { committedRevision: receipt.revision } : {},
|
|
4990
|
-
...receipt.committedDigest !== void 0 ? { committedDigest: receipt.committedDigest } : snapshotDigest !== null ? { committedDigest: snapshotDigest } : {}
|
|
5027
|
+
...receipt.committedDigest !== void 0 ? { committedDigest: receipt.committedDigest } : snapshotDigest !== null ? { committedDigest: snapshotDigest } : {},
|
|
5028
|
+
...receipt.committedSemanticFingerprint !== void 0 ? { committedSemanticFingerprint: receipt.committedSemanticFingerprint } : snapshotSemanticFingerprint !== null ? { committedSemanticFingerprint: snapshotSemanticFingerprint } : {}
|
|
4991
5029
|
},
|
|
4992
5030
|
readFailed: false
|
|
4993
5031
|
};
|
|
4994
5032
|
}
|
|
5033
|
+
async function readDurableSemanticFingerprint(filePath) {
|
|
5034
|
+
try {
|
|
5035
|
+
return createHash3("sha256").update(canonicalSemanticFileText(await readFile2(filePath, "utf8"))).digest("hex");
|
|
5036
|
+
} catch {
|
|
5037
|
+
return null;
|
|
5038
|
+
}
|
|
5039
|
+
}
|
|
4995
5040
|
async function readPromotionReceiptStatus(storage, filePath) {
|
|
4996
5041
|
try {
|
|
4997
5042
|
const status = await storage.readCasRevisionStatus(filePath);
|
|
@@ -4999,7 +5044,8 @@ async function readPromotionReceiptStatus(storage, filePath) {
|
|
|
4999
5044
|
return {
|
|
5000
5045
|
available: true,
|
|
5001
5046
|
revision: status.status === "present" ? status.revision : void 0,
|
|
5002
|
-
committedDigest: status.status === "present" ? status.committedDigest : void 0
|
|
5047
|
+
committedDigest: status.status === "present" ? status.committedDigest : void 0,
|
|
5048
|
+
committedSemanticFingerprint: status.status === "present" ? status.committedSemanticFingerprint : void 0
|
|
5003
5049
|
};
|
|
5004
5050
|
} catch (err) {
|
|
5005
5051
|
return { available: false, reason: err instanceof Error ? err.message : String(err) };
|
|
@@ -5159,10 +5205,10 @@ async function promoteAndReconcileMergedTarget(args) {
|
|
|
5159
5205
|
return;
|
|
5160
5206
|
}
|
|
5161
5207
|
const standingReceipt = await readPromotionReceiptStatus(args.sourceStorage, current.path);
|
|
5162
|
-
const
|
|
5163
|
-
if (!standingReceipt.available || (standingReceipt.revision ?? void 0) !== (payload.committedRevision ?? void 0) || payload.committedDigest !== void 0 && standingReceipt.committedDigest !== void 0 && standingReceipt.committedDigest !== payload.committedDigest || payload.
|
|
5208
|
+
const standingSemanticFingerprint = await readDurableSemanticFingerprint(current.path);
|
|
5209
|
+
if (!standingReceipt.available || (standingReceipt.revision ?? void 0) !== (payload.committedRevision ?? void 0) || payload.committedDigest !== void 0 && standingReceipt.committedDigest !== void 0 && standingReceipt.committedDigest !== payload.committedDigest || payload.committedSemanticFingerprint !== void 0 && standingSemanticFingerprint !== null && standingSemanticFingerprint !== payload.committedSemanticFingerprint) {
|
|
5164
5210
|
log.warn(
|
|
5165
|
-
`persistExtraction: merged-target promotion abandoned for ${args.sourceMemoryId} \u2014 the committed record's CAS receipt or
|
|
5211
|
+
`persistExtraction: merged-target promotion abandoned for ${args.sourceMemoryId} \u2014 the committed record's CAS receipt or semantic fingerprint ${standingReceipt.available ? "does not match the cached payload's" : "is unreadable"}, so the cached body is not confirmed`
|
|
5166
5212
|
);
|
|
5167
5213
|
return;
|
|
5168
5214
|
}
|
|
@@ -5323,9 +5369,9 @@ async function persistConstructedHarmonicRecords(options) {
|
|
|
5323
5369
|
import path5 from "path";
|
|
5324
5370
|
|
|
5325
5371
|
// src/orchestration/semantic-merge-commit-effects.ts
|
|
5326
|
-
import { readFile as
|
|
5372
|
+
import { readFile as readFile3 } from "fs/promises";
|
|
5327
5373
|
async function stageMergedTargetSnapshot(target, versioning, memoryDir) {
|
|
5328
|
-
const currentFile = await
|
|
5374
|
+
const currentFile = await readFile3(target.path, "utf8");
|
|
5329
5375
|
const version = await createVersion(
|
|
5330
5376
|
target.path,
|
|
5331
5377
|
currentFile,
|
|
@@ -8055,14 +8101,14 @@ async function drainExtractionAndShutdownDependencyPropagation(extractionQueue,
|
|
|
8055
8101
|
|
|
8056
8102
|
// src/orchestration/dependency-propagation-delivery.ts
|
|
8057
8103
|
import { randomUUID } from "crypto";
|
|
8058
|
-
import { readFile as
|
|
8104
|
+
import { readFile as readFile4, unlink } from "fs/promises";
|
|
8059
8105
|
import path7 from "path";
|
|
8060
8106
|
|
|
8061
8107
|
// src/orchestration/dependency-propagation-recovery-replay.ts
|
|
8062
|
-
import { createHash as
|
|
8108
|
+
import { createHash as createHash4 } from "crypto";
|
|
8063
8109
|
function memoryFingerprint(memory) {
|
|
8064
8110
|
const { accessCount: _accessCount, lastAccessed: _lastAccessed, ...frontmatter } = memory.frontmatter;
|
|
8065
|
-
return
|
|
8111
|
+
return createHash4("sha256").update(JSON.stringify(canonicalize({ content: memory.content, frontmatter }))).digest("hex");
|
|
8066
8112
|
}
|
|
8067
8113
|
async function findRecoverySource(storage, sourceId) {
|
|
8068
8114
|
const hot = await storage.getMemoryById(sourceId);
|
|
@@ -8232,7 +8278,7 @@ var DependencyPropagationDelivery = class {
|
|
|
8232
8278
|
}, delayMs);
|
|
8233
8279
|
timer.unref();
|
|
8234
8280
|
});
|
|
8235
|
-
this.readQueueFile = options.readQueueFile ?? ((filePath) =>
|
|
8281
|
+
this.readQueueFile = options.readQueueFile ?? ((filePath) => readFile4(filePath, "utf8"));
|
|
8236
8282
|
this.writeQueueFile = options.writeQueueFile ?? ((filePath, content) => writeJsonFileAtomic(filePath, JSON.parse(content)));
|
|
8237
8283
|
this.replayReconciliation = options.replayReconciliation;
|
|
8238
8284
|
}
|
|
@@ -9079,8 +9125,8 @@ function createDependencyPropagationReplayReconciliation(host) {
|
|
|
9079
9125
|
}
|
|
9080
9126
|
|
|
9081
9127
|
// src/orchestration/recall-internal.ts
|
|
9082
|
-
import { createHash as
|
|
9083
|
-
import { readFile as
|
|
9128
|
+
import { createHash as createHash6 } from "crypto";
|
|
9129
|
+
import { readFile as readFile5, stat, unlink as unlink2 } from "fs/promises";
|
|
9084
9130
|
import path11 from "path";
|
|
9085
9131
|
|
|
9086
9132
|
// src/orchestration/graph-path-state-loader.ts
|
|
@@ -9328,7 +9374,7 @@ var GraphPathStateLoader = class {
|
|
|
9328
9374
|
};
|
|
9329
9375
|
|
|
9330
9376
|
// src/orchestration/graph-recall-coordinator.ts
|
|
9331
|
-
import { createHash as
|
|
9377
|
+
import { createHash as createHash5 } from "crypto";
|
|
9332
9378
|
import { mkdir as mkdir3, writeFile as writeFile3 } from "fs/promises";
|
|
9333
9379
|
import path9 from "path";
|
|
9334
9380
|
function mergeGraphExpandedResults(primary, expanded) {
|
|
@@ -9716,7 +9762,7 @@ var GraphRecallCoordinator = class {
|
|
|
9716
9762
|
const payload = {
|
|
9717
9763
|
recordedAt: now,
|
|
9718
9764
|
mode: options.recallMode,
|
|
9719
|
-
queryHash:
|
|
9765
|
+
queryHash: createHash5("sha256").update(options.prompt).digest("hex"),
|
|
9720
9766
|
queryLength: options.prompt.length,
|
|
9721
9767
|
namespaces: options.recallNamespaces,
|
|
9722
9768
|
seedCount: totalSeedCount,
|
|
@@ -10231,8 +10277,8 @@ var RecallInternalCoordinator = class {
|
|
|
10231
10277
|
record: recordRecallSectionMetric,
|
|
10232
10278
|
logger: log
|
|
10233
10279
|
});
|
|
10234
|
-
const promptHash =
|
|
10235
|
-
const traceId =
|
|
10280
|
+
const promptHash = createHash6("sha256").update(prompt).digest("hex");
|
|
10281
|
+
const traceId = createHash6("sha256").update(`${sessionKey ?? "default"}:${recallStart}:${promptHash}`).digest("hex").slice(0, 16);
|
|
10236
10282
|
const sectionBuckets = /* @__PURE__ */ new Map();
|
|
10237
10283
|
const queryPolicy = buildRecallQueryPolicy(prompt, sessionKey, {
|
|
10238
10284
|
cronRecallPolicyEnabled: resolveRecallAuxiliaryCapabilities(this.deps.config).cronRecallPolicy,
|
|
@@ -10241,8 +10287,9 @@ var RecallInternalCoordinator = class {
|
|
|
10241
10287
|
cronConversationRecallMode: this.deps.config.cronConversationRecallMode
|
|
10242
10288
|
});
|
|
10243
10289
|
const retrievalQuery = queryPolicy.retrievalQuery || prompt;
|
|
10244
|
-
const stateViewActive = resolveRecallStateViewActive(options, this.deps.config,
|
|
10245
|
-
const
|
|
10290
|
+
const stateViewActive = resolveRecallStateViewActive(options, this.deps.config, prompt);
|
|
10291
|
+
const stateViewPacketActive2 = stateViewActive === true && !(typeof asOfMs === "number" && Number.isFinite(asOfMs));
|
|
10292
|
+
const retrievalQueryHash = createHash6("sha256").update(retrievalQuery).digest("hex");
|
|
10246
10293
|
const policyVersion = this.deps.currentPolicyVersion();
|
|
10247
10294
|
let recallSource = "none";
|
|
10248
10295
|
let recalledMemoryCount = 0;
|
|
@@ -11928,7 +11975,7 @@ ${formatted}`;
|
|
|
11928
11975
|
const signalStat = await stat(signalPath).catch(() => null);
|
|
11929
11976
|
if (!signalStat) return null;
|
|
11930
11977
|
const signalAge = Date.now() - signalStat.mtimeMs;
|
|
11931
|
-
const signalData = JSON.parse(await
|
|
11978
|
+
const signalData = JSON.parse(await readFile5(signalPath, "utf-8"));
|
|
11932
11979
|
if (signalData.sessionKey !== effectiveSessionKey) {
|
|
11933
11980
|
log.debug(
|
|
11934
11981
|
`recall: compaction signal is for ${signalData.sessionKey}, not ${effectiveSessionKey} \u2014 skipping`
|
|
@@ -11948,7 +11995,7 @@ ${formatted}`;
|
|
|
11948
11995
|
|
|
11949
11996
|
`;
|
|
11950
11997
|
try {
|
|
11951
|
-
const bootContent = await
|
|
11998
|
+
const bootContent = await readFile5(bootPath, "utf-8");
|
|
11952
11999
|
section += "### BOOT.md (working state before compaction)\n\n";
|
|
11953
12000
|
section += bootContent + "\n";
|
|
11954
12001
|
} catch {
|
|
@@ -13065,15 +13112,17 @@ ${tmtNode.summary}`
|
|
|
13065
13112
|
memoryResults,
|
|
13066
13113
|
recallResultLimit,
|
|
13067
13114
|
retrievalQuery,
|
|
13068
|
-
caps
|
|
13115
|
+
caps,
|
|
13116
|
+
stateViewPacketActive2
|
|
13069
13117
|
) : null;
|
|
13070
|
-
memoryResults = hotQmdPartition ? [...hotQmdPartition.appliedResults] : this.deps.
|
|
13118
|
+
memoryResults = hotQmdPartition ? [...hotQmdPartition.appliedResults] : this.deps.recallRerankCoordinator.diversifyRecallResultsWithHeadroom(
|
|
13071
13119
|
"memories",
|
|
13072
13120
|
memoryResults,
|
|
13073
13121
|
recallResultLimit,
|
|
13074
13122
|
retrievalQuery,
|
|
13075
|
-
caps
|
|
13076
|
-
|
|
13123
|
+
caps,
|
|
13124
|
+
stateViewPacketActive2
|
|
13125
|
+
).appliedResults;
|
|
13077
13126
|
if (resolveRecallEnhancementCapabilities(this.deps.config).memoryReconstruction && memoryResults.length > 0) {
|
|
13078
13127
|
try {
|
|
13079
13128
|
const snippets = memoryResults.map((r) => r.snippet);
|
|
@@ -13175,20 +13224,6 @@ ${tmtNode.summary}`
|
|
|
13175
13224
|
},
|
|
13176
13225
|
[]
|
|
13177
13226
|
);
|
|
13178
|
-
const embeddingPartition = options.xrayCapture === true ? this.deps.recallRerankCoordinator.diversifyRecallResultsWithHeadroom(
|
|
13179
|
-
"memories",
|
|
13180
|
-
scoped,
|
|
13181
|
-
recallResultLimit,
|
|
13182
|
-
retrievalQuery,
|
|
13183
|
-
caps
|
|
13184
|
-
) : null;
|
|
13185
|
-
scoped = embeddingPartition?.appliedResults ?? this.deps.diversifyAndLimitRecallResults(
|
|
13186
|
-
"memories",
|
|
13187
|
-
scoped,
|
|
13188
|
-
recallResultLimit,
|
|
13189
|
-
retrievalQuery,
|
|
13190
|
-
caps
|
|
13191
|
-
);
|
|
13192
13227
|
{
|
|
13193
13228
|
const trustT0 = Date.now();
|
|
13194
13229
|
const trustFallback = { results: scoped, trustByPath: recallTrustByPath };
|
|
@@ -13216,6 +13251,22 @@ ${tmtNode.summary}`
|
|
|
13216
13251
|
success: !trustFellBack
|
|
13217
13252
|
});
|
|
13218
13253
|
}
|
|
13254
|
+
const embeddingPartition = options.xrayCapture === true ? this.deps.recallRerankCoordinator.diversifyRecallResultsWithHeadroom(
|
|
13255
|
+
"memories",
|
|
13256
|
+
scoped,
|
|
13257
|
+
recallResultLimit,
|
|
13258
|
+
retrievalQuery,
|
|
13259
|
+
caps,
|
|
13260
|
+
stateViewPacketActive2
|
|
13261
|
+
) : null;
|
|
13262
|
+
scoped = embeddingPartition?.appliedResults ?? this.deps.recallRerankCoordinator.diversifyRecallResultsWithHeadroom(
|
|
13263
|
+
"memories",
|
|
13264
|
+
scoped,
|
|
13265
|
+
recallResultLimit,
|
|
13266
|
+
retrievalQuery,
|
|
13267
|
+
caps,
|
|
13268
|
+
stateViewPacketActive2
|
|
13269
|
+
).appliedResults;
|
|
13219
13270
|
if (scoped.length > 0) {
|
|
13220
13271
|
if (shouldPersistGraphSnapshot) {
|
|
13221
13272
|
graphSnapshotFinalResults = this.deps.buildGraphRecallRankedResults(
|
|
@@ -13368,20 +13419,6 @@ ${tmtNode.summary}`
|
|
|
13368
13419
|
},
|
|
13369
13420
|
[]
|
|
13370
13421
|
);
|
|
13371
|
-
const embeddingPartition = options.xrayCapture === true ? this.deps.recallRerankCoordinator.diversifyRecallResultsWithHeadroom(
|
|
13372
|
-
"memories",
|
|
13373
|
-
scoped,
|
|
13374
|
-
recallResultLimit,
|
|
13375
|
-
retrievalQuery,
|
|
13376
|
-
caps
|
|
13377
|
-
) : null;
|
|
13378
|
-
scoped = embeddingPartition?.appliedResults ?? this.deps.diversifyAndLimitRecallResults(
|
|
13379
|
-
"memories",
|
|
13380
|
-
scoped,
|
|
13381
|
-
recallResultLimit,
|
|
13382
|
-
retrievalQuery,
|
|
13383
|
-
caps
|
|
13384
|
-
);
|
|
13385
13422
|
{
|
|
13386
13423
|
const trustT0 = Date.now();
|
|
13387
13424
|
const trustFallback = { results: scoped, trustByPath: recallTrustByPath };
|
|
@@ -13409,6 +13446,22 @@ ${tmtNode.summary}`
|
|
|
13409
13446
|
success: !trustFellBack
|
|
13410
13447
|
});
|
|
13411
13448
|
}
|
|
13449
|
+
const embeddingPartition = options.xrayCapture === true ? this.deps.recallRerankCoordinator.diversifyRecallResultsWithHeadroom(
|
|
13450
|
+
"memories",
|
|
13451
|
+
scoped,
|
|
13452
|
+
recallResultLimit,
|
|
13453
|
+
retrievalQuery,
|
|
13454
|
+
caps,
|
|
13455
|
+
stateViewPacketActive2
|
|
13456
|
+
) : null;
|
|
13457
|
+
scoped = embeddingPartition?.appliedResults ?? this.deps.recallRerankCoordinator.diversifyRecallResultsWithHeadroom(
|
|
13458
|
+
"memories",
|
|
13459
|
+
scoped,
|
|
13460
|
+
recallResultLimit,
|
|
13461
|
+
retrievalQuery,
|
|
13462
|
+
caps,
|
|
13463
|
+
stateViewPacketActive2
|
|
13464
|
+
).appliedResults;
|
|
13412
13465
|
if (scoped.length > 0) {
|
|
13413
13466
|
if (shouldPersistGraphSnapshot) {
|
|
13414
13467
|
graphSnapshotFinalResults = this.deps.buildGraphRecallRankedResults(
|
|
@@ -13445,16 +13498,16 @@ ${tmtNode.summary}`
|
|
|
13445
13498
|
[]
|
|
13446
13499
|
);
|
|
13447
13500
|
if (memories.length > 0) {
|
|
13448
|
-
const activeMemories =
|
|
13449
|
-
|
|
13450
|
-
|
|
13451
|
-
|
|
13501
|
+
const activeMemories = filterRecentScanMemories(memories, {
|
|
13502
|
+
stateViewActive,
|
|
13503
|
+
asOfMs,
|
|
13504
|
+
namespaceOf: (p) => this.deps.namespaceFromPath(p),
|
|
13505
|
+
isExcluded: (p) => isGenericRecallExcludedPath(p, this.deps.config),
|
|
13506
|
+
supersessionOptions: {
|
|
13452
13507
|
enabled: lifecycleCaps.temporalSupersession,
|
|
13453
13508
|
includeInRecall: this.deps.config.temporalSupersessionIncludeInRecall
|
|
13454
|
-
}
|
|
13455
|
-
|
|
13456
|
-
asOfMs
|
|
13457
|
-
);
|
|
13509
|
+
}
|
|
13510
|
+
});
|
|
13458
13511
|
const queryAwareScopedMemories = queryAwarePrefilter.candidatePaths ? activeMemories.filter(
|
|
13459
13512
|
(memory) => queryAwarePrefilter.candidatePaths?.has(memory.path)
|
|
13460
13513
|
) : activeMemories;
|
|
@@ -13539,20 +13592,6 @@ ${tmtNode.summary}`
|
|
|
13539
13592
|
},
|
|
13540
13593
|
[]
|
|
13541
13594
|
);
|
|
13542
|
-
const recentPartition = options.xrayCapture === true ? this.deps.recallRerankCoordinator.diversifyRecallResultsWithHeadroom(
|
|
13543
|
-
"memories",
|
|
13544
|
-
recent,
|
|
13545
|
-
recallResultLimit,
|
|
13546
|
-
retrievalQuery,
|
|
13547
|
-
caps
|
|
13548
|
-
) : null;
|
|
13549
|
-
recent = recentPartition?.appliedResults ?? this.deps.diversifyAndLimitRecallResults(
|
|
13550
|
-
"memories",
|
|
13551
|
-
recent,
|
|
13552
|
-
recallResultLimit,
|
|
13553
|
-
retrievalQuery,
|
|
13554
|
-
caps
|
|
13555
|
-
);
|
|
13556
13595
|
{
|
|
13557
13596
|
const trustT0 = Date.now();
|
|
13558
13597
|
const recentPreloaded = new Map(
|
|
@@ -13583,6 +13622,22 @@ ${tmtNode.summary}`
|
|
|
13583
13622
|
success: !trustFellBack
|
|
13584
13623
|
});
|
|
13585
13624
|
}
|
|
13625
|
+
const recentPartition = options.xrayCapture === true ? this.deps.recallRerankCoordinator.diversifyRecallResultsWithHeadroom(
|
|
13626
|
+
"memories",
|
|
13627
|
+
recent,
|
|
13628
|
+
recallResultLimit,
|
|
13629
|
+
retrievalQuery,
|
|
13630
|
+
caps,
|
|
13631
|
+
stateViewPacketActive2
|
|
13632
|
+
) : null;
|
|
13633
|
+
recent = recentPartition?.appliedResults ?? this.deps.recallRerankCoordinator.diversifyRecallResultsWithHeadroom(
|
|
13634
|
+
"memories",
|
|
13635
|
+
recent,
|
|
13636
|
+
recallResultLimit,
|
|
13637
|
+
retrievalQuery,
|
|
13638
|
+
caps,
|
|
13639
|
+
stateViewPacketActive2
|
|
13640
|
+
).appliedResults;
|
|
13586
13641
|
if (recent.length > 0) {
|
|
13587
13642
|
if (shouldPersistGraphSnapshot) {
|
|
13588
13643
|
graphSnapshotFinalResults = this.deps.buildGraphRecallRankedResults(
|
|
@@ -14200,7 +14255,7 @@ ${tmtNode.summary}`
|
|
|
14200
14255
|
};
|
|
14201
14256
|
|
|
14202
14257
|
// src/orchestration/recall-search-pipeline.ts
|
|
14203
|
-
import { createHash as
|
|
14258
|
+
import { createHash as createHash7 } from "crypto";
|
|
14204
14259
|
import path13 from "path";
|
|
14205
14260
|
|
|
14206
14261
|
// src/orchestration/recall-search-prefilter.ts
|
|
@@ -14423,7 +14478,7 @@ var RecallSearchPipelineCoordinator = class {
|
|
|
14423
14478
|
if (!options.onDebugSnapshot) return;
|
|
14424
14479
|
await options.onDebugSnapshot({
|
|
14425
14480
|
recordedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
14426
|
-
queryHash:
|
|
14481
|
+
queryHash: createHash7("sha256").update(prompt).digest("hex"),
|
|
14427
14482
|
queryLength: prompt.length,
|
|
14428
14483
|
collection: options.collection,
|
|
14429
14484
|
namespaces: options.recallNamespaces,
|
|
@@ -14891,18 +14946,21 @@ var RecallSearchPipelineCoordinator = class {
|
|
|
14891
14946
|
results,
|
|
14892
14947
|
options.recallResultLimit,
|
|
14893
14948
|
options.prompt,
|
|
14894
|
-
caps
|
|
14949
|
+
caps,
|
|
14950
|
+
// #2859: packet semantics are off under a historical asOf pin.
|
|
14951
|
+
stateViewPacketActive(options.stateViewActive, options.asOfMs)
|
|
14895
14952
|
);
|
|
14896
14953
|
options.resultPartitionSink.partition = partition;
|
|
14897
14954
|
return partition.appliedResults;
|
|
14898
14955
|
}
|
|
14899
|
-
return this.deps.
|
|
14956
|
+
return this.deps.recallRerankCoordinator.diversifyRecallResultsWithHeadroom(
|
|
14900
14957
|
"memories",
|
|
14901
14958
|
results,
|
|
14902
14959
|
options.recallResultLimit,
|
|
14903
14960
|
options.prompt,
|
|
14904
|
-
caps
|
|
14905
|
-
|
|
14961
|
+
caps,
|
|
14962
|
+
stateViewPacketActive(options.stateViewActive, options.asOfMs)
|
|
14963
|
+
).appliedResults;
|
|
14906
14964
|
}
|
|
14907
14965
|
async loadSearchResultMemoryMap(results, preloadedMemoryMap, options) {
|
|
14908
14966
|
const memoryByPath = preloadedMemoryMap ? new Map(preloadedMemoryMap) : /* @__PURE__ */ new Map();
|
|
@@ -14991,7 +15049,7 @@ var RecallSearchPipelineCoordinator = class {
|
|
|
14991
15049
|
}
|
|
14992
15050
|
filterSearchResultsByRecallSafety(results, memoryByPath, options) {
|
|
14993
15051
|
const stateViewActive = options?.stateViewActive === true;
|
|
14994
|
-
const
|
|
15052
|
+
const stateViewAnchors = stateViewActive ? new StateViewAnchorTracker() : null;
|
|
14995
15053
|
const stateViewDeferred = [];
|
|
14996
15054
|
const stateViewBuilt = stateViewActive ? new Array(results.length).fill(null) : null;
|
|
14997
15055
|
const buildRecallRow = (r, memory) => ({
|
|
@@ -15003,8 +15061,11 @@ var RecallSearchPipelineCoordinator = class {
|
|
|
15003
15061
|
...stateViewActive && memory ? {
|
|
15004
15062
|
id: memory.frontmatter.id,
|
|
15005
15063
|
status: memory.frontmatter.status,
|
|
15064
|
+
supersedes: memory.frontmatter.supersedes,
|
|
15006
15065
|
supersededBy: memory.frontmatter.supersededBy,
|
|
15007
|
-
supersededAt: memory.frontmatter.supersededAt
|
|
15066
|
+
supersededAt: memory.frontmatter.supersededAt,
|
|
15067
|
+
validAt: memory.frontmatter.valid_at,
|
|
15068
|
+
invalidAt: memory.frontmatter.invalid_at
|
|
15008
15069
|
} : {}
|
|
15009
15070
|
});
|
|
15010
15071
|
let stateViewAdmittedCount = 0;
|
|
@@ -15097,10 +15158,7 @@ var RecallSearchPipelineCoordinator = class {
|
|
|
15097
15158
|
const builtRow = buildRecallRow(r, memory);
|
|
15098
15159
|
if (stateViewBuilt !== null) {
|
|
15099
15160
|
stateViewBuilt[resultIdx] = builtRow;
|
|
15100
|
-
if (memory)
|
|
15101
|
-
const id = memory.frontmatter.id;
|
|
15102
|
-
if (typeof id === "string" && id.length > 0) stateViewSurvivorIds.add(id);
|
|
15103
|
-
}
|
|
15161
|
+
if (memory && stateViewAnchors) stateViewAnchors.admit(r.namespace, memory.frontmatter);
|
|
15104
15162
|
}
|
|
15105
15163
|
filtered.push(builtRow);
|
|
15106
15164
|
}
|
|
@@ -15110,12 +15168,12 @@ var RecallSearchPipelineCoordinator = class {
|
|
|
15110
15168
|
progress = false;
|
|
15111
15169
|
for (const deferredIdx of stateViewDeferred) {
|
|
15112
15170
|
if (admitted.has(deferredIdx)) continue;
|
|
15113
|
-
const
|
|
15171
|
+
const deferredRow = results[deferredIdx];
|
|
15172
|
+
const deferredMemory = memoryForResult(memoryByPath, deferredRow);
|
|
15114
15173
|
if (!deferredMemory) continue;
|
|
15115
|
-
if (
|
|
15174
|
+
if (stateViewAnchors.anchored(deferredRow.namespace, deferredMemory.frontmatter)) {
|
|
15116
15175
|
admitted.add(deferredIdx);
|
|
15117
|
-
|
|
15118
|
-
if (typeof id === "string" && id.length > 0) stateViewSurvivorIds.add(id);
|
|
15176
|
+
stateViewAnchors.admit(deferredRow.namespace, deferredMemory.frontmatter);
|
|
15119
15177
|
progress = true;
|
|
15120
15178
|
}
|
|
15121
15179
|
}
|
|
@@ -15390,7 +15448,7 @@ var RecallSearchPipelineCoordinator = class {
|
|
|
15390
15448
|
};
|
|
15391
15449
|
|
|
15392
15450
|
// src/orchestration/turn-ingestion.ts
|
|
15393
|
-
import { createHash as
|
|
15451
|
+
import { createHash as createHash8, randomBytes } from "crypto";
|
|
15394
15452
|
function isFlushPlanRecoveryTurn(turn) {
|
|
15395
15453
|
const provenance = turn.importProvenance;
|
|
15396
15454
|
if (provenance?.sourceLabel === "OpenClaw flush plan") return true;
|
|
@@ -15581,7 +15639,7 @@ var TurnIngestionCoordinator = class {
|
|
|
15581
15639
|
const shouldUseStableBatchKey = turns.some(
|
|
15582
15640
|
(turn) => turn.persistProcessedFingerprint === true || typeof turn.turnFingerprint === "string" && turn.turnFingerprint.length > 0
|
|
15583
15641
|
);
|
|
15584
|
-
const stableBatchFingerprint = shouldUseStableBatchKey ?
|
|
15642
|
+
const stableBatchFingerprint = shouldUseStableBatchKey ? createHash8("sha256").update(
|
|
15585
15643
|
turns.map(
|
|
15586
15644
|
(turn) => [
|
|
15587
15645
|
turn.role,
|
|
@@ -15927,7 +15985,7 @@ var TurnIngestionCoordinator = class {
|
|
|
15927
15985
|
};
|
|
15928
15986
|
|
|
15929
15987
|
// src/orchestration/recall-introspection.ts
|
|
15930
|
-
import { mkdir as mkdir5, readFile as
|
|
15988
|
+
import { mkdir as mkdir5, readFile as readFile7, writeFile as writeFile5 } from "fs/promises";
|
|
15931
15989
|
import path15 from "path";
|
|
15932
15990
|
|
|
15933
15991
|
// src/taxonomy/default-taxonomy.ts
|
|
@@ -16050,7 +16108,7 @@ function generateResolverDocument(taxonomy) {
|
|
|
16050
16108
|
}
|
|
16051
16109
|
|
|
16052
16110
|
// src/taxonomy/taxonomy-loader.ts
|
|
16053
|
-
import { readFile as
|
|
16111
|
+
import { readFile as readFile6, mkdir as mkdir4, writeFile as writeFile4 } from "fs/promises";
|
|
16054
16112
|
import path14 from "path";
|
|
16055
16113
|
var TAXONOMY_DIR = ".taxonomy";
|
|
16056
16114
|
var TAXONOMY_FILE = "taxonomy.json";
|
|
@@ -16152,7 +16210,7 @@ async function loadTaxonomy(memoryDir) {
|
|
|
16152
16210
|
const taxonomyPath = path14.join(memoryDir, TAXONOMY_DIR, TAXONOMY_FILE);
|
|
16153
16211
|
let raw;
|
|
16154
16212
|
try {
|
|
16155
|
-
raw = await
|
|
16213
|
+
raw = await readFile6(taxonomyPath, "utf-8");
|
|
16156
16214
|
} catch (err) {
|
|
16157
16215
|
if (err instanceof Error && err.code === "ENOENT") {
|
|
16158
16216
|
return structuredClone(DEFAULT_TAXONOMY);
|
|
@@ -16238,7 +16296,7 @@ var RecallIntrospectionCoordinator = class {
|
|
|
16238
16296
|
"last_graph_recall.json"
|
|
16239
16297
|
);
|
|
16240
16298
|
try {
|
|
16241
|
-
const raw = await
|
|
16299
|
+
const raw = await readFile7(snapshotPath, "utf-8");
|
|
16242
16300
|
const parsed = JSON.parse(raw);
|
|
16243
16301
|
if (!parsed || typeof parsed !== "object") return null;
|
|
16244
16302
|
return {
|
|
@@ -16273,7 +16331,7 @@ var RecallIntrospectionCoordinator = class {
|
|
|
16273
16331
|
const storage = await this.deps.getStorage(namespace);
|
|
16274
16332
|
const snapshotPath = path15.join(storage.dir, "state", "last_intent.json");
|
|
16275
16333
|
try {
|
|
16276
|
-
const raw = await
|
|
16334
|
+
const raw = await readFile7(snapshotPath, "utf-8");
|
|
16277
16335
|
const parsed = JSON.parse(raw);
|
|
16278
16336
|
if (!parsed || typeof parsed !== "object") return null;
|
|
16279
16337
|
const graphDecision = parsed.graphDecision && typeof parsed.graphDecision === "object" ? parsed.graphDecision : void 0;
|
|
@@ -16310,7 +16368,7 @@ var RecallIntrospectionCoordinator = class {
|
|
|
16310
16368
|
"last_qmd_recall.json"
|
|
16311
16369
|
);
|
|
16312
16370
|
try {
|
|
16313
|
-
const raw = await
|
|
16371
|
+
const raw = await readFile7(snapshotPath, "utf-8");
|
|
16314
16372
|
const parsed = JSON.parse(raw);
|
|
16315
16373
|
if (!parsed || typeof parsed !== "object") return null;
|
|
16316
16374
|
return {
|
|
@@ -16649,15 +16707,214 @@ var RecallIntrospectionCoordinator = class {
|
|
|
16649
16707
|
// src/orchestration/orchestrator-init.ts
|
|
16650
16708
|
import { readdir as readdir2, stat as stat2, unlink as unlink3 } from "fs/promises";
|
|
16651
16709
|
import path16 from "path";
|
|
16710
|
+
|
|
16711
|
+
// src/orchestration/startup-collection-checks.ts
|
|
16712
|
+
async function startupDiscoveryWithTimeout(discover, configuredFallback, timeoutMs = qmdStartupCollectionCheckTimeoutMs()) {
|
|
16713
|
+
let timer;
|
|
16714
|
+
const fallback = {
|
|
16715
|
+
value: configuredFallback,
|
|
16716
|
+
complete: false
|
|
16717
|
+
};
|
|
16718
|
+
const timeoutPromise = new Promise((resolve) => {
|
|
16719
|
+
timer = setTimeout(() => {
|
|
16720
|
+
log.warn(
|
|
16721
|
+
`startup discovery timed out after ${timeoutMs}ms; using configured fallback fail-open`
|
|
16722
|
+
);
|
|
16723
|
+
resolve(fallback);
|
|
16724
|
+
}, timeoutMs);
|
|
16725
|
+
});
|
|
16726
|
+
try {
|
|
16727
|
+
return await Promise.race([
|
|
16728
|
+
Promise.resolve().then(discover).then((value) => ({ value, complete: true })),
|
|
16729
|
+
timeoutPromise
|
|
16730
|
+
]);
|
|
16731
|
+
} finally {
|
|
16732
|
+
if (timer) clearTimeout(timer);
|
|
16733
|
+
}
|
|
16734
|
+
}
|
|
16735
|
+
async function qmdStartupCollectionChecksWithTimeout(checks, namespaces, timeoutMs = qmdStartupCollectionCheckTimeoutMs() + 1e3) {
|
|
16736
|
+
if (checks.length === 0) return [];
|
|
16737
|
+
const settled = /* @__PURE__ */ new Map();
|
|
16738
|
+
const trackedChecks = checks.map((check) => check.then((result) => {
|
|
16739
|
+
settled.set(result.namespace, result);
|
|
16740
|
+
return result;
|
|
16741
|
+
}));
|
|
16742
|
+
let timer;
|
|
16743
|
+
const timeoutPromise = new Promise((resolve) => {
|
|
16744
|
+
timer = setTimeout(() => {
|
|
16745
|
+
log.warn(
|
|
16746
|
+
`QMD startup collection check batch timed out after ${timeoutMs}ms; keeping search enabled fail-open`
|
|
16747
|
+
);
|
|
16748
|
+
resolve(namespaces.map(
|
|
16749
|
+
(namespace) => settled.get(namespace) ?? { namespace, state: "unknown" }
|
|
16750
|
+
));
|
|
16751
|
+
}, timeoutMs);
|
|
16752
|
+
});
|
|
16753
|
+
try {
|
|
16754
|
+
return await Promise.race([Promise.all(trackedChecks), timeoutPromise]);
|
|
16755
|
+
} finally {
|
|
16756
|
+
if (timer) clearTimeout(timer);
|
|
16757
|
+
}
|
|
16758
|
+
}
|
|
16759
|
+
|
|
16760
|
+
// src/orchestration/orchestrator-init.ts
|
|
16652
16761
|
var OrchestratorInitCoordinator = class {
|
|
16653
16762
|
constructor(deps) {
|
|
16654
16763
|
this.deps = deps;
|
|
16655
16764
|
}
|
|
16656
16765
|
deps;
|
|
16766
|
+
nextStartupEpoch = 0;
|
|
16767
|
+
activeStartupEpoch = null;
|
|
16768
|
+
startupClosed = false;
|
|
16769
|
+
maintenanceNamespacesFlight;
|
|
16770
|
+
correctionCatalogFlight;
|
|
16771
|
+
recoveredCorrectionNamespaces = /* @__PURE__ */ new Set();
|
|
16772
|
+
correctionRecoveryChain = Promise.resolve();
|
|
16773
|
+
startupEpochAbort;
|
|
16774
|
+
/** Retire the current lifecycle without constructing a lazy coordinator. */
|
|
16775
|
+
retireStartupEpoch() {
|
|
16776
|
+
this.startupEpochAbort?.controller.abort();
|
|
16777
|
+
this.startupEpochAbort = void 0;
|
|
16778
|
+
this.startupClosed = true;
|
|
16779
|
+
this.activeStartupEpoch = null;
|
|
16780
|
+
}
|
|
16781
|
+
beginStartupEpoch() {
|
|
16782
|
+
this.startupEpochAbort?.controller.abort();
|
|
16783
|
+
this.startupEpochAbort = void 0;
|
|
16784
|
+
this.deps.deferredInitAbort?.abort();
|
|
16785
|
+
this.deps.deferredInitAbort = null;
|
|
16786
|
+
this.deps.deferredSyncSucceeded = false;
|
|
16787
|
+
const epoch = ++this.nextStartupEpoch;
|
|
16788
|
+
this.startupEpochAbort = { epoch, controller: new AbortController() };
|
|
16789
|
+
this.activeStartupEpoch = epoch;
|
|
16790
|
+
this.startupClosed = false;
|
|
16791
|
+
this.maintenanceNamespacesFlight = void 0;
|
|
16792
|
+
this.correctionCatalogFlight = void 0;
|
|
16793
|
+
this.recoveredCorrectionNamespaces = /* @__PURE__ */ new Set();
|
|
16794
|
+
this.correctionRecoveryChain = Promise.resolve();
|
|
16795
|
+
return epoch;
|
|
16796
|
+
}
|
|
16797
|
+
currentOrNewStartupEpoch() {
|
|
16798
|
+
if (this.startupClosed) return null;
|
|
16799
|
+
return this.activeStartupEpoch ?? this.beginStartupEpoch();
|
|
16800
|
+
}
|
|
16801
|
+
isCurrentStartupEpoch(epoch) {
|
|
16802
|
+
return !this.startupClosed && this.activeStartupEpoch === epoch;
|
|
16803
|
+
}
|
|
16804
|
+
startupEpochSignal(epoch) {
|
|
16805
|
+
return this.startupEpochAbort?.epoch === epoch ? this.startupEpochAbort.controller.signal : void 0;
|
|
16806
|
+
}
|
|
16807
|
+
linkedEpochAbortController(epoch, externalSignal) {
|
|
16808
|
+
const controller = new AbortController();
|
|
16809
|
+
const signals = [this.startupEpochSignal(epoch), externalSignal].filter((signal) => signal !== void 0);
|
|
16810
|
+
const abort = () => controller.abort();
|
|
16811
|
+
for (const signal of signals) {
|
|
16812
|
+
if (signal.aborted) abort();
|
|
16813
|
+
else signal.addEventListener("abort", abort, { once: true });
|
|
16814
|
+
}
|
|
16815
|
+
return {
|
|
16816
|
+
controller,
|
|
16817
|
+
dispose: () => {
|
|
16818
|
+
for (const signal of signals) signal.removeEventListener("abort", abort);
|
|
16819
|
+
}
|
|
16820
|
+
};
|
|
16821
|
+
}
|
|
16822
|
+
async probeForStartupEpoch(epoch, externalSignal) {
|
|
16823
|
+
const abort = this.linkedEpochAbortController(epoch, externalSignal);
|
|
16824
|
+
try {
|
|
16825
|
+
if (!this.isCurrentStartupEpoch(epoch) || abort.controller.signal.aborted) return false;
|
|
16826
|
+
return await this.deps.qmd.probe({ signal: abort.controller.signal });
|
|
16827
|
+
} finally {
|
|
16828
|
+
abort.dispose();
|
|
16829
|
+
}
|
|
16830
|
+
}
|
|
16831
|
+
maintenanceNamespacesFlightFor(epoch) {
|
|
16832
|
+
if (this.maintenanceNamespacesFlight?.epoch === epoch) {
|
|
16833
|
+
return this.maintenanceNamespacesFlight.promise;
|
|
16834
|
+
}
|
|
16835
|
+
const promise = Promise.resolve().then(() => {
|
|
16836
|
+
if (!this.isCurrentStartupEpoch(epoch)) return [];
|
|
16837
|
+
return this.deps.maintenanceNamespaces();
|
|
16838
|
+
});
|
|
16839
|
+
this.maintenanceNamespacesFlight = { epoch, promise };
|
|
16840
|
+
void promise.catch(() => {
|
|
16841
|
+
if (this.isCurrentStartupEpoch(epoch) && this.maintenanceNamespacesFlight?.epoch === epoch && this.maintenanceNamespacesFlight.promise === promise) {
|
|
16842
|
+
this.maintenanceNamespacesFlight = void 0;
|
|
16843
|
+
}
|
|
16844
|
+
});
|
|
16845
|
+
return promise;
|
|
16846
|
+
}
|
|
16847
|
+
correctionCatalogFlightFor(epoch) {
|
|
16848
|
+
if (!this.isCurrentStartupEpoch(epoch)) {
|
|
16849
|
+
return Promise.resolve([]);
|
|
16850
|
+
}
|
|
16851
|
+
if (this.correctionCatalogFlight?.epoch === epoch) {
|
|
16852
|
+
return this.correctionCatalogFlight.promise;
|
|
16853
|
+
}
|
|
16854
|
+
const promise = Promise.resolve().then(() => {
|
|
16855
|
+
if (!this.isCurrentStartupEpoch(epoch)) return [];
|
|
16856
|
+
return this.deps.namespaceCatalog.listNamespaces();
|
|
16857
|
+
});
|
|
16858
|
+
this.correctionCatalogFlight = { epoch, promise };
|
|
16859
|
+
return promise;
|
|
16860
|
+
}
|
|
16861
|
+
enqueueCorrectionRecovery(epoch, namespaces) {
|
|
16862
|
+
if (!this.isCurrentStartupEpoch(epoch)) return Promise.resolve();
|
|
16863
|
+
const unrecovered = [...new Set(namespaces)].filter(
|
|
16864
|
+
(namespace) => !this.recoveredCorrectionNamespaces.has(namespace)
|
|
16865
|
+
);
|
|
16866
|
+
if (unrecovered.length === 0) return this.correctionRecoveryChain;
|
|
16867
|
+
for (const namespace of unrecovered) this.recoveredCorrectionNamespaces.add(namespace);
|
|
16868
|
+
this.correctionRecoveryChain = this.correctionRecoveryChain.then(async () => {
|
|
16869
|
+
if (!this.isCurrentStartupEpoch(epoch)) return;
|
|
16870
|
+
try {
|
|
16871
|
+
const recovered = await this.deps.passiveCorrectionService().recoverStaleApplyingPlans(
|
|
16872
|
+
unrecovered
|
|
16873
|
+
);
|
|
16874
|
+
if (recovered > 0) {
|
|
16875
|
+
log.info(`correction: recovered ${recovered} stale applying plan(s) on startup`);
|
|
16876
|
+
}
|
|
16877
|
+
} catch (staleErr) {
|
|
16878
|
+
log.debug(`correction: stale-plan recovery skipped: ${staleErr instanceof Error ? staleErr.message : String(staleErr)}`);
|
|
16879
|
+
}
|
|
16880
|
+
});
|
|
16881
|
+
return this.correctionRecoveryChain;
|
|
16882
|
+
}
|
|
16883
|
+
async startupNamespaces(epoch) {
|
|
16884
|
+
if (!this.isCurrentStartupEpoch(epoch)) {
|
|
16885
|
+
return { namespaces: this.deps.configuredNamespaceList(), complete: false };
|
|
16886
|
+
}
|
|
16887
|
+
if (!resolveNamespaceCapabilities(this.deps.config).namespaces) {
|
|
16888
|
+
return { namespaces: [this.deps.config.defaultNamespace], complete: true };
|
|
16889
|
+
}
|
|
16890
|
+
const discovery = await startupDiscoveryWithTimeout(
|
|
16891
|
+
() => this.maintenanceNamespacesFlightFor(epoch),
|
|
16892
|
+
this.deps.configuredNamespaceList()
|
|
16893
|
+
);
|
|
16894
|
+
return { namespaces: discovery.value, complete: discovery.complete };
|
|
16895
|
+
}
|
|
16657
16896
|
async initialize() {
|
|
16897
|
+
const epoch = this.beginStartupEpoch();
|
|
16898
|
+
let resolveDeferred;
|
|
16658
16899
|
this.deps.deferredReady = new Promise((resolve) => {
|
|
16659
|
-
|
|
16900
|
+
resolveDeferred = () => resolve();
|
|
16901
|
+
this.deps.resolveDeferredReady = resolveDeferred;
|
|
16660
16902
|
});
|
|
16903
|
+
const settleOwnDeferredReady = () => {
|
|
16904
|
+
if (this.deps.resolveDeferredReady === resolveDeferred) {
|
|
16905
|
+
this.deps.resolveDeferredReady = null;
|
|
16906
|
+
}
|
|
16907
|
+
resolveDeferred?.();
|
|
16908
|
+
};
|
|
16909
|
+
const exitIfStale = () => {
|
|
16910
|
+
if (this.isCurrentStartupEpoch(epoch)) return false;
|
|
16911
|
+
if (this.startupClosed && this.deps.resolveInit) {
|
|
16912
|
+
this.deps.resolveInit();
|
|
16913
|
+
this.deps.resolveInit = null;
|
|
16914
|
+
}
|
|
16915
|
+
settleOwnDeferredReady();
|
|
16916
|
+
return true;
|
|
16917
|
+
};
|
|
16661
16918
|
try {
|
|
16662
16919
|
await migrateFromEngram({
|
|
16663
16920
|
quiet: true,
|
|
@@ -16690,21 +16947,34 @@ var OrchestratorInitCoordinator = class {
|
|
|
16690
16947
|
const correctionNamespaces = new Set(this.deps.configuredNamespaceList());
|
|
16691
16948
|
if (this.deps.namespaceCatalog.enabled) {
|
|
16692
16949
|
try {
|
|
16693
|
-
|
|
16950
|
+
const catalogFlight = this.correctionCatalogFlightFor(epoch);
|
|
16951
|
+
const catalogDiscovery = await startupDiscoveryWithTimeout(
|
|
16952
|
+
() => catalogFlight,
|
|
16953
|
+
[]
|
|
16954
|
+
);
|
|
16955
|
+
for (const rec of catalogDiscovery.value) {
|
|
16694
16956
|
correctionNamespaces.add(rec.namespace);
|
|
16695
16957
|
}
|
|
16958
|
+
if (!catalogDiscovery.complete) {
|
|
16959
|
+
void catalogFlight.then(
|
|
16960
|
+
(records) => {
|
|
16961
|
+
if (!this.isCurrentStartupEpoch(epoch)) return;
|
|
16962
|
+
void this.enqueueCorrectionRecovery(
|
|
16963
|
+
epoch,
|
|
16964
|
+
records.map((record) => record.namespace)
|
|
16965
|
+
);
|
|
16966
|
+
},
|
|
16967
|
+
() => void 0
|
|
16968
|
+
);
|
|
16969
|
+
}
|
|
16696
16970
|
} catch {
|
|
16697
16971
|
}
|
|
16698
16972
|
}
|
|
16699
|
-
|
|
16700
|
-
[...correctionNamespaces]
|
|
16701
|
-
);
|
|
16702
|
-
if (recovered > 0) {
|
|
16703
|
-
log.info(`correction: recovered ${recovered} stale applying plan(s) on startup`);
|
|
16704
|
-
}
|
|
16973
|
+
await this.enqueueCorrectionRecovery(epoch, correctionNamespaces);
|
|
16705
16974
|
} catch (staleErr) {
|
|
16706
16975
|
log.debug(`correction: stale-plan recovery skipped: ${staleErr instanceof Error ? staleErr.message : String(staleErr)}`);
|
|
16707
16976
|
}
|
|
16977
|
+
if (exitIfStale()) return;
|
|
16708
16978
|
await this.deps.relevance.load();
|
|
16709
16979
|
await this.deps.negatives.load();
|
|
16710
16980
|
await this.deps.lastRecall.load();
|
|
@@ -16765,52 +17035,68 @@ var OrchestratorInitCoordinator = class {
|
|
|
16765
17035
|
}
|
|
16766
17036
|
}
|
|
16767
17037
|
try {
|
|
16768
|
-
const available = await this.
|
|
17038
|
+
const available = await this.probeForStartupEpoch(epoch);
|
|
16769
17039
|
if (available) {
|
|
16770
17040
|
log.info(`Search backend: available ${this.deps.qmd.debugStatus()}`);
|
|
16771
|
-
const
|
|
16772
|
-
const
|
|
16773
|
-
|
|
16774
|
-
|
|
16775
|
-
|
|
16776
|
-
|
|
16777
|
-
|
|
16778
|
-
|
|
16779
|
-
|
|
16780
|
-
this.deps.
|
|
16781
|
-
|
|
16782
|
-
|
|
16783
|
-
|
|
16784
|
-
|
|
16785
|
-
|
|
16786
|
-
|
|
16787
|
-
|
|
16788
|
-
|
|
16789
|
-
|
|
16790
|
-
|
|
16791
|
-
|
|
16792
|
-
|
|
16793
|
-
|
|
16794
|
-
|
|
16795
|
-
|
|
16796
|
-
|
|
16797
|
-
|
|
16798
|
-
|
|
16799
|
-
|
|
16800
|
-
|
|
16801
|
-
|
|
16802
|
-
|
|
16803
|
-
|
|
16804
|
-
|
|
16805
|
-
|
|
16806
|
-
|
|
16807
|
-
|
|
16808
|
-
|
|
16809
|
-
|
|
16810
|
-
|
|
16811
|
-
|
|
16812
|
-
|
|
16813
|
-
)
|
|
17041
|
+
const namespaceCapabilities = resolveNamespaceCapabilities(this.deps.config).namespaces;
|
|
17042
|
+
const discovery = await this.startupNamespaces(epoch);
|
|
17043
|
+
if (!this.isCurrentStartupEpoch(epoch)) {
|
|
17044
|
+
log.debug("startup collection check skipped for a retired startup epoch");
|
|
17045
|
+
} else {
|
|
17046
|
+
const checks = discovery.namespaces.map(async (namespace) => {
|
|
17047
|
+
const epochAbort = this.linkedEpochAbortController(epoch);
|
|
17048
|
+
try {
|
|
17049
|
+
const state = await qmdStartupCollectionCheckWithTimeout(
|
|
17050
|
+
namespaceCapabilities ? this.deps.namespaceSearchRouter.ensureNamespaceCollection(
|
|
17051
|
+
namespace,
|
|
17052
|
+
{ signal: epochAbort.controller.signal }
|
|
17053
|
+
) : this.deps.qmd.ensureCollection(
|
|
17054
|
+
this.deps.config.memoryDir,
|
|
17055
|
+
this.deps.config.qmdCollection,
|
|
17056
|
+
{ signal: epochAbort.controller.signal }
|
|
17057
|
+
),
|
|
17058
|
+
epochAbort.controller,
|
|
17059
|
+
namespace
|
|
17060
|
+
);
|
|
17061
|
+
return { namespace, state };
|
|
17062
|
+
} finally {
|
|
17063
|
+
epochAbort.dispose();
|
|
17064
|
+
}
|
|
17065
|
+
});
|
|
17066
|
+
const states = await qmdStartupCollectionChecksWithTimeout(checks, discovery.namespaces);
|
|
17067
|
+
if (!this.isCurrentStartupEpoch(epoch)) {
|
|
17068
|
+
log.debug("startup collection-check batch completed for a retired startup epoch");
|
|
17069
|
+
} else {
|
|
17070
|
+
const defaultState = states.find(
|
|
17071
|
+
(entry) => entry.namespace === this.deps.config.defaultNamespace
|
|
17072
|
+
)?.state ?? "unknown";
|
|
17073
|
+
if (defaultState === "missing") {
|
|
17074
|
+
await this.deps.disposeSearchBackendIfNeeded();
|
|
17075
|
+
if (!this.isCurrentStartupEpoch(epoch)) {
|
|
17076
|
+
log.debug("startup collection-check disposal completed for a retired startup epoch");
|
|
17077
|
+
} else {
|
|
17078
|
+
this.deps.qmd = new NoopSearchBackend();
|
|
17079
|
+
log.warn(
|
|
17080
|
+
"Search collection missing for Remnic memory store; disabling search retrieval for this runtime (fallback retrieval remains enabled)"
|
|
17081
|
+
);
|
|
17082
|
+
}
|
|
17083
|
+
} else if (defaultState === "unknown") {
|
|
17084
|
+
log.warn(
|
|
17085
|
+
"Search collection check unavailable; keeping search retrieval enabled for fail-open behavior"
|
|
17086
|
+
);
|
|
17087
|
+
} else if (defaultState === "skipped") {
|
|
17088
|
+
log.debug(
|
|
17089
|
+
"Search collection check skipped (remote or daemon-only mode)"
|
|
17090
|
+
);
|
|
17091
|
+
}
|
|
17092
|
+
for (const entry of states) {
|
|
17093
|
+
if (entry.namespace === this.deps.config.defaultNamespace) continue;
|
|
17094
|
+
if (entry.state === "missing") {
|
|
17095
|
+
log.warn(
|
|
17096
|
+
`Search collection missing for namespace '${entry.namespace}'; namespace retrieval will fail open to non-search paths`
|
|
17097
|
+
);
|
|
17098
|
+
}
|
|
17099
|
+
}
|
|
16814
17100
|
}
|
|
16815
17101
|
}
|
|
16816
17102
|
} else if (this.deps.qmd instanceof NoopSearchBackend) {
|
|
@@ -16821,46 +17107,55 @@ var OrchestratorInitCoordinator = class {
|
|
|
16821
17107
|
} catch (err) {
|
|
16822
17108
|
log.error(`QMD probe/collection check failed (non-fatal): ${err}`);
|
|
16823
17109
|
}
|
|
17110
|
+
if (exitIfStale()) return;
|
|
16824
17111
|
if (this.deps.resolveInit) {
|
|
16825
17112
|
this.deps.resolveInit();
|
|
16826
17113
|
this.deps.resolveInit = null;
|
|
16827
17114
|
log.info("init gate opened (essential state + QMD state loaded)");
|
|
16828
17115
|
}
|
|
16829
|
-
|
|
16830
|
-
|
|
17116
|
+
if (this.deps.resolveDeferredReady === resolveDeferred) {
|
|
17117
|
+
this.deps.resolveDeferredReady = null;
|
|
17118
|
+
}
|
|
16831
17119
|
this.deps.deferredInitAbort = new AbortController();
|
|
16832
17120
|
this.deps.deferredInitialize(this.deps.deferredInitAbort.signal).catch((err) => {
|
|
16833
17121
|
log.error(`deferred initialization failed (non-fatal): ${err}`);
|
|
16834
17122
|
}).finally(() => {
|
|
16835
|
-
|
|
17123
|
+
settleOwnDeferredReady();
|
|
16836
17124
|
});
|
|
16837
17125
|
} catch (err) {
|
|
16838
|
-
if (this.deps.resolveInit) {
|
|
17126
|
+
if ((this.isCurrentStartupEpoch(epoch) || this.startupClosed) && this.deps.resolveInit) {
|
|
16839
17127
|
this.deps.resolveInit();
|
|
16840
17128
|
this.deps.resolveInit = null;
|
|
16841
17129
|
}
|
|
16842
|
-
|
|
16843
|
-
this.deps.resolveDeferredReady();
|
|
16844
|
-
this.deps.resolveDeferredReady = null;
|
|
16845
|
-
}
|
|
17130
|
+
settleOwnDeferredReady();
|
|
16846
17131
|
throw err;
|
|
16847
17132
|
}
|
|
16848
17133
|
}
|
|
16849
17134
|
async deferredInitialize(signal) {
|
|
17135
|
+
const epoch = this.currentOrNewStartupEpoch();
|
|
17136
|
+
if (epoch === null) return;
|
|
16850
17137
|
const lifecycleCaps = resolveMemoryLifecycleCapabilities(this.deps.config);
|
|
16851
17138
|
if (this.deps.qmd.isAvailable() && resolveQmdCapabilities(this.deps.config).qmdMaintenance) {
|
|
16852
17139
|
try {
|
|
16853
17140
|
log.info("QMD startup sync: updating index to match current disk state");
|
|
17141
|
+
const discovery = await this.startupNamespaces(epoch);
|
|
17142
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
16854
17143
|
if (resolveNamespaceCapabilities(this.deps.config).namespaces) {
|
|
16855
17144
|
await this.deps.namespaceSearchRouter.updateNamespaces(
|
|
16856
|
-
|
|
17145
|
+
discovery.namespaces,
|
|
16857
17146
|
{ signal }
|
|
16858
17147
|
);
|
|
16859
17148
|
} else {
|
|
16860
17149
|
await this.deps.qmd.update({ signal });
|
|
16861
17150
|
}
|
|
17151
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
16862
17152
|
log.info("QMD startup sync: complete");
|
|
16863
|
-
|
|
17153
|
+
if (discovery.complete) {
|
|
17154
|
+
this.deps.deferredSyncSucceeded = true;
|
|
17155
|
+
} else {
|
|
17156
|
+
this.deps.deferredSyncSucceeded = false;
|
|
17157
|
+
log.warn("QMD startup sync used configured namespace fallback; retry remains armed");
|
|
17158
|
+
}
|
|
16864
17159
|
} catch (err) {
|
|
16865
17160
|
log.warn(`QMD startup sync failed (non-fatal): ${err}`);
|
|
16866
17161
|
}
|
|
@@ -16868,7 +17163,7 @@ var OrchestratorInitCoordinator = class {
|
|
|
16868
17163
|
} else {
|
|
16869
17164
|
this.deps.deferredSyncSucceeded = true;
|
|
16870
17165
|
}
|
|
16871
|
-
if (signal.aborted) return;
|
|
17166
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
16872
17167
|
const warmupPromises = [];
|
|
16873
17168
|
if (this.deps.qmd.isAvailable()) {
|
|
16874
17169
|
const warmupNs = this.deps.config.defaultNamespace;
|
|
@@ -16893,7 +17188,7 @@ var OrchestratorInitCoordinator = class {
|
|
|
16893
17188
|
);
|
|
16894
17189
|
}
|
|
16895
17190
|
await Promise.all(warmupPromises);
|
|
16896
|
-
if (signal.aborted) return;
|
|
17191
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
16897
17192
|
const cacheWarmups = [];
|
|
16898
17193
|
if (resolveRecallAuxiliaryCapabilities(this.deps.config).knowledgeIndex) {
|
|
16899
17194
|
cacheWarmups.push(
|
|
@@ -16915,10 +17210,11 @@ var OrchestratorInitCoordinator = class {
|
|
|
16915
17210
|
}).catch(() => {
|
|
16916
17211
|
}));
|
|
16917
17212
|
await Promise.all(cacheWarmups);
|
|
16918
|
-
if (signal.aborted) return;
|
|
17213
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
16919
17214
|
if (resolveIndexingCapabilities(this.deps.config).conversationIndex && this.deps.conversationIndexBackend) {
|
|
16920
17215
|
try {
|
|
16921
17216
|
const init = await this.deps.conversationIndexBackend.initialize();
|
|
17217
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
16922
17218
|
if (!init.enabled) {
|
|
16923
17219
|
this.deps.config.conversationIndexEnabled = false;
|
|
16924
17220
|
}
|
|
@@ -16930,11 +17226,12 @@ var OrchestratorInitCoordinator = class {
|
|
|
16930
17226
|
log.debug(init.message);
|
|
16931
17227
|
}
|
|
16932
17228
|
} catch (err) {
|
|
17229
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
16933
17230
|
log.error(`Conversation index initialization failed (non-fatal): ${err}`);
|
|
16934
17231
|
this.deps.config.conversationIndexEnabled = false;
|
|
16935
17232
|
}
|
|
16936
17233
|
}
|
|
16937
|
-
if (signal.aborted) return;
|
|
17234
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
16938
17235
|
if (resolveLocalLlmCapabilities(this.deps.config).localLlm) {
|
|
16939
17236
|
try {
|
|
16940
17237
|
await this.deps.validateLocalLlmModel();
|
|
@@ -16942,12 +17239,13 @@ var OrchestratorInitCoordinator = class {
|
|
|
16942
17239
|
log.error(`Local LLM validation failed (non-fatal): ${err}`);
|
|
16943
17240
|
}
|
|
16944
17241
|
}
|
|
16945
|
-
if (signal.aborted) return;
|
|
17242
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
16946
17243
|
await this.deps.maintenanceScheduler.autoRegisterCrons(signal);
|
|
16947
|
-
if (signal.aborted) return;
|
|
17244
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
16948
17245
|
if (lifecycleCaps.lifecyclePolicy && resolveQmdCapabilities(this.deps.config).qmdTierMigration) {
|
|
16949
17246
|
try {
|
|
16950
17247
|
const { runFirstStartMigration } = await import("./first-start-migration-ZWMV5CX4.js");
|
|
17248
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
16951
17249
|
const result = await runFirstStartMigration({
|
|
16952
17250
|
storage: this.deps.storage,
|
|
16953
17251
|
config: this.deps.config,
|
|
@@ -16967,11 +17265,11 @@ var OrchestratorInitCoordinator = class {
|
|
|
16967
17265
|
log.warn(`first-start lifecycle migration failed (non-fatal): ${err}`);
|
|
16968
17266
|
}
|
|
16969
17267
|
}
|
|
16970
|
-
if (signal.aborted) return;
|
|
17268
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
16971
17269
|
if (!this.deps.wearablesAutoSyncHandle && this.deps.config.wearables.enabled && this.deps.config.wearables.autoSyncEnabled && Object.values(this.deps.config.wearables.sources).some((source) => source.enabled)) {
|
|
16972
17270
|
try {
|
|
16973
|
-
const { startWearablesAutoSync } = await import("./auto-sync-
|
|
16974
|
-
if (signal.aborted) return;
|
|
17271
|
+
const { startWearablesAutoSync } = await import("./auto-sync-D6BAPIJV.js");
|
|
17272
|
+
if (signal.aborted || !this.isCurrentStartupEpoch(epoch)) return;
|
|
16975
17273
|
this.deps.wearablesAutoSyncHandle = startWearablesAutoSync(
|
|
16976
17274
|
{
|
|
16977
17275
|
intervalMinutes: this.deps.config.wearables.autoSyncIntervalMinutes,
|
|
@@ -17017,33 +17315,58 @@ var OrchestratorInitCoordinator = class {
|
|
|
17017
17315
|
*/
|
|
17018
17316
|
async startupSearchSync(signal) {
|
|
17019
17317
|
if (signal?.aborted) return false;
|
|
17020
|
-
const
|
|
17318
|
+
const epoch = this.currentOrNewStartupEpoch();
|
|
17319
|
+
if (epoch === null) return false;
|
|
17320
|
+
const available = await this.probeForStartupEpoch(epoch, signal);
|
|
17021
17321
|
if (!available) return false;
|
|
17022
|
-
if (signal?.aborted) {
|
|
17023
|
-
log.debug("startupSearchSync: aborted after probe");
|
|
17322
|
+
if (signal?.aborted || !this.isCurrentStartupEpoch(epoch)) {
|
|
17323
|
+
log.debug("startupSearchSync: aborted or retired after probe");
|
|
17024
17324
|
return false;
|
|
17025
17325
|
}
|
|
17026
17326
|
log.info(`startupSearchSync: backend now available ${this.deps.qmd.debugStatus()}`);
|
|
17027
17327
|
if (resolveNamespaceCapabilities(this.deps.config).namespaces) {
|
|
17028
17328
|
this.deps.namespaceSearchRouter.clearCache();
|
|
17029
17329
|
}
|
|
17030
|
-
const
|
|
17330
|
+
const discovery = await this.startupNamespaces(epoch);
|
|
17331
|
+
if (signal?.aborted || !this.isCurrentStartupEpoch(epoch)) {
|
|
17332
|
+
log.debug("startupSearchSync: aborted or retired after namespace discovery");
|
|
17333
|
+
return false;
|
|
17334
|
+
}
|
|
17335
|
+
const namespaces = discovery.namespaces;
|
|
17031
17336
|
const states = await Promise.all(
|
|
17032
|
-
namespaces.map(async (namespace) =>
|
|
17033
|
-
|
|
17034
|
-
|
|
17035
|
-
|
|
17337
|
+
namespaces.map(async (namespace) => {
|
|
17338
|
+
const epochAbort = this.linkedEpochAbortController(epoch, signal);
|
|
17339
|
+
try {
|
|
17340
|
+
return {
|
|
17341
|
+
namespace,
|
|
17342
|
+
state: resolveNamespaceCapabilities(this.deps.config).namespaces ? await this.deps.namespaceSearchRouter.ensureNamespaceCollection(
|
|
17343
|
+
namespace,
|
|
17344
|
+
{ signal: epochAbort.controller.signal }
|
|
17345
|
+
) : await this.deps.qmd.ensureCollection(
|
|
17346
|
+
this.deps.config.memoryDir,
|
|
17347
|
+
this.deps.config.qmdCollection,
|
|
17348
|
+
{ signal: epochAbort.controller.signal }
|
|
17349
|
+
)
|
|
17350
|
+
};
|
|
17351
|
+
} finally {
|
|
17352
|
+
epochAbort.dispose();
|
|
17353
|
+
}
|
|
17354
|
+
})
|
|
17036
17355
|
);
|
|
17037
|
-
if (signal?.aborted) {
|
|
17038
|
-
log.debug("startupSearchSync: aborted after ensureCollection");
|
|
17356
|
+
if (signal?.aborted || !this.isCurrentStartupEpoch(epoch)) {
|
|
17357
|
+
log.debug("startupSearchSync: aborted or retired after ensureCollection");
|
|
17039
17358
|
return false;
|
|
17040
17359
|
}
|
|
17041
17360
|
const defaultState = states.find((e) => e.namespace === this.deps.config.defaultNamespace)?.state ?? "unknown";
|
|
17042
17361
|
if (defaultState === "missing") {
|
|
17362
|
+
await this.deps.disposeSearchBackendIfNeeded();
|
|
17363
|
+
if (signal?.aborted || !this.isCurrentStartupEpoch(epoch)) {
|
|
17364
|
+
log.debug("startupSearchSync: aborted or retired while disposing a missing backend");
|
|
17365
|
+
return false;
|
|
17366
|
+
}
|
|
17043
17367
|
if ("available" in this.deps.qmd) {
|
|
17044
17368
|
this.deps.qmd.available = false;
|
|
17045
17369
|
}
|
|
17046
|
-
await this.deps.disposeSearchBackendIfNeeded();
|
|
17047
17370
|
this.deps.qmd = new NoopSearchBackend();
|
|
17048
17371
|
log.warn("startupSearchSync: search collection missing; disabling search (fallback retrieval remains enabled)");
|
|
17049
17372
|
return false;
|
|
@@ -17056,17 +17379,22 @@ var OrchestratorInitCoordinator = class {
|
|
|
17056
17379
|
this.deps.qmd.resetUpdateThrottles();
|
|
17057
17380
|
}
|
|
17058
17381
|
log.info("startupSearchSync: updating index to match current disk state");
|
|
17382
|
+
const updateAbort = this.linkedEpochAbortController(epoch, signal);
|
|
17059
17383
|
let namespacesUpdated = 0;
|
|
17060
|
-
|
|
17061
|
-
|
|
17062
|
-
|
|
17063
|
-
|
|
17064
|
-
|
|
17065
|
-
|
|
17066
|
-
|
|
17384
|
+
try {
|
|
17385
|
+
if (resolveNamespaceCapabilities(this.deps.config).namespaces) {
|
|
17386
|
+
namespacesUpdated = await this.deps.namespaceSearchRouter.updateNamespaces(
|
|
17387
|
+
namespaces,
|
|
17388
|
+
{ signal: updateAbort.controller.signal }
|
|
17389
|
+
);
|
|
17390
|
+
} else {
|
|
17391
|
+
await this.deps.qmd.update({ signal: updateAbort.controller.signal });
|
|
17392
|
+
}
|
|
17393
|
+
} finally {
|
|
17394
|
+
updateAbort.dispose();
|
|
17067
17395
|
}
|
|
17068
|
-
if (signal?.aborted) {
|
|
17069
|
-
log.debug("startupSearchSync: aborted after update");
|
|
17396
|
+
if (signal?.aborted || !this.isCurrentStartupEpoch(epoch)) {
|
|
17397
|
+
log.debug("startupSearchSync: aborted or retired after update");
|
|
17070
17398
|
return false;
|
|
17071
17399
|
}
|
|
17072
17400
|
const failTsAfter = "lastUpdateFailedAtMs" in this.deps.qmd ? this.deps.qmd.lastUpdateFailedAtMs : null;
|
|
@@ -17091,15 +17419,24 @@ var OrchestratorInitCoordinator = class {
|
|
|
17091
17419
|
return false;
|
|
17092
17420
|
}
|
|
17093
17421
|
}
|
|
17094
|
-
if (!signal?.aborted) {
|
|
17422
|
+
if (!signal?.aborted && this.isCurrentStartupEpoch(epoch)) {
|
|
17423
|
+
const warmupAbort = this.linkedEpochAbortController(epoch, signal);
|
|
17095
17424
|
try {
|
|
17096
|
-
await this.deps.qmd.search(
|
|
17425
|
+
await this.deps.qmd.search(
|
|
17426
|
+
"warmup",
|
|
17427
|
+
this.deps.config.defaultNamespace,
|
|
17428
|
+
1,
|
|
17429
|
+
void 0,
|
|
17430
|
+
{ signal: warmupAbort.controller.signal }
|
|
17431
|
+
);
|
|
17097
17432
|
log.info("startupSearchSync: warmup complete");
|
|
17098
17433
|
} catch (err) {
|
|
17099
17434
|
log.debug(`startupSearchSync: warmup search failed (non-fatal): ${err}`);
|
|
17435
|
+
} finally {
|
|
17436
|
+
warmupAbort.dispose();
|
|
17100
17437
|
}
|
|
17101
17438
|
}
|
|
17102
|
-
return
|
|
17439
|
+
return discovery.complete;
|
|
17103
17440
|
}
|
|
17104
17441
|
};
|
|
17105
17442
|
|
|
@@ -17450,7 +17787,7 @@ var PersistenceIndexCoordinator = class {
|
|
|
17450
17787
|
};
|
|
17451
17788
|
|
|
17452
17789
|
// src/orchestration/workspace-ops.ts
|
|
17453
|
-
import { lstat as lstat2, mkdir as mkdir6, readFile as
|
|
17790
|
+
import { lstat as lstat2, mkdir as mkdir6, readFile as readFile8, readdir as readdir3, realpath as realpath2, writeFile as writeFile6 } from "fs/promises";
|
|
17454
17791
|
import path18 from "path";
|
|
17455
17792
|
|
|
17456
17793
|
// src/maintenance/pattern-reinforcement.ts
|
|
@@ -19452,7 +19789,7 @@ var WorkspaceOpsCoordinator = class {
|
|
|
19452
19789
|
for (const rel of hygiene.rotatePaths) {
|
|
19453
19790
|
const abs = path18.isAbsolute(rel) ? rel : path18.join(this.deps.config.workspaceDir, rel);
|
|
19454
19791
|
try {
|
|
19455
|
-
const raw = await
|
|
19792
|
+
const raw = await readFile8(abs, "utf-8");
|
|
19456
19793
|
if (raw.length > hygiene.rotateMaxBytes) {
|
|
19457
19794
|
const archiveDir = path18.join(
|
|
19458
19795
|
this.deps.config.workspaceDir,
|
|
@@ -19493,7 +19830,7 @@ var WorkspaceOpsCoordinator = class {
|
|
|
19493
19830
|
` + warnings.map((w) => `- ${w.message}`).join("\n") + "\n";
|
|
19494
19831
|
let existing = "";
|
|
19495
19832
|
try {
|
|
19496
|
-
existing = await
|
|
19833
|
+
existing = await readFile8(fp, "utf-8");
|
|
19497
19834
|
} catch {
|
|
19498
19835
|
existing = "# Engram File Hygiene Warnings\n";
|
|
19499
19836
|
}
|
|
@@ -19563,7 +19900,7 @@ var WorkspaceOpsCoordinator = class {
|
|
|
19563
19900
|
for (const date of datesToScan) {
|
|
19564
19901
|
const summaryFile = path18.join(hourlyBaseDir, sk.name, `${date}.md`);
|
|
19565
19902
|
try {
|
|
19566
|
-
const raw = await
|
|
19903
|
+
const raw = await readFile8(summaryFile, "utf-8");
|
|
19567
19904
|
const filtered = filterHourlySummaryMarkdownForLocalDay(
|
|
19568
19905
|
raw,
|
|
19569
19906
|
date,
|
|
@@ -20961,6 +21298,10 @@ var Orchestrator = class {
|
|
|
20961
21298
|
this.deferredInitAbort = null;
|
|
20962
21299
|
}
|
|
20963
21300
|
}
|
|
21301
|
+
async disposeSearchBackendIfNeeded() {
|
|
21302
|
+
await this.namespaceSearchRouter.disableSearchBackends();
|
|
21303
|
+
await this.qmd.dispose?.();
|
|
21304
|
+
}
|
|
20964
21305
|
/** Track a recall-side write so destroy() can wait for it before teardown. @internal */
|
|
20965
21306
|
trackRecallBackgroundWrite(promise, label) {
|
|
20966
21307
|
trackRecallWrite(this, promise, label);
|
|
@@ -20971,6 +21312,7 @@ var Orchestrator = class {
|
|
|
20971
21312
|
* commands should call it before returning to let Node exit naturally.
|
|
20972
21313
|
*/
|
|
20973
21314
|
async destroy() {
|
|
21315
|
+
this._orchestratorInitCoordinator?.retireStartupEpoch();
|
|
20974
21316
|
this.abortDeferredInit();
|
|
20975
21317
|
this.extractionQueueCoordinator.stopAccepting();
|
|
20976
21318
|
if (this.wearablesAutoSyncHandle) {
|
|
@@ -21609,7 +21951,7 @@ var Orchestrator = class {
|
|
|
21609
21951
|
utilityPromoteThresholdDelta: this.utilityRuntimeValues?.promoteThresholdDelta ?? 0,
|
|
21610
21952
|
utilityDemoteThresholdDelta: this.utilityRuntimeValues?.demoteThresholdDelta ?? 0
|
|
21611
21953
|
};
|
|
21612
|
-
return
|
|
21954
|
+
return createHash9("sha256").update(JSON.stringify(payload)).digest("hex").slice(0, 12);
|
|
21613
21955
|
}
|
|
21614
21956
|
effectiveLifecycleThresholds() {
|
|
21615
21957
|
const archiveDecayThreshold = this.config.lifecycleArchiveDecayThreshold;
|
|
@@ -27363,7 +27705,12 @@ async function runTimelineCliCommand(deps, args, io) {
|
|
|
27363
27705
|
io.stderr.write("timeline publish requires the Remnic config \u2014 run `remnic doctor`\n");
|
|
27364
27706
|
return 1;
|
|
27365
27707
|
}
|
|
27366
|
-
const publishFlags = parseFlags(rest, PUBLISH_FLAGS)
|
|
27708
|
+
const { flags: publishFlags, positional } = parseFlags(rest, PUBLISH_FLAGS);
|
|
27709
|
+
if (positional.length > 0) {
|
|
27710
|
+
throw new TypeError(
|
|
27711
|
+
`timeline publish takes no positional arguments (got ${JSON.stringify(positional.join(" "))})`
|
|
27712
|
+
);
|
|
27713
|
+
}
|
|
27367
27714
|
return runTimelinePublishCli(
|
|
27368
27715
|
deps.config,
|
|
27369
27716
|
{
|
|
@@ -28441,7 +28788,7 @@ function readVerifiedDailyNote(root, filePath) {
|
|
|
28441
28788
|
}
|
|
28442
28789
|
|
|
28443
28790
|
// src/activity/journal-state.ts
|
|
28444
|
-
import { createHash as
|
|
28791
|
+
import { createHash as createHash10, randomBytes as randomBytes4 } from "crypto";
|
|
28445
28792
|
import { mkdirSync as mkdirSync2, readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
28446
28793
|
import path35 from "path";
|
|
28447
28794
|
var STATE_DIR_NAME = "state";
|
|
@@ -28450,7 +28797,7 @@ function timelineStatePath(memoryDir) {
|
|
|
28450
28797
|
return path35.join(memoryDir, STATE_DIR_NAME, STATE_FILE_NAME);
|
|
28451
28798
|
}
|
|
28452
28799
|
function hashJournalText(text) {
|
|
28453
|
-
return
|
|
28800
|
+
return createHash10("sha256").update(text, "utf8").digest("hex");
|
|
28454
28801
|
}
|
|
28455
28802
|
function readTimelineState(memoryDir) {
|
|
28456
28803
|
const filePath = timelineStatePath(memoryDir);
|
|
@@ -29171,31 +29518,6 @@ function filterPrivacyWindow(items, options) {
|
|
|
29171
29518
|
});
|
|
29172
29519
|
}
|
|
29173
29520
|
|
|
29174
|
-
// src/activity/vault-frontmatter.ts
|
|
29175
|
-
function assertNoNewlineKey(key) {
|
|
29176
|
-
if (key.includes("\n") || key.includes("\r")) {
|
|
29177
|
-
throw new RangeError("Vault frontmatter keys must not contain newlines.");
|
|
29178
|
-
}
|
|
29179
|
-
}
|
|
29180
|
-
function applyVaultFrontmatter(existingYaml, updates) {
|
|
29181
|
-
const entries = Object.entries(updates);
|
|
29182
|
-
if (entries.length === 0) return existingYaml;
|
|
29183
|
-
const merged = /* @__PURE__ */ new Map();
|
|
29184
|
-
for (const line of existingYaml.split("\n")) {
|
|
29185
|
-
const idx = line.indexOf(":");
|
|
29186
|
-
if (idx === -1) continue;
|
|
29187
|
-
const key = line.slice(0, idx).trim();
|
|
29188
|
-
if (key.length === 0) continue;
|
|
29189
|
-
assertNoNewlineKey(key);
|
|
29190
|
-
merged.set(key, line.slice(idx + 1).trim());
|
|
29191
|
-
}
|
|
29192
|
-
for (const [key, value] of entries) {
|
|
29193
|
-
assertNoNewlineKey(key);
|
|
29194
|
-
merged.set(key, value);
|
|
29195
|
-
}
|
|
29196
|
-
return [...merged.keys()].sort((a, b) => a < b ? -1 : a > b ? 1 : 0).map((key) => `${key}: ${merged.get(key)}`).join("\n");
|
|
29197
|
-
}
|
|
29198
|
-
|
|
29199
29521
|
// src/activity/vault-wikilink.ts
|
|
29200
29522
|
import path36 from "path";
|
|
29201
29523
|
function formatVaultWikilink(notePath) {
|
|
@@ -29295,8 +29617,8 @@ function planVaultDryRun(inputs) {
|
|
|
29295
29617
|
}
|
|
29296
29618
|
|
|
29297
29619
|
// src/session-summaries/index.ts
|
|
29298
|
-
import { createHash as
|
|
29299
|
-
import { lstat as lstat3, mkdir as mkdir7, readFile as
|
|
29620
|
+
import { createHash as createHash11 } from "crypto";
|
|
29621
|
+
import { lstat as lstat3, mkdir as mkdir7, readFile as readFile9, readdir as readdir4, rename, rm, stat as stat4, writeFile as writeFile7 } from "fs/promises";
|
|
29300
29622
|
import path38 from "path";
|
|
29301
29623
|
|
|
29302
29624
|
// src/session-summaries/adapters.ts
|
|
@@ -29797,7 +30119,7 @@ var DEFAULT_MAX_FILES = 5e3;
|
|
|
29797
30119
|
var DEFAULT_MAX_SESSIONS = 500;
|
|
29798
30120
|
var SUPPORTED_EXTENSIONS = /* @__PURE__ */ new Set([".json", ".jsonl"]);
|
|
29799
30121
|
function shortHash(value, length = 16) {
|
|
29800
|
-
return
|
|
30122
|
+
return createHash11("sha256").update(value).digest("hex").slice(0, length);
|
|
29801
30123
|
}
|
|
29802
30124
|
async function listTranscriptFiles(root, maxFiles) {
|
|
29803
30125
|
const out = [];
|
|
@@ -29991,7 +30313,7 @@ async function collectLocalSessionSummaries(options) {
|
|
|
29991
30313
|
});
|
|
29992
30314
|
}
|
|
29993
30315
|
for (const filePath of files) {
|
|
29994
|
-
const content = await
|
|
30316
|
+
const content = await readFile9(filePath, "utf-8");
|
|
29995
30317
|
const fileHash = shortHash(content, 24);
|
|
29996
30318
|
if (seenFileHashes.has(fileHash)) {
|
|
29997
30319
|
warnings.push({
|
|
@@ -30062,7 +30384,7 @@ async function collectLocalSessionSummaries(options) {
|
|
|
30062
30384
|
}
|
|
30063
30385
|
async function readRedactionConfig(pathLike) {
|
|
30064
30386
|
if (!pathLike) return void 0;
|
|
30065
|
-
const raw = await
|
|
30387
|
+
const raw = await readFile9(path38.resolve(expandTildePath(pathLike)), "utf-8");
|
|
30066
30388
|
const parsed = JSON.parse(raw);
|
|
30067
30389
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
30068
30390
|
throw new Error("redaction config must be a JSON object");
|
|
@@ -30135,7 +30457,7 @@ async function runLocalSessionSummaryCliCommand(options) {
|
|
|
30135
30457
|
}
|
|
30136
30458
|
|
|
30137
30459
|
// src/transfer/capsule-fork.ts
|
|
30138
|
-
import { lstat as lstat4, mkdir as mkdir8, readFile as
|
|
30460
|
+
import { lstat as lstat4, mkdir as mkdir8, readFile as readFile10, realpath as realpath3, writeFile as writeFile8 } from "fs/promises";
|
|
30139
30461
|
import path39 from "path";
|
|
30140
30462
|
async function forkCapsule(opts) {
|
|
30141
30463
|
validateForkId(opts.forkId);
|
|
@@ -30197,7 +30519,7 @@ async function readForkLineage(targetRoot, forkId) {
|
|
|
30197
30519
|
if (!await isLineagePathContained(rootReal, lineagePath)) {
|
|
30198
30520
|
return null;
|
|
30199
30521
|
}
|
|
30200
|
-
const raw = await
|
|
30522
|
+
const raw = await readFile10(lineagePath, "utf-8").catch(() => null);
|
|
30201
30523
|
if (raw === null) return null;
|
|
30202
30524
|
try {
|
|
30203
30525
|
const parsed = JSON.parse(raw);
|
|
@@ -30391,7 +30713,6 @@ export {
|
|
|
30391
30713
|
ACTIVITY_FEATURE_GATES,
|
|
30392
30714
|
resolveActivityGates,
|
|
30393
30715
|
filterPrivacyWindow,
|
|
30394
|
-
applyVaultFrontmatter,
|
|
30395
30716
|
formatVaultWikilink,
|
|
30396
30717
|
stripVaultMdSuffix,
|
|
30397
30718
|
joinVaultSegments,
|
|
@@ -30427,6 +30748,7 @@ export {
|
|
|
30427
30748
|
mergeGraphExpandedResults,
|
|
30428
30749
|
graphPathRelativeToStorage,
|
|
30429
30750
|
blendGraphExpandedRecallScore,
|
|
30751
|
+
qmdStartupCollectionChecksWithTimeout,
|
|
30430
30752
|
Orchestrator
|
|
30431
30753
|
};
|
|
30432
|
-
//# sourceMappingURL=chunk-
|
|
30754
|
+
//# sourceMappingURL=chunk-UZ6JYPJ6.js.map
|