@remnic/core 9.54.4 → 9.54.6
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 +24 -23
- package/dist/access-admin-ops-surface.js +55 -50
- package/dist/access-authorization-probe.d.ts +25 -22
- package/dist/access-authorization-probe.js +58 -51
- package/dist/access-boundary.d.ts +26 -23
- package/dist/access-boundary.js +59 -52
- package/dist/access-cli.js +115 -107
- 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 +19 -18
- package/dist/access-extraction-force-flush.js +55 -50
- package/dist/access-health-types.d.ts +1 -1
- package/dist/access-http-lcm-compaction.d.ts +22 -21
- package/dist/access-http-lifecycle-flush.d.ts +22 -21
- package/dist/access-http-offline-stream.d.ts +19 -18
- package/dist/access-http-query.js +55 -50
- package/dist/access-http.d.ts +55 -36
- package/dist/access-http.js +76 -65
- package/dist/access-identity-continuity-surface.d.ts +9 -9
- package/dist/access-identity-continuity-surface.js +55 -50
- package/dist/access-lcm-surface.d.ts +21 -20
- package/dist/access-lcm-surface.js +55 -50
- package/dist/access-mcp.d.ts +22 -21
- package/dist/access-mcp.js +63 -57
- package/dist/access-memory-search-fanout.d.ts +22 -2
- package/dist/access-memory-search-fanout.js +1 -1
- package/dist/{access-namespace-preflight-C7n4tgWC.d.ts → access-namespace-preflight-CCNn_6NE.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +55 -50
- package/dist/access-observe-write-surface.d.ts +22 -21
- package/dist/access-observe-write-surface.js +55 -50
- package/dist/access-offline-manifest.d.ts +10 -9
- package/dist/access-offline-manifest.js +12 -10
- package/dist/access-operations-batch.js +57 -52
- package/dist/access-operations.d.ts +23 -22
- package/dist/access-operations.js +61 -55
- package/dist/access-recall-concurrency.d.ts +21 -20
- package/dist/access-recall-concurrency.js +55 -50
- package/dist/access-recall-response.d.ts +19 -18
- package/dist/access-recall-response.js +55 -50
- package/dist/access-recall-surface.d.ts +19 -18
- package/dist/access-recall-surface.js +55 -50
- package/dist/access-schema.d.ts +2 -2
- package/dist/access-schema.js +5 -4
- package/dist/{access-service-CXvbxLK-.d.ts → access-service-DkSdXK4S.d.ts} +1314 -83
- package/dist/access-service-helpers.d.ts +22 -21
- package/dist/access-service.d.ts +31 -30
- package/dist/access-service.js +55 -50
- package/dist/access-surface-catalog.d.ts +22 -21
- package/dist/access-surface-catalog.js +209 -2
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-wearables-meetings-surface.d.ts +3 -3
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +14 -1
- package/dist/active-memory-bridge.js +6 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +4 -2
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +7 -7
- package/dist/adapters/registry.js +3 -3
- package/dist/admin-console/public/what-helps-me/app.js +1594 -0
- package/dist/admin-console/public/what-helps-me/index.html +339 -0
- package/dist/admin-console/public/what-helps-me/model.js +685 -0
- package/dist/admin-console/public/what-helps-me/what-helps-me.css +1296 -0
- package/dist/ambient-provenance.d.ts +1 -1
- package/dist/artifact-search.d.ts +1 -1
- package/dist/{auto-sync-TDHLZPVP.js → auto-sync-NR3GPCOA.js} +4 -4
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +9 -9
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +33 -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 +3 -3
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +1 -1
- package/dist/calibration.js +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{catalog-BOOxl-I2.d.ts → catalog-DGFf8mD9.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 +34 -13
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-ZYLC7NFO.js → chunk-26ZXBTYN.js} +4 -4
- package/dist/chunk-26ZXBTYN.js.map +1 -0
- package/dist/{chunk-LLJMAULE.js → chunk-2FKEIPIT.js} +5 -5
- package/dist/{chunk-3CSX3ETE.js → chunk-2LWQSV6A.js} +23 -11
- package/dist/chunk-2LWQSV6A.js.map +1 -0
- package/dist/{chunk-JBPKEARU.js → chunk-2QSZNTDO.js} +7 -7
- package/dist/chunk-37DZZFFM.js +502 -0
- package/dist/chunk-37DZZFFM.js.map +1 -0
- package/dist/chunk-3HSRWJTC.js +9 -0
- package/dist/chunk-3HSRWJTC.js.map +1 -0
- package/dist/{chunk-XUAMCLY4.js → chunk-3TIZPSJC.js} +17 -13
- package/dist/chunk-3TIZPSJC.js.map +1 -0
- package/dist/{chunk-PDDTI7IC.js → chunk-43SEBY2M.js} +1 -1
- package/dist/{chunk-HWRD23DW.js → chunk-46SZBVDS.js} +3 -3
- package/dist/{chunk-6HPHEFXT.js → chunk-5FD7JMTX.js} +2 -2
- package/dist/{chunk-7BZOBA5J.js → chunk-5NB726GV.js} +70 -16
- package/dist/chunk-5NB726GV.js.map +1 -0
- package/dist/chunk-62OKGIJA.js +39 -0
- package/dist/chunk-62OKGIJA.js.map +1 -0
- package/dist/{chunk-IBKR2TFR.js → chunk-6CYHUWCO.js} +2 -2
- package/dist/{chunk-YN6ASZUG.js → chunk-6QPI2ITJ.js} +5 -5
- package/dist/{chunk-UU3G6GUP.js → chunk-76JJSXK7.js} +1 -1
- package/dist/chunk-76JJSXK7.js.map +1 -0
- package/dist/{chunk-PX2LSHYM.js → chunk-7BD6O7ZV.js} +189 -4
- package/dist/chunk-7BD6O7ZV.js.map +1 -0
- package/dist/chunk-7TBXNYLO.js +346 -0
- package/dist/chunk-7TBXNYLO.js.map +1 -0
- package/dist/{chunk-NH5IR2WM.js → chunk-BRR5EUTF.js} +6 -2
- package/dist/chunk-BRR5EUTF.js.map +1 -0
- package/dist/{chunk-NIS256NW.js → chunk-CIAI24TQ.js} +3 -3
- package/dist/{chunk-T2JHZWH6.js → chunk-D3LBIUWV.js} +11703 -7573
- package/dist/chunk-D3LBIUWV.js.map +1 -0
- package/dist/{chunk-7FGL6CGA.js → chunk-DVYRD4HY.js} +2 -2
- package/dist/{chunk-G7Z6EENO.js → chunk-EKTP7MNS.js} +4 -4
- package/dist/{chunk-S75M5ZRK.js → chunk-F2JRDPON.js} +16 -1
- package/dist/chunk-F2JRDPON.js.map +1 -0
- package/dist/{chunk-RZ4XGKOJ.js → chunk-FFRTNF3L.js} +8 -8
- package/dist/{chunk-VKXWK44Q.js → chunk-FONWBCVY.js} +3 -3
- package/dist/{chunk-DZD576ZU.js → chunk-FPLM2TKD.js} +2 -2
- package/dist/{chunk-ZPJ4QSGP.js → chunk-FTPONF6B.js} +2 -2
- package/dist/{chunk-LJS7KUPV.js → chunk-FWX7W5PM.js} +2 -2
- package/dist/{chunk-UTRO5UJU.js → chunk-G6DFSS6A.js} +5 -1
- package/dist/chunk-G6DFSS6A.js.map +1 -0
- package/dist/{chunk-6LAPLZOS.js → chunk-GJ776BC2.js} +8 -3
- package/dist/chunk-GJ776BC2.js.map +1 -0
- package/dist/{chunk-G4T7L557.js → chunk-GN3WRFJY.js} +6 -6
- package/dist/{chunk-QT2FRYI4.js → chunk-H7NAZ3UB.js} +2 -2
- package/dist/{chunk-APPFNGX6.js → chunk-HBUFQRIM.js} +2 -2
- package/dist/{chunk-UU7TRFNE.js → chunk-HGJ6NJ4E.js} +2 -2
- package/dist/{chunk-WB7JSQCP.js → chunk-HIEWDJ2O.js} +5 -2
- package/dist/{chunk-WB7JSQCP.js.map → chunk-HIEWDJ2O.js.map} +1 -1
- package/dist/{chunk-UES4BHA2.js → chunk-I3MSGFGD.js} +17 -6
- package/dist/chunk-I3MSGFGD.js.map +1 -0
- package/dist/{chunk-C4ZNGVK3.js → chunk-IKP5OYQQ.js} +2 -2
- package/dist/{chunk-KQAFEZQX.js → chunk-IPLYGWQF.js} +5 -5
- package/dist/{chunk-RDJRFDJY.js → chunk-IQ4NVWEF.js} +2 -2
- package/dist/{chunk-CGVHPCP2.js → chunk-JYG4OLWH.js} +2 -2
- package/dist/{chunk-WOPA3SGI.js → chunk-K26NWEOC.js} +8 -8
- package/dist/{chunk-K4QS7LXU.js → chunk-K2UGPTYY.js} +485 -44
- package/dist/chunk-K2UGPTYY.js.map +1 -0
- package/dist/{chunk-L6CQ7WIW.js → chunk-KFBOPMF6.js} +11 -11
- package/dist/chunk-KFBOPMF6.js.map +1 -0
- package/dist/{chunk-G7A5HLUS.js → chunk-KJH6W2I7.js} +2 -2
- package/dist/{chunk-IXEBUYO4.js → chunk-KM55SMLG.js} +11 -2
- package/dist/{chunk-IXEBUYO4.js.map → chunk-KM55SMLG.js.map} +1 -1
- package/dist/{chunk-HOIRB77A.js → chunk-L6Z5OAS4.js} +2 -2
- package/dist/chunk-LC2BDILZ.js +57 -0
- package/dist/chunk-LC2BDILZ.js.map +1 -0
- package/dist/{chunk-227UFSEQ.js → chunk-LEPOP46W.js} +4 -4
- package/dist/{chunk-6R4G7N4S.js → chunk-M4YHAODQ.js} +388 -748
- package/dist/chunk-M4YHAODQ.js.map +1 -0
- package/dist/{chunk-3JLPGJ43.js → chunk-MIH3CJPN.js} +5 -5
- package/dist/{chunk-QHFV6VNU.js → chunk-MK5VEWCR.js} +2 -2
- package/dist/chunk-NISZQW72.js +140 -0
- package/dist/chunk-NISZQW72.js.map +1 -0
- package/dist/{chunk-GUKBW4HL.js → chunk-NQMSEB5D.js} +6 -6
- package/dist/{chunk-G2LUMAUF.js → chunk-OCIP6YMD.js} +12 -5
- package/dist/chunk-OCIP6YMD.js.map +1 -0
- package/dist/{chunk-47P3RYZP.js → chunk-PG4QBPVG.js} +21 -11
- package/dist/chunk-PG4QBPVG.js.map +1 -0
- package/dist/{chunk-WRJVB3C2.js → chunk-PO7NXBG2.js} +2 -2
- package/dist/{chunk-QWGE2PUH.js → chunk-PT54WISF.js} +190 -56
- package/dist/chunk-PT54WISF.js.map +1 -0
- package/dist/{chunk-AZM4CCAC.js → chunk-QZLDRQ4I.js} +8 -8
- package/dist/{chunk-THPPCISA.js → chunk-RBII7637.js} +5 -5
- package/dist/{chunk-JDZPNCMA.js → chunk-RUNORG2P.js} +6 -3
- package/dist/chunk-RUNORG2P.js.map +1 -0
- package/dist/{chunk-JV5YUBIZ.js → chunk-RZQ6W2W4.js} +50 -44
- package/dist/chunk-RZQ6W2W4.js.map +1 -0
- package/dist/{chunk-RUMNY5DT.js → chunk-SMNYAMJD.js} +6 -2
- package/dist/chunk-SMNYAMJD.js.map +1 -0
- package/dist/{chunk-MKQBXQKU.js → chunk-TB6CBZ5V.js} +22 -15
- package/dist/chunk-TB6CBZ5V.js.map +1 -0
- package/dist/{chunk-VMMQDEN5.js → chunk-TO7ZTWJW.js} +2 -2
- package/dist/{chunk-K2TDK7GG.js → chunk-TWTUGCTY.js} +2 -2
- package/dist/{chunk-HLYR2TQL.js → chunk-UCTS3DDH.js} +2 -2
- package/dist/{chunk-JYIJNNN3.js → chunk-UG6VXIOK.js} +2 -2
- package/dist/{chunk-WM65LU67.js → chunk-UKYS3NU5.js} +2 -2
- package/dist/{chunk-WDBX6VER.js → chunk-UPLZNJKN.js} +5 -5
- package/dist/{chunk-C23BYTJV.js → chunk-UW5NPZJ2.js} +40 -12
- package/dist/chunk-UW5NPZJ2.js.map +1 -0
- package/dist/{chunk-2GFK22OZ.js → chunk-V6ERBR7U.js} +2 -2
- package/dist/{chunk-CYF6WVE7.js → chunk-W5ZKPI34.js} +139 -158
- package/dist/chunk-W5ZKPI34.js.map +1 -0
- package/dist/chunk-XX4HPFFM.js +370 -0
- package/dist/chunk-XX4HPFFM.js.map +1 -0
- package/dist/{chunk-ZMYDYNI4.js → chunk-XZHE2DEN.js} +4 -4
- package/dist/chunk-YXQEKCZM.js +223 -0
- package/dist/chunk-YXQEKCZM.js.map +1 -0
- package/dist/{chunk-GYPQL6XN.js → chunk-Z4N7SVVF.js} +35 -47
- package/dist/chunk-Z4N7SVVF.js.map +1 -0
- package/dist/{chunk-MAXVH44E.js → chunk-Z54EM5YZ.js} +7 -7
- package/dist/{chunk-YGLY6QFV.js → chunk-ZRZVLB7O.js} +2 -2
- package/dist/{chunk-4IIFL7GC.js → chunk-ZUKIUXHQ.js} +10 -10
- package/dist/{cli-DVUFIa5E.d.ts → cli-Bze8S0Qs.d.ts} +5 -5
- package/dist/cli.d.ts +22 -21
- package/dist/cli.js +90 -80
- package/dist/coding/pre-action-gate.d.ts +1 -1
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +33 -12
- 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 +4 -2
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +33 -12
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +32 -12
- package/dist/consolidation-provenance-check.d.ts +2 -2
- package/dist/consolidation-undo.d.ts +2 -2
- package/dist/contradiction/index.d.ts +2 -2
- package/dist/contradiction/index.js +3 -1
- package/dist/contradiction-scan-JDTBXRGW.js +20 -0
- package/dist/converge-config.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +2 -2
- package/dist/convergence-refresh.js +35 -14
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/backend.js +2 -2
- 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 +25 -24
- package/dist/day-summary.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-XzF76C9n.d.ts → dependency-propagation-delivery-CzEfB31P.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-retrieval.d.ts +2 -2
- package/dist/entity-retrieval.js +33 -12
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +9 -9
- package/dist/explicit-capture.js +7 -4
- package/dist/external-wiki-access.d.ts +22 -21
- package/dist/external-wiki-access.js +56 -51
- 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 +22 -21
- package/dist/extraction-error-classification.d.ts +1 -1
- package/dist/extraction-faithfulness.d.ts +1 -1
- package/dist/extraction-faithfulness.js +2 -2
- package/dist/extraction-judge-telemetry.d.ts +1 -1
- package/dist/extraction-judge-training.d.ts +1 -1
- package/dist/extraction-judge.d.ts +1 -1
- 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.d.ts +1 -1
- package/dist/extraction.js +35 -19
- package/dist/fallback-llm.d.ts +14 -1
- package/dist/fallback-llm.js +1 -1
- package/dist/{first-start-migration-626C5554.js → first-start-migration-CRZCZAJN.js} +11 -3
- package/dist/first-start-migration-CRZCZAJN.js.map +1 -0
- 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-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/in-flight-reads.d.ts +1 -1
- package/dist/index.d.ts +314 -308
- package/dist/index.js +304 -133
- package/dist/inline-script.d.ts +3 -0
- package/dist/inline-script.js +8 -0
- package/dist/inline-script.js.map +1 -0
- 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 +6 -6
- 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.d.ts +2 -1
- package/dist/local-llm.js +2 -2
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +33 -12
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +33 -12
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +34 -13
- package/dist/{maintenance-BJzNIKBE.d.ts → maintenance-C8aRWfhq.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +22 -21
- package/dist/mcp-read-only-tools.js +1 -1
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-mutations.js +2 -2
- package/dist/memory-projection-store.d.ts +6 -2
- package/dist/memory-projection-store.js +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-snapshot.d.ts +1 -1
- 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 +24 -23
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +8 -8
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +33 -12
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/offline-sync-file-io.d.ts +20 -0
- package/dist/offline-sync-file-io.js +18 -0
- package/dist/offline-sync-file-io.js.map +1 -0
- package/dist/offline-sync-impression-drain.d.ts +1 -1
- package/dist/offline-sync-impression-drain.js +5 -5
- package/dist/offline-sync.d.ts +8 -6
- package/dist/offline-sync.js +2 -1
- package/dist/operator-doctor-corpus.d.ts +1 -1
- package/dist/operator-doctor-corpus.js +26 -25
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +39 -36
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +38 -18
- package/dist/{orchestrator-BiXgBJBQ.d.ts → orchestrator-D85CzDDY.d.ts} +11 -8
- package/dist/orchestrator.d.ts +9 -9
- package/dist/orchestrator.js +117 -109
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-sz_dcuLg.d.ts → pipeline-DPcUifCO.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/proactive-contention.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/public-http-D-SyWNj6.d.ts +25 -0
- package/dist/{purge-533FZLS4.js → purge-GB7PZHT2.js} +2 -2
- package/dist/{qmd-eAWObK4M.d.ts → qmd-dFCHp1r0.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-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-planner-llm.d.ts +1 -1
- package/dist/recall-planner-llm.js +1 -1
- 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 +2 -1
- package/dist/reconcile/manifest.d.ts +2 -1
- package/dist/reconcile/manifest.js +6 -5
- package/dist/reconcile/plan.d.ts +2 -1
- package/dist/reconcile/plan.js +3 -2
- 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 +5 -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/schemas.d.ts +38 -38
- package/dist/{scope-profiles-BBQsXuyj.d.ts → scope-profiles-DICK7GtN.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 +6 -6
- 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/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-HD8RkzVA.d.ts → semantic-consolidation-BP7NAX0N.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +34 -13
- package/dist/semantic-rule-promotion.js +33 -12
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +33 -12
- package/dist/{service-DIrtHHEg.d.ts → service-DT-pJyda.d.ts} +660 -660
- 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 +31 -15
- package/dist/{storage-DqCzXi56.d.ts → storage-qOnaJ1Lw.d.ts} +49 -13
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +33 -12
- 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 +518 -0
- package/dist/support-passport/index.js +357 -0
- package/dist/support-passport/index.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 +2 -2
- package/dist/tier-routing.js +7 -1
- package/dist/{tier-stats-2JCZYEF7.js → tier-stats-EXYSKSVN.js} +8 -2
- package/dist/{tier-stats-2JCZYEF7.js.map → tier-stats-EXYSKSVN.js.map} +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 +1 -1
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/types.d.ts +36 -36
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-d_j4vC6N.d.ts → types-ed-SvS2t.d.ts} +8 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +2 -2
- package/dist/verified-recall.js +33 -12
- package/dist/write-envelope.d.ts +1 -1
- package/dist/write-rate-limiter.d.ts +11 -5
- package/dist/write-rate-limiter.js +1 -1
- package/package.json +12 -2
- package/scripts/build-with-heap.mjs +11 -1
- package/src/access-authorization-probe.ts +20 -2
- package/src/access-boundary.ts +32 -0
- package/src/access-http.test.ts +1971 -643
- package/src/access-http.ts +81 -74
- package/src/access-mcp.ts +3 -1
- package/src/access-memory-search-fanout.ts +24 -1
- package/src/access-offline-manifest.ts +5 -0
- package/src/access-operations.ts +2 -0
- package/src/access-service-namespace.test.ts +14 -0
- package/src/access-service-observe-scope.test.ts +2 -0
- package/src/access-service-offline-file-content.test.ts +211 -0
- package/src/access-service.ts +628 -884
- package/src/access-surface-catalog.test.ts +40 -10
- package/src/access-surface-catalog.ts +15 -0
- package/src/active-memory-bridge.test.ts +151 -0
- package/src/active-memory-bridge.ts +95 -21
- package/src/briefing.test.ts +38 -0
- package/src/briefing.ts +3 -3
- package/src/cli.ts +6 -1
- package/src/config.ts +18 -9
- package/src/connectors/codex-materialize-runner.ts +2 -0
- package/src/contradiction/contradiction-scan.ts +2 -0
- package/src/contradiction/contradiction.test.ts +42 -0
- package/src/correction/correction-access-wiring.ts +8 -2
- package/src/correction/correction-storage-integration.test.ts +7 -0
- package/src/explicit-capture.test.ts +24 -0
- package/src/explicit-capture.ts +2 -0
- package/src/fallback-llm.test.ts +54 -0
- package/src/fallback-llm.ts +54 -9
- package/src/index.ts +3 -0
- package/src/inline-script.ts +6 -0
- package/src/local-llm-headers-timeout.test.ts +42 -0
- package/src/local-llm.ts +8 -8
- package/src/maintenance/first-start-migration.ts +2 -1
- package/src/maintenance/memory-governance.test.ts +25 -0
- package/src/maintenance/memory-governance.ts +4 -1
- package/src/maintenance/pattern-reinforcement.test.ts +20 -0
- package/src/maintenance/pattern-reinforcement.ts +2 -1
- package/src/maintenance/rebuild-memory-projection.ts +8 -8
- package/src/mcp-read-only-tools.ts +3 -0
- package/src/memory-projection-store.ts +25 -27
- package/src/offline-sync-file-io.ts +68 -0
- package/src/offline-sync.ts +43 -57
- package/src/orchestration/consolidation-run.ts +5 -4
- package/src/orchestration/contradiction-linking-coordinator.ts +7 -0
- package/src/orchestration/contradiction-localization.integration.test.ts +115 -0
- package/src/orchestration/lifecycle-policy-coordinator.ts +2 -1
- package/src/orchestration/qmd-result-resolver.test.ts +215 -14
- package/src/orchestration/qmd-result-resolver.ts +142 -82
- package/src/orchestration/recall-search-pipeline.test.ts +41 -0
- package/src/orchestration/recall-search-pipeline.ts +12 -0
- package/src/orchestration/semantic-consolidation-coordinator.ts +2 -1
- package/src/orchestration/tier-migration-coordinator.ts +23 -56
- package/src/orchestration/workspace-ops.test.ts +37 -0
- package/src/orchestration/workspace-ops.ts +5 -29
- package/src/orchestrator.ts +7 -8
- package/src/relay/mission-access.test.ts +11 -11
- package/src/relay/mission-ui.test.ts +3 -1
- package/src/storage/supersession-audit.ts +7 -1
- package/src/storage/supersession-side-effects.ts +17 -5
- package/src/storage/tombstone-blocked-capture-sync.ts +31 -0
- package/src/storage-contract/failure-semantics.test.ts +102 -0
- package/src/storage.ts +18 -19
- package/src/support-passport/access-http-base.ts +143 -0
- package/src/support-passport/access-http.ts +172 -0
- package/src/support-passport/access-operations.ts +272 -0
- package/src/support-passport/access-service-base.test.ts +193 -0
- package/src/support-passport/access-service-base.ts +176 -0
- package/src/support-passport/access-surface.test.ts +283 -0
- package/src/support-passport/access-surface.ts +286 -0
- package/src/support-passport/card-projection.test.ts +137 -0
- package/src/support-passport/card-projection.ts +348 -0
- package/src/support-passport/card-replacement.ts +126 -0
- package/src/support-passport/card-service-commit-forwarding.test.ts +160 -0
- package/src/support-passport/card-service.test.ts +2964 -0
- package/src/support-passport/card-service.ts +1184 -0
- package/src/support-passport/card-state.ts +158 -0
- package/src/support-passport/config-model-routing.test.ts +37 -0
- package/src/support-passport/config.test.ts +34 -0
- package/src/support-passport/config.ts +41 -0
- package/src/support-passport/contracts.test.ts +156 -0
- package/src/support-passport/contracts.ts +149 -0
- package/src/support-passport/errors.ts +30 -0
- package/src/support-passport/generated-batch.test.ts +185 -0
- package/src/support-passport/generated-batch.ts +338 -0
- package/src/support-passport/grant-contracts.ts +183 -0
- package/src/support-passport/grant-generated-batch-scope.test.ts +201 -0
- package/src/support-passport/grant-service-cache.test.ts +148 -0
- package/src/support-passport/grant-service-cancellation.test.ts +83 -0
- package/src/support-passport/grant-service-marker-cache.test.ts +62 -0
- package/src/support-passport/grant-service.test.ts +3496 -0
- package/src/support-passport/grant-service.ts +513 -0
- package/src/support-passport/grant-store-commit-hook.test.ts +123 -0
- package/src/support-passport/grant-store-order.test.ts +60 -0
- package/src/support-passport/grant-store-path-safety.test.ts +30 -0
- package/src/support-passport/grant-store-recovery.test.ts +448 -0
- package/src/support-passport/grant-store.ts +906 -0
- package/src/support-passport/index.ts +17 -0
- package/src/support-passport/mcp-tools.test.ts +222 -0
- package/src/support-passport/mcp-tools.ts +187 -0
- package/src/support-passport/model-adapter.test.ts +840 -0
- package/src/support-passport/model-adapter.ts +602 -0
- package/src/support-passport/model-audit-pinned-write.test.ts +59 -0
- package/src/support-passport/model-audit.ts +152 -0
- package/src/support-passport/model-bridge.test.ts +456 -0
- package/src/support-passport/model-bridge.ts +439 -0
- package/src/support-passport/model-contracts.ts +124 -0
- package/src/support-passport/model-service.test.ts +1731 -0
- package/src/support-passport/model-service.ts +399 -0
- package/src/support-passport/offline-sync-guard.ts +230 -0
- package/src/support-passport/owner-http.test.ts +671 -0
- package/src/support-passport/owner-lock.ts +70 -0
- package/src/support-passport/private-file.test.ts +99 -0
- package/src/support-passport/private-file.ts +498 -0
- package/src/support-passport/public-http.test.ts +476 -0
- package/src/support-passport/public-http.ts +601 -0
- package/src/support-passport/ui.test.ts +181 -0
- package/src/tier-routing.ts +28 -17
- package/src/training-export/converter.test.ts +24 -0
- package/src/training-export/converter.ts +2 -0
- package/src/types.ts +8 -1
- package/src/wearables/service.test.ts +13 -0
- package/src/wearables/service.ts +2 -0
- package/src/write-rate-limiter.test.ts +30 -6
- package/src/write-rate-limiter.ts +29 -18
- package/dist/chunk-3CSX3ETE.js.map +0 -1
- package/dist/chunk-47P3RYZP.js.map +0 -1
- package/dist/chunk-6LAPLZOS.js.map +0 -1
- package/dist/chunk-6R4G7N4S.js.map +0 -1
- package/dist/chunk-7BZOBA5J.js.map +0 -1
- package/dist/chunk-C23BYTJV.js.map +0 -1
- package/dist/chunk-CYF6WVE7.js.map +0 -1
- package/dist/chunk-G2LUMAUF.js.map +0 -1
- package/dist/chunk-GYPQL6XN.js.map +0 -1
- package/dist/chunk-JDZPNCMA.js.map +0 -1
- package/dist/chunk-JV5YUBIZ.js.map +0 -1
- package/dist/chunk-K4QS7LXU.js.map +0 -1
- package/dist/chunk-L6CQ7WIW.js.map +0 -1
- package/dist/chunk-MKQBXQKU.js.map +0 -1
- package/dist/chunk-NH5IR2WM.js.map +0 -1
- package/dist/chunk-PX2LSHYM.js.map +0 -1
- package/dist/chunk-QWGE2PUH.js.map +0 -1
- package/dist/chunk-RUMNY5DT.js.map +0 -1
- package/dist/chunk-S75M5ZRK.js.map +0 -1
- package/dist/chunk-T2JHZWH6.js.map +0 -1
- package/dist/chunk-UES4BHA2.js.map +0 -1
- package/dist/chunk-UTRO5UJU.js.map +0 -1
- package/dist/chunk-UU3G6GUP.js.map +0 -1
- package/dist/chunk-XUAMCLY4.js.map +0 -1
- package/dist/chunk-ZYLC7NFO.js.map +0 -1
- package/dist/contradiction-scan-HYLIRMJ2.js +0 -14
- package/dist/first-start-migration-626C5554.js.map +0 -1
- /package/dist/{auto-sync-TDHLZPVP.js.map → auto-sync-NR3GPCOA.js.map} +0 -0
- /package/dist/{chunk-LLJMAULE.js.map → chunk-2FKEIPIT.js.map} +0 -0
- /package/dist/{chunk-JBPKEARU.js.map → chunk-2QSZNTDO.js.map} +0 -0
- /package/dist/{chunk-PDDTI7IC.js.map → chunk-43SEBY2M.js.map} +0 -0
- /package/dist/{chunk-HWRD23DW.js.map → chunk-46SZBVDS.js.map} +0 -0
- /package/dist/{chunk-6HPHEFXT.js.map → chunk-5FD7JMTX.js.map} +0 -0
- /package/dist/{chunk-IBKR2TFR.js.map → chunk-6CYHUWCO.js.map} +0 -0
- /package/dist/{chunk-YN6ASZUG.js.map → chunk-6QPI2ITJ.js.map} +0 -0
- /package/dist/{chunk-NIS256NW.js.map → chunk-CIAI24TQ.js.map} +0 -0
- /package/dist/{chunk-7FGL6CGA.js.map → chunk-DVYRD4HY.js.map} +0 -0
- /package/dist/{chunk-G7Z6EENO.js.map → chunk-EKTP7MNS.js.map} +0 -0
- /package/dist/{chunk-RZ4XGKOJ.js.map → chunk-FFRTNF3L.js.map} +0 -0
- /package/dist/{chunk-VKXWK44Q.js.map → chunk-FONWBCVY.js.map} +0 -0
- /package/dist/{chunk-DZD576ZU.js.map → chunk-FPLM2TKD.js.map} +0 -0
- /package/dist/{chunk-ZPJ4QSGP.js.map → chunk-FTPONF6B.js.map} +0 -0
- /package/dist/{chunk-LJS7KUPV.js.map → chunk-FWX7W5PM.js.map} +0 -0
- /package/dist/{chunk-G4T7L557.js.map → chunk-GN3WRFJY.js.map} +0 -0
- /package/dist/{chunk-QT2FRYI4.js.map → chunk-H7NAZ3UB.js.map} +0 -0
- /package/dist/{chunk-APPFNGX6.js.map → chunk-HBUFQRIM.js.map} +0 -0
- /package/dist/{chunk-UU7TRFNE.js.map → chunk-HGJ6NJ4E.js.map} +0 -0
- /package/dist/{chunk-C4ZNGVK3.js.map → chunk-IKP5OYQQ.js.map} +0 -0
- /package/dist/{chunk-KQAFEZQX.js.map → chunk-IPLYGWQF.js.map} +0 -0
- /package/dist/{chunk-RDJRFDJY.js.map → chunk-IQ4NVWEF.js.map} +0 -0
- /package/dist/{chunk-CGVHPCP2.js.map → chunk-JYG4OLWH.js.map} +0 -0
- /package/dist/{chunk-WOPA3SGI.js.map → chunk-K26NWEOC.js.map} +0 -0
- /package/dist/{chunk-G7A5HLUS.js.map → chunk-KJH6W2I7.js.map} +0 -0
- /package/dist/{chunk-HOIRB77A.js.map → chunk-L6Z5OAS4.js.map} +0 -0
- /package/dist/{chunk-227UFSEQ.js.map → chunk-LEPOP46W.js.map} +0 -0
- /package/dist/{chunk-3JLPGJ43.js.map → chunk-MIH3CJPN.js.map} +0 -0
- /package/dist/{chunk-QHFV6VNU.js.map → chunk-MK5VEWCR.js.map} +0 -0
- /package/dist/{chunk-GUKBW4HL.js.map → chunk-NQMSEB5D.js.map} +0 -0
- /package/dist/{chunk-WRJVB3C2.js.map → chunk-PO7NXBG2.js.map} +0 -0
- /package/dist/{chunk-AZM4CCAC.js.map → chunk-QZLDRQ4I.js.map} +0 -0
- /package/dist/{chunk-THPPCISA.js.map → chunk-RBII7637.js.map} +0 -0
- /package/dist/{chunk-VMMQDEN5.js.map → chunk-TO7ZTWJW.js.map} +0 -0
- /package/dist/{chunk-K2TDK7GG.js.map → chunk-TWTUGCTY.js.map} +0 -0
- /package/dist/{chunk-HLYR2TQL.js.map → chunk-UCTS3DDH.js.map} +0 -0
- /package/dist/{chunk-JYIJNNN3.js.map → chunk-UG6VXIOK.js.map} +0 -0
- /package/dist/{chunk-WM65LU67.js.map → chunk-UKYS3NU5.js.map} +0 -0
- /package/dist/{chunk-WDBX6VER.js.map → chunk-UPLZNJKN.js.map} +0 -0
- /package/dist/{chunk-2GFK22OZ.js.map → chunk-V6ERBR7U.js.map} +0 -0
- /package/dist/{chunk-ZMYDYNI4.js.map → chunk-XZHE2DEN.js.map} +0 -0
- /package/dist/{chunk-MAXVH44E.js.map → chunk-Z54EM5YZ.js.map} +0 -0
- /package/dist/{chunk-YGLY6QFV.js.map → chunk-ZRZVLB7O.js.map} +0 -0
- /package/dist/{chunk-4IIFL7GC.js.map → chunk-ZUKIUXHQ.js.map} +0 -0
- /package/dist/{contradiction-scan-HYLIRMJ2.js.map → contradiction-scan-JDTBXRGW.js.map} +0 -0
- /package/dist/{purge-533FZLS4.js.map → purge-GB7PZHT2.js.map} +0 -0
|
@@ -27,13 +27,37 @@
|
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
29
|
import path from "node:path";
|
|
30
|
+
import { resolveNamespaceCapabilities } from "../capabilities.js";
|
|
31
|
+
import type { StorageManager } from "../index.js";
|
|
30
32
|
import { log } from "../logger.js";
|
|
31
|
-
import { isPathInsideStorageRoot } from "../storage-paths.js";
|
|
32
33
|
import { namespaceIdentityFromToken } from "../namespaces/identity.js";
|
|
33
|
-
import {
|
|
34
|
+
import { normalizeQmdResultPath } from "../namespaces/search.js";
|
|
34
35
|
import { SecureStoreLockedError } from "../secure-store/index.js";
|
|
35
|
-
import
|
|
36
|
-
import
|
|
36
|
+
import { isPathInsideStorageRoot } from "../storage-paths.js";
|
|
37
|
+
import { isSupportPassportPrivateMemory } from "../support-passport/card-projection.js";
|
|
38
|
+
import type { MemoryFile, PluginConfig, QmdSearchResult } from "../types.js";
|
|
39
|
+
import { ALL_CATEGORY_DIRS } from "../utils/category-dir.js";
|
|
40
|
+
|
|
41
|
+
const INTERNAL_QMD_ROOTS = new Set([
|
|
42
|
+
...ALL_CATEGORY_DIRS,
|
|
43
|
+
"activity",
|
|
44
|
+
"archive",
|
|
45
|
+
"artifacts",
|
|
46
|
+
"cold",
|
|
47
|
+
"config",
|
|
48
|
+
"entities",
|
|
49
|
+
"identity",
|
|
50
|
+
"meetings",
|
|
51
|
+
"namespaces",
|
|
52
|
+
"state",
|
|
53
|
+
"summaries",
|
|
54
|
+
"transcripts",
|
|
55
|
+
"wearables",
|
|
56
|
+
"work",
|
|
57
|
+
"workspace",
|
|
58
|
+
]);
|
|
59
|
+
|
|
60
|
+
const PRIVATE_RESULT_RESOLUTION_CONCURRENCY = 16;
|
|
37
61
|
|
|
38
62
|
/**
|
|
39
63
|
* Split a relative QMD result path into its collection prefix and the
|
|
@@ -45,6 +69,18 @@ export function qmdCollectionPathParts(resultPath: string): {
|
|
|
45
69
|
relativePath: string;
|
|
46
70
|
} | null {
|
|
47
71
|
if (!resultPath || path.isAbsolute(resultPath)) return null;
|
|
72
|
+
if (resultPath.trim().startsWith("qmd://")) {
|
|
73
|
+
try {
|
|
74
|
+
const parsed = new URL(resultPath.trim());
|
|
75
|
+
if (parsed.protocol !== "qmd:" || !parsed.hostname) return null;
|
|
76
|
+
const collection = parsed.hostname;
|
|
77
|
+
const relativePath = normalizeQmdResultPath(resultPath, collection).replace(/\\/g, "/").replace(/^\/+/, "");
|
|
78
|
+
if (!relativePath) return null;
|
|
79
|
+
return { collection, relativePath };
|
|
80
|
+
} catch {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
48
84
|
const normalized = resultPath.replace(/\\/g, "/").replace(/^\/+/, "");
|
|
49
85
|
const slashIndex = normalized.indexOf("/");
|
|
50
86
|
if (slashIndex <= 0 || slashIndex >= normalized.length - 1) return null;
|
|
@@ -61,10 +97,7 @@ export function qmdCollectionPathParts(resultPath: string): {
|
|
|
61
97
|
* constrained to the storage root so a result path can never escape the
|
|
62
98
|
* namespace directory.
|
|
63
99
|
*/
|
|
64
|
-
export function qmdResultPathCandidates(
|
|
65
|
-
storageDir: string,
|
|
66
|
-
resultPath: string,
|
|
67
|
-
): string[] {
|
|
100
|
+
export function qmdResultPathCandidates(storageDir: string, resultPath: string): string[] {
|
|
68
101
|
const candidates = new Set<string>();
|
|
69
102
|
const storageRoot = path.resolve(storageDir);
|
|
70
103
|
const addCandidate = (candidate: string) => {
|
|
@@ -122,25 +155,20 @@ export class QmdResultResolver {
|
|
|
122
155
|
private readonly getConfig: () => PluginConfig;
|
|
123
156
|
private readonly storageFor: (namespace: string) => Promise<StorageManager>;
|
|
124
157
|
private readonly storageDirNamespace: (storageDir: string) => string;
|
|
125
|
-
private readonly qmdCollectionNamespaceFromPrefix: (
|
|
126
|
-
collectionPrefix: string,
|
|
127
|
-
) => string | null;
|
|
158
|
+
private readonly qmdCollectionNamespaceFromPrefix: (collectionPrefix: string) => string | null;
|
|
128
159
|
private readonly namespaceFromPath: (p: string) => string;
|
|
129
160
|
|
|
130
161
|
constructor(options: {
|
|
131
162
|
getConfig: () => PluginConfig;
|
|
132
163
|
storageFor: (namespace: string) => Promise<StorageManager>;
|
|
133
164
|
storageDirNamespace: (storageDir: string) => string;
|
|
134
|
-
qmdCollectionNamespaceFromPrefix: (
|
|
135
|
-
collectionPrefix: string,
|
|
136
|
-
) => string | null;
|
|
165
|
+
qmdCollectionNamespaceFromPrefix: (collectionPrefix: string) => string | null;
|
|
137
166
|
namespaceFromPath: (p: string) => string;
|
|
138
167
|
}) {
|
|
139
168
|
this.getConfig = options.getConfig;
|
|
140
169
|
this.storageFor = options.storageFor;
|
|
141
170
|
this.storageDirNamespace = options.storageDirNamespace;
|
|
142
|
-
this.qmdCollectionNamespaceFromPrefix =
|
|
143
|
-
options.qmdCollectionNamespaceFromPrefix;
|
|
171
|
+
this.qmdCollectionNamespaceFromPrefix = options.qmdCollectionNamespaceFromPrefix;
|
|
144
172
|
this.namespaceFromPath = options.namespaceFromPath;
|
|
145
173
|
}
|
|
146
174
|
|
|
@@ -148,29 +176,29 @@ export class QmdResultResolver {
|
|
|
148
176
|
resultPath: string,
|
|
149
177
|
fallbackStorage: StorageManager,
|
|
150
178
|
recallNamespaces: readonly string[] = [],
|
|
151
|
-
preferredNamespace?: string
|
|
179
|
+
preferredNamespace?: string
|
|
152
180
|
): Promise<MemoryFile | null> {
|
|
153
181
|
const parts = qmdCollectionPathParts(resultPath);
|
|
154
182
|
const fallbackStorageDir = storageDirOrNull(fallbackStorage);
|
|
155
183
|
const config = this.getConfig();
|
|
156
184
|
const coldCollection = config.qmdColdCollection ?? "openclaw-engram-cold";
|
|
185
|
+
const fallbackResultPath =
|
|
186
|
+
resultPath.trim().startsWith("qmd://") && parts?.collection === config.qmdCollection
|
|
187
|
+
? parts.relativePath
|
|
188
|
+
: resultPath;
|
|
157
189
|
if (parts && parts.collection === coldCollection) {
|
|
158
190
|
const storages: StorageManager[] = [];
|
|
159
191
|
const seenStorageDirs = new Set<string>();
|
|
160
192
|
const addStorage = (storage: StorageManager): void => {
|
|
161
193
|
const storageDir = storageDirOrNull(storage);
|
|
162
|
-
const storageKey = storageDir
|
|
163
|
-
? path.resolve(storageDir)
|
|
164
|
-
: `storage-without-dir-${storages.length}`;
|
|
194
|
+
const storageKey = storageDir ? path.resolve(storageDir) : `storage-without-dir-${storages.length}`;
|
|
165
195
|
if (seenStorageDirs.has(storageKey)) return;
|
|
166
196
|
seenStorageDirs.add(storageKey);
|
|
167
197
|
storages.push(storage);
|
|
168
198
|
};
|
|
169
199
|
|
|
170
200
|
const fallbackNamespace =
|
|
171
|
-
fallbackStorageDir !== null
|
|
172
|
-
? this.storageDirNamespace(fallbackStorageDir)
|
|
173
|
-
: config.defaultNamespace;
|
|
201
|
+
fallbackStorageDir !== null ? this.storageDirNamespace(fallbackStorageDir) : config.defaultNamespace;
|
|
174
202
|
if (
|
|
175
203
|
recallNamespaces.length === 0 ||
|
|
176
204
|
!resolveNamespaceCapabilities(config).namespaces ||
|
|
@@ -202,10 +230,7 @@ export class QmdResultResolver {
|
|
|
202
230
|
}
|
|
203
231
|
try {
|
|
204
232
|
const coldRoot = path.join(storageDir, "cold");
|
|
205
|
-
for (const candidate of qmdResultPathCandidates(
|
|
206
|
-
coldRoot,
|
|
207
|
-
parts.relativePath,
|
|
208
|
-
)) {
|
|
233
|
+
for (const candidate of qmdResultPathCandidates(coldRoot, parts.relativePath)) {
|
|
209
234
|
const memory = await storage.readMemoryByPath(candidate);
|
|
210
235
|
if (memory) return memory;
|
|
211
236
|
}
|
|
@@ -220,17 +245,12 @@ export class QmdResultResolver {
|
|
|
220
245
|
}
|
|
221
246
|
return null;
|
|
222
247
|
}
|
|
223
|
-
const collectionNamespace = parts
|
|
224
|
-
? this.qmdCollectionNamespaceFromPrefix(parts.collection)
|
|
225
|
-
: null;
|
|
248
|
+
const collectionNamespace = parts ? this.qmdCollectionNamespaceFromPrefix(parts.collection) : null;
|
|
226
249
|
|
|
227
250
|
if (parts && collectionNamespace) {
|
|
228
251
|
try {
|
|
229
252
|
const collectionStorage = await this.storageFor(collectionNamespace);
|
|
230
|
-
for (const candidate of qmdResultPathCandidates(
|
|
231
|
-
collectionStorage.dir,
|
|
232
|
-
parts.relativePath,
|
|
233
|
-
)) {
|
|
253
|
+
for (const candidate of qmdResultPathCandidates(collectionStorage.dir, parts.relativePath)) {
|
|
234
254
|
const memory = await collectionStorage.readMemoryByPath(candidate);
|
|
235
255
|
if (memory) return memory;
|
|
236
256
|
}
|
|
@@ -249,10 +269,7 @@ export class QmdResultResolver {
|
|
|
249
269
|
if (preferredNamespace) {
|
|
250
270
|
try {
|
|
251
271
|
const preferredStorage = await this.storageFor(preferredNamespace);
|
|
252
|
-
for (const candidate of qmdResultPathCandidates(
|
|
253
|
-
preferredStorage.dir,
|
|
254
|
-
resultPath,
|
|
255
|
-
)) {
|
|
272
|
+
for (const candidate of qmdResultPathCandidates(preferredStorage.dir, fallbackResultPath)) {
|
|
256
273
|
const memory = await preferredStorage.readMemoryByPath(candidate);
|
|
257
274
|
if (memory) return memory;
|
|
258
275
|
}
|
|
@@ -269,22 +286,19 @@ export class QmdResultResolver {
|
|
|
269
286
|
// is stale/deleted — do NOT fall through to the default store and validate
|
|
270
287
|
// a same-relative-path memory from the wrong namespace (#2020). Absolute
|
|
271
288
|
// paths still fall through: the absolute branch resolves the true owner.
|
|
272
|
-
if (!path.isAbsolute(
|
|
289
|
+
if (!path.isAbsolute(fallbackResultPath)) return null;
|
|
273
290
|
}
|
|
274
|
-
if (path.isAbsolute(
|
|
291
|
+
if (path.isAbsolute(fallbackResultPath)) {
|
|
275
292
|
if (!fallbackStorageDir) {
|
|
276
|
-
return await fallbackStorage.readMemoryByPath(
|
|
293
|
+
return await fallbackStorage.readMemoryByPath(fallbackResultPath);
|
|
277
294
|
}
|
|
278
295
|
const ownerStorage = await this.storageForAbsoluteQmdResultPath(
|
|
279
|
-
|
|
296
|
+
fallbackResultPath,
|
|
280
297
|
fallbackStorage,
|
|
281
|
-
recallNamespaces
|
|
298
|
+
recallNamespaces
|
|
282
299
|
);
|
|
283
300
|
if (!ownerStorage) return null;
|
|
284
|
-
for (const candidate of qmdResultPathCandidates(
|
|
285
|
-
ownerStorage.dir,
|
|
286
|
-
resultPath,
|
|
287
|
-
)) {
|
|
301
|
+
for (const candidate of qmdResultPathCandidates(ownerStorage.dir, fallbackResultPath)) {
|
|
288
302
|
const memory = await ownerStorage.storage.readMemoryByPath(candidate);
|
|
289
303
|
if (memory) return memory;
|
|
290
304
|
}
|
|
@@ -292,46 +306,101 @@ export class QmdResultResolver {
|
|
|
292
306
|
}
|
|
293
307
|
|
|
294
308
|
if (!fallbackStorageDir) {
|
|
295
|
-
return await fallbackStorage.readMemoryByPath(
|
|
309
|
+
return await fallbackStorage.readMemoryByPath(fallbackResultPath);
|
|
296
310
|
}
|
|
297
|
-
for (const candidate of qmdResultPathCandidates(
|
|
298
|
-
fallbackStorageDir,
|
|
299
|
-
resultPath,
|
|
300
|
-
)) {
|
|
311
|
+
for (const candidate of qmdResultPathCandidates(fallbackStorageDir, fallbackResultPath)) {
|
|
301
312
|
const memory = await fallbackStorage.readMemoryByPath(candidate);
|
|
302
313
|
if (memory) return memory;
|
|
303
314
|
}
|
|
304
315
|
return null;
|
|
305
316
|
}
|
|
306
317
|
|
|
318
|
+
async filterPrivateSearchResults(
|
|
319
|
+
results: QmdSearchResult[],
|
|
320
|
+
fallbackStorage: StorageManager,
|
|
321
|
+
namespaces: readonly string[] = [],
|
|
322
|
+
preserveUnresolved = false,
|
|
323
|
+
visibilityCache = new Map<string, boolean>()
|
|
324
|
+
): Promise<QmdSearchResult[]> {
|
|
325
|
+
const namespaceKey = namespaces.join("\0");
|
|
326
|
+
const entries = results
|
|
327
|
+
.filter((result) => Boolean(result.path))
|
|
328
|
+
.map((result) => ({
|
|
329
|
+
result,
|
|
330
|
+
cacheKey: `${namespaceKey}\0${preserveUnresolved ? "1" : "0"}\0${result.namespace ?? ""}\0${result.path}`,
|
|
331
|
+
}));
|
|
332
|
+
const pending = new Map<string, QmdSearchResult>();
|
|
333
|
+
for (const { result, cacheKey } of entries) {
|
|
334
|
+
if (!visibilityCache.has(cacheKey)) pending.set(cacheKey, result);
|
|
335
|
+
}
|
|
336
|
+
const unresolved = [...pending];
|
|
337
|
+
for (let offset = 0; offset < unresolved.length; offset += PRIVATE_RESULT_RESOLUTION_CONCURRENCY) {
|
|
338
|
+
await Promise.all(
|
|
339
|
+
unresolved.slice(offset, offset + PRIVATE_RESULT_RESOLUTION_CONCURRENCY).map(async ([cacheKey, result]) => {
|
|
340
|
+
visibilityCache.set(
|
|
341
|
+
cacheKey,
|
|
342
|
+
await this.isVisibleSearchResult(result, fallbackStorage, namespaces, preserveUnresolved)
|
|
343
|
+
);
|
|
344
|
+
})
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
return entries.filter(({ cacheKey }) => visibilityCache.get(cacheKey) === true).map(({ result }) => result);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
private async isVisibleSearchResult(
|
|
351
|
+
result: QmdSearchResult,
|
|
352
|
+
fallbackStorage: StorageManager,
|
|
353
|
+
namespaces: readonly string[],
|
|
354
|
+
preserveUnresolved: boolean
|
|
355
|
+
): Promise<boolean> {
|
|
356
|
+
const parts = qmdCollectionPathParts(result.path);
|
|
357
|
+
const config = this.getConfig();
|
|
358
|
+
const collectionIsKnownInternal = parts !== null && INTERNAL_QMD_ROOTS.has(parts.collection);
|
|
359
|
+
const collectionIsConfigured =
|
|
360
|
+
parts !== null &&
|
|
361
|
+
(parts.collection === config.qmdCollection ||
|
|
362
|
+
parts.collection === (config.qmdColdCollection ?? "openclaw-engram-cold") ||
|
|
363
|
+
this.qmdCollectionNamespaceFromPrefix(parts.collection) !== null);
|
|
364
|
+
let memory = await this.readQmdResultMemory(result.path, fallbackStorage, namespaces, result.namespace);
|
|
365
|
+
if (!memory && parts && !collectionIsKnownInternal && !collectionIsConfigured) {
|
|
366
|
+
memory = await this.readQmdResultMemory(parts.relativePath, fallbackStorage, namespaces, result.namespace);
|
|
367
|
+
}
|
|
368
|
+
const absoluteInsideMemoryRoot =
|
|
369
|
+
path.isAbsolute(result.path) &&
|
|
370
|
+
isPathInsideStorageRoot(path.resolve(config.memoryDir), path.resolve(result.path));
|
|
371
|
+
const hasExplicitQmdCollection = result.path.trim().startsWith("qmd://");
|
|
372
|
+
const unresolvedInternalPath =
|
|
373
|
+
!memory &&
|
|
374
|
+
(absoluteInsideMemoryRoot ||
|
|
375
|
+
(collectionIsKnownInternal && (!preserveUnresolved || hasExplicitQmdCollection)) ||
|
|
376
|
+
(hasExplicitQmdCollection && collectionIsConfigured));
|
|
377
|
+
const unresolvedExternalCollection =
|
|
378
|
+
!memory &&
|
|
379
|
+
((parts !== null && !collectionIsKnownInternal && !collectionIsConfigured) ||
|
|
380
|
+
(path.isAbsolute(result.path) &&
|
|
381
|
+
!isPathInsideStorageRoot(path.resolve(config.memoryDir), path.resolve(result.path))));
|
|
382
|
+
return (
|
|
383
|
+
(memory !== null && !isSupportPassportPrivateMemory(memory)) ||
|
|
384
|
+
(!memory && !unresolvedInternalPath && (preserveUnresolved || unresolvedExternalCollection))
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
|
|
307
388
|
async resolveColdQmdResultForRecall(
|
|
308
389
|
result: QmdSearchResult,
|
|
309
390
|
fallbackStorage: StorageManager,
|
|
310
|
-
recallNamespaces: readonly string[] = []
|
|
391
|
+
recallNamespaces: readonly string[] = []
|
|
311
392
|
): Promise<{ namespace: string; result: QmdSearchResult } | null> {
|
|
312
|
-
const memory = await this.readQmdResultMemory(
|
|
313
|
-
result.path,
|
|
314
|
-
fallbackStorage,
|
|
315
|
-
recallNamespaces,
|
|
316
|
-
result.namespace,
|
|
317
|
-
);
|
|
393
|
+
const memory = await this.readQmdResultMemory(result.path, fallbackStorage, recallNamespaces, result.namespace);
|
|
318
394
|
if (!memory) return null;
|
|
319
395
|
|
|
320
396
|
let ownerNamespace: string | null = null;
|
|
321
397
|
if (path.isAbsolute(memory.path)) {
|
|
322
|
-
const ownerStorage = await this.storageForAbsoluteQmdResultPath(
|
|
323
|
-
memory.path,
|
|
324
|
-
fallbackStorage,
|
|
325
|
-
recallNamespaces,
|
|
326
|
-
);
|
|
398
|
+
const ownerStorage = await this.storageForAbsoluteQmdResultPath(memory.path, fallbackStorage, recallNamespaces);
|
|
327
399
|
ownerNamespace = ownerStorage?.namespace ?? null;
|
|
328
400
|
if (!ownerNamespace && resolveNamespaceCapabilities(this.getConfig()).namespaces) return null;
|
|
329
401
|
}
|
|
330
402
|
ownerNamespace ??= this.namespaceFromPath(memory.path);
|
|
331
|
-
if (
|
|
332
|
-
recallNamespaces.length > 0 &&
|
|
333
|
-
!recallNamespaces.includes(ownerNamespace)
|
|
334
|
-
) {
|
|
403
|
+
if (recallNamespaces.length > 0 && !recallNamespaces.includes(ownerNamespace)) {
|
|
335
404
|
return null;
|
|
336
405
|
}
|
|
337
406
|
|
|
@@ -349,7 +418,7 @@ export class QmdResultResolver {
|
|
|
349
418
|
async storageForAbsoluteQmdResultPath(
|
|
350
419
|
resultPath: string,
|
|
351
420
|
fallbackStorage: StorageManager,
|
|
352
|
-
recallNamespaces: readonly string[] = []
|
|
421
|
+
recallNamespaces: readonly string[] = []
|
|
353
422
|
): Promise<{ storage: StorageManager; dir: string; namespace: string } | null> {
|
|
354
423
|
const resolvedPath = path.resolve(resultPath);
|
|
355
424
|
const config = this.getConfig();
|
|
@@ -365,10 +434,7 @@ export class QmdResultResolver {
|
|
|
365
434
|
const candidateRoot = path.resolve(storageDir);
|
|
366
435
|
if (seenDirs.has(candidateRoot)) return;
|
|
367
436
|
if (!isPathInsideStorageRoot(candidateRoot, resolvedPath)) return;
|
|
368
|
-
if (
|
|
369
|
-
candidateRoot === memoryRoot &&
|
|
370
|
-
isPathInsideStorageRoot(namespacesRoot, resolvedPath)
|
|
371
|
-
) {
|
|
437
|
+
if (candidateRoot === memoryRoot && isPathInsideStorageRoot(namespacesRoot, resolvedPath)) {
|
|
372
438
|
return;
|
|
373
439
|
}
|
|
374
440
|
seenDirs.add(candidateRoot);
|
|
@@ -376,9 +442,7 @@ export class QmdResultResolver {
|
|
|
376
442
|
};
|
|
377
443
|
|
|
378
444
|
const fallbackNamespace =
|
|
379
|
-
fallbackStorageDir !== null
|
|
380
|
-
? this.storageDirNamespace(fallbackStorageDir)
|
|
381
|
-
: config.defaultNamespace;
|
|
445
|
+
fallbackStorageDir !== null ? this.storageDirNamespace(fallbackStorageDir) : config.defaultNamespace;
|
|
382
446
|
maybeAddStorage(fallbackStorage, fallbackNamespace);
|
|
383
447
|
|
|
384
448
|
const candidateNamespaces = new Set<string>();
|
|
@@ -391,9 +455,7 @@ export class QmdResultResolver {
|
|
|
391
455
|
const relativeToNamespaces = path.relative(namespacesRoot, resolvedPath);
|
|
392
456
|
const [namespaceSegment] = relativeToNamespaces.split(/[\\/]/);
|
|
393
457
|
if (namespaceSegment) {
|
|
394
|
-
candidateNamespaces.add(
|
|
395
|
-
namespaceIdentityFromToken(namespaceSegment) ?? namespaceSegment,
|
|
396
|
-
);
|
|
458
|
+
candidateNamespaces.add(namespaceIdentityFromToken(namespaceSegment) ?? namespaceSegment);
|
|
397
459
|
}
|
|
398
460
|
}
|
|
399
461
|
for (const policy of config.namespacePolicies ?? []) {
|
|
@@ -404,9 +466,7 @@ export class QmdResultResolver {
|
|
|
404
466
|
if (!ns) continue;
|
|
405
467
|
try {
|
|
406
468
|
maybeAddStorage(await this.storageFor(ns), ns);
|
|
407
|
-
} catch {
|
|
408
|
-
continue;
|
|
409
|
-
}
|
|
469
|
+
} catch {}
|
|
410
470
|
}
|
|
411
471
|
|
|
412
472
|
matches.sort((a, b) => b.dir.length - a.dir.length);
|
|
@@ -108,6 +108,47 @@ test("recall safety derives sourceConnector exclusively from the hydrated memory
|
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
+
test("recall safety keeps support passport records out of generic recall", async () => {
|
|
112
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-passport-recall-"));
|
|
113
|
+
try {
|
|
114
|
+
const coordinator = await makeCoordinator(memoryDir);
|
|
115
|
+
const card = {
|
|
116
|
+
path: "preferences/support-card.md",
|
|
117
|
+
content: "Give me time to answer.",
|
|
118
|
+
frontmatter: {
|
|
119
|
+
status: "active",
|
|
120
|
+
tags: ["support-passport-card"],
|
|
121
|
+
created: "2026-07-19T00:00:00.000Z",
|
|
122
|
+
updated: "2026-07-19T00:00:00.000Z",
|
|
123
|
+
},
|
|
124
|
+
} as unknown as MemoryFile;
|
|
125
|
+
const audit = {
|
|
126
|
+
path: "corrections/support-card-audit.md",
|
|
127
|
+
content: "Superseded: Give me time to answer.",
|
|
128
|
+
frontmatter: {
|
|
129
|
+
status: "active",
|
|
130
|
+
tags: ["support-passport-audit"],
|
|
131
|
+
created: "2026-07-19T00:00:00.000Z",
|
|
132
|
+
updated: "2026-07-19T00:00:00.000Z",
|
|
133
|
+
},
|
|
134
|
+
} as unknown as MemoryFile;
|
|
135
|
+
const candidates = [result("default", card.path), result("default", audit.path)];
|
|
136
|
+
const memoryByPath = new Map([
|
|
137
|
+
[`default\0${card.path}`, card],
|
|
138
|
+
[`default\0${audit.path}`, audit],
|
|
139
|
+
]);
|
|
140
|
+
|
|
141
|
+
assert.deepEqual(coordinator.filterSearchResultsByRecallSafety(candidates, memoryByPath), []);
|
|
142
|
+
assert.deepEqual(
|
|
143
|
+
coordinator.filterSearchResultsByRecallSafety(candidates, memoryByPath, { allowDedicatedSurface: true }),
|
|
144
|
+
[],
|
|
145
|
+
"a generic-recall override must not disclose owner-controlled support records",
|
|
146
|
+
);
|
|
147
|
+
} finally {
|
|
148
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
|
|
111
152
|
test("recall safety partitions tool-scoped memories by requesting connector", async () => {
|
|
112
153
|
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-connector-partition-"));
|
|
113
154
|
try {
|
|
@@ -70,6 +70,7 @@ import {
|
|
|
70
70
|
} from "../orchestrator.js";
|
|
71
71
|
import { isActivityDigestPath } from "./orchestrator-helpers.js";
|
|
72
72
|
import { isGenericRecallExcludedPath, isTopLevelArchivePath } from "./generic-recall-paths.js";
|
|
73
|
+
import { isSupportPassportPrivateMemory } from "../support-passport/card-projection.js";
|
|
73
74
|
|
|
74
75
|
export interface RecallSearchPipelineDeps {
|
|
75
76
|
applyMemoryWorthRerank(
|
|
@@ -1091,6 +1092,7 @@ export class RecallSearchPipelineCoordinator {
|
|
|
1091
1092
|
let forgottenFilteredCount = 0;
|
|
1092
1093
|
let blockedPathFilteredCount = 0;
|
|
1093
1094
|
let connectorPartitionFilteredCount = 0;
|
|
1095
|
+
let supportPassportFilteredCount = 0;
|
|
1094
1096
|
const filtered: QmdSearchResult[] = [];
|
|
1095
1097
|
for (const r of results) {
|
|
1096
1098
|
if (options?.blockedPaths && resultHasKey(options.blockedPaths, r)) {
|
|
@@ -1127,6 +1129,11 @@ export class RecallSearchPipelineCoordinator {
|
|
|
1127
1129
|
continue;
|
|
1128
1130
|
}
|
|
1129
1131
|
|
|
1132
|
+
if (isSupportPassportPrivateMemory(memory)) {
|
|
1133
|
+
supportPassportFilteredCount += 1;
|
|
1134
|
+
continue;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1130
1137
|
if (
|
|
1131
1138
|
options?.allowLifecycleFiltered !== true &&
|
|
1132
1139
|
shouldFilterLifecycleRecallCandidate(memory.frontmatter, {
|
|
@@ -1223,6 +1230,11 @@ export class RecallSearchPipelineCoordinator {
|
|
|
1223
1230
|
`connector partition filter removed ${connectorPartitionFilteredCount} tool-scoped candidates from recall`,
|
|
1224
1231
|
);
|
|
1225
1232
|
}
|
|
1233
|
+
if (supportPassportFilteredCount > 0) {
|
|
1234
|
+
log.debug(
|
|
1235
|
+
`support passport filter removed ${supportPassportFilteredCount} owner-controlled records from generic recall`,
|
|
1236
|
+
);
|
|
1237
|
+
}
|
|
1226
1238
|
if (lifecycleFilteredCount > 0) {
|
|
1227
1239
|
log.debug(
|
|
1228
1240
|
`lifecycle retrieval filter removed ${lifecycleFilteredCount} stale/archived candidates`,
|
|
@@ -51,6 +51,7 @@ import type { PluginConfig, MemoryFile, AgentPersonaModelConfig } from "../types
|
|
|
51
51
|
import { log } from "../logger.js";
|
|
52
52
|
import { composeMemoryEnvelope } from "../write-envelope.js";
|
|
53
53
|
import { resolveConversationContextCapabilities } from "../capabilities.js";
|
|
54
|
+
import { excludeSupportPassportPrivateMemories } from "../support-passport/card-projection.js";
|
|
54
55
|
|
|
55
56
|
/** Dependencies injected by the orchestrator. All stable references or
|
|
56
57
|
* live accessors. */
|
|
@@ -110,7 +111,7 @@ export class SemanticConsolidationCoordinator {
|
|
|
110
111
|
|
|
111
112
|
log.info("[semantic-consolidation] starting run");
|
|
112
113
|
|
|
113
|
-
const allMemories = await targetStorage.readAllMemories();
|
|
114
|
+
const allMemories = excludeSupportPassportPrivateMemories(await targetStorage.readAllMemories());
|
|
114
115
|
if (allMemories.length < 10) {
|
|
115
116
|
log.debug("[semantic-consolidation] too few memories, skipping");
|
|
116
117
|
return result;
|
|
@@ -19,28 +19,22 @@
|
|
|
19
19
|
|
|
20
20
|
import path from "node:path";
|
|
21
21
|
|
|
22
|
+
import { resolveQmdCapabilities } from "../capabilities.js";
|
|
23
|
+
import { type CompoundingEngine, defaultTierMigrationCycleBudget } from "../compounding/engine.js";
|
|
22
24
|
// StorageManager type comes from the package barrel (type-only) so this
|
|
23
25
|
// module does not add a direct storage.ts import (#1533 ratchet).
|
|
24
26
|
import type { StorageManager } from "../index.js";
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
import { log } from "../logger.js";
|
|
28
|
+
import type {
|
|
29
|
+
TierMigrationCycleSummary,
|
|
30
|
+
TierMigrationStatusSnapshot,
|
|
29
31
|
TierMigrationStatusStore,
|
|
30
|
-
type TierMigrationCycleSummary,
|
|
31
|
-
type TierMigrationStatusSnapshot,
|
|
32
32
|
} from "../recall-state.js";
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} from "../
|
|
37
|
-
import {
|
|
38
|
-
applyUtilityPromotionRuntimePolicy,
|
|
39
|
-
type UtilityRuntimeValues,
|
|
40
|
-
} from "../utility-runtime.js";
|
|
41
|
-
import type { PluginConfig, MemoryFile } from "../types.js";
|
|
42
|
-
import { log } from "../logger.js";
|
|
43
|
-
import { resolveQmdCapabilities } from "../capabilities.js";
|
|
33
|
+
import type { SearchBackend } from "../search/port.js";
|
|
34
|
+
import { TierMigrationExecutor } from "../tier-migration.js";
|
|
35
|
+
import { type MemoryTier, decideTierTransition } from "../tier-routing.js";
|
|
36
|
+
import type { MemoryFile, PluginConfig } from "../types.js";
|
|
37
|
+
import { type UtilityRuntimeValues, applyUtilityPromotionRuntimePolicy } from "../utility-runtime.js";
|
|
44
38
|
|
|
45
39
|
/** Dependencies injected by the orchestrator. All stable references or live
|
|
46
40
|
* accessors (the orchestrator reassigns `qmd` to NoopSearchBackend and
|
|
@@ -91,7 +85,7 @@ export class TierMigrationCoordinator {
|
|
|
91
85
|
dryRun?: boolean;
|
|
92
86
|
limitOverride?: number;
|
|
93
87
|
force?: boolean;
|
|
94
|
-
}
|
|
88
|
+
}
|
|
95
89
|
): Promise<TierMigrationCycleSummary> {
|
|
96
90
|
const { config, tierMigrationStatus } = this.deps;
|
|
97
91
|
const dryRun = options?.dryRun === true;
|
|
@@ -110,11 +104,7 @@ export class TierMigrationCoordinator {
|
|
|
110
104
|
if (persistSkipped) await tierMigrationStatus.recordCycle(skipped);
|
|
111
105
|
return skipped;
|
|
112
106
|
}
|
|
113
|
-
if (
|
|
114
|
-
trigger === "maintenance" &&
|
|
115
|
-
!resolveQmdCapabilities(config).qmdTierAutoBackfill &&
|
|
116
|
-
options?.force !== true
|
|
117
|
-
) {
|
|
107
|
+
if (trigger === "maintenance" && !resolveQmdCapabilities(config).qmdTierAutoBackfill && options?.force !== true) {
|
|
118
108
|
const skipped: TierMigrationCycleSummary = {
|
|
119
109
|
trigger,
|
|
120
110
|
scanned: 0,
|
|
@@ -147,15 +137,9 @@ export class TierMigrationCoordinator {
|
|
|
147
137
|
const budget =
|
|
148
138
|
this.deps.getCompounding()?.tierMigrationCycleBudget(budgetTrigger) ??
|
|
149
139
|
defaultTierMigrationCycleBudget(config, budgetTrigger);
|
|
150
|
-
const limit =
|
|
151
|
-
options?.limitOverride !== undefined
|
|
152
|
-
? Math.max(0, Math.floor(options.limitOverride))
|
|
153
|
-
: budget.limit;
|
|
140
|
+
const limit = options?.limitOverride !== undefined ? Math.max(0, Math.floor(options.limitOverride)) : budget.limit;
|
|
154
141
|
const nowMs = Date.now();
|
|
155
|
-
if (
|
|
156
|
-
options?.force !== true &&
|
|
157
|
-
nowMs - this.lastRunAtMs < budget.minIntervalMs
|
|
158
|
-
) {
|
|
142
|
+
if (options?.force !== true && nowMs - this.lastRunAtMs < budget.minIntervalMs) {
|
|
159
143
|
const skipped: TierMigrationCycleSummary = {
|
|
160
144
|
trigger,
|
|
161
145
|
scanned: 0,
|
|
@@ -177,28 +161,17 @@ export class TierMigrationCoordinator {
|
|
|
177
161
|
demotionValueThreshold: config.qmdTierDemotionValueThreshold,
|
|
178
162
|
promotionValueThreshold: config.qmdTierPromotionValueThreshold,
|
|
179
163
|
},
|
|
180
|
-
this.deps.getUtilityRuntimeValues()
|
|
164
|
+
this.deps.getUtilityRuntimeValues()
|
|
181
165
|
);
|
|
182
166
|
|
|
183
167
|
this.inFlight = true;
|
|
184
168
|
try {
|
|
185
|
-
const coldStorage = this.deps.createColdStorage(
|
|
186
|
-
|
|
187
|
-
);
|
|
188
|
-
const [hotMemories, coldMemories] = await Promise.all([
|
|
189
|
-
storage.readAllMemories(),
|
|
190
|
-
coldStorage.readAllMemories(),
|
|
191
|
-
]);
|
|
169
|
+
const coldStorage = this.deps.createColdStorage(path.join(storage.dir, "cold"));
|
|
170
|
+
const [hotMemories, coldMemories] = await Promise.all([storage.readAllMemories(), coldStorage.readAllMemories()]);
|
|
192
171
|
const now = new Date();
|
|
193
172
|
const scanLimit = Math.max(0, Math.floor(budget.scanLimit));
|
|
194
|
-
const hotScanLimit = Math.min(
|
|
195
|
-
|
|
196
|
-
Math.ceil(scanLimit * 0.75),
|
|
197
|
-
);
|
|
198
|
-
const coldScanLimit = Math.min(
|
|
199
|
-
coldMemories.length,
|
|
200
|
-
Math.max(0, scanLimit - hotScanLimit),
|
|
201
|
-
);
|
|
173
|
+
const hotScanLimit = Math.min(hotMemories.length, Math.ceil(scanLimit * 0.75));
|
|
174
|
+
const coldScanLimit = Math.min(coldMemories.length, Math.max(0, scanLimit - hotScanLimit));
|
|
202
175
|
const toTimestamp = (memory: MemoryFile): number =>
|
|
203
176
|
Date.parse(memory.frontmatter.updated ?? memory.frontmatter.created);
|
|
204
177
|
const hotCandidates = hotMemories
|
|
@@ -215,8 +188,7 @@ export class TierMigrationCoordinator {
|
|
|
215
188
|
storage,
|
|
216
189
|
qmd: this.deps.getQmd(),
|
|
217
190
|
hotCollection: config.qmdCollection,
|
|
218
|
-
coldCollection:
|
|
219
|
-
config.qmdColdCollection ?? `${config.qmdCollection}-cold`,
|
|
191
|
+
coldCollection: config.qmdColdCollection ?? `${config.qmdCollection}-cold`,
|
|
220
192
|
autoEmbed: resolveQmdCapabilities(config).qmdAutoEmbed,
|
|
221
193
|
});
|
|
222
194
|
|
|
@@ -225,12 +197,7 @@ export class TierMigrationCoordinator {
|
|
|
225
197
|
let demoted = 0;
|
|
226
198
|
for (const candidate of candidates) {
|
|
227
199
|
if (migrated >= limit) break;
|
|
228
|
-
const decision = decideTierTransition(
|
|
229
|
-
candidate.memory,
|
|
230
|
-
candidate.tier,
|
|
231
|
-
policy,
|
|
232
|
-
now,
|
|
233
|
-
);
|
|
200
|
+
const decision = decideTierTransition(candidate.memory, candidate.tier, policy, now);
|
|
234
201
|
if (!decision.changed) continue;
|
|
235
202
|
|
|
236
203
|
if (!dryRun) {
|
|
@@ -249,7 +216,7 @@ export class TierMigrationCoordinator {
|
|
|
249
216
|
|
|
250
217
|
if (!dryRun) this.lastRunAtMs = Date.now();
|
|
251
218
|
log.debug(
|
|
252
|
-
`tier migration cycle completed: trigger=${trigger} scanned=${candidates.length} migrated=${migrated} limit=${limit}${dryRun ? " dryRun=true" : ""}
|
|
219
|
+
`tier migration cycle completed: trigger=${trigger} scanned=${candidates.length} migrated=${migrated} limit=${limit}${dryRun ? " dryRun=true" : ""}`
|
|
253
220
|
);
|
|
254
221
|
const summary: TierMigrationCycleSummary = {
|
|
255
222
|
trigger,
|
|
@@ -1,9 +1,46 @@
|
|
|
1
1
|
import test from "node:test";
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
|
+
import { mkdtemp, mkdir, rm } from "node:fs/promises";
|
|
4
|
+
import os from "node:os";
|
|
3
5
|
import path from "node:path";
|
|
6
|
+
import { StorageManager } from "../storage.js";
|
|
4
7
|
import { WorkspaceOpsCoordinator, type WorkspaceOpsDeps } from "./workspace-ops.js";
|
|
5
8
|
import type { AccessTrackingEntry, PluginConfig } from "../types.js";
|
|
6
9
|
|
|
10
|
+
test("gatherTodayFacts excludes support passport cards from day-summary input", async () => {
|
|
11
|
+
const root = await mkdtemp(path.join(os.tmpdir(), "remnic-workspace-passport-"));
|
|
12
|
+
try {
|
|
13
|
+
await mkdir(root, { recursive: true });
|
|
14
|
+
const storage = new StorageManager(root);
|
|
15
|
+
await storage.writeMemory("preference", "Private support statement", {
|
|
16
|
+
tags: ["support-passport-card"],
|
|
17
|
+
source: "support-passport",
|
|
18
|
+
});
|
|
19
|
+
await storage.writeMemory("fact", "Public project update", {
|
|
20
|
+
source: "test",
|
|
21
|
+
});
|
|
22
|
+
const coordinator = new WorkspaceOpsCoordinator({
|
|
23
|
+
config: {
|
|
24
|
+
defaultNamespace: "default",
|
|
25
|
+
daySummaryTimezone: "UTC",
|
|
26
|
+
} as unknown as PluginConfig,
|
|
27
|
+
storageRouter: {
|
|
28
|
+
storageFor: async () => storage,
|
|
29
|
+
},
|
|
30
|
+
} as unknown as WorkspaceOpsDeps);
|
|
31
|
+
|
|
32
|
+
const gathered = await coordinator.gatherTodayFacts(undefined, {
|
|
33
|
+
now: new Date(),
|
|
34
|
+
timeZone: "UTC",
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
assert.equal(gathered.includes("Private support statement"), false);
|
|
38
|
+
assert.equal(gathered.includes("Public project update"), true);
|
|
39
|
+
} finally {
|
|
40
|
+
await rm(root, { recursive: true, force: true });
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
7
44
|
test("flushAccessTracking keeps duplicate memory IDs scoped by memory path", async () => {
|
|
8
45
|
const defaultPath = path.join("/memory", "namespaces", "default", "facts", "same-id.md");
|
|
9
46
|
const sharedPath = path.join("/memory", "namespaces", "shared", "facts", "same-id.md");
|