@remnic/core 9.54.3 → 9.54.5
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 +12 -11
- package/dist/access-admin-ops-surface.js +46 -44
- package/dist/access-authorization-probe.d.ts +12 -11
- package/dist/access-authorization-probe.js +47 -45
- package/dist/access-boundary.d.ts +12 -11
- package/dist/access-boundary.js +46 -44
- package/dist/access-cli.js +92 -90
- 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 +12 -11
- package/dist/access-extraction-force-flush.js +46 -44
- package/dist/access-health-types.d.ts +1 -1
- package/dist/access-http-lcm-compaction.d.ts +12 -11
- package/dist/access-http-lifecycle-flush.d.ts +12 -11
- package/dist/access-http-offline-stream.d.ts +12 -11
- package/dist/access-http-query.js +46 -44
- package/dist/access-http.d.ts +12 -11
- package/dist/access-http.js +56 -54
- package/dist/access-identity-continuity-surface.d.ts +9 -9
- package/dist/access-identity-continuity-surface.js +46 -44
- package/dist/access-lcm-surface.d.ts +12 -11
- package/dist/access-lcm-surface.js +46 -44
- package/dist/access-mcp.d.ts +12 -11
- package/dist/access-mcp.js +52 -50
- 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-BdHlGd_T.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +46 -44
- package/dist/access-observe-write-surface.d.ts +12 -11
- package/dist/access-observe-write-surface.js +46 -44
- package/dist/access-offline-manifest.d.ts +10 -9
- package/dist/access-offline-manifest.js +12 -10
- package/dist/access-operations-batch.js +48 -46
- package/dist/access-operations.d.ts +15 -14
- package/dist/access-operations.js +51 -49
- package/dist/access-recall-concurrency.d.ts +12 -11
- package/dist/access-recall-concurrency.js +46 -44
- package/dist/access-recall-response.d.ts +12 -11
- package/dist/access-recall-response.js +46 -44
- package/dist/access-recall-surface.d.ts +12 -11
- package/dist/access-recall-surface.js +46 -44
- package/dist/access-schema.d.ts +90 -90
- package/dist/access-schema.js +3 -2
- package/dist/{access-service-CXvbxLK-.d.ts → access-service-DL7X9hrg.d.ts} +7 -7
- package/dist/access-service-helpers.d.ts +12 -11
- package/dist/access-service.d.ts +12 -11
- package/dist/access-service.js +46 -44
- package/dist/access-surface-catalog.d.ts +12 -11
- 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 +13 -1
- package/dist/active-memory-bridge.js +6 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +3 -2
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/ambient-provenance.d.ts +1 -1
- package/dist/artifact-search.d.ts +1 -1
- package/dist/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 +30 -9
- 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/capabilities.d.ts +1 -1
- package/dist/{catalog-BOOxl-I2.d.ts → catalog-B90is4d8.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 +31 -10
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-6LAPLZOS.js → chunk-2DD6ZHOM.js} +8 -3
- package/dist/chunk-2DD6ZHOM.js.map +1 -0
- package/dist/{chunk-47P3RYZP.js → chunk-2INWPC6E.js} +2 -2
- package/dist/{chunk-3CSX3ETE.js → chunk-2LWQSV6A.js} +23 -11
- package/dist/chunk-2LWQSV6A.js.map +1 -0
- package/dist/{chunk-7BZOBA5J.js → chunk-2PNXOQ4P.js} +69 -11
- package/dist/chunk-2PNXOQ4P.js.map +1 -0
- package/dist/{chunk-WOPA3SGI.js → chunk-3OTSVCPK.js} +8 -8
- package/dist/{chunk-PX2LSHYM.js → chunk-3SXLD5T3.js} +3 -3
- package/dist/{chunk-T2JHZWH6.js → chunk-3WGI7F4V.js} +237 -93
- package/dist/chunk-3WGI7F4V.js.map +1 -0
- package/dist/{chunk-C4ZNGVK3.js → chunk-5JKUSBMX.js} +2 -2
- package/dist/{chunk-S75M5ZRK.js → chunk-6LEIWWAF.js} +16 -1
- package/dist/chunk-6LEIWWAF.js.map +1 -0
- package/dist/{chunk-MAXVH44E.js → chunk-6NNNURLK.js} +4 -4
- package/dist/{chunk-LJS7KUPV.js → chunk-6PZGKGAO.js} +2 -2
- package/dist/{chunk-YN6ASZUG.js → chunk-6QPI2ITJ.js} +5 -5
- package/dist/{chunk-CYF6WVE7.js → chunk-7HG7MGAP.js} +2688 -496
- package/dist/chunk-7HG7MGAP.js.map +1 -0
- package/dist/{chunk-CGVHPCP2.js → chunk-7Q7JWLQ4.js} +2 -2
- package/dist/{chunk-227UFSEQ.js → chunk-7RZJWZ46.js} +5 -5
- package/dist/{chunk-JBPKEARU.js → chunk-AU7Q3LSC.js} +4 -4
- package/dist/{chunk-PDDTI7IC.js → chunk-B4T3FQMT.js} +1 -1
- package/dist/{chunk-UU3G6GUP.js → chunk-BIF4SHMD.js} +1 -1
- package/dist/{chunk-UU3G6GUP.js.map → chunk-BIF4SHMD.js.map} +1 -1
- package/dist/{chunk-APPFNGX6.js → chunk-BSXGTDVJ.js} +2 -2
- package/dist/{chunk-4IIFL7GC.js → chunk-CLKBV3Z3.js} +10 -10
- package/dist/{chunk-ZYLC7NFO.js → chunk-CSY44OKU.js} +4 -4
- package/dist/{chunk-HLYR2TQL.js → chunk-CUTFSLSD.js} +2 -2
- package/dist/{chunk-RDJRFDJY.js → chunk-DBY26JJJ.js} +2 -2
- package/dist/{chunk-QWGE2PUH.js → chunk-DDA55IVB.js} +10 -10
- package/dist/{chunk-VMMQDEN5.js → chunk-DN2IDKI5.js} +2 -2
- package/dist/{chunk-2GFK22OZ.js → chunk-DOOWFDWN.js} +2 -2
- package/dist/{chunk-7FGL6CGA.js → chunk-DVYRD4HY.js} +2 -2
- package/dist/{chunk-YGLY6QFV.js → chunk-F2Y6I74C.js} +2 -2
- package/dist/{chunk-UU7TRFNE.js → chunk-FFEBSFVT.js} +2 -2
- package/dist/chunk-HNDIND7P.js +331 -0
- package/dist/chunk-HNDIND7P.js.map +1 -0
- package/dist/{chunk-NIS256NW.js → chunk-JKW663ZN.js} +2 -2
- 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-G2LUMAUF.js → chunk-L7RTUEDG.js} +12 -5
- package/dist/chunk-L7RTUEDG.js.map +1 -0
- package/dist/chunk-LC2BDILZ.js +57 -0
- package/dist/chunk-LC2BDILZ.js.map +1 -0
- package/dist/{chunk-JV5YUBIZ.js → chunk-LC3FD4BV.js} +52 -46
- package/dist/chunk-LC3FD4BV.js.map +1 -0
- package/dist/{chunk-HWRD23DW.js → chunk-LVKYLMSM.js} +3 -3
- package/dist/{chunk-RUMNY5DT.js → chunk-MRGJZ75M.js} +6 -2
- package/dist/chunk-MRGJZ75M.js.map +1 -0
- package/dist/{chunk-ZMYDYNI4.js → chunk-N7CXQ5TA.js} +4 -4
- package/dist/{chunk-3JLPGJ43.js → chunk-NGT35IGQ.js} +5 -5
- package/dist/{chunk-GUKBW4HL.js → chunk-NQMSEB5D.js} +6 -6
- package/dist/{chunk-WRJVB3C2.js → chunk-PO7NXBG2.js} +2 -2
- package/dist/{chunk-WM65LU67.js → chunk-QOQQMVR2.js} +2 -2
- package/dist/{chunk-QHFV6VNU.js → chunk-QPAQSG3F.js} +2 -2
- package/dist/{chunk-UTRO5UJU.js → chunk-QPW3PAIH.js} +5 -1
- package/dist/chunk-QPW3PAIH.js.map +1 -0
- package/dist/{chunk-6R4G7N4S.js → chunk-QQXWFDRD.js} +128 -74
- package/dist/chunk-QQXWFDRD.js.map +1 -0
- package/dist/{chunk-UES4BHA2.js → chunk-QTO6BMQZ.js} +2 -2
- package/dist/{chunk-THPPCISA.js → chunk-RBII7637.js} +5 -5
- package/dist/{chunk-QT2FRYI4.js → chunk-RG426DJO.js} +2 -2
- package/dist/{chunk-XUAMCLY4.js → chunk-TKFGFDPJ.js} +17 -13
- package/dist/chunk-TKFGFDPJ.js.map +1 -0
- package/dist/{chunk-VKXWK44Q.js → chunk-TY6MKIWP.js} +3 -3
- package/dist/{chunk-AZM4CCAC.js → chunk-UWJNKGBA.js} +5 -5
- package/dist/{chunk-JDZPNCMA.js → chunk-UYOXFFEY.js} +6 -3
- package/dist/chunk-UYOXFFEY.js.map +1 -0
- package/dist/{chunk-ZPJ4QSGP.js → chunk-VTU5IEKY.js} +2 -2
- package/dist/{chunk-RZ4XGKOJ.js → chunk-VYQ4URQB.js} +8 -8
- package/dist/{chunk-WDBX6VER.js → chunk-VZRFGJCH.js} +5 -5
- package/dist/{chunk-IBKR2TFR.js → chunk-WM5LD6AT.js} +2 -2
- package/dist/{chunk-K4QS7LXU.js → chunk-WZWZRZ2V.js} +2 -2
- package/dist/{chunk-G4T7L557.js → chunk-XKAR4RF6.js} +2 -2
- package/dist/{chunk-DZD576ZU.js → chunk-XSV2YDCJ.js} +2 -2
- package/dist/{chunk-G7Z6EENO.js → chunk-YDWPYDML.js} +4 -4
- package/dist/{chunk-6HPHEFXT.js → chunk-YKZLOPTC.js} +2 -2
- package/dist/{chunk-NH5IR2WM.js → chunk-YR65W7BV.js} +6 -2
- package/dist/chunk-YR65W7BV.js.map +1 -0
- package/dist/{chunk-GYPQL6XN.js → chunk-Z4N7SVVF.js} +35 -47
- package/dist/chunk-Z4N7SVVF.js.map +1 -0
- package/dist/{cli-DVUFIa5E.d.ts → cli-jfuZXixq.d.ts} +5 -5
- package/dist/cli.d.ts +14 -13
- package/dist/cli.js +74 -72
- package/dist/coding/pre-action-gate.d.ts +1 -1
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +30 -9
- 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 +3 -2
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +30 -9
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +29 -9
- 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-KCADHXPE.js +20 -0
- package/dist/converge-config.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +2 -2
- package/dist/convergence-refresh.js +32 -11
- 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 +21 -20
- 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-CTDuAVJc.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 +30 -9
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +9 -9
- package/dist/explicit-capture.js +6 -4
- package/dist/external-wiki-access.d.ts +12 -11
- package/dist/external-wiki-access.js +47 -45
- 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 +12 -11
- package/dist/extraction-error-classification.d.ts +1 -1
- package/dist/extraction-faithfulness.d.ts +1 -1
- 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-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 +29 -13
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/{first-start-migration-626C5554.js → first-start-migration-LMMZFLKK.js} +13 -5
- package/dist/first-start-migration-LMMZFLKK.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 +1439 -716
- package/dist/index.js +207 -121
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +5 -5
- 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 +1 -1
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +30 -9
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +30 -9
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +31 -10
- package/dist/{maintenance-BJzNIKBE.d.ts → maintenance-heMZSq7G.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +12 -11
- 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 +20 -19
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +6 -6
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +30 -9
- 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 +22 -21
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +34 -32
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +35 -15
- package/dist/{orchestrator-BiXgBJBQ.d.ts → orchestrator-BQQPsSjs.d.ts} +11 -8
- package/dist/orchestrator.d.ts +9 -9
- package/dist/orchestrator.js +93 -91
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-sz_dcuLg.d.ts → pipeline-DFfmsnGk.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/{purge-533FZLS4.js → purge-GB7PZHT2.js} +2 -2
- package/dist/{qmd-eAWObK4M.d.ts → qmd-BF5bcVRs.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-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 +4 -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 +138 -138
- package/dist/{scope-profiles-BBQsXuyj.d.ts → scope-profiles-CbUOsE_E.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 +4 -4
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +6 -6
- 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-DAB3xdKM.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +31 -10
- package/dist/semantic-rule-promotion.js +30 -9
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +30 -9
- package/dist/{service-DIrtHHEg.d.ts → service-DGKg2O6r.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 +9 -9
- package/dist/signal.d.ts +1 -1
- package/dist/source-agent-qualifier.d.ts +1 -1
- package/dist/source-agent-qualifier.js +28 -12
- package/dist/{storage-DqCzXi56.d.ts → storage-CC1jKcWg.d.ts} +46 -13
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +30 -9
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- 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-JDN6HRNT.js} +8 -2
- package/dist/{tier-stats-2JCZYEF7.js.map → tier-stats-JDN6HRNT.js.map} +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transfer/types.d.ts +66 -66
- 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-BnQza1y8.d.ts} +2 -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 +30 -9
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -2
- package/src/access-http.test.ts +31 -0
- package/src/access-memory-search-fanout.ts +24 -1
- package/src/access-offline-manifest.ts +5 -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 +20 -43
- package/src/active-memory-bridge.test.ts +151 -0
- package/src/active-memory-bridge.ts +87 -11
- package/src/briefing.test.ts +38 -0
- package/src/briefing.ts +3 -3
- package/src/cli.ts +6 -1
- 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/index.ts +3 -0
- 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/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/storage/supersession-audit.ts +7 -1
- package/src/storage/supersession-side-effects.ts +17 -5
- package/src/storage.ts +18 -19
- package/src/support-passport/card-projection.test.ts +129 -0
- package/src/support-passport/card-projection.ts +287 -0
- package/src/support-passport/card-service.test.ts +2462 -0
- package/src/support-passport/card-service.ts +1042 -0
- package/src/support-passport/contracts.test.ts +143 -0
- package/src/support-passport/contracts.ts +136 -0
- package/src/support-passport/errors.ts +24 -0
- package/src/support-passport/grant-contracts.ts +139 -0
- package/src/support-passport/grant-service-cache.test.ts +148 -0
- package/src/support-passport/grant-service-cancellation.test.ts +81 -0
- package/src/support-passport/grant-service.test.ts +2882 -0
- package/src/support-passport/grant-service.ts +364 -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 +902 -0
- package/src/support-passport/index.ts +7 -0
- package/src/support-passport/offline-sync-guard.ts +230 -0
- package/src/support-passport/owner-lock.ts +53 -0
- package/src/support-passport/private-file.ts +371 -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 +1 -1
- package/src/wearables/service.test.ts +13 -0
- package/src/wearables/service.ts +2 -0
- package/dist/chunk-3CSX3ETE.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-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-NH5IR2WM.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-UTRO5UJU.js.map +0 -1
- package/dist/chunk-XUAMCLY4.js.map +0 -1
- package/dist/contradiction-scan-HYLIRMJ2.js +0 -14
- package/dist/first-start-migration-626C5554.js.map +0 -1
- /package/dist/{chunk-47P3RYZP.js.map → chunk-2INWPC6E.js.map} +0 -0
- /package/dist/{chunk-WOPA3SGI.js.map → chunk-3OTSVCPK.js.map} +0 -0
- /package/dist/{chunk-PX2LSHYM.js.map → chunk-3SXLD5T3.js.map} +0 -0
- /package/dist/{chunk-C4ZNGVK3.js.map → chunk-5JKUSBMX.js.map} +0 -0
- /package/dist/{chunk-MAXVH44E.js.map → chunk-6NNNURLK.js.map} +0 -0
- /package/dist/{chunk-LJS7KUPV.js.map → chunk-6PZGKGAO.js.map} +0 -0
- /package/dist/{chunk-YN6ASZUG.js.map → chunk-6QPI2ITJ.js.map} +0 -0
- /package/dist/{chunk-CGVHPCP2.js.map → chunk-7Q7JWLQ4.js.map} +0 -0
- /package/dist/{chunk-227UFSEQ.js.map → chunk-7RZJWZ46.js.map} +0 -0
- /package/dist/{chunk-JBPKEARU.js.map → chunk-AU7Q3LSC.js.map} +0 -0
- /package/dist/{chunk-PDDTI7IC.js.map → chunk-B4T3FQMT.js.map} +0 -0
- /package/dist/{chunk-APPFNGX6.js.map → chunk-BSXGTDVJ.js.map} +0 -0
- /package/dist/{chunk-4IIFL7GC.js.map → chunk-CLKBV3Z3.js.map} +0 -0
- /package/dist/{chunk-ZYLC7NFO.js.map → chunk-CSY44OKU.js.map} +0 -0
- /package/dist/{chunk-HLYR2TQL.js.map → chunk-CUTFSLSD.js.map} +0 -0
- /package/dist/{chunk-RDJRFDJY.js.map → chunk-DBY26JJJ.js.map} +0 -0
- /package/dist/{chunk-QWGE2PUH.js.map → chunk-DDA55IVB.js.map} +0 -0
- /package/dist/{chunk-VMMQDEN5.js.map → chunk-DN2IDKI5.js.map} +0 -0
- /package/dist/{chunk-2GFK22OZ.js.map → chunk-DOOWFDWN.js.map} +0 -0
- /package/dist/{chunk-7FGL6CGA.js.map → chunk-DVYRD4HY.js.map} +0 -0
- /package/dist/{chunk-YGLY6QFV.js.map → chunk-F2Y6I74C.js.map} +0 -0
- /package/dist/{chunk-UU7TRFNE.js.map → chunk-FFEBSFVT.js.map} +0 -0
- /package/dist/{chunk-NIS256NW.js.map → chunk-JKW663ZN.js.map} +0 -0
- /package/dist/{chunk-G7A5HLUS.js.map → chunk-KJH6W2I7.js.map} +0 -0
- /package/dist/{chunk-HWRD23DW.js.map → chunk-LVKYLMSM.js.map} +0 -0
- /package/dist/{chunk-ZMYDYNI4.js.map → chunk-N7CXQ5TA.js.map} +0 -0
- /package/dist/{chunk-3JLPGJ43.js.map → chunk-NGT35IGQ.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-WM65LU67.js.map → chunk-QOQQMVR2.js.map} +0 -0
- /package/dist/{chunk-QHFV6VNU.js.map → chunk-QPAQSG3F.js.map} +0 -0
- /package/dist/{chunk-UES4BHA2.js.map → chunk-QTO6BMQZ.js.map} +0 -0
- /package/dist/{chunk-THPPCISA.js.map → chunk-RBII7637.js.map} +0 -0
- /package/dist/{chunk-QT2FRYI4.js.map → chunk-RG426DJO.js.map} +0 -0
- /package/dist/{chunk-VKXWK44Q.js.map → chunk-TY6MKIWP.js.map} +0 -0
- /package/dist/{chunk-AZM4CCAC.js.map → chunk-UWJNKGBA.js.map} +0 -0
- /package/dist/{chunk-ZPJ4QSGP.js.map → chunk-VTU5IEKY.js.map} +0 -0
- /package/dist/{chunk-RZ4XGKOJ.js.map → chunk-VYQ4URQB.js.map} +0 -0
- /package/dist/{chunk-WDBX6VER.js.map → chunk-VZRFGJCH.js.map} +0 -0
- /package/dist/{chunk-IBKR2TFR.js.map → chunk-WM5LD6AT.js.map} +0 -0
- /package/dist/{chunk-K4QS7LXU.js.map → chunk-WZWZRZ2V.js.map} +0 -0
- /package/dist/{chunk-G4T7L557.js.map → chunk-XKAR4RF6.js.map} +0 -0
- /package/dist/{chunk-DZD576ZU.js.map → chunk-XSV2YDCJ.js.map} +0 -0
- /package/dist/{chunk-G7Z6EENO.js.map → chunk-YDWPYDML.js.map} +0 -0
- /package/dist/{chunk-6HPHEFXT.js.map → chunk-YKZLOPTC.js.map} +0 -0
- /package/dist/{contradiction-scan-HYLIRMJ2.js.map → contradiction-scan-KCADHXPE.js.map} +0 -0
- /package/dist/{purge-533FZLS4.js.map → purge-GB7PZHT2.js.map} +0 -0
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
|
-
import test from "node:test";
|
|
3
2
|
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
4
3
|
import os from "node:os";
|
|
5
4
|
import path from "node:path";
|
|
5
|
+
import test from "node:test";
|
|
6
6
|
|
|
7
7
|
import { parseConfig } from "../config.js";
|
|
8
8
|
import { StorageManager } from "../index.js";
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
import { QmdResultResolver, qmdCollectionPathParts, qmdResultPathCandidates } from "./qmd-result-resolver.js";
|
|
10
|
+
|
|
11
|
+
test("qmdCollectionPathParts normalizes QMD URIs", () => {
|
|
12
|
+
assert.deepEqual(qmdCollectionPathParts("qmd://openclaw-engram/facts/private.md"), {
|
|
13
|
+
collection: "openclaw-engram",
|
|
14
|
+
relativePath: "facts/private.md",
|
|
15
|
+
});
|
|
16
|
+
});
|
|
13
17
|
|
|
14
18
|
test("qmdResultPathCandidates probes the facts/ fallback for relative date paths", () => {
|
|
15
19
|
const root = path.join(os.tmpdir(), "remnic-resolver-rel");
|
|
16
20
|
const candidates = qmdResultPathCandidates(root, "2026-07-21/fact-x.md");
|
|
17
21
|
assert.deepEqual(
|
|
18
22
|
candidates.sort(),
|
|
19
|
-
[
|
|
20
|
-
|
|
21
|
-
path.join(root, "facts", "2026-07-21", "fact-x.md"),
|
|
22
|
-
].sort(),
|
|
23
|
-
"relative date paths probe both the literal and the facts/ location",
|
|
23
|
+
[path.join(root, "2026-07-21", "fact-x.md"), path.join(root, "facts", "2026-07-21", "fact-x.md")].sort(),
|
|
24
|
+
"relative date paths probe both the literal and the facts/ location"
|
|
24
25
|
);
|
|
25
26
|
});
|
|
26
27
|
|
|
@@ -31,7 +32,7 @@ test("qmdResultPathCandidates probes the facts/ fallback for absolute date paths
|
|
|
31
32
|
assert.deepEqual(
|
|
32
33
|
candidates.sort(),
|
|
33
34
|
[absolute, path.join(root, "facts", "2026-07-21", "fact-x.md")].sort(),
|
|
34
|
-
"pre-absolutized date paths must probe the facts/ location too"
|
|
35
|
+
"pre-absolutized date paths must probe the facts/ location too"
|
|
35
36
|
);
|
|
36
37
|
});
|
|
37
38
|
|
|
@@ -41,7 +42,7 @@ test("qmdResultPathCandidates keeps non-date absolute paths literal", () => {
|
|
|
41
42
|
assert.deepEqual(
|
|
42
43
|
qmdResultPathCandidates(root, absolute),
|
|
43
44
|
[absolute],
|
|
44
|
-
"non-date absolute paths must not grow a facts/ variant"
|
|
45
|
+
"non-date absolute paths must not grow a facts/ variant"
|
|
45
46
|
);
|
|
46
47
|
});
|
|
47
48
|
|
|
@@ -51,7 +52,7 @@ test("qmdResultPathCandidates rejects absolute paths outside the storage root",
|
|
|
51
52
|
assert.deepEqual(
|
|
52
53
|
qmdResultPathCandidates(root, outside),
|
|
53
54
|
[],
|
|
54
|
-
"containment must drop escaping paths, including their facts/ variant"
|
|
55
|
+
"containment must drop escaping paths, including their facts/ variant"
|
|
55
56
|
);
|
|
56
57
|
});
|
|
57
58
|
|
|
@@ -77,7 +78,7 @@ test("readQmdResultMemory resolves an absolute date path whose file lives under
|
|
|
77
78
|
"The storefront manages a uniqueId cookie with a 90-day expiration.",
|
|
78
79
|
"",
|
|
79
80
|
].join("\n"),
|
|
80
|
-
"utf8"
|
|
81
|
+
"utf8"
|
|
81
82
|
);
|
|
82
83
|
|
|
83
84
|
const config = parseConfig({ memoryDir: dir });
|
|
@@ -101,3 +102,203 @@ test("readQmdResultMemory resolves an absolute date path whose file lives under
|
|
|
101
102
|
await rm(dir, { recursive: true, force: true });
|
|
102
103
|
}
|
|
103
104
|
});
|
|
105
|
+
|
|
106
|
+
test("private-result filtering can preserve unresolved custom-collection hits", async () => {
|
|
107
|
+
const dir = await mkdtemp(path.join(os.tmpdir(), "remnic-resolver-custom-"));
|
|
108
|
+
try {
|
|
109
|
+
const storage = new StorageManager(dir);
|
|
110
|
+
await storage.ensureDirectories();
|
|
111
|
+
const config = parseConfig({ memoryDir: dir });
|
|
112
|
+
const resolver = new QmdResultResolver({
|
|
113
|
+
getConfig: () => config,
|
|
114
|
+
storageFor: async () => storage,
|
|
115
|
+
storageDirNamespace: () => config.defaultNamespace,
|
|
116
|
+
qmdCollectionNamespaceFromPrefix: () => null,
|
|
117
|
+
namespaceFromPath: () => config.defaultNamespace,
|
|
118
|
+
});
|
|
119
|
+
const result = { docid: "external", path: "custom-collection/page.md", snippet: "page", score: 1 };
|
|
120
|
+
|
|
121
|
+
const privateDir = path.join(dir, "preferences");
|
|
122
|
+
await mkdir(privateDir, { recursive: true });
|
|
123
|
+
await writeFile(
|
|
124
|
+
path.join(privateDir, "private.md"),
|
|
125
|
+
[
|
|
126
|
+
"---",
|
|
127
|
+
"id: private",
|
|
128
|
+
"category: preference",
|
|
129
|
+
"created: 2026-08-13T00:00:00.000Z",
|
|
130
|
+
"updated: 2026-08-13T00:00:00.000Z",
|
|
131
|
+
"status: active",
|
|
132
|
+
"tags:",
|
|
133
|
+
" - support-passport-card",
|
|
134
|
+
"---",
|
|
135
|
+
"",
|
|
136
|
+
"Private support card.",
|
|
137
|
+
"",
|
|
138
|
+
].join("\n"),
|
|
139
|
+
"utf8"
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
assert.deepEqual(await resolver.filterPrivateSearchResults([result], storage), [result]);
|
|
143
|
+
const qualifiedPrivate = {
|
|
144
|
+
...result,
|
|
145
|
+
path: "custom-collection/preferences/private.md",
|
|
146
|
+
snippet: "Private support card.",
|
|
147
|
+
};
|
|
148
|
+
assert.deepEqual(await resolver.filterPrivateSearchResults([qualifiedPrivate], storage), []);
|
|
149
|
+
const configured = { ...result, path: `${config.qmdCollection}/page.md` };
|
|
150
|
+
assert.deepEqual(await resolver.filterPrivateSearchResults([configured], storage), []);
|
|
151
|
+
assert.deepEqual(await resolver.filterPrivateSearchResults([configured], storage, [], true), [configured]);
|
|
152
|
+
const externalAbsolute = { ...result, path: path.join(os.tmpdir(), "external-collection", "page.md") };
|
|
153
|
+
assert.deepEqual(await resolver.filterPrivateSearchResults([externalAbsolute], storage), [externalAbsolute]);
|
|
154
|
+
} finally {
|
|
155
|
+
await rm(dir, { recursive: true, force: true });
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
test("private-result filtering distinguishes custom category paths from explicit internal collections", async () => {
|
|
160
|
+
const dir = await mkdtemp(path.join(os.tmpdir(), "remnic-resolver-internal-"));
|
|
161
|
+
try {
|
|
162
|
+
const storage = new StorageManager(dir);
|
|
163
|
+
await storage.ensureDirectories();
|
|
164
|
+
const config = parseConfig({ memoryDir: dir });
|
|
165
|
+
const resolver = new QmdResultResolver({
|
|
166
|
+
getConfig: () => config,
|
|
167
|
+
storageFor: async () => storage,
|
|
168
|
+
storageDirNamespace: () => config.defaultNamespace,
|
|
169
|
+
qmdCollectionNamespaceFromPrefix: () => null,
|
|
170
|
+
namespaceFromPath: () => config.defaultNamespace,
|
|
171
|
+
});
|
|
172
|
+
for (const root of [
|
|
173
|
+
"activity",
|
|
174
|
+
"archive",
|
|
175
|
+
"artifacts",
|
|
176
|
+
"cold",
|
|
177
|
+
"entities",
|
|
178
|
+
"identity",
|
|
179
|
+
"state",
|
|
180
|
+
"summaries",
|
|
181
|
+
"transcripts",
|
|
182
|
+
]) {
|
|
183
|
+
const result = { docid: root, path: `${root}/missing.md`, snippet: "private", score: 1 };
|
|
184
|
+
assert.deepEqual(await resolver.filterPrivateSearchResults([result], storage), []);
|
|
185
|
+
assert.deepEqual(await resolver.filterPrivateSearchResults([result], storage, [], true), [result]);
|
|
186
|
+
}
|
|
187
|
+
const explicitInternal = {
|
|
188
|
+
docid: "internal",
|
|
189
|
+
path: `qmd://${config.qmdCollection}/facts/missing.md`,
|
|
190
|
+
snippet: "private",
|
|
191
|
+
score: 1,
|
|
192
|
+
};
|
|
193
|
+
assert.deepEqual(await resolver.filterPrivateSearchResults([explicitInternal], storage, [], true), []);
|
|
194
|
+
} finally {
|
|
195
|
+
await rm(dir, { recursive: true, force: true });
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
test("private-result filtering resolves QMD URIs before checking passport privacy", async () => {
|
|
200
|
+
const dir = await mkdtemp(path.join(os.tmpdir(), "remnic-resolver-qmd-uri-"));
|
|
201
|
+
try {
|
|
202
|
+
const storage = new StorageManager(dir);
|
|
203
|
+
await storage.ensureDirectories();
|
|
204
|
+
const factDir = path.join(dir, "facts");
|
|
205
|
+
await mkdir(factDir, { recursive: true });
|
|
206
|
+
await writeFile(
|
|
207
|
+
path.join(factDir, "private.md"),
|
|
208
|
+
[
|
|
209
|
+
"---",
|
|
210
|
+
"id: private",
|
|
211
|
+
"category: preference",
|
|
212
|
+
"created: 2026-08-13T00:00:00.000Z",
|
|
213
|
+
"updated: 2026-08-13T00:00:00.000Z",
|
|
214
|
+
"status: active",
|
|
215
|
+
"tags:",
|
|
216
|
+
" - support-passport-card",
|
|
217
|
+
"---",
|
|
218
|
+
"",
|
|
219
|
+
"Private support card.",
|
|
220
|
+
"",
|
|
221
|
+
].join("\n"),
|
|
222
|
+
"utf8"
|
|
223
|
+
);
|
|
224
|
+
const config = parseConfig({ memoryDir: dir });
|
|
225
|
+
const resolver = new QmdResultResolver({
|
|
226
|
+
getConfig: () => config,
|
|
227
|
+
storageFor: async () => storage,
|
|
228
|
+
storageDirNamespace: () => config.defaultNamespace,
|
|
229
|
+
qmdCollectionNamespaceFromPrefix: () => null,
|
|
230
|
+
namespaceFromPath: () => config.defaultNamespace,
|
|
231
|
+
});
|
|
232
|
+
const result = {
|
|
233
|
+
docid: "private",
|
|
234
|
+
path: `qmd://${config.qmdCollection}/facts/private.md`,
|
|
235
|
+
snippet: "Private support card.",
|
|
236
|
+
score: 1,
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
assert.deepEqual(await resolver.filterPrivateSearchResults([result], storage), []);
|
|
240
|
+
} finally {
|
|
241
|
+
await rm(dir, { recursive: true, force: true });
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
test("private-result filtering resolves bounded batches and reuses prefix results", async () => {
|
|
246
|
+
const dir = await mkdtemp(path.join(os.tmpdir(), "remnic-resolver-batch-"));
|
|
247
|
+
try {
|
|
248
|
+
let activeReads = 0;
|
|
249
|
+
let maximumReads = 0;
|
|
250
|
+
const readCounts = new Map<string, number>();
|
|
251
|
+
const storage = {
|
|
252
|
+
dir,
|
|
253
|
+
async readMemoryByPath(filePath: string) {
|
|
254
|
+
const id = path.basename(filePath, ".md");
|
|
255
|
+
readCounts.set(id, (readCounts.get(id) ?? 0) + 1);
|
|
256
|
+
activeReads += 1;
|
|
257
|
+
maximumReads = Math.max(maximumReads, activeReads);
|
|
258
|
+
await new Promise((resolve) => setTimeout(resolve, 5));
|
|
259
|
+
activeReads -= 1;
|
|
260
|
+
return {
|
|
261
|
+
path: filePath,
|
|
262
|
+
content: `content for ${id}`,
|
|
263
|
+
frontmatter: {
|
|
264
|
+
id,
|
|
265
|
+
category: "fact",
|
|
266
|
+
created: "2026-08-13T00:00:00.000Z",
|
|
267
|
+
updated: "2026-08-13T00:00:00.000Z",
|
|
268
|
+
status: "active",
|
|
269
|
+
tags: id === "memory-0" ? ["support-passport-card"] : [],
|
|
270
|
+
},
|
|
271
|
+
};
|
|
272
|
+
},
|
|
273
|
+
} as unknown as StorageManager;
|
|
274
|
+
const config = parseConfig({ memoryDir: dir });
|
|
275
|
+
const resolver = new QmdResultResolver({
|
|
276
|
+
getConfig: () => config,
|
|
277
|
+
storageFor: async () => storage,
|
|
278
|
+
storageDirNamespace: () => config.defaultNamespace,
|
|
279
|
+
qmdCollectionNamespaceFromPrefix: () => null,
|
|
280
|
+
namespaceFromPath: () => config.defaultNamespace,
|
|
281
|
+
});
|
|
282
|
+
const results = Array.from({ length: 20 }, (_, index) => ({
|
|
283
|
+
docid: `memory-${index}`,
|
|
284
|
+
path: `facts/memory-${index}.md`,
|
|
285
|
+
snippet: "candidate",
|
|
286
|
+
score: 1,
|
|
287
|
+
}));
|
|
288
|
+
const visibilityCache = new Map<string, boolean>();
|
|
289
|
+
|
|
290
|
+
const first = await resolver.filterPrivateSearchResults(results.slice(0, 16), storage, [], false, visibilityCache);
|
|
291
|
+
const second = await resolver.filterPrivateSearchResults(results, storage, [], false, visibilityCache);
|
|
292
|
+
|
|
293
|
+
assert.equal(first.length, 15);
|
|
294
|
+
assert.equal(second.length, 19);
|
|
295
|
+
assert.equal(maximumReads, 16);
|
|
296
|
+
assert.equal(
|
|
297
|
+
[...readCounts.values()].reduce((total, count) => total + count, 0),
|
|
298
|
+
20
|
|
299
|
+
);
|
|
300
|
+
assert.equal(readCounts.get("memory-0"), 1);
|
|
301
|
+
} finally {
|
|
302
|
+
await rm(dir, { recursive: true, force: true });
|
|
303
|
+
}
|
|
304
|
+
});
|
|
@@ -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);
|