@remnic/core 9.69.50 → 9.69.52
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 +14 -14
- package/dist/access-admin-ops-surface.js +60 -60
- package/dist/access-audit.d.ts +1 -0
- package/dist/access-audit.js +2 -2
- package/dist/access-authorization-probe.d.ts +14 -14
- package/dist/access-authorization-probe.js +61 -61
- package/dist/access-boundary.d.ts +14 -14
- package/dist/access-boundary.js +60 -60
- package/dist/access-cli.js +121 -120
- 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 +14 -14
- package/dist/access-extraction-force-flush.js +60 -60
- package/dist/access-health-types.d.ts +1 -1
- package/dist/access-http-briefing.d.ts +14 -14
- package/dist/access-http-briefing.js +61 -61
- package/dist/access-http-lcm-compaction.d.ts +14 -14
- package/dist/access-http-lifecycle-flush.d.ts +14 -14
- package/dist/access-http-offline-stream.d.ts +14 -14
- package/dist/access-http-query.d.ts +2 -2
- package/dist/access-http-query.js +62 -62
- package/dist/access-http.d.ts +15 -15
- package/dist/access-http.js +80 -80
- package/dist/access-identity-continuity-surface.d.ts +11 -11
- package/dist/access-identity-continuity-surface.js +60 -60
- package/dist/access-lcm-surface.d.ts +14 -14
- package/dist/access-lcm-surface.js +60 -60
- package/dist/access-mcp-output-schemas.js +1 -1
- package/dist/access-mcp-shared-context-tools.d.ts +14 -14
- package/dist/access-mcp.d.ts +14 -14
- package/dist/access-mcp.js +71 -71
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-C1q3XuAc.d.ts → access-namespace-preflight-U9RAdxqZ.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +60 -60
- package/dist/access-observe-transcript.d.ts +11 -11
- package/dist/access-observe-write-category.d.ts +3 -3
- package/dist/access-observe-write-category.js +7 -7
- package/dist/access-observe-write-surface.d.ts +14 -14
- package/dist/access-observe-write-surface.js +60 -60
- package/dist/access-offline-manifest.d.ts +11 -11
- package/dist/access-offline-manifest.js +5 -5
- package/dist/access-operations-batch.js +62 -62
- package/dist/access-operations.d.ts +14 -14
- package/dist/access-operations.js +69 -69
- package/dist/access-recall-concurrency.d.ts +14 -14
- package/dist/access-recall-concurrency.js +60 -60
- package/dist/access-recall-response.d.ts +14 -14
- package/dist/access-recall-response.js +60 -60
- package/dist/access-recall-surface.d.ts +15 -15
- package/dist/access-recall-surface.js +60 -60
- package/dist/access-schema.d.ts +1 -1
- package/dist/access-schema.js +4 -4
- package/dist/{access-service-BZaC-RZw.d.ts → access-service-CUNM5RfA.d.ts} +9 -9
- package/dist/access-service-helpers.d.ts +14 -14
- package/dist/access-service.d.ts +14 -14
- package/dist/access-service.js +60 -60
- package/dist/access-surface-catalog.d.ts +14 -14
- package/dist/access-surface-catalog.js +62 -62
- package/dist/access-wearables-meetings-surface.d.ts +4 -4
- 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 +73 -2
- package/dist/active-recall.js.map +1 -1
- package/dist/activity/digest.d.ts +1 -1
- package/dist/ambient-provenance.d.ts +1 -1
- package/dist/artifact-search.d.ts +1 -1
- package/dist/{auto-sync-DG5KEOF5.js → auto-sync-CWSZDLLW.js} +6 -6
- 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 +11 -11
- package/dist/briefing-window.d.ts +2 -2
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +12 -12
- 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 +4 -4
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{capsule-crypto-7FJQINUR.js → capsule-crypto-YO5QJ6L3.js} +2 -2
- package/dist/{catalog-DK2eHhax.d.ts → catalog-BuMyYPUn.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 +19 -19
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-3SI3FFTW.js → chunk-2INZSV27.js} +2 -2
- package/dist/{chunk-PMLFPVYJ.js → chunk-2QZJ4P27.js} +2 -2
- package/dist/{chunk-3RZB7TYL.js → chunk-2UDAABV6.js} +2 -2
- package/dist/{chunk-4PXFLDMJ.js → chunk-35EH6KW4.js} +2 -2
- package/dist/{chunk-KOEDSRF5.js → chunk-43IQRLEF.js} +2 -2
- package/dist/{chunk-LBLXEFWK.js → chunk-4MN27537.js} +1 -1
- package/dist/chunk-4MN27537.js.map +1 -0
- package/dist/{chunk-PQWICTRO.js → chunk-4UVJ6EIT.js} +1 -1
- package/dist/chunk-4UVJ6EIT.js.map +1 -0
- package/dist/{chunk-56C7OO3N.js → chunk-6KCQNFDQ.js} +18 -18
- package/dist/chunk-6VITOSPL.js +69 -0
- package/dist/chunk-6VITOSPL.js.map +1 -0
- package/dist/{chunk-UD6W67JM.js → chunk-72AV2H3R.js} +76 -25
- package/dist/chunk-72AV2H3R.js.map +1 -0
- package/dist/{chunk-VBRS7Z3O.js → chunk-72N2P44O.js} +5 -5
- package/dist/{chunk-ZUNYFDI4.js → chunk-7QVYVSEH.js} +2 -2
- package/dist/{chunk-SRMBMMTK.js → chunk-7RKAE6Y4.js} +3 -3
- package/dist/{chunk-42BV46XS.js → chunk-AH44WTLJ.js} +2 -2
- package/dist/{chunk-TZ44E732.js → chunk-AIVRD66I.js} +2 -2
- package/dist/{chunk-AYGWJ2UK.js → chunk-AQWGCHIV.js} +6 -6
- package/dist/{chunk-EZV43XBD.js → chunk-AYHNTYVG.js} +2 -2
- package/dist/{chunk-2NLLXCJG.js → chunk-BXLOS5AJ.js} +2 -2
- package/dist/{chunk-JHUODJRW.js → chunk-D2N3PMAE.js} +2 -2
- package/dist/{chunk-7SJCSDQ3.js → chunk-D7VT2LED.js} +2 -2
- package/dist/{chunk-TVVEYCNW.js → chunk-DAOMWGO2.js} +2 -2
- package/dist/{chunk-OQZYHCWM.js → chunk-DCRK7I5E.js} +72 -71
- package/dist/{chunk-OQZYHCWM.js.map → chunk-DCRK7I5E.js.map} +1 -1
- package/dist/{chunk-MVMNEU65.js → chunk-DI52XAKG.js} +2 -2
- package/dist/{chunk-X7Y7WX73.js → chunk-DQEMWVMT.js} +1 -1
- package/dist/{chunk-EUP4AXIW.js → chunk-DZP2XMZC.js} +2 -2
- package/dist/{chunk-PA5EOTRR.js → chunk-EVQ33D3N.js} +4 -4
- package/dist/{chunk-E64HBW7M.js → chunk-EW3Y73MN.js} +5 -5
- package/dist/{chunk-VSN2DMQK.js → chunk-G2DF5MI7.js} +4 -4
- package/dist/{chunk-JIWZVOQM.js → chunk-G7S37WD4.js} +2 -2
- package/dist/{chunk-AL7OLBL7.js → chunk-GRX6YH4E.js} +2 -2
- package/dist/{chunk-XTMABIFW.js → chunk-HG42J2EX.js} +2 -2
- package/dist/{chunk-MQMZO23A.js → chunk-HWT6KRGS.js} +2 -2
- package/dist/{chunk-LR7KUQ2W.js → chunk-IEOBAOA6.js} +6 -6
- package/dist/{chunk-UDAUULK2.js → chunk-IGEZE6QB.js} +5 -5
- package/dist/{chunk-SGHGCFVV.js → chunk-JE334SIA.js} +10 -10
- package/dist/{chunk-IC3PM3YO.js → chunk-JE4H2QBO.js} +2 -2
- package/dist/{chunk-E73SVGJA.js → chunk-JMZQS6OS.js} +2 -2
- package/dist/{chunk-3RABJOGD.js → chunk-KH2D26LQ.js} +5 -5
- package/dist/{chunk-3MIZ2EKQ.js → chunk-KQQEZTH6.js} +2 -2
- package/dist/{chunk-F5V7KRQS.js → chunk-LIAKZGOY.js} +2 -2
- package/dist/{chunk-A7GQBJP5.js → chunk-LVFI5LG7.js} +7 -7
- package/dist/{chunk-IST6MBYC.js → chunk-MSTKJI5T.js} +529 -376
- package/dist/chunk-MSTKJI5T.js.map +1 -0
- package/dist/{chunk-DH536WT2.js → chunk-MWVYHNSU.js} +12 -2
- package/dist/chunk-MWVYHNSU.js.map +1 -0
- package/dist/{chunk-D7QX26FF.js → chunk-O7OVWKT4.js} +2 -2
- package/dist/{chunk-JOP7W24J.js → chunk-PLJ2MQFT.js} +4 -4
- package/dist/{chunk-D2XUSZ24.js → chunk-QWQB7TOB.js} +20 -20
- package/dist/{chunk-HRCWDO6S.js → chunk-RSMNPYBM.js} +2 -2
- package/dist/{chunk-BOTSR5S3.js → chunk-RUUJXAGT.js} +2 -2
- package/dist/{chunk-FO6IK4IF.js → chunk-SEQ6DWXD.js} +11 -11
- package/dist/{chunk-ZBAQMSEY.js → chunk-SLGD36MM.js} +3 -3
- package/dist/{chunk-IYHHCSF6.js → chunk-SOFATSHJ.js} +61 -61
- package/dist/{chunk-JG4AP36X.js → chunk-SPFNGHHP.js} +2 -2
- package/dist/{chunk-DNO6QWCB.js → chunk-SPWNCGSM.js} +2 -2
- package/dist/{chunk-QSP4Y73Q.js → chunk-SVUUOLKM.js} +2 -2
- package/dist/{chunk-D6WX5FEF.js → chunk-SZ7IVZGD.js} +2 -2
- package/dist/{chunk-2IVHOQRY.js → chunk-TEQQQTQS.js} +5 -5
- package/dist/{chunk-UI6R2YUB.js → chunk-TQT4AOPO.js} +4 -4
- package/dist/{chunk-3UQIS2GC.js → chunk-TTFJQ5B5.js} +2 -2
- package/dist/{chunk-JTPAXDSX.js → chunk-U2SK45U3.js} +2 -2
- package/dist/{chunk-4FWNMN5R.js → chunk-U6CMLAP4.js} +5 -5
- package/dist/{chunk-6525YIYL.js → chunk-UCH2RWFX.js} +3 -3
- package/dist/{chunk-QZDUNK6V.js → chunk-UCY4EHAG.js} +6 -6
- package/dist/{chunk-OP5IBPHP.js → chunk-UDJMJNBK.js} +2 -2
- package/dist/{chunk-BHI5ILU5.js → chunk-ULQVG6G3.js} +2 -2
- package/dist/{chunk-X6B2QWXW.js → chunk-UQTXER7M.js} +2 -2
- package/dist/{chunk-OLJYDGGP.js → chunk-UVZBDIJX.js} +214 -4
- package/dist/chunk-UVZBDIJX.js.map +1 -0
- package/dist/{chunk-QXQCPNKA.js → chunk-V5BU5PVE.js} +7 -7
- package/dist/{chunk-IPLYGWQF.js → chunk-VDX2J7OX.js} +6 -6
- package/dist/{chunk-XUKUMBP3.js → chunk-VGO57TU7.js} +5 -5
- package/dist/{chunk-W6V7JN2E.js → chunk-VUV472VH.js} +12 -12
- package/dist/{chunk-ZHXSOMYH.js → chunk-VVX5PZFS.js} +2 -2
- package/dist/{chunk-ML5FW2RO.js → chunk-WBW34YCJ.js} +2 -2
- package/dist/{chunk-ECLY4NZA.js → chunk-WH7RINGG.js} +10 -4
- package/dist/chunk-WH7RINGG.js.map +1 -0
- package/dist/{chunk-FDDCZDBI.js → chunk-WN4HFL4K.js} +4 -4
- package/dist/{chunk-MECKA6G2.js → chunk-WUJD4CHZ.js} +4 -4
- package/dist/{chunk-HS75MCQF.js → chunk-WUUGE7QC.js} +4 -4
- package/dist/{chunk-UVEBBXB5.js → chunk-X7WAM3IY.js} +2 -2
- package/dist/{chunk-4SDO74N2.js → chunk-XPFJSUOR.js} +5 -5
- package/dist/{chunk-PPNFKQ6D.js → chunk-Y4G6LHJW.js} +2 -2
- package/dist/{chunk-C3PKRFZ4.js → chunk-Y7LZ5V7N.js} +2 -2
- package/dist/{chunk-WVI43D54.js → chunk-YEIKOBOW.js} +15 -2
- package/dist/chunk-YEIKOBOW.js.map +1 -0
- package/dist/{chunk-AYP2FZFA.js → chunk-YIIW2OH2.js} +2 -2
- package/dist/{chunk-YSBYNCCN.js → chunk-YLPCEUXP.js} +3 -3
- package/dist/{chunk-RFIJH2OE.js → chunk-YUHGJBQK.js} +2 -2
- package/dist/{cli-BHDMJqJS.d.ts → cli-CCc34xV7.d.ts} +5 -5
- package/dist/cli.d.ts +16 -16
- package/dist/cli.js +98 -98
- package/dist/coding/export-okf-codegraph.d.ts +1 -1
- package/dist/coding/export-okf-codegraph.js +12 -12
- package/dist/coding/pre-action-gate.d.ts +1 -1
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +11 -11
- 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 +73 -2
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +15 -15
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +19 -19
- package/dist/consolidation-provenance-check.d.ts +2 -2
- package/dist/consolidation-undo.d.ts +2 -2
- package/dist/contradiction/index.d.ts +4 -4
- package/dist/converge-config.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +2 -2
- package/dist/convergence-refresh.js +13 -13
- 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 +13 -13
- 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 +14 -14
- package/dist/deep-recall-http-glue.js +5 -5
- package/dist/deep-recall-mcp-tools.d.ts +14 -14
- package/dist/deep-recall-policy-llm.d.ts +2 -2
- package/dist/deep-recall-seeds.d.ts +1 -1
- package/dist/deep-recall.js +2 -2
- package/dist/delinearize.d.ts +1 -1
- package/dist/dependency-propagation-config.d.ts +1 -1
- package/dist/{dependency-propagation-delivery-BMkR4gmY.d.ts → dependency-propagation-delivery-BrhPjAHQ.d.ts} +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/directory-sidecars.d.ts +28 -2
- package/dist/directory-sidecars.js +9 -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 +11 -11
- 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 +11 -11
- package/dist/external-wiki-access.d.ts +14 -14
- package/dist/external-wiki-access.js +61 -61
- 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 +14 -14
- package/dist/extraction-error-classification.d.ts +1 -1
- package/dist/extraction-evidence-class.d.ts +1 -1
- package/dist/extraction-faithfulness.d.ts +2 -2
- package/dist/extraction-judge-telemetry.d.ts +2 -2
- package/dist/extraction-judge-training.d.ts +2 -2
- package/dist/extraction-judge.d.ts +2 -2
- package/dist/extraction-judge.js +2 -2
- 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-span-wire.d.ts +1 -1
- package/dist/extraction.d.ts +2 -2
- package/dist/extraction.js +21 -21
- package/dist/fallback-llm-codex-subscription.d.ts +1 -1
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/{generic-recall-paths-BCRtXU32.d.ts → generic-recall-paths-C0J1Oxb7.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 +2 -2
- 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-DMNTW4W6.d.ts → index-B735x-tK.d.ts} +3 -3
- package/dist/index.d.ts +28 -26
- package/dist/index.js +208 -198
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/engine.js +3 -3
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +8 -8
- 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-BXYC-mbU.d.ts → local-llm-BkkEK9rn.d.ts} +1 -1
- package/dist/local-llm-helpers.d.ts +2 -2
- package/dist/local-llm.d.ts +2 -2
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/location/index.d.ts +5 -5
- package/dist/location/index.js +15 -15
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +11 -11
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +11 -11
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +12 -12
- package/dist/{maintenance-zJiLsKBY.d.ts → maintenance-CLBIvVxg.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +14 -14
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-browse-http-glue.d.ts +14 -14
- package/dist/memory-browse-mcp-tools.d.ts +14 -14
- package/dist/memory-browse-operations.js +61 -61
- package/dist/memory-browse.d.ts +1 -1
- package/dist/memory-browse.js +5 -5
- 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 +14 -14
- package/dist/memory-subject.d.ts +14 -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 +12 -12
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +3 -3
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +11 -11
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/offline-sync-impression-drain.d.ts +1 -1
- package/dist/offline-sync-impression-drain.js +3 -3
- package/dist/operator-doctor-corpus.d.ts +1 -1
- package/dist/operator-doctor-corpus.js +16 -16
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +40 -40
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +22 -22
- package/dist/{orchestrator-BTqT3F6X.d.ts → orchestrator-iexgVLow.d.ts} +13 -11
- package/dist/orchestrator.d.ts +11 -11
- package/dist/orchestrator.js +121 -120
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-CgO2Sd4O.d.ts → pipeline-DvtDtyo9.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-Dk1EA9ix.d.ts → public-http-UWVcqMcb.d.ts} +1 -1
- package/dist/{qmd-CwxtVz64.d.ts → qmd-CBYBJ6HW.d.ts} +1 -1
- 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/recall-audit-anomaly.d.ts +1 -0
- package/dist/recall-audit.d.ts +4 -0
- package/dist/recall-audit.js +1 -1
- package/dist/recall-composition-decision.d.ts +41 -0
- package/dist/recall-composition-decision.js +17 -0
- package/dist/recall-composition-decision.js.map +1 -0
- 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 +2 -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 +2 -2
- package/dist/recall-navigate.d.ts +1 -1
- package/dist/recall-navigate.js +2 -2
- package/dist/recall-navigation-http-glue.d.ts +14 -14
- package/dist/recall-navigation-mcp-tools.d.ts +14 -14
- package/dist/recall-navigation-operations.js +61 -61
- package/dist/recall-navigation-renderer.d.ts +2 -1
- package/dist/recall-navigation.d.ts +2 -1
- package/dist/recall-navigation.js +60 -60
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-state-view-admission.d.ts +2 -2
- package/dist/recall-state-view-admission.js +5 -5
- package/dist/recall-state-view-anchors.d.ts +1 -1
- package/dist/recall-state-view-anchors.js +2 -2
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.d.ts +2 -1
- package/dist/recall-timings.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +2 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +2 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +10 -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/manifest.js +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 +73 -3
- 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-Bg1rB-Dp.d.ts → scope-profiles-BN1Dgfha.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 +2 -2
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +4 -4
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-DEzRyeyn.d.ts → semantic-consolidation-D--qe0eE.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +16 -16
- package/dist/semantic-rule-promotion.js +11 -11
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +11 -11
- package/dist/{service-DGEIDOeD.d.ts → service-VealHeqO.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 +20 -20
- package/dist/standup/build.js +12 -12
- package/dist/{storage-DNQWtOSM.d.ts → storage-CMm-3aD3.d.ts} +1 -1
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +10 -10
- package/dist/subject-config.d.ts +1 -1
- package/dist/summarizer.d.ts +1 -1
- package/dist/summarizer.js +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/support-passport/index.d.ts +17 -17
- package/dist/support-passport/index.js +63 -63
- package/dist/{tagging-CPVwgadt.d.ts → tagging-BjsNFKWz.d.ts} +2 -2
- 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/autodetect.js +1 -1
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-export.js +3 -3
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/export-okf.d.ts +1 -1
- package/dist/transfer/export-okf.js +11 -11
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-DCB90q3g.d.ts → types-Du6VdoAg.d.ts} +22 -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 +11 -11
- package/dist/who-knows-cli.d.ts +14 -14
- package/dist/who-knows-cli.js +12 -12
- package/dist/who-knows.d.ts +14 -14
- package/dist/who-knows.js +11 -11
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -2
- package/src/access-mcp-output-schemas.ts +14 -1
- package/src/access-recall-response.ts +3 -0
- package/src/config.ts +3 -4
- package/src/directory-sidecars.test.ts +119 -0
- package/src/directory-sidecars.ts +110 -25
- package/src/experience/session-experience-recall.test.ts +228 -0
- package/src/experience/session-experience-recall.ts +60 -0
- package/src/index.ts +1 -0
- package/src/lifecycle/seed-graduation-config-types.ts +22 -0
- package/src/lifecycle/seed-graduation.test.ts +160 -1
- package/src/lifecycle/seed-graduation.ts +7 -9
- package/src/orchestration/lifecycle-policy-coordinator.ts +12 -0
- package/src/orchestration/recall-entry.ts +16 -2
- package/src/orchestration/recall-internal.ts +21 -18
- package/src/orchestration/recall-recognition-search.test.ts +290 -0
- package/src/orchestration/recall-recognition-search.ts +160 -0
- package/src/orchestrator.ts +1 -0
- package/src/procedural/procedure-recall.ts +14 -3
- package/src/recall-audit.test.ts +34 -0
- package/src/recall-audit.ts +4 -0
- package/src/recall-composition-decision.test.ts +134 -0
- package/src/recall-composition-decision.ts +113 -0
- package/src/recall-xray-renderer.test.ts +17 -0
- package/src/recall-xray-renderer.ts +10 -0
- package/src/recall-xray.test.ts +28 -0
- package/src/recall-xray.ts +15 -0
- package/src/testing/subjects/recall-recognition-tier.test.ts +106 -0
- package/src/types.ts +4 -6
- package/dist/chunk-DH536WT2.js.map +0 -1
- package/dist/chunk-ECLY4NZA.js.map +0 -1
- package/dist/chunk-IST6MBYC.js.map +0 -1
- package/dist/chunk-LBLXEFWK.js.map +0 -1
- package/dist/chunk-OLJYDGGP.js.map +0 -1
- package/dist/chunk-PQWICTRO.js.map +0 -1
- package/dist/chunk-UD6W67JM.js.map +0 -1
- package/dist/chunk-WVI43D54.js.map +0 -1
- /package/dist/{auto-sync-DG5KEOF5.js.map → auto-sync-CWSZDLLW.js.map} +0 -0
- /package/dist/{capsule-crypto-7FJQINUR.js.map → capsule-crypto-YO5QJ6L3.js.map} +0 -0
- /package/dist/{chunk-3SI3FFTW.js.map → chunk-2INZSV27.js.map} +0 -0
- /package/dist/{chunk-PMLFPVYJ.js.map → chunk-2QZJ4P27.js.map} +0 -0
- /package/dist/{chunk-3RZB7TYL.js.map → chunk-2UDAABV6.js.map} +0 -0
- /package/dist/{chunk-4PXFLDMJ.js.map → chunk-35EH6KW4.js.map} +0 -0
- /package/dist/{chunk-KOEDSRF5.js.map → chunk-43IQRLEF.js.map} +0 -0
- /package/dist/{chunk-56C7OO3N.js.map → chunk-6KCQNFDQ.js.map} +0 -0
- /package/dist/{chunk-VBRS7Z3O.js.map → chunk-72N2P44O.js.map} +0 -0
- /package/dist/{chunk-ZUNYFDI4.js.map → chunk-7QVYVSEH.js.map} +0 -0
- /package/dist/{chunk-SRMBMMTK.js.map → chunk-7RKAE6Y4.js.map} +0 -0
- /package/dist/{chunk-42BV46XS.js.map → chunk-AH44WTLJ.js.map} +0 -0
- /package/dist/{chunk-TZ44E732.js.map → chunk-AIVRD66I.js.map} +0 -0
- /package/dist/{chunk-AYGWJ2UK.js.map → chunk-AQWGCHIV.js.map} +0 -0
- /package/dist/{chunk-EZV43XBD.js.map → chunk-AYHNTYVG.js.map} +0 -0
- /package/dist/{chunk-2NLLXCJG.js.map → chunk-BXLOS5AJ.js.map} +0 -0
- /package/dist/{chunk-JHUODJRW.js.map → chunk-D2N3PMAE.js.map} +0 -0
- /package/dist/{chunk-7SJCSDQ3.js.map → chunk-D7VT2LED.js.map} +0 -0
- /package/dist/{chunk-TVVEYCNW.js.map → chunk-DAOMWGO2.js.map} +0 -0
- /package/dist/{chunk-MVMNEU65.js.map → chunk-DI52XAKG.js.map} +0 -0
- /package/dist/{chunk-X7Y7WX73.js.map → chunk-DQEMWVMT.js.map} +0 -0
- /package/dist/{chunk-EUP4AXIW.js.map → chunk-DZP2XMZC.js.map} +0 -0
- /package/dist/{chunk-PA5EOTRR.js.map → chunk-EVQ33D3N.js.map} +0 -0
- /package/dist/{chunk-E64HBW7M.js.map → chunk-EW3Y73MN.js.map} +0 -0
- /package/dist/{chunk-VSN2DMQK.js.map → chunk-G2DF5MI7.js.map} +0 -0
- /package/dist/{chunk-JIWZVOQM.js.map → chunk-G7S37WD4.js.map} +0 -0
- /package/dist/{chunk-AL7OLBL7.js.map → chunk-GRX6YH4E.js.map} +0 -0
- /package/dist/{chunk-XTMABIFW.js.map → chunk-HG42J2EX.js.map} +0 -0
- /package/dist/{chunk-MQMZO23A.js.map → chunk-HWT6KRGS.js.map} +0 -0
- /package/dist/{chunk-LR7KUQ2W.js.map → chunk-IEOBAOA6.js.map} +0 -0
- /package/dist/{chunk-UDAUULK2.js.map → chunk-IGEZE6QB.js.map} +0 -0
- /package/dist/{chunk-SGHGCFVV.js.map → chunk-JE334SIA.js.map} +0 -0
- /package/dist/{chunk-IC3PM3YO.js.map → chunk-JE4H2QBO.js.map} +0 -0
- /package/dist/{chunk-E73SVGJA.js.map → chunk-JMZQS6OS.js.map} +0 -0
- /package/dist/{chunk-3RABJOGD.js.map → chunk-KH2D26LQ.js.map} +0 -0
- /package/dist/{chunk-3MIZ2EKQ.js.map → chunk-KQQEZTH6.js.map} +0 -0
- /package/dist/{chunk-F5V7KRQS.js.map → chunk-LIAKZGOY.js.map} +0 -0
- /package/dist/{chunk-A7GQBJP5.js.map → chunk-LVFI5LG7.js.map} +0 -0
- /package/dist/{chunk-D7QX26FF.js.map → chunk-O7OVWKT4.js.map} +0 -0
- /package/dist/{chunk-JOP7W24J.js.map → chunk-PLJ2MQFT.js.map} +0 -0
- /package/dist/{chunk-D2XUSZ24.js.map → chunk-QWQB7TOB.js.map} +0 -0
- /package/dist/{chunk-HRCWDO6S.js.map → chunk-RSMNPYBM.js.map} +0 -0
- /package/dist/{chunk-BOTSR5S3.js.map → chunk-RUUJXAGT.js.map} +0 -0
- /package/dist/{chunk-FO6IK4IF.js.map → chunk-SEQ6DWXD.js.map} +0 -0
- /package/dist/{chunk-ZBAQMSEY.js.map → chunk-SLGD36MM.js.map} +0 -0
- /package/dist/{chunk-IYHHCSF6.js.map → chunk-SOFATSHJ.js.map} +0 -0
- /package/dist/{chunk-JG4AP36X.js.map → chunk-SPFNGHHP.js.map} +0 -0
- /package/dist/{chunk-DNO6QWCB.js.map → chunk-SPWNCGSM.js.map} +0 -0
- /package/dist/{chunk-QSP4Y73Q.js.map → chunk-SVUUOLKM.js.map} +0 -0
- /package/dist/{chunk-D6WX5FEF.js.map → chunk-SZ7IVZGD.js.map} +0 -0
- /package/dist/{chunk-2IVHOQRY.js.map → chunk-TEQQQTQS.js.map} +0 -0
- /package/dist/{chunk-UI6R2YUB.js.map → chunk-TQT4AOPO.js.map} +0 -0
- /package/dist/{chunk-3UQIS2GC.js.map → chunk-TTFJQ5B5.js.map} +0 -0
- /package/dist/{chunk-JTPAXDSX.js.map → chunk-U2SK45U3.js.map} +0 -0
- /package/dist/{chunk-4FWNMN5R.js.map → chunk-U6CMLAP4.js.map} +0 -0
- /package/dist/{chunk-6525YIYL.js.map → chunk-UCH2RWFX.js.map} +0 -0
- /package/dist/{chunk-QZDUNK6V.js.map → chunk-UCY4EHAG.js.map} +0 -0
- /package/dist/{chunk-OP5IBPHP.js.map → chunk-UDJMJNBK.js.map} +0 -0
- /package/dist/{chunk-BHI5ILU5.js.map → chunk-ULQVG6G3.js.map} +0 -0
- /package/dist/{chunk-X6B2QWXW.js.map → chunk-UQTXER7M.js.map} +0 -0
- /package/dist/{chunk-QXQCPNKA.js.map → chunk-V5BU5PVE.js.map} +0 -0
- /package/dist/{chunk-IPLYGWQF.js.map → chunk-VDX2J7OX.js.map} +0 -0
- /package/dist/{chunk-XUKUMBP3.js.map → chunk-VGO57TU7.js.map} +0 -0
- /package/dist/{chunk-W6V7JN2E.js.map → chunk-VUV472VH.js.map} +0 -0
- /package/dist/{chunk-ZHXSOMYH.js.map → chunk-VVX5PZFS.js.map} +0 -0
- /package/dist/{chunk-ML5FW2RO.js.map → chunk-WBW34YCJ.js.map} +0 -0
- /package/dist/{chunk-FDDCZDBI.js.map → chunk-WN4HFL4K.js.map} +0 -0
- /package/dist/{chunk-MECKA6G2.js.map → chunk-WUJD4CHZ.js.map} +0 -0
- /package/dist/{chunk-HS75MCQF.js.map → chunk-WUUGE7QC.js.map} +0 -0
- /package/dist/{chunk-UVEBBXB5.js.map → chunk-X7WAM3IY.js.map} +0 -0
- /package/dist/{chunk-4SDO74N2.js.map → chunk-XPFJSUOR.js.map} +0 -0
- /package/dist/{chunk-PPNFKQ6D.js.map → chunk-Y4G6LHJW.js.map} +0 -0
- /package/dist/{chunk-C3PKRFZ4.js.map → chunk-Y7LZ5V7N.js.map} +0 -0
- /package/dist/{chunk-AYP2FZFA.js.map → chunk-YIIW2OH2.js.map} +0 -0
- /package/dist/{chunk-YSBYNCCN.js.map → chunk-YLPCEUXP.js.map} +0 -0
- /package/dist/{chunk-RFIJH2OE.js.map → chunk-YUHGJBQK.js.map} +0 -0
|
@@ -31,20 +31,18 @@ import { stripAttributesSuffix } from "../storage.js";
|
|
|
31
31
|
import { STRUCTURED_ATTRIBUTE_LIMITS } from "../write-envelope.js";
|
|
32
32
|
import { excludeSupportPassportPrivateMemories } from "../support-passport/card-projection.js";
|
|
33
33
|
import type { MemoryFile, MemoryFrontmatter, MemoryStatus } from "../types.js";
|
|
34
|
+
import type { SeedGraduationConfig } from "./seed-graduation-config-types.js";
|
|
34
35
|
|
|
35
36
|
// ---------------------------------------------------------------------------
|
|
36
37
|
// Config
|
|
37
38
|
// ---------------------------------------------------------------------------
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
*/
|
|
46
|
-
minCorroborations: number;
|
|
47
|
-
}
|
|
40
|
+
// Canonical definitions live in seed-graduation-config-types.ts (a leaf) so
|
|
41
|
+
// types.ts can consume them without this module's storage.js import cycle.
|
|
42
|
+
export type {
|
|
43
|
+
SeedGraduationConfig,
|
|
44
|
+
SeedGraduationSettings,
|
|
45
|
+
} from "./seed-graduation-config-types.js";
|
|
48
46
|
|
|
49
47
|
export const SEED_GRADUATION_DEFAULTS: SeedGraduationConfig = {
|
|
50
48
|
enabled: false,
|
|
@@ -49,6 +49,8 @@ import type {
|
|
|
49
49
|
MemorySummary,
|
|
50
50
|
} from "../types.js";
|
|
51
51
|
import { excludeSupportPassportPrivateMemories } from "../support-passport/card-projection.js";
|
|
52
|
+
import { runSeedGraduationPass } from "../lifecycle/seed-graduation.js";
|
|
53
|
+
import type { RecallHandleHistoryStore } from "../recall-state.js";
|
|
52
54
|
|
|
53
55
|
/** Dependencies injected by the orchestrator. All stable references or
|
|
54
56
|
* live accessors. */
|
|
@@ -76,6 +78,8 @@ export interface LifecyclePolicyCoordinatorDeps {
|
|
|
76
78
|
) => Promise<void>;
|
|
77
79
|
/** Persist all dirty content-hash indexes to disk. */
|
|
78
80
|
saveContentHashIndexes: () => Promise<void>;
|
|
81
|
+
/** Recall-handle ring used to suppress quoted-back echo during seed graduation. */
|
|
82
|
+
getHandleHistory?: () => RecallHandleHistoryStore;
|
|
79
83
|
}
|
|
80
84
|
|
|
81
85
|
/**
|
|
@@ -256,6 +260,14 @@ export class LifecyclePolicyCoordinator {
|
|
|
256
260
|
if (wrote) updatedCount += 1;
|
|
257
261
|
}
|
|
258
262
|
|
|
263
|
+
const history = this.deps.getHandleHistory?.();
|
|
264
|
+
await runSeedGraduationPass({
|
|
265
|
+
memories: allMemories,
|
|
266
|
+
storage,
|
|
267
|
+
config: this.config.seedGraduation,
|
|
268
|
+
recalledBySession: history ? (sessionKey) => history.recent(sessionKey) : undefined,
|
|
269
|
+
});
|
|
270
|
+
|
|
259
271
|
// Report how many memories had frontmatter rewritten so callers can record a
|
|
260
272
|
// catalog write touch for lifecycle-only passes (codex NR-tS).
|
|
261
273
|
if (!lifecycleCaps.lifecycleMetrics) return updatedCount;
|
|
@@ -22,7 +22,12 @@ import type { RecallResultFormatter } from "./recall-result-formatter.js";
|
|
|
22
22
|
import type { IdentityInjectionMode, PluginConfig, QmdSearchResult } from "../types.js";
|
|
23
23
|
import { stateViewPacketActive } from "../recall-state-view-anchors.js";
|
|
24
24
|
import { resultStateViewKey, stateViewPacketKeys } from "../recall-state-view.js";
|
|
25
|
-
|
|
25
|
+
import { applyRecallStateViews } from "../recall-state-view-wire.js";
|
|
26
|
+
import { composeRecallContext } from "../recall-context-composition.js";
|
|
27
|
+
import {
|
|
28
|
+
notifyContextComposition,
|
|
29
|
+
recallFailureComposition,
|
|
30
|
+
} from "../recall-composition-decision.js";
|
|
26
31
|
|
|
27
32
|
export interface RecallEntryDeps {
|
|
28
33
|
appendRecallSection(
|
|
@@ -197,7 +202,16 @@ export class RecallEntryCoordinator {
|
|
|
197
202
|
// endTrace() is safe here: if no trace is active (disabled or already
|
|
198
203
|
// closed by recallInternal's try/finally), it returns null immediately.
|
|
199
204
|
this.deps.profiler.endTrace();
|
|
200
|
-
|
|
205
|
+
// Caller-cancelled recalls stay quiet: the failure was the caller's
|
|
206
|
+
// abort, not a recall degradation (issue #2972 contract).
|
|
207
|
+
const missing = options.abortSignal?.aborted
|
|
208
|
+
? null
|
|
209
|
+
: recallFailureComposition(err);
|
|
210
|
+
if (!missing) return "";
|
|
211
|
+
notifyContextComposition(options.onContextComposition, missing, (observerErr) => {
|
|
212
|
+
log.warn("recall: context composition observer failed open", observerErr);
|
|
213
|
+
});
|
|
214
|
+
return composeRecallContext(missing);
|
|
201
215
|
} finally {
|
|
202
216
|
options.abortSignal?.removeEventListener("abort", onAbort);
|
|
203
217
|
}
|
|
@@ -45,9 +45,14 @@ import { buildQmdRecallCacheKey, getCachedQmdRecall, setCachedQmdRecall } from "
|
|
|
45
45
|
import { MEMORY_ID_PATTERN } from "../recall-handles.js";
|
|
46
46
|
import { shouldRecordRecallAuthorityHistory } from "../recall-navigation-config.js";
|
|
47
47
|
import {
|
|
48
|
-
|
|
48
|
+
contextBudgetForFooter,
|
|
49
49
|
formatCuriosityFooter, renderAuthorityBoundContent, selectCuriosityQuestion,
|
|
50
50
|
} from "../recall-context-composition.js";
|
|
51
|
+
import {
|
|
52
|
+
compactRecallContextFromBuckets,
|
|
53
|
+
decideRecallContextComposition,
|
|
54
|
+
notifyContextComposition,
|
|
55
|
+
} from "../recall-composition-decision.js";
|
|
51
56
|
import {
|
|
52
57
|
createBoundedCoreSectionRunner,
|
|
53
58
|
createRecallSectionMetricRecorder,
|
|
@@ -110,6 +115,7 @@ import {
|
|
|
110
115
|
import type { RecallInternalDeps } from "./recall-internal-deps.js";
|
|
111
116
|
import { appendEpisodicContextSection } from "./episodic-context-section.js";
|
|
112
117
|
import { resolveCompositeProfileStorage } from "./recall-profile-storage.js";
|
|
118
|
+
import { fetchQmdMemoryResultsWithRecognitionSwap } from "./recall-recognition-search.js";
|
|
113
119
|
|
|
114
120
|
export class RecallInternalCoordinator {
|
|
115
121
|
private readonly securityCapabilities: SecurityCapabilitySet;
|
|
@@ -2141,7 +2147,8 @@ export class RecallInternalCoordinator {
|
|
|
2141
2147
|
|
|
2142
2148
|
try {
|
|
2143
2149
|
const filteredResults =
|
|
2144
|
-
await
|
|
2150
|
+
await fetchQmdMemoryResultsWithRecognitionSwap(
|
|
2151
|
+
this.deps,
|
|
2145
2152
|
retrievalQuery,
|
|
2146
2153
|
qmdFetchLimit,
|
|
2147
2154
|
qmdHybridFetchLimit,
|
|
@@ -4951,23 +4958,16 @@ export class RecallInternalCoordinator {
|
|
|
4951
4958
|
recalledMemoryNamespaces,
|
|
4952
4959
|
);
|
|
4953
4960
|
const recalledContext = assembledRecall.sections.join("\n\n---\n\n");
|
|
4954
|
-
const composition =
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
"recall: context composition observer rejected", err,
|
|
4963
|
-
));
|
|
4964
|
-
}
|
|
4965
|
-
} catch (err) {
|
|
4961
|
+
const { composition, context, truncated: compositionTruncated } =
|
|
4962
|
+
decideRecallContextComposition({
|
|
4963
|
+
context: recalledContext,
|
|
4964
|
+
compactContext: compactRecallContextFromBuckets(sectionBuckets),
|
|
4965
|
+
footer: curiosityFooter,
|
|
4966
|
+
maxChars: recallBudgetChars,
|
|
4967
|
+
});
|
|
4968
|
+
notifyContextComposition(options.onContextComposition, composition, (err) => {
|
|
4966
4969
|
log.warn("recall: context composition observer failed open", err);
|
|
4967
|
-
}
|
|
4968
|
-
const compositionTruncated = context.length < composeRecallContext({
|
|
4969
|
-
context: recalledContext, footer: curiosityFooter,
|
|
4970
|
-
}).length;
|
|
4970
|
+
});
|
|
4971
4971
|
const includedSections = [...assembledRecall.includedIds];
|
|
4972
4972
|
const omittedSections = [...assembledRecall.omittedIds];
|
|
4973
4973
|
if (composition.footer && !includedSections.includes("questions")) includedSections.push("questions");
|
|
@@ -5202,6 +5202,9 @@ export class RecallInternalCoordinator {
|
|
|
5202
5202
|
chars: this.deps.getRecallBudgetChars(options.budgetCharsOverride),
|
|
5203
5203
|
used: context.length,
|
|
5204
5204
|
},
|
|
5205
|
+
...(composition.degradation
|
|
5206
|
+
? { degradation: composition.degradation }
|
|
5207
|
+
: {}),
|
|
5205
5208
|
sessionKey,
|
|
5206
5209
|
namespace: selfNamespace,
|
|
5207
5210
|
traceId,
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* recall-recognition-search.test.ts — issue #2975 recall-slice wiring.
|
|
3
|
+
*
|
|
4
|
+
* Pins the fetchQmdMemoryResultsWithArtifactTopUp seam:
|
|
5
|
+
* - gate off: original fetch only (zero extra I/O, same options object);
|
|
6
|
+
* - under-threshold index: recognition pass, no vector fetch for that ns;
|
|
7
|
+
* - above-threshold index: vector fetch, no recognizer call.
|
|
8
|
+
*/
|
|
9
|
+
import assert from "node:assert/strict";
|
|
10
|
+
import os from "node:os";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
import { mkdtemp, rm } from "node:fs/promises";
|
|
13
|
+
import test from "node:test";
|
|
14
|
+
|
|
15
|
+
import { saveRecognitionIndex, type RecognitionIndex } from "../recall-recognition-tier.js";
|
|
16
|
+
import {
|
|
17
|
+
fetchQmdMemoryResultsWithRecognitionSwap,
|
|
18
|
+
type RecognitionSearchDeps,
|
|
19
|
+
} from "./recall-recognition-search.js";
|
|
20
|
+
import type { QmdSearchResult } from "../types.js";
|
|
21
|
+
|
|
22
|
+
function vec(namespace: string, filePath: string, score = 1): QmdSearchResult {
|
|
23
|
+
return { docid: `${namespace}:${filePath}`, namespace, path: filePath, score, snippet: filePath };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function indexOf(ids: string[]): RecognitionIndex {
|
|
27
|
+
return {
|
|
28
|
+
version: 1,
|
|
29
|
+
entries: ids.map((id) => ({ id, description: `trigger for ${id}` })),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function tmpDir(): Promise<string> {
|
|
34
|
+
return mkdtemp(path.join(os.tmpdir(), "remnic-recognition-search-"));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function makeDeps(args: {
|
|
38
|
+
recallRecognitionTier: boolean;
|
|
39
|
+
recognitionIndexMaxEntries?: number;
|
|
40
|
+
storages: Record<string, { dir: string; pathsById: Record<string, string> }>;
|
|
41
|
+
vectorResults?: QmdSearchResult[];
|
|
42
|
+
recognize?: (prompt: string) => Promise<string>;
|
|
43
|
+
recognizeError?: Error;
|
|
44
|
+
}) {
|
|
45
|
+
const fetchCalls: Array<{
|
|
46
|
+
prompt: string;
|
|
47
|
+
qmdFetchLimit: number;
|
|
48
|
+
qmdHybridFetchLimit: number;
|
|
49
|
+
options: unknown;
|
|
50
|
+
}> = [];
|
|
51
|
+
const recognizePrompts: string[] = [];
|
|
52
|
+
const storageForCalls: string[] = [];
|
|
53
|
+
|
|
54
|
+
const deps = {
|
|
55
|
+
config: {
|
|
56
|
+
recallRecognitionTier: args.recallRecognitionTier,
|
|
57
|
+
recognitionIndexMaxEntries: args.recognitionIndexMaxEntries ?? 500,
|
|
58
|
+
},
|
|
59
|
+
storageRouter: {
|
|
60
|
+
storageFor: async (namespace: string) => {
|
|
61
|
+
storageForCalls.push(namespace);
|
|
62
|
+
const storage = args.storages[namespace];
|
|
63
|
+
if (!storage) throw new Error(`unknown namespace ${namespace}`);
|
|
64
|
+
return {
|
|
65
|
+
dir: storage.dir,
|
|
66
|
+
findExistingMemoryPaths: async (ids: string[]) => {
|
|
67
|
+
const found = new Map<string, string[]>();
|
|
68
|
+
for (const id of ids) {
|
|
69
|
+
const filePath = storage.pathsById[id];
|
|
70
|
+
if (filePath) found.set(id, [filePath]);
|
|
71
|
+
}
|
|
72
|
+
return found;
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
fastLlmForRerank: {
|
|
78
|
+
chatCompletion: async (messages: Array<{ role: string; content: string }>) => {
|
|
79
|
+
if (args.recognizeError) throw args.recognizeError;
|
|
80
|
+
const prompt = messages[0]?.content ?? "";
|
|
81
|
+
recognizePrompts.push(prompt);
|
|
82
|
+
return { content: await (args.recognize ?? (async () => ""))(prompt) };
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
fetchQmdMemoryResultsWithArtifactTopUp: async (
|
|
86
|
+
prompt: string,
|
|
87
|
+
qmdFetchLimit: number,
|
|
88
|
+
qmdHybridFetchLimit: number,
|
|
89
|
+
options: unknown,
|
|
90
|
+
) => {
|
|
91
|
+
fetchCalls.push({ prompt, qmdFetchLimit, qmdHybridFetchLimit, options });
|
|
92
|
+
return args.vectorResults ?? [];
|
|
93
|
+
},
|
|
94
|
+
} as unknown as RecognitionSearchDeps;
|
|
95
|
+
|
|
96
|
+
return { deps, fetchCalls, recognizePrompts, storageForCalls };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const baseOptions = {
|
|
100
|
+
namespacesEnabled: true,
|
|
101
|
+
recallNamespaces: ["alpha"],
|
|
102
|
+
resolveNamespace: (filePath: string) => (filePath.startsWith("beta/") ? "beta" : "alpha"),
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
test("off-path: gate off calls original fetch once with the same options object", async () => {
|
|
106
|
+
const options = { ...baseOptions };
|
|
107
|
+
const { deps, fetchCalls, recognizePrompts, storageForCalls } = makeDeps({
|
|
108
|
+
recallRecognitionTier: false,
|
|
109
|
+
storages: {},
|
|
110
|
+
vectorResults: [vec("alpha", "facts/from-vector.md")],
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
const out = await fetchQmdMemoryResultsWithRecognitionSwap(deps, "q", 7, 9, options);
|
|
114
|
+
|
|
115
|
+
assert.equal(fetchCalls.length, 1);
|
|
116
|
+
assert.equal(fetchCalls[0].prompt, "q");
|
|
117
|
+
assert.equal(fetchCalls[0].qmdFetchLimit, 7);
|
|
118
|
+
assert.equal(fetchCalls[0].qmdHybridFetchLimit, 9);
|
|
119
|
+
assert.equal(fetchCalls[0].options, options);
|
|
120
|
+
assert.equal(recognizePrompts.length, 0);
|
|
121
|
+
assert.equal(storageForCalls.length, 0);
|
|
122
|
+
assert.deepEqual(out.map((r) => r.path), ["facts/from-vector.md"]);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
test("acceptance: under-threshold namespace uses recognition, not vector search", async () => {
|
|
126
|
+
const dir = await tmpDir();
|
|
127
|
+
try {
|
|
128
|
+
await saveRecognitionIndex(dir, indexOf(["m-001", "m-002", "m-003"]));
|
|
129
|
+
const { deps, fetchCalls, recognizePrompts } = makeDeps({
|
|
130
|
+
recallRecognitionTier: true,
|
|
131
|
+
recognitionIndexMaxEntries: 10,
|
|
132
|
+
storages: {
|
|
133
|
+
alpha: {
|
|
134
|
+
dir,
|
|
135
|
+
pathsById: {
|
|
136
|
+
"m-001": path.join(dir, "facts/m-001.md"),
|
|
137
|
+
"m-002": path.join(dir, "facts/m-002.md"),
|
|
138
|
+
"m-003": path.join(dir, "facts/m-003.md"),
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
recognize: async () => "m-002, m-003",
|
|
143
|
+
vectorResults: [vec("alpha", "facts/must-not-appear.md")],
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const out = await fetchQmdMemoryResultsWithRecognitionSwap(deps, "which memories?", 5, 5, {
|
|
147
|
+
...baseOptions,
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
assert.equal(fetchCalls.length, 0, "vector search must not run on the recognition tier");
|
|
151
|
+
assert.equal(recognizePrompts.length, 1);
|
|
152
|
+
assert.ok(recognizePrompts[0].includes("m-001: trigger for m-001"));
|
|
153
|
+
assert.ok(recognizePrompts[0].includes("m-002: trigger for m-002"));
|
|
154
|
+
assert.ok(recognizePrompts[0].includes("m-003: trigger for m-003"));
|
|
155
|
+
assert.deepEqual(
|
|
156
|
+
out.map((r) => r.path),
|
|
157
|
+
["facts/m-002.md", "facts/m-003.md"],
|
|
158
|
+
);
|
|
159
|
+
assert.deepEqual(
|
|
160
|
+
out.map((r) => r.namespace),
|
|
161
|
+
["alpha", "alpha"],
|
|
162
|
+
);
|
|
163
|
+
} finally {
|
|
164
|
+
await rm(dir, { recursive: true, force: true });
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
test("acceptance: above-threshold namespace uses vector search, not the recognizer", async () => {
|
|
169
|
+
const dir = await tmpDir();
|
|
170
|
+
try {
|
|
171
|
+
await saveRecognitionIndex(dir, indexOf(["a", "b", "c", "d", "e"]));
|
|
172
|
+
const options = { ...baseOptions };
|
|
173
|
+
const { deps, fetchCalls, recognizePrompts } = makeDeps({
|
|
174
|
+
recallRecognitionTier: true,
|
|
175
|
+
recognitionIndexMaxEntries: 4,
|
|
176
|
+
storages: { alpha: { dir, pathsById: {} } },
|
|
177
|
+
vectorResults: [vec("alpha", "facts/vector-hit.md")],
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
const out = await fetchQmdMemoryResultsWithRecognitionSwap(deps, "q", 3, 3, options);
|
|
181
|
+
|
|
182
|
+
assert.equal(recognizePrompts.length, 0);
|
|
183
|
+
assert.equal(fetchCalls.length, 1);
|
|
184
|
+
assert.equal(fetchCalls[0].options, options);
|
|
185
|
+
assert.deepEqual(out.map((r) => r.path), ["facts/vector-hit.md"]);
|
|
186
|
+
} finally {
|
|
187
|
+
await rm(dir, { recursive: true, force: true });
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
test("acceptance: missing index falls back to vector search with original options", async () => {
|
|
192
|
+
const dir = await tmpDir();
|
|
193
|
+
try {
|
|
194
|
+
const options = { ...baseOptions };
|
|
195
|
+
const { deps, fetchCalls, recognizePrompts } = makeDeps({
|
|
196
|
+
recallRecognitionTier: true,
|
|
197
|
+
storages: { alpha: { dir, pathsById: {} } },
|
|
198
|
+
vectorResults: [vec("alpha", "facts/fallback.md")],
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
const out = await fetchQmdMemoryResultsWithRecognitionSwap(deps, "q", 2, 2, options);
|
|
202
|
+
|
|
203
|
+
assert.equal(recognizePrompts.length, 0);
|
|
204
|
+
assert.equal(fetchCalls.length, 1);
|
|
205
|
+
assert.equal(fetchCalls[0].options, options);
|
|
206
|
+
assert.deepEqual(out.map((r) => r.path), ["facts/fallback.md"]);
|
|
207
|
+
} finally {
|
|
208
|
+
await rm(dir, { recursive: true, force: true });
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
test("mixed namespaces: small ns recognizes; large ns stays on vector search", async () => {
|
|
213
|
+
const small = await tmpDir();
|
|
214
|
+
const large = await tmpDir();
|
|
215
|
+
try {
|
|
216
|
+
await saveRecognitionIndex(small, indexOf(["s-1", "s-2"]));
|
|
217
|
+
await saveRecognitionIndex(large, indexOf(["l-1", "l-2", "l-3"]));
|
|
218
|
+
const { deps, fetchCalls, recognizePrompts } = makeDeps({
|
|
219
|
+
recallRecognitionTier: true,
|
|
220
|
+
recognitionIndexMaxEntries: 2,
|
|
221
|
+
storages: {
|
|
222
|
+
alpha: {
|
|
223
|
+
dir: small,
|
|
224
|
+
pathsById: { "s-1": path.join(small, "facts/s-1.md") },
|
|
225
|
+
},
|
|
226
|
+
beta: { dir: large, pathsById: {} },
|
|
227
|
+
},
|
|
228
|
+
recognize: async () => "s-1",
|
|
229
|
+
vectorResults: [vec("beta", "facts/large-hit.md")],
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
const out = await fetchQmdMemoryResultsWithRecognitionSwap(deps, "q", 10, 10, {
|
|
233
|
+
namespacesEnabled: true,
|
|
234
|
+
recallNamespaces: ["alpha", "beta"],
|
|
235
|
+
resolveNamespace: (filePath) => (filePath.includes("large") ? "beta" : "alpha"),
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
assert.equal(recognizePrompts.length, 1);
|
|
239
|
+
assert.equal(fetchCalls.length, 1);
|
|
240
|
+
assert.deepEqual(
|
|
241
|
+
(fetchCalls[0].options as { recallNamespaces: string[] }).recallNamespaces,
|
|
242
|
+
["beta"],
|
|
243
|
+
);
|
|
244
|
+
assert.deepEqual(
|
|
245
|
+
out.map((r) => `${r.namespace}:${r.path}`),
|
|
246
|
+
["alpha:facts/s-1.md", "beta:facts/large-hit.md"],
|
|
247
|
+
);
|
|
248
|
+
} finally {
|
|
249
|
+
await rm(small, { recursive: true, force: true });
|
|
250
|
+
await rm(large, { recursive: true, force: true });
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
test("loud degradation: recognizer throw routes that namespace back to vector search", async () => {
|
|
255
|
+
const dir = await tmpDir();
|
|
256
|
+
try {
|
|
257
|
+
await saveRecognitionIndex(dir, indexOf(["m-001"]));
|
|
258
|
+
const { deps, fetchCalls, recognizePrompts } = makeDeps({
|
|
259
|
+
recallRecognitionTier: true,
|
|
260
|
+
storages: { alpha: { dir, pathsById: { "m-001": path.join(dir, "facts/m-001.md") } } },
|
|
261
|
+
recognizeError: new Error("model down"),
|
|
262
|
+
vectorResults: [vec("alpha", "facts/degraded.md")],
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
const out = await fetchQmdMemoryResultsWithRecognitionSwap(deps, "q", 4, 4, { ...baseOptions });
|
|
266
|
+
|
|
267
|
+
assert.equal(recognizePrompts.length, 0);
|
|
268
|
+
assert.equal(fetchCalls.length, 1);
|
|
269
|
+
assert.deepEqual(out.map((r) => r.path), ["facts/degraded.md"]);
|
|
270
|
+
} finally {
|
|
271
|
+
await rm(dir, { recursive: true, force: true });
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
test("namespaces disabled: gate on still calls original fetch with the same options object", async () => {
|
|
276
|
+
const options = { ...baseOptions, namespacesEnabled: false };
|
|
277
|
+
const { deps, fetchCalls, recognizePrompts, storageForCalls } = makeDeps({
|
|
278
|
+
recallRecognitionTier: true,
|
|
279
|
+
storages: {},
|
|
280
|
+
vectorResults: [vec("alpha", "facts/from-vector.md")],
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
const out = await fetchQmdMemoryResultsWithRecognitionSwap(deps, "q", 2, 2, options);
|
|
284
|
+
|
|
285
|
+
assert.equal(fetchCalls.length, 1);
|
|
286
|
+
assert.equal(fetchCalls[0].options, options);
|
|
287
|
+
assert.equal(recognizePrompts.length, 0);
|
|
288
|
+
assert.equal(storageForCalls.length, 0);
|
|
289
|
+
assert.deepEqual(out.map((r) => r.path), ["facts/from-vector.md"]);
|
|
290
|
+
});
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recognition-tier swap at fetchQmdMemoryResultsWithArtifactTopUp (issue #2975).
|
|
3
|
+
*
|
|
4
|
+
* Off-path (recallRecognitionTier !== true): original fetch only — no index
|
|
5
|
+
* load, no model call. On-path: namespaces whose index is at or under
|
|
6
|
+
* recognitionIndexMaxEntries go through one recognizer call; the rest keep
|
|
7
|
+
* vector search. A failing recognizer degrades that namespace to vector search.
|
|
8
|
+
*/
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
|
|
11
|
+
import { log } from "../logger.js";
|
|
12
|
+
import { dedupeResultsByNamespace } from "../recall-memory-map.js";
|
|
13
|
+
import {
|
|
14
|
+
decideRecognitionTier,
|
|
15
|
+
loadRecognitionIndex,
|
|
16
|
+
runRecognitionTier,
|
|
17
|
+
type RecognitionIndex,
|
|
18
|
+
} from "../recall-recognition-tier.js";
|
|
19
|
+
import type { QmdSearchResult } from "../types.js";
|
|
20
|
+
import { throwIfRecallAborted } from "./orchestrator-helpers.js";
|
|
21
|
+
import type { RecallInternalDeps } from "./recall-internal-deps.js";
|
|
22
|
+
|
|
23
|
+
export type RecognitionSearchDeps = Pick<
|
|
24
|
+
RecallInternalDeps,
|
|
25
|
+
"config" | "storageRouter" | "fastLlmForRerank" | "fetchQmdMemoryResultsWithArtifactTopUp"
|
|
26
|
+
>;
|
|
27
|
+
|
|
28
|
+
type ArtifactTopUpOptions = Parameters<
|
|
29
|
+
RecognitionSearchDeps["fetchQmdMemoryResultsWithArtifactTopUp"]
|
|
30
|
+
>[3];
|
|
31
|
+
|
|
32
|
+
type RecognitionStorage = {
|
|
33
|
+
dir: string;
|
|
34
|
+
findExistingMemoryPaths(ids: string[]): Promise<Map<string, string[]>>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export async function fetchQmdMemoryResultsWithRecognitionSwap(
|
|
38
|
+
deps: RecognitionSearchDeps,
|
|
39
|
+
prompt: string,
|
|
40
|
+
qmdFetchLimit: number,
|
|
41
|
+
qmdHybridFetchLimit: number,
|
|
42
|
+
options: ArtifactTopUpOptions,
|
|
43
|
+
): Promise<QmdSearchResult[]> {
|
|
44
|
+
if (
|
|
45
|
+
deps.config.recallRecognitionTier !== true ||
|
|
46
|
+
options.collection ||
|
|
47
|
+
options.namespacesEnabled !== true
|
|
48
|
+
) {
|
|
49
|
+
return deps.fetchQmdMemoryResultsWithArtifactTopUp(
|
|
50
|
+
prompt,
|
|
51
|
+
qmdFetchLimit,
|
|
52
|
+
qmdHybridFetchLimit,
|
|
53
|
+
options,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const namespaces = options.recallNamespaces.filter(Boolean);
|
|
58
|
+
if (namespaces.length === 0) {
|
|
59
|
+
return deps.fetchQmdMemoryResultsWithArtifactTopUp(
|
|
60
|
+
prompt,
|
|
61
|
+
qmdFetchLimit,
|
|
62
|
+
qmdHybridFetchLimit,
|
|
63
|
+
options,
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
throwIfRecallAborted(options.abortSignal);
|
|
68
|
+
const maxEntries = deps.config.recognitionIndexMaxEntries;
|
|
69
|
+
const recognitionNs: Array<{ namespace: string; storage: RecognitionStorage; index: RecognitionIndex }> = [];
|
|
70
|
+
const vectorNs: string[] = [];
|
|
71
|
+
|
|
72
|
+
for (const namespace of namespaces) {
|
|
73
|
+
throwIfRecallAborted(options.abortSignal);
|
|
74
|
+
const storage = (await deps.storageRouter.storageFor(namespace)) as RecognitionStorage;
|
|
75
|
+
const index = await loadRecognitionIndex(storage.dir);
|
|
76
|
+
const decision = decideRecognitionTier(index, { maxEntries });
|
|
77
|
+
if (index !== null && decision.tier === "recognition") {
|
|
78
|
+
recognitionNs.push({ namespace, storage, index });
|
|
79
|
+
} else {
|
|
80
|
+
vectorNs.push(namespace);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (recognitionNs.length === 0) {
|
|
85
|
+
return deps.fetchQmdMemoryResultsWithArtifactTopUp(
|
|
86
|
+
prompt,
|
|
87
|
+
qmdFetchLimit,
|
|
88
|
+
qmdHybridFetchLimit,
|
|
89
|
+
options,
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const recognize = async (recognitionPrompt: string): Promise<string | null | undefined> => {
|
|
94
|
+
const reply = await deps.fastLlmForRerank.chatCompletion(
|
|
95
|
+
[{ role: "user", content: recognitionPrompt }],
|
|
96
|
+
{ operation: "recognition-tier", priority: "recall-critical" },
|
|
97
|
+
);
|
|
98
|
+
return reply?.content;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const recognized: QmdSearchResult[] = [];
|
|
102
|
+
for (const { namespace, storage, index } of recognitionNs) {
|
|
103
|
+
throwIfRecallAborted(options.abortSignal);
|
|
104
|
+
try {
|
|
105
|
+
const run = await runRecognitionTier(prompt, index.entries, recognize);
|
|
106
|
+
recognized.push(
|
|
107
|
+
...(await hitsFromIds(namespace, storage, index, run.ids)),
|
|
108
|
+
);
|
|
109
|
+
} catch (err) {
|
|
110
|
+
log.warn(
|
|
111
|
+
`recognition tier degraded to vector search: recognizer failed${
|
|
112
|
+
err instanceof Error ? ` (${err.message})` : ""
|
|
113
|
+
}`,
|
|
114
|
+
);
|
|
115
|
+
vectorNs.push(namespace);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const vectorResults =
|
|
120
|
+
vectorNs.length === 0
|
|
121
|
+
? []
|
|
122
|
+
: await deps.fetchQmdMemoryResultsWithArtifactTopUp(
|
|
123
|
+
prompt,
|
|
124
|
+
qmdFetchLimit,
|
|
125
|
+
qmdHybridFetchLimit,
|
|
126
|
+
{ ...options, recallNamespaces: vectorNs },
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
return dedupeResultsByNamespace(
|
|
130
|
+
[...recognized, ...vectorResults],
|
|
131
|
+
options.resolveNamespace,
|
|
132
|
+
qmdFetchLimit,
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
async function hitsFromIds(
|
|
137
|
+
namespace: string,
|
|
138
|
+
storage: RecognitionStorage,
|
|
139
|
+
index: RecognitionIndex,
|
|
140
|
+
ids: readonly string[],
|
|
141
|
+
): Promise<QmdSearchResult[]> {
|
|
142
|
+
if (ids.length === 0) return [];
|
|
143
|
+
const pathsById = await storage.findExistingMemoryPaths([...ids]);
|
|
144
|
+
const descriptionById = new Map(index.entries.map((entry) => [entry.id, entry.description]));
|
|
145
|
+
const hits: QmdSearchResult[] = [];
|
|
146
|
+
for (const [offset, id] of ids.entries()) {
|
|
147
|
+
const absPath = pathsById.get(id)?.[0];
|
|
148
|
+
if (!absPath) continue;
|
|
149
|
+
const rel = path.relative(storage.dir, absPath).split(path.sep).join("/");
|
|
150
|
+
if (!rel || rel.startsWith("..")) continue;
|
|
151
|
+
hits.push({
|
|
152
|
+
docid: `${namespace}:${rel}`,
|
|
153
|
+
namespace,
|
|
154
|
+
path: rel,
|
|
155
|
+
score: ids.length - offset,
|
|
156
|
+
snippet: descriptionById.get(id) ?? id,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
return hits;
|
|
160
|
+
}
|
package/src/orchestrator.ts
CHANGED
|
@@ -1711,6 +1711,7 @@ export class Orchestrator {
|
|
|
1711
1711
|
removeContentHashForMemory: (targetStorage, memory, context) =>
|
|
1712
1712
|
this.removeContentHashForMemory(targetStorage, memory, context),
|
|
1713
1713
|
saveContentHashIndexes: () => this.saveContentHashIndexes(),
|
|
1714
|
+
getHandleHistory: () => this.handleHistory,
|
|
1714
1715
|
});
|
|
1715
1716
|
this.threading = new ThreadingManager(
|
|
1716
1717
|
path.join(config.memoryDir, "threads"),
|