@remnic/core 9.64.4 → 9.65.1
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 +36 -35
- package/dist/access-authorization-probe.d.ts +12 -11
- package/dist/access-authorization-probe.js +37 -36
- package/dist/access-boundary.d.ts +12 -11
- package/dist/access-boundary.js +36 -35
- package/dist/access-cli.js +91 -88
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +2 -1
- package/dist/access-extraction-force-flush.d.ts +12 -11
- package/dist/access-extraction-force-flush.js +36 -35
- package/dist/access-health-types.d.ts +2 -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.d.ts +3 -2
- package/dist/access-http-query.js +38 -37
- package/dist/access-http.d.ts +13 -12
- package/dist/access-http.js +49 -48
- package/dist/access-identity-continuity-surface.d.ts +10 -9
- package/dist/access-identity-continuity-surface.js +36 -35
- package/dist/access-lcm-surface.d.ts +12 -11
- package/dist/access-lcm-surface.js +36 -35
- package/dist/access-mcp.d.ts +12 -11
- package/dist/access-mcp.js +42 -41
- package/dist/access-memory-search-fanout.d.ts +3 -2
- package/dist/{access-namespace-preflight-CYeI1R2_.d.ts → access-namespace-preflight-BKUnKsBv.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +4 -3
- package/dist/access-namespace-preflight.js +36 -35
- package/dist/access-observe-write-surface.d.ts +12 -11
- package/dist/access-observe-write-surface.js +36 -35
- package/dist/access-offline-manifest.d.ts +10 -9
- package/dist/access-operations-batch.js +38 -37
- package/dist/access-operations.d.ts +12 -11
- package/dist/access-operations.js +41 -40
- package/dist/access-recall-concurrency.d.ts +12 -11
- package/dist/access-recall-concurrency.js +36 -35
- package/dist/access-recall-response.d.ts +12 -11
- package/dist/access-recall-response.js +36 -35
- package/dist/access-recall-surface.d.ts +12 -11
- package/dist/access-recall-surface.js +36 -35
- package/dist/{access-service-BKtdXnyk.d.ts → access-service-B1Lbb-nQ.d.ts} +13 -13
- package/dist/access-service-helpers.d.ts +12 -11
- package/dist/access-service.d.ts +12 -11
- package/dist/access-service.js +36 -35
- package/dist/access-surface-catalog.d.ts +12 -11
- package/dist/access-surface-catalog.js +38 -37
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-wearables-meetings-surface.d.ts +4 -3
- package/dist/action-confidence.d.ts +2 -1
- package/dist/active-memory-bridge.d.ts +2 -1
- package/dist/active-recall.d.ts +2 -1
- package/dist/active-recall.js +4 -2
- package/dist/active-recall.js.map +1 -1
- package/dist/ambient-provenance.d.ts +2 -1
- package/dist/artifact-search.d.ts +2 -1
- package/dist/behavior-learner.d.ts +2 -1
- package/dist/behavior-signals.d.ts +2 -1
- package/dist/bootstrap.d.ts +10 -9
- package/dist/briefing-window.d.ts +3 -2
- package/dist/briefing.d.ts +3 -2
- package/dist/briefing.js +15 -14
- package/dist/buffer-surprise-report.d.ts +2 -1
- package/dist/buffer-turn-helpers.d.ts +2 -1
- package/dist/buffer.d.ts +3 -2
- package/dist/buffer.js +5 -5
- package/dist/bulk-import/index.d.ts +4 -3
- package/dist/calibration.d.ts +2 -1
- package/dist/capabilities.d.ts +2 -1
- package/dist/{catalog-CLAqQO2L.d.ts → catalog-DjVhJoRM.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +2 -1
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.d.ts +2 -1
- package/dist/causal-consolidation.js +18 -17
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.d.ts +2 -1
- package/dist/causal-trajectory-graph.js +2 -2
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-5HERQ5FX.js → chunk-256FBCVX.js} +5 -5
- package/dist/{chunk-GVRLED7R.js → chunk-2572MRP2.js} +2 -2
- package/dist/{chunk-TY35YQ6E.js → chunk-3MADV4YC.js} +2 -2
- package/dist/{chunk-XACYILRA.js → chunk-3PXVYJMC.js} +31 -31
- package/dist/{chunk-DC4FJY2G.js → chunk-3RHFGGI5.js} +4 -4
- package/dist/{chunk-LOETWOEB.js → chunk-3TMYV3LP.js} +2 -2
- package/dist/chunk-3WU7XOFN.js +102 -0
- package/dist/chunk-3WU7XOFN.js.map +1 -0
- package/dist/{chunk-XH4IQVTN.js → chunk-4W6INNXO.js} +2 -2
- package/dist/{chunk-SB6YBB2V.js → chunk-53ENM6F6.js} +2 -2
- package/dist/{chunk-7V3AZWWZ.js → chunk-5UYSCYR7.js} +9 -7
- package/dist/{chunk-7V3AZWWZ.js.map → chunk-5UYSCYR7.js.map} +1 -1
- package/dist/{chunk-Z6CJLYXT.js → chunk-63FHSH7E.js} +3 -3
- package/dist/{chunk-DG6MJD7W.js → chunk-6JJT5AKI.js} +2 -2
- package/dist/{chunk-7BVO64UC.js → chunk-6L27N6YI.js} +2 -2
- package/dist/chunk-7PHI6GUI.js +95 -0
- package/dist/chunk-7PHI6GUI.js.map +1 -0
- package/dist/{chunk-YXGU3MDQ.js → chunk-7PWWGYGO.js} +2 -2
- package/dist/{chunk-CKZHKFY3.js → chunk-7QFBLYFP.js} +3 -3
- package/dist/{chunk-RWLRKMZK.js → chunk-AGKIG3YA.js} +2 -2
- package/dist/{chunk-A2IBK3TG.js → chunk-ALCJRQ72.js} +2 -2
- package/dist/{chunk-44DSGZFF.js → chunk-BC4QD3FM.js} +2 -2
- package/dist/{chunk-YMOPYG3K.js → chunk-BIJAWZYW.js} +6 -6
- package/dist/{chunk-KRPE7ANR.js → chunk-CCTVAVTT.js} +2 -2
- package/dist/{chunk-VYEPACWY.js → chunk-CEH2AFXG.js} +7 -7
- package/dist/{chunk-XBRGJJK7.js → chunk-CEQF6L5K.js} +3 -3
- package/dist/{chunk-PVIXAMWM.js → chunk-CFRBTATE.js} +2 -2
- package/dist/{chunk-UIYYS2YI.js → chunk-CTQRPANJ.js} +2 -2
- package/dist/{chunk-XZUCNVGE.js → chunk-CUS6S7PN.js} +10 -10
- package/dist/{chunk-KWIGDKM2.js → chunk-D2YNNDML.js} +2 -2
- package/dist/{chunk-MJRVF7SF.js → chunk-DBXZZIDU.js} +87 -56
- package/dist/chunk-DBXZZIDU.js.map +1 -0
- package/dist/{chunk-2QI2JBLQ.js → chunk-DEFI2QBT.js} +16 -10
- package/dist/chunk-DEFI2QBT.js.map +1 -0
- package/dist/{chunk-JCSUNXYJ.js → chunk-ESCQ6LY7.js} +3 -3
- package/dist/{chunk-652S5A5D.js → chunk-EUYWQ7TS.js} +2 -2
- package/dist/{chunk-ML3U4KPR.js → chunk-GIC6BASP.js} +2 -2
- package/dist/{chunk-ZSYE2QVJ.js → chunk-GXWDWOWP.js} +2 -2
- package/dist/{chunk-55SJFHVD.js → chunk-HJQZQUPC.js} +11 -11
- package/dist/{chunk-6LTCUN3T.js → chunk-HQSBYI5X.js} +2 -2
- package/dist/{chunk-H5CGAD7L.js → chunk-HQSPXTQO.js} +1 -1
- package/dist/{chunk-EJDLQRUO.js → chunk-HUNSEO5U.js} +2 -2
- package/dist/{chunk-ON2P3SHG.js → chunk-IAY7YBXS.js} +2 -2
- package/dist/{chunk-MB6GLPRY.js → chunk-IVKIODHO.js} +4 -4
- package/dist/{chunk-CUIAHZPZ.js → chunk-IXRC7EQG.js} +2 -2
- package/dist/{chunk-VRYEXPRX.js → chunk-JFJ3MHGV.js} +1 -1
- package/dist/{chunk-VRYEXPRX.js.map → chunk-JFJ3MHGV.js.map} +1 -1
- package/dist/{chunk-LZKCMK3U.js → chunk-JTSVMJHV.js} +2 -2
- package/dist/{chunk-URS5GSM7.js → chunk-JXN77SGO.js} +1 -1
- package/dist/chunk-JXN77SGO.js.map +1 -0
- package/dist/{chunk-WBM5NR4E.js → chunk-KPBLJCCV.js} +2 -2
- package/dist/{chunk-VLES5S4K.js → chunk-LWVO2QZV.js} +36 -36
- package/dist/{chunk-NO7B6DRB.js → chunk-LYIZXQYY.js} +2 -2
- package/dist/{chunk-7RAJ3GXO.js → chunk-M6L7HI7R.js} +2 -156
- package/dist/chunk-M6L7HI7R.js.map +1 -0
- package/dist/{chunk-VUP47UJI.js → chunk-MIBKEW7A.js} +3 -3
- package/dist/{chunk-OQIRBGUU.js → chunk-N37X5RU7.js} +2 -2
- package/dist/{chunk-C6AKYOFO.js → chunk-N6TRHP72.js} +2 -2
- package/dist/{chunk-VANZKHTN.js → chunk-NNBZS3DY.js} +2 -2
- package/dist/{chunk-2PSX5BJU.js → chunk-NZPFCP5A.js} +2 -2
- package/dist/{chunk-LTBKKSCX.js → chunk-OLBZ2WGG.js} +2 -2
- package/dist/{chunk-PD66CVSD.js → chunk-OUKBMQ2O.js} +2 -2
- package/dist/{chunk-GPFZFCRN.js → chunk-PP7R754B.js} +1 -1
- package/dist/{chunk-TKI2WOL5.js → chunk-R3AAOKR2.js} +2 -2
- package/dist/{chunk-RNORDDD6.js → chunk-S2VBSTTA.js} +2 -2
- package/dist/{chunk-3A46U7XG.js → chunk-SYJ6EKKE.js} +2 -2
- package/dist/{chunk-YFQTDE7N.js → chunk-VJ6ECBIP.js} +2 -2
- package/dist/{chunk-IFK3PVM7.js → chunk-VPGRXEAB.js} +2 -2
- package/dist/{chunk-246HFJVG.js → chunk-VZVP2W4O.js} +2 -2
- package/dist/{chunk-SHQFYZTD.js → chunk-W6TSGWYS.js} +2 -2
- package/dist/{chunk-DA2O3F5V.js → chunk-WTOE7CW4.js} +13 -13
- package/dist/{chunk-IJXECCUV.js → chunk-X5SDZMO7.js} +2 -2
- package/dist/chunk-XAB6STPO.js +160 -0
- package/dist/chunk-XAB6STPO.js.map +1 -0
- package/dist/{chunk-DHKV6E4A.js → chunk-Y23B2QXP.js} +2 -2
- package/dist/{chunk-PE76XIDM.js → chunk-YEQEGSJA.js} +3 -3
- package/dist/{chunk-UMDZXW5J.js → chunk-YQ3CBLL4.js} +5 -85
- package/dist/chunk-YQ3CBLL4.js.map +1 -0
- package/dist/{chunk-VYISFWVX.js → chunk-YQNNHLCG.js} +2 -2
- package/dist/{chunk-3LOQN3TO.js → chunk-Z54TXZ2F.js} +3 -3
- package/dist/{cli-CLvBewKf.d.ts → cli-Pulnz-qm.d.ts} +5 -5
- package/dist/cli.d.ts +14 -13
- package/dist/cli.js +70 -67
- package/dist/coding/pre-action-gate.d.ts +2 -1
- package/dist/coding/pre-action-gate.js +2 -2
- package/dist/compounding/engine.d.ts +3 -2
- package/dist/compounding/engine.js +15 -14
- package/dist/compounding/preference-consolidator.d.ts +2 -1
- package/dist/compression-optimizer.d.ts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/config.js +4 -2
- package/dist/connectors/codex-materialize-runner.d.ts +2 -1
- package/dist/connectors/codex-materialize-runner.js +15 -14
- package/dist/connectors/codex-materialize.d.ts +2 -1
- package/dist/connectors/index.d.ts +2 -1
- package/dist/connectors/index.js +15 -14
- package/dist/consolidation-provenance-check.d.ts +3 -2
- package/dist/consolidation-undo.d.ts +3 -2
- package/dist/contradiction/index.d.ts +3 -2
- package/dist/converge-config.d.ts +2 -1
- package/dist/convergence-refresh.d.ts +3 -2
- package/dist/convergence-refresh.js +17 -16
- package/dist/conversation-index/backend.d.ts +2 -1
- package/dist/conversation-index/chunker.d.ts +2 -1
- package/dist/conversation-index/faiss-adapter.d.ts +2 -1
- package/dist/conversation-index/indexer.d.ts +2 -1
- package/dist/conversation-index/search.d.ts +2 -1
- package/dist/corpus-watermark.d.ts +2 -1
- package/dist/corpus-watermark.js +17 -16
- package/dist/cross-lingual-recall.d.ts +70 -0
- package/dist/cross-lingual-recall.js +14 -0
- package/dist/day-summary.d.ts +2 -1
- package/dist/delinearize.d.ts +2 -1
- package/dist/dependency-propagation-config.d.ts +2 -1
- package/dist/{dependency-propagation-delivery-DMqIw9Zh.d.ts → dependency-propagation-delivery-Co17gxYb.d.ts} +1 -1
- package/dist/direct-answer-wiring.d.ts +2 -1
- package/dist/direct-answer.d.ts +2 -1
- package/dist/embedding-fallback.d.ts +2 -1
- package/dist/enrichment/index.d.ts +2 -1
- package/dist/entity-origin-fields.d.ts +2 -1
- package/dist/entity-retrieval.d.ts +3 -2
- package/dist/entity-retrieval.js +15 -14
- package/dist/entity-schema.d.ts +2 -1
- package/dist/episodic-context.d.ts +2 -1
- package/dist/explicit-capture.d.ts +10 -9
- package/dist/external-wiki-access.d.ts +12 -11
- package/dist/external-wiki-access.js +37 -36
- package/dist/external-wiki-collection-registration.d.ts +2 -1
- package/dist/external-wiki-collection.d.ts +2 -1
- package/dist/external-wiki-mcp-tools.d.ts +12 -11
- package/dist/extraction-error-classification.d.ts +2 -1
- package/dist/extraction-faithfulness.d.ts +2 -1
- package/dist/extraction-judge-telemetry.d.ts +2 -1
- package/dist/extraction-judge-training.d.ts +2 -1
- package/dist/extraction-judge.d.ts +2 -1
- package/dist/extraction-liveness.d.ts +2 -1
- package/dist/extraction-normalization.d.ts +2 -1
- package/dist/extraction-prompt.d.ts +2 -1
- package/dist/extraction-source-grounding-rules.d.ts +2 -1
- package/dist/extraction-source-grounding.d.ts +2 -1
- package/dist/extraction.d.ts +2 -1
- package/dist/extraction.js +20 -19
- package/dist/fallback-llm.d.ts +2 -1
- package/dist/graph-dashboard-diff.d.ts +2 -1
- package/dist/graph-dashboard-key.d.ts +2 -1
- package/dist/graph-dashboard-parser.d.ts +2 -1
- package/dist/{graph-edge-decay-A4SDFMMS.js → graph-edge-decay-FXGELBFA.js} +4 -4
- package/dist/graph-edge-decay-FXGELBFA.js.map +1 -0
- package/dist/graph-edge-reinforcement.d.ts +2 -1
- package/dist/graph-path-reconstruction.d.ts +2 -1
- package/dist/graph-path-scoring.d.ts +2 -1
- package/dist/graph-snapshot.d.ts +2 -1
- package/dist/graph-snapshot.js +3 -3
- package/dist/graph.d.ts +2 -1
- package/dist/graph.js +3 -3
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/importance.d.ts +2 -1
- package/dist/importers/index.d.ts +2 -1
- package/dist/in-flight-reads.d.ts +2 -1
- package/dist/index.d.ts +24 -23
- package/dist/index.js +130 -126
- package/dist/intent.d.ts +2 -1
- package/dist/lcm/engine.d.ts +2 -1
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.d.ts +2 -1
- package/dist/lcm/index.js +5 -5
- package/dist/lcm/tools.d.ts +2 -1
- package/dist/lifecycle.d.ts +2 -1
- package/dist/live-connectors-runner.d.ts +2 -1
- package/dist/local-llm.d.ts +2 -1
- package/dist/local-llm.js +2 -2
- package/dist/local-model-endpoint.d.ts +2 -1
- package/dist/location/index.d.ts +295 -0
- package/dist/location/index.js +798 -0
- package/dist/location/index.js.map +1 -0
- package/dist/maintenance/memory-governance.d.ts +2 -1
- package/dist/maintenance/memory-governance.js +15 -14
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +15 -14
- package/dist/maintenance/rebuild-memory-projection.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-projection.js +16 -15
- package/dist/{maintenance-DITiehFX.d.ts → maintenance-DiSLtVN7.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +12 -11
- package/dist/memory-action-policy.d.ts +2 -1
- package/dist/memory-cache.d.ts +2 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +2 -1
- package/dist/memory-projection-store.d.ts +2 -1
- package/dist/memory-provenance.d.ts +2 -1
- package/dist/memory-snapshot.d.ts +2 -1
- package/dist/memory-worth-outcomes.d.ts +3 -2
- package/dist/models-json.d.ts +2 -1
- package/dist/namespaces/migrate.d.ts +4 -3
- package/dist/namespaces/migrate.js +16 -15
- package/dist/namespaces/principal.d.ts +2 -1
- package/dist/namespaces/search.d.ts +2 -1
- package/dist/namespaces/search.js +10 -10
- package/dist/namespaces/storage.d.ts +4 -3
- package/dist/namespaces/storage.js +15 -14
- package/dist/native-knowledge.d.ts +2 -1
- package/dist/offline-sync-impression-drain.d.ts +2 -1
- package/dist/operator-doctor-corpus.d.ts +2 -1
- package/dist/operator-doctor-corpus.js +18 -17
- package/dist/operator-doctor-replica.d.ts +2 -1
- package/dist/operator-toolkit.d.ts +4 -3
- package/dist/operator-toolkit.js +29 -26
- package/dist/orchestration/compression-guideline-coordinator.d.ts +3 -2
- package/dist/orchestration/maintenance.d.ts +5 -4
- package/dist/orchestration/maintenance.js +23 -21
- package/dist/{orchestrator-6fPa2l9x.d.ts → orchestrator-DzCaxNS4.d.ts} +8 -8
- package/dist/orchestrator.d.ts +10 -9
- package/dist/orchestrator.js +92 -89
- package/dist/patterns-cli.d.ts +2 -1
- package/dist/{pipeline-DHpYtfM3.d.ts → pipeline-HJ8DKbFl.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +2 -1
- package/dist/proactive-contention.d.ts +2 -1
- package/dist/provenance.d.ts +2 -1
- package/dist/{public-http-BT36aBb-.d.ts → public-http-DwXauTX3.d.ts} +1 -1
- package/dist/{qmd-BaX31tM0.d.ts → qmd-BzxluoLt.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +3 -2
- package/dist/qmd-recall-cache.d.ts +2 -1
- package/dist/qmd.d.ts +3 -2
- package/dist/qmd.js +5 -5
- package/dist/recall-concurrency-config.d.ts +2 -1
- package/dist/recall-disclosure-escalation.d.ts +2 -1
- package/dist/recall-explain-renderer.d.ts +2 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +2 -1
- package/dist/recall-planner-llm.d.ts +2 -1
- package/dist/recall-state.d.ts +2 -1
- package/dist/recall-tag-filter.d.ts +2 -1
- package/dist/recall-timings.d.ts +2 -1
- package/dist/recall-xray-cli.d.ts +2 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +2 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +2 -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/plan.d.ts +2 -1
- package/dist/replay/normalizers/chatgpt.d.ts +2 -1
- package/dist/replay/normalizers/claude.d.ts +2 -1
- package/dist/replay/normalizers/openclaw.d.ts +2 -1
- package/dist/replay/normalizers/shared.d.ts +2 -1
- package/dist/replay/runner.d.ts +2 -1
- package/dist/replay/types.d.ts +2 -1
- package/dist/replica-divergence.d.ts +2 -1
- package/dist/replica-peers-config.d.ts +2 -1
- package/dist/resolve-auth-token.d.ts +2 -1
- package/dist/resume-bundles.js +5 -3
- package/dist/retrieval-agents.d.ts +3 -2
- package/dist/retrieval-tiers.d.ts +2 -1
- package/dist/routing/engine.d.ts +2 -1
- package/dist/routing/store.d.ts +2 -1
- package/dist/salvage-envelope.d.ts +2 -1
- package/dist/schemas.d.ts +30 -30
- package/dist/{scope-profiles-1hYWJ9bM.d.ts → scope-profiles-CEMZz0t5.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +2 -1
- package/dist/search/factory.d.ts +2 -1
- package/dist/search/factory.js +9 -9
- package/dist/search/index.d.ts +2 -1
- package/dist/search/index.js +13 -13
- package/dist/search/lancedb-backend.d.ts +2 -1
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.d.ts +2 -1
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/noop-backend.d.ts +2 -1
- package/dist/search/orama-backend.d.ts +2 -1
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +3 -2
- package/dist/search/port.js +1 -1
- package/dist/search/remote-backend.d.ts +2 -1
- package/dist/search/remote-backend.js +2 -2
- package/dist/{semantic-consolidation-Chmddvcg.d.ts → semantic-consolidation-D9dYj6vu.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +3 -2
- package/dist/semantic-consolidation.js +16 -15
- package/dist/semantic-rule-promotion.js +15 -14
- package/dist/semantic-rule-verifier.d.ts +2 -1
- package/dist/semantic-rule-verifier.js +15 -14
- package/dist/{service-DMs_dCCg.d.ts → service-_qgST_0y.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +2 -1
- package/dist/session-observer-state.d.ts +2 -1
- package/dist/shared-context/manager.d.ts +2 -1
- package/dist/signal.d.ts +2 -1
- package/dist/source-agent-qualifier.d.ts +2 -1
- package/dist/source-agent-qualifier.js +17 -16
- package/dist/{storage-CzorrpcN.d.ts → storage-B9lbNTYE.d.ts} +1 -1
- package/dist/storage.d.ts +3 -2
- package/dist/storage.js +14 -13
- package/dist/summarizer.d.ts +2 -1
- package/dist/summarizer.js +3 -3
- package/dist/summary-snapshot.d.ts +2 -1
- package/dist/support-passport/index.d.ts +15 -14
- package/dist/support-passport/index.js +39 -38
- package/dist/temporal-supersession.d.ts +3 -2
- package/dist/temporal-timeline-recall.d.ts +2 -1
- package/dist/temporal-validity.d.ts +2 -1
- package/dist/threading.d.ts +2 -1
- package/dist/tier-migration.d.ts +3 -2
- package/dist/tier-routing.d.ts +2 -1
- package/dist/topics.d.ts +2 -1
- package/dist/transcript.d.ts +2 -1
- package/dist/transfer/types.d.ts +12 -12
- package/dist/trust-score-stage.d.ts +2 -1
- package/dist/trust-score.d.ts +2 -1
- package/dist/{types-BP5MC8UU.d.ts → types-BrEzuxPA.d.ts} +3 -23
- package/dist/types-CM86alG1.d.ts +89 -0
- package/dist/types.d.ts +2 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +2 -1
- package/dist/verified-recall.js +15 -14
- package/dist/who-knows-cli.d.ts +12 -11
- package/dist/who-knows-cli.js +16 -15
- package/dist/who-knows.d.ts +12 -11
- package/dist/who-knows.js +15 -14
- package/dist/write-envelope.d.ts +2 -1
- package/package.json +12 -2
- package/src/cross-lingual-recall.test.ts +47 -0
- package/src/cross-lingual-recall.ts +186 -0
- package/src/location/adapter-isolation.test.ts +44 -0
- package/src/location/index.ts +16 -0
- package/src/orchestration/recall-internal-deps.ts +2 -0
- package/src/orchestration/recall-internal.ts +35 -33
- package/src/orchestration/recall-search-pipeline.ts +16 -0
- package/src/search/port.ts +2 -1
- package/src/storage.ts +5 -1
- package/src/types.ts +2 -0
- package/dist/chunk-2QI2JBLQ.js.map +0 -1
- package/dist/chunk-7RAJ3GXO.js.map +0 -1
- package/dist/chunk-MJRVF7SF.js.map +0 -1
- package/dist/chunk-UMDZXW5J.js.map +0 -1
- package/dist/chunk-URS5GSM7.js.map +0 -1
- /package/dist/{chunk-5HERQ5FX.js.map → chunk-256FBCVX.js.map} +0 -0
- /package/dist/{chunk-GVRLED7R.js.map → chunk-2572MRP2.js.map} +0 -0
- /package/dist/{chunk-TY35YQ6E.js.map → chunk-3MADV4YC.js.map} +0 -0
- /package/dist/{chunk-XACYILRA.js.map → chunk-3PXVYJMC.js.map} +0 -0
- /package/dist/{chunk-DC4FJY2G.js.map → chunk-3RHFGGI5.js.map} +0 -0
- /package/dist/{chunk-LOETWOEB.js.map → chunk-3TMYV3LP.js.map} +0 -0
- /package/dist/{chunk-XH4IQVTN.js.map → chunk-4W6INNXO.js.map} +0 -0
- /package/dist/{chunk-SB6YBB2V.js.map → chunk-53ENM6F6.js.map} +0 -0
- /package/dist/{chunk-Z6CJLYXT.js.map → chunk-63FHSH7E.js.map} +0 -0
- /package/dist/{chunk-DG6MJD7W.js.map → chunk-6JJT5AKI.js.map} +0 -0
- /package/dist/{chunk-7BVO64UC.js.map → chunk-6L27N6YI.js.map} +0 -0
- /package/dist/{chunk-YXGU3MDQ.js.map → chunk-7PWWGYGO.js.map} +0 -0
- /package/dist/{chunk-CKZHKFY3.js.map → chunk-7QFBLYFP.js.map} +0 -0
- /package/dist/{chunk-RWLRKMZK.js.map → chunk-AGKIG3YA.js.map} +0 -0
- /package/dist/{chunk-A2IBK3TG.js.map → chunk-ALCJRQ72.js.map} +0 -0
- /package/dist/{chunk-44DSGZFF.js.map → chunk-BC4QD3FM.js.map} +0 -0
- /package/dist/{chunk-YMOPYG3K.js.map → chunk-BIJAWZYW.js.map} +0 -0
- /package/dist/{chunk-KRPE7ANR.js.map → chunk-CCTVAVTT.js.map} +0 -0
- /package/dist/{chunk-VYEPACWY.js.map → chunk-CEH2AFXG.js.map} +0 -0
- /package/dist/{chunk-XBRGJJK7.js.map → chunk-CEQF6L5K.js.map} +0 -0
- /package/dist/{chunk-PVIXAMWM.js.map → chunk-CFRBTATE.js.map} +0 -0
- /package/dist/{chunk-UIYYS2YI.js.map → chunk-CTQRPANJ.js.map} +0 -0
- /package/dist/{chunk-XZUCNVGE.js.map → chunk-CUS6S7PN.js.map} +0 -0
- /package/dist/{chunk-KWIGDKM2.js.map → chunk-D2YNNDML.js.map} +0 -0
- /package/dist/{chunk-JCSUNXYJ.js.map → chunk-ESCQ6LY7.js.map} +0 -0
- /package/dist/{chunk-652S5A5D.js.map → chunk-EUYWQ7TS.js.map} +0 -0
- /package/dist/{chunk-ML3U4KPR.js.map → chunk-GIC6BASP.js.map} +0 -0
- /package/dist/{chunk-ZSYE2QVJ.js.map → chunk-GXWDWOWP.js.map} +0 -0
- /package/dist/{chunk-55SJFHVD.js.map → chunk-HJQZQUPC.js.map} +0 -0
- /package/dist/{chunk-6LTCUN3T.js.map → chunk-HQSBYI5X.js.map} +0 -0
- /package/dist/{chunk-H5CGAD7L.js.map → chunk-HQSPXTQO.js.map} +0 -0
- /package/dist/{chunk-EJDLQRUO.js.map → chunk-HUNSEO5U.js.map} +0 -0
- /package/dist/{chunk-ON2P3SHG.js.map → chunk-IAY7YBXS.js.map} +0 -0
- /package/dist/{chunk-MB6GLPRY.js.map → chunk-IVKIODHO.js.map} +0 -0
- /package/dist/{chunk-CUIAHZPZ.js.map → chunk-IXRC7EQG.js.map} +0 -0
- /package/dist/{chunk-LZKCMK3U.js.map → chunk-JTSVMJHV.js.map} +0 -0
- /package/dist/{chunk-WBM5NR4E.js.map → chunk-KPBLJCCV.js.map} +0 -0
- /package/dist/{chunk-VLES5S4K.js.map → chunk-LWVO2QZV.js.map} +0 -0
- /package/dist/{chunk-NO7B6DRB.js.map → chunk-LYIZXQYY.js.map} +0 -0
- /package/dist/{chunk-VUP47UJI.js.map → chunk-MIBKEW7A.js.map} +0 -0
- /package/dist/{chunk-OQIRBGUU.js.map → chunk-N37X5RU7.js.map} +0 -0
- /package/dist/{chunk-C6AKYOFO.js.map → chunk-N6TRHP72.js.map} +0 -0
- /package/dist/{chunk-VANZKHTN.js.map → chunk-NNBZS3DY.js.map} +0 -0
- /package/dist/{chunk-2PSX5BJU.js.map → chunk-NZPFCP5A.js.map} +0 -0
- /package/dist/{chunk-LTBKKSCX.js.map → chunk-OLBZ2WGG.js.map} +0 -0
- /package/dist/{chunk-PD66CVSD.js.map → chunk-OUKBMQ2O.js.map} +0 -0
- /package/dist/{chunk-GPFZFCRN.js.map → chunk-PP7R754B.js.map} +0 -0
- /package/dist/{chunk-TKI2WOL5.js.map → chunk-R3AAOKR2.js.map} +0 -0
- /package/dist/{chunk-RNORDDD6.js.map → chunk-S2VBSTTA.js.map} +0 -0
- /package/dist/{chunk-3A46U7XG.js.map → chunk-SYJ6EKKE.js.map} +0 -0
- /package/dist/{chunk-YFQTDE7N.js.map → chunk-VJ6ECBIP.js.map} +0 -0
- /package/dist/{chunk-IFK3PVM7.js.map → chunk-VPGRXEAB.js.map} +0 -0
- /package/dist/{chunk-246HFJVG.js.map → chunk-VZVP2W4O.js.map} +0 -0
- /package/dist/{chunk-SHQFYZTD.js.map → chunk-W6TSGWYS.js.map} +0 -0
- /package/dist/{chunk-DA2O3F5V.js.map → chunk-WTOE7CW4.js.map} +0 -0
- /package/dist/{chunk-IJXECCUV.js.map → chunk-X5SDZMO7.js.map} +0 -0
- /package/dist/{chunk-DHKV6E4A.js.map → chunk-Y23B2QXP.js.map} +0 -0
- /package/dist/{chunk-PE76XIDM.js.map → chunk-YEQEGSJA.js.map} +0 -0
- /package/dist/{chunk-VYISFWVX.js.map → chunk-YQNNHLCG.js.map} +0 -0
- /package/dist/{chunk-3LOQN3TO.js.map → chunk-Z54TXZ2F.js.map} +0 -0
- /package/dist/{graph-edge-decay-A4SDFMMS.js.map → cross-lingual-recall.js.map} +0 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-lingual recall planner (issue #2197).
|
|
3
|
+
*
|
|
4
|
+
* Lexical tiers (BM25/FTS) match on shared surface tokens, so a query whose
|
|
5
|
+
* dominant script differs from the corpus's cannot retrieve lexically — an
|
|
6
|
+
* English query never token-overlaps a Japanese fact. When the planner
|
|
7
|
+
* detects that mismatch it leans on the vector tier (the embedding-fallback
|
|
8
|
+
* supplement in the recall search pipeline), and when NO vector tier exists
|
|
9
|
+
* it emits a {@link SearchDegradation} so "no results" stays distinguishable
|
|
10
|
+
* from "cross-script query, vectors unavailable" (rule 34).
|
|
11
|
+
*
|
|
12
|
+
* The write-time half is a dominant-script hint stamped into frontmatter
|
|
13
|
+
* `language` by `StorageManager.writeMemory` (ISO 15924 script codes);
|
|
14
|
+
* legacy files without the field simply do not vote for the corpus script.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type { MemoryFile } from "./types.js";
|
|
18
|
+
import type { SearchDegradation } from "./search/port.js";
|
|
19
|
+
|
|
20
|
+
type CorpusLanguageStorage = {
|
|
21
|
+
dir: string;
|
|
22
|
+
readAllMemories: () => Promise<MemoryFile[]>;
|
|
23
|
+
getCorpusScanVersion: () => string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** Script classes the cheap detector can distinguish. ISO 15924 codes. */
|
|
27
|
+
export type LanguageHint =
|
|
28
|
+
| "latn"
|
|
29
|
+
| "jpan"
|
|
30
|
+
| "kore"
|
|
31
|
+
| "hani"
|
|
32
|
+
| "cyrl"
|
|
33
|
+
| "grek"
|
|
34
|
+
| "arab"
|
|
35
|
+
| "hebr"
|
|
36
|
+
| "thai"
|
|
37
|
+
| "deva";
|
|
38
|
+
|
|
39
|
+
/** Inclusive codepoint ranges per script class. `kana` folds into `jpan` at detection. */
|
|
40
|
+
const SCRIPT_RANGES: ReadonlyArray<readonly [LanguageHint | "kana", number, number]> = [
|
|
41
|
+
["latn", 0x41, 0x5a],
|
|
42
|
+
["latn", 0x61, 0x7a],
|
|
43
|
+
["latn", 0xc0, 0x24f],
|
|
44
|
+
["grek", 0x370, 0x3ff],
|
|
45
|
+
["cyrl", 0x400, 0x4ff],
|
|
46
|
+
["cyrl", 0x500, 0x52f],
|
|
47
|
+
["hebr", 0x590, 0x5ff],
|
|
48
|
+
["arab", 0x600, 0x6ff],
|
|
49
|
+
["arab", 0x750, 0x77f],
|
|
50
|
+
["deva", 0x900, 0x97f],
|
|
51
|
+
["thai", 0xe00, 0xe7f],
|
|
52
|
+
["kore", 0x1100, 0x11ff],
|
|
53
|
+
["latn", 0x1e00, 0x1eff],
|
|
54
|
+
["kana", 0x3040, 0x309f],
|
|
55
|
+
["kana", 0x30a0, 0x30ff],
|
|
56
|
+
["kana", 0x31f0, 0x31ff],
|
|
57
|
+
["hani", 0x3400, 0x4dbf],
|
|
58
|
+
["hani", 0x4e00, 0x9fff],
|
|
59
|
+
["kore", 0xac00, 0xd7a3],
|
|
60
|
+
["kana", 0xff66, 0xff9d],
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Dominant-script hint for a text. Codepoint-range counting (no regex):
|
|
65
|
+
* kana anywhere maps to `jpan` — kana is unique to Japanese and disambiguates
|
|
66
|
+
* it from `hani` (Chinese, or kanji-only Japanese). Returns `undefined` when
|
|
67
|
+
* the text contains no lettered script class.
|
|
68
|
+
*/
|
|
69
|
+
export function detectLanguageHint(text: string): LanguageHint | undefined {
|
|
70
|
+
const counts = new Map<LanguageHint | "kana", number>();
|
|
71
|
+
for (let i = 0; i < text.length; i += 1) {
|
|
72
|
+
const code = text.charCodeAt(i);
|
|
73
|
+
for (const [script, low, high] of SCRIPT_RANGES) {
|
|
74
|
+
if (code < low) break;
|
|
75
|
+
if (code <= high) {
|
|
76
|
+
counts.set(script, (counts.get(script) ?? 0) + 1);
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// SCRIPT_RANGES is sorted by start codepoint, so `break` on the first
|
|
82
|
+
// range starting past the codepoint is exact — one range test per char.
|
|
83
|
+
if (counts.has("kana")) return "jpan";
|
|
84
|
+
let best: LanguageHint | undefined;
|
|
85
|
+
let bestCount = 0;
|
|
86
|
+
for (const [script, count] of counts) {
|
|
87
|
+
if (script === "kana") continue;
|
|
88
|
+
if (count > bestCount) {
|
|
89
|
+
best = script;
|
|
90
|
+
bestCount = count;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return best;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Dominant hint over a corpus sample; `undefined` entries (legacy files) never vote. */
|
|
97
|
+
export function corpusDominantLanguage(
|
|
98
|
+
hints: Iterable<string | undefined>,
|
|
99
|
+
): LanguageHint | undefined {
|
|
100
|
+
const counts = new Map<string, number>();
|
|
101
|
+
for (const hint of hints) {
|
|
102
|
+
if (hint === undefined || hint === "") continue;
|
|
103
|
+
counts.set(hint, (counts.get(hint) ?? 0) + 1);
|
|
104
|
+
}
|
|
105
|
+
let best: string | undefined;
|
|
106
|
+
let bestCount = 0;
|
|
107
|
+
for (const [hint, count] of counts) {
|
|
108
|
+
if (count > bestCount) {
|
|
109
|
+
best = hint;
|
|
110
|
+
bestCount = count;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return best as LanguageHint | undefined;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** Planner decision for one recall query. */
|
|
117
|
+
export interface CrossScriptPlan {
|
|
118
|
+
queryLanguage: LanguageHint | undefined;
|
|
119
|
+
corpusLanguage: LanguageHint | undefined;
|
|
120
|
+
/** True when both hints resolved and differ — lexical tiers cannot serve this query. */
|
|
121
|
+
crossScript: boolean;
|
|
122
|
+
/** Emitted when `crossScript` is true and no vector tier can compensate. */
|
|
123
|
+
degradation?: SearchDegradation;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Pure planner core: compare query/corpus hints and, on a mismatch without a
|
|
128
|
+
* vector tier, build the visible degradation signal.
|
|
129
|
+
*/
|
|
130
|
+
export function planCrossScript(input: {
|
|
131
|
+
queryLanguage: LanguageHint | undefined;
|
|
132
|
+
corpusLanguage: LanguageHint | undefined;
|
|
133
|
+
vectorTierAvailable: boolean;
|
|
134
|
+
}): CrossScriptPlan {
|
|
135
|
+
const crossScript =
|
|
136
|
+
input.queryLanguage !== undefined &&
|
|
137
|
+
input.corpusLanguage !== undefined &&
|
|
138
|
+
input.queryLanguage !== input.corpusLanguage;
|
|
139
|
+
return {
|
|
140
|
+
queryLanguage: input.queryLanguage,
|
|
141
|
+
corpusLanguage: input.corpusLanguage,
|
|
142
|
+
crossScript,
|
|
143
|
+
degradation:
|
|
144
|
+
crossScript && !input.vectorTierAvailable
|
|
145
|
+
? {
|
|
146
|
+
backend: "qmd",
|
|
147
|
+
code: "vector_tier_unavailable",
|
|
148
|
+
detail:
|
|
149
|
+
`cross-script query (${input.queryLanguage}) over a ${input.corpusLanguage} corpus: ` +
|
|
150
|
+
"lexical recall cannot match across scripts — enable a multilingual embedding model " +
|
|
151
|
+
"(embedding fallback) so the vector tier can serve it",
|
|
152
|
+
}
|
|
153
|
+
: undefined,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** Corpus sample cap: dominant script stabilizes well below the full corpus. */
|
|
158
|
+
const CORPUS_SAMPLE_CAP = 500;
|
|
159
|
+
|
|
160
|
+
/** Memoized dominant corpus language per storage dir, keyed by corpus scan version. */
|
|
161
|
+
const corpusLanguageCache = new Map<string, { version: string; language: LanguageHint | undefined }>();
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Dominant corpus language for a storage manager, sampled from the newest
|
|
165
|
+
* frontmatter `language` hints (capped, memoized on the corpus scan version so
|
|
166
|
+
* recurring recalls pay one pass per corpus generation, not per query).
|
|
167
|
+
* Read failures degrade to `undefined` — never break recall.
|
|
168
|
+
*/
|
|
169
|
+
export async function dominantCorpusLanguage(
|
|
170
|
+
storage: CorpusLanguageStorage,
|
|
171
|
+
): Promise<LanguageHint | undefined> {
|
|
172
|
+
try {
|
|
173
|
+
const version = storage.getCorpusScanVersion();
|
|
174
|
+
const cached = corpusLanguageCache.get(storage.dir);
|
|
175
|
+
if (cached?.version === version) return cached.language;
|
|
176
|
+
const memories = await storage.readAllMemories();
|
|
177
|
+
const language = corpusDominantLanguage(
|
|
178
|
+
memories.slice(0, CORPUS_SAMPLE_CAP).map((memory: MemoryFile) => memory.frontmatter.language),
|
|
179
|
+
);
|
|
180
|
+
if (corpusLanguageCache.size > 8) corpusLanguageCache.clear();
|
|
181
|
+
corpusLanguageCache.set(storage.dir, { version, language });
|
|
182
|
+
return language;
|
|
183
|
+
} catch {
|
|
184
|
+
return undefined;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { readdirSync, readFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { test } from "node:test";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Architecture boundary (issue #2045): `@remnic/core` must never statically
|
|
8
|
+
* depend on an optional provider package. Provider implementations register
|
|
9
|
+
* through the location registry at runtime; the connector package consumes
|
|
10
|
+
* core, never the reverse. A static import here would break à-la-carte
|
|
11
|
+
* installs (`npm install @remnic/core` alone must work) and drag a network
|
|
12
|
+
* adapter into every base install.
|
|
13
|
+
*/
|
|
14
|
+
const FORBIDDEN_SPECIFIERS = ["@remnic/connector-reitti", "connector-reitti/src"];
|
|
15
|
+
|
|
16
|
+
// Production sources only: this test file itself names the banned specifier.
|
|
17
|
+
function collectSourceFiles(dir: string, files: string[] = []): string[] {
|
|
18
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
19
|
+
const path = join(dir, entry.name);
|
|
20
|
+
if (entry.isDirectory()) {
|
|
21
|
+
if (entry.name === "dist" || entry.name === "node_modules") continue;
|
|
22
|
+
collectSourceFiles(path, files);
|
|
23
|
+
} else if (entry.isFile() && /\.tsx?$/.test(entry.name) && !/\.test\.tsx?$/.test(entry.name)) {
|
|
24
|
+
files.push(path);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return files;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
test("core source never statically imports @remnic/connector-reitti", () => {
|
|
31
|
+
// The whole core tree, not just src/location: a static import anywhere in
|
|
32
|
+
// core would break a base install.
|
|
33
|
+
const coreSrc = join(import.meta.dirname, "..");
|
|
34
|
+
const offenders: string[] = [];
|
|
35
|
+
for (const file of collectSourceFiles(coreSrc)) {
|
|
36
|
+
const content = readFileSync(file, "utf8");
|
|
37
|
+
for (const specifier of FORBIDDEN_SPECIFIERS) {
|
|
38
|
+
if (content.includes(specifier)) {
|
|
39
|
+
offenders.push(`${file} references ${specifier}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
assert.deepEqual(offenders, []);
|
|
44
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Location context subsystem — public surface (issues #2044, #2045).
|
|
3
|
+
*
|
|
4
|
+
* Consumed by host adapters and optional provider packages via the
|
|
5
|
+
* `@remnic/core/location` subpath export; the root index stays frozen at its
|
|
6
|
+
* ratchet ceiling, and core never statically imports a provider package
|
|
7
|
+
* (register implementations through `registerLocationProvider` instead).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export * from "./types.js";
|
|
11
|
+
export * from "./registry.js";
|
|
12
|
+
export * from "./config.js";
|
|
13
|
+
export * from "./intervals.js";
|
|
14
|
+
export * from "./store.js";
|
|
15
|
+
export * from "./pipeline.js";
|
|
16
|
+
export * from "./cli.js";
|
|
@@ -219,6 +219,8 @@ export interface RecallInternalDeps {
|
|
|
219
219
|
searchOptions?: SearchQueryOptions;
|
|
220
220
|
onDebugSnapshot?: (snapshot: QmdRecallSnapshot) => Promise<void>;
|
|
221
221
|
/** Backend degradation observer, threaded into every QMD call (#1536). */
|
|
222
|
+
/** Cross-lingual plan flag (#2197): supplement the lexical page with vector-tier hits. */
|
|
223
|
+
crossScript?: boolean;
|
|
222
224
|
onDegradation?: (degradation: SearchDegradation) => void;
|
|
223
225
|
abortSignal?: AbortSignal;
|
|
224
226
|
},
|
|
@@ -25,6 +25,7 @@ import path from "node:path";
|
|
|
25
25
|
import { type BoxFrontmatter } from "../boxes.js";
|
|
26
26
|
import { type CapabilitySet, type GraphConstructionCapabilitySet, type MemoryLifecycleCapabilitySet, type SecurityCapabilitySet, resolveCapabilities, resolveCompressionCapabilities, resolveConsolidationCapabilities, resolveConversationContextCapabilities, resolveCreationMemoryCapabilities, resolveGraphConstructionCapabilities, resolveIdentityContinuityCapabilities, resolveIndexingCapabilities, resolveMemoryLifecycleCapabilities, resolveNamespaceCapabilities, resolveObjectiveStateCapabilities, resolvePipelineProcessingCapabilities, resolvePresentationCapabilities, resolveQmdCapabilities, resolveRecallAuxiliaryCapabilities, resolveRecallEnhancementCapabilities, resolveSecurityCapabilities } from "../capabilities.js";
|
|
27
27
|
import { searchCausalTrajectories } from "../causal-trajectory.js";
|
|
28
|
+
import { detectLanguageHint, dominantCorpusLanguage, planCrossScript } from "../cross-lingual-recall.js";
|
|
28
29
|
import { buildEntityRecallSection, entityRecentTranscriptLookbackHours, readRecentEntityTranscriptEntries } from "../entity-retrieval.js";
|
|
29
30
|
import { buildEventOrderRecallSection, shouldRecallEventOrderEvidence } from "../event-order-recall.js";
|
|
30
31
|
import { buildExplicitCueRecallSection } from "../explicit-cue-recall.js";
|
|
@@ -261,34 +262,22 @@ export class RecallInternalCoordinator {
|
|
|
261
262
|
// per-result explain data (e.g. reinforcementBoost) from the result that
|
|
262
263
|
// was actually served.
|
|
263
264
|
let xrayRecalledResults: QmdSearchResult[] = [];
|
|
264
|
-
// Issue #1577 — per-recall trust map (admitted + quarantined
|
|
265
|
-
//
|
|
266
|
-
//
|
|
267
|
-
//
|
|
268
|
-
// consumed by formatQmdResults (epistemic hedge), publishRecallResults
|
|
269
|
-
// (quarantine filtering on ALL paths), and the X-ray capture (trust
|
|
270
|
-
// projection + quarantined-item visibility — rule 34).
|
|
265
|
+
// Issue #1577 — per-recall trust map (admitted + quarantined). LOCAL, not
|
|
266
|
+
// instance state, so concurrent recalls cannot race on it. Consumed by
|
|
267
|
+
// formatQmdResults, publishRecallResults (quarantine filtering on ALL
|
|
268
|
+
// paths), and the X-ray capture (rule 34).
|
|
271
269
|
let recallTrustByPath: Map<string, TrustStageResultItem> | null = null;
|
|
272
|
-
// Issue #1577 — sink for the cold
|
|
273
|
-
//
|
|
274
|
-
//
|
|
275
|
-
// recallTrustByPath so cold/embedding/recent paths feed the same X-ray +
|
|
276
|
-
// epistemic-rendering + publisher-quarantine consumers the hot path uses
|
|
277
|
-
// (rule 41: the feature gate applies across ALL parallel recall paths).
|
|
270
|
+
// Issue #1577 — sink for the cold pipeline's trust map: cold callers read
|
|
271
|
+
// it back into recallTrustByPath so every path feeds the same consumers
|
|
272
|
+
// (rule 41 parity).
|
|
278
273
|
const trustByPathSink: { trustByPath: Map<string, TrustStageResultItem> | null } = {
|
|
279
274
|
trustByPath: null,
|
|
280
275
|
};
|
|
281
276
|
const lcmStructuredXrayResults: RecallXrayResult[] = [];
|
|
282
|
-
// Per-branch
|
|
283
|
-
//
|
|
284
|
-
//
|
|
285
|
-
//
|
|
286
|
-
// even when many candidates were dropped. Each entry captures
|
|
287
|
-
// the pool size BEFORE truncation at that branch. The X-ray
|
|
288
|
-
// capture block picks the pool that corresponds to the branch
|
|
289
|
-
// that actually produced the admitted results (via `recallSource`)
|
|
290
|
-
// so a pool from a branch whose candidates were killed by an
|
|
291
|
-
// earlier gate cannot leak into the `considered` count.
|
|
277
|
+
// Per-branch PRE-truncation pool size for the X-ray filter trace
|
|
278
|
+
// (issue #570 PR 1): `recalledMemoryCount` is post-truncation, so the
|
|
279
|
+
// trace would otherwise report considered == admitted. The capture block
|
|
280
|
+
// picks the branch that produced the admitted results via `recallSource`.
|
|
292
281
|
const xrayBranchPoolSize: Record<
|
|
293
282
|
"hot_qmd" | "hot_embedding" | "cold_fallback" | "recent_scan",
|
|
294
283
|
number
|
|
@@ -298,11 +287,9 @@ export class RecallInternalCoordinator {
|
|
|
298
287
|
cold_fallback: 0,
|
|
299
288
|
recent_scan: 0,
|
|
300
289
|
};
|
|
301
|
-
//
|
|
302
|
-
//
|
|
303
|
-
//
|
|
304
|
-
// sites) updates the same counter; the X-ray capture block
|
|
305
|
-
// reads this as the cold-fallback pool.
|
|
290
|
+
// Sink the cold-fallback pipeline (four call sites) writes its
|
|
291
|
+
// pre-truncation pool size into (issue #570 PR 1); the X-ray capture
|
|
292
|
+
// block reads it as the cold-fallback pool.
|
|
306
293
|
const xrayColdPoolSink = { size: 0 };
|
|
307
294
|
let selectedResultPartition: RecallResultPartition | null = null;
|
|
308
295
|
let identityInjectionModeUsed: IdentityInjectionMode | "none" = "none";
|
|
@@ -1908,6 +1895,19 @@ export class RecallInternalCoordinator {
|
|
|
1908
1895
|
degradations?: SearchDegradation[];
|
|
1909
1896
|
} | null;
|
|
1910
1897
|
|
|
1898
|
+
// Cross-lingual recall (#2197): computed beside the prefilter; never
|
|
1899
|
+
// throws — a failed corpus sample only skips the plan.
|
|
1900
|
+
const crossScriptPlanPromise = (async () => {
|
|
1901
|
+
const queryLanguage = detectLanguageHint(retrievalQuery);
|
|
1902
|
+
if (queryLanguage === undefined) return null;
|
|
1903
|
+
const corpusLanguage = await dominantCorpusLanguage(this.deps.storage);
|
|
1904
|
+
if (corpusLanguage === undefined) return null;
|
|
1905
|
+
return planCrossScript({
|
|
1906
|
+
queryLanguage,
|
|
1907
|
+
corpusLanguage,
|
|
1908
|
+
vectorTierAvailable: resolveMemoryLifecycleCapabilities(this.deps.config).embeddingFallback,
|
|
1909
|
+
});
|
|
1910
|
+
})().catch(() => null);
|
|
1911
1911
|
const qmdEnrichmentAbort = createEnrichmentAbortHandle(options.abortSignal);
|
|
1912
1912
|
const qmdPromise = observeEnrichmentPromise(
|
|
1913
1913
|
(async (): Promise<QmdPhaseResult> => {
|
|
@@ -1989,7 +1989,11 @@ export class RecallInternalCoordinator {
|
|
|
1989
1989
|
}
|
|
1990
1990
|
return cachedQmd.value;
|
|
1991
1991
|
}
|
|
1992
|
-
|
|
1992
|
+
const crossScriptPlan = await crossScriptPlanPromise;
|
|
1993
|
+
if (crossScriptPlan?.degradation) {
|
|
1994
|
+
backendDegradations.push(crossScriptPlan.degradation);
|
|
1995
|
+
}
|
|
1996
|
+
const crossScript = crossScriptPlan?.crossScript === true;
|
|
1993
1997
|
if (!this.deps.qmd.isAvailable()) {
|
|
1994
1998
|
const now = Date.now();
|
|
1995
1999
|
const QMD_REPROBE_COOLDOWN_MS = 60_000;
|
|
@@ -2141,6 +2145,7 @@ export class RecallInternalCoordinator {
|
|
|
2141
2145
|
resolveNamespace: (p) => this.deps.namespaceFromPath(p),
|
|
2142
2146
|
queryAwarePrefilter,
|
|
2143
2147
|
searchOptions: qmdSearchOptions,
|
|
2148
|
+
crossScript,
|
|
2144
2149
|
abortSignal: qmdEnrichmentAbort.signal,
|
|
2145
2150
|
onDegradation: (degradation) => {
|
|
2146
2151
|
backendDegradations.push(degradation);
|
|
@@ -4105,8 +4110,6 @@ export class RecallInternalCoordinator {
|
|
|
4105
4110
|
undefined,
|
|
4106
4111
|
{ asOfMs, requestingConnector: options.sourceConnector },
|
|
4107
4112
|
);
|
|
4108
|
-
// MMR runs on the pre-truncation pool so diverse candidates just
|
|
4109
|
-
// below the cutoff can be promoted into the injected set.
|
|
4110
4113
|
xrayBranchPoolSize.hot_embedding = Math.max(
|
|
4111
4114
|
xrayBranchPoolSize.hot_embedding,
|
|
4112
4115
|
boostedScoped.length,
|
|
@@ -4319,8 +4322,7 @@ export class RecallInternalCoordinator {
|
|
|
4319
4322
|
undefined,
|
|
4320
4323
|
{ asOfMs, requestingConnector: options.sourceConnector },
|
|
4321
4324
|
);
|
|
4322
|
-
// MMR runs on the pre-truncation pool
|
|
4323
|
-
// below the cutoff can be promoted into the injected set.
|
|
4325
|
+
// MMR runs on the pre-truncation pool (see the hot-embedding branch).
|
|
4324
4326
|
xrayBranchPoolSize.hot_embedding = Math.max(
|
|
4325
4327
|
xrayBranchPoolSize.hot_embedding,
|
|
4326
4328
|
boostedScoped.length,
|
|
@@ -281,6 +281,8 @@ export class RecallSearchPipelineCoordinator {
|
|
|
281
281
|
searchOptions?: SearchQueryOptions;
|
|
282
282
|
onDebugSnapshot?: (snapshot: QmdRecallSnapshot) => Promise<void>;
|
|
283
283
|
/** Backend degradation observer, threaded into every QMD call (#1536). */
|
|
284
|
+
/** Cross-lingual plan flag (#2197): supplement the lexical page with vector-tier hits. */
|
|
285
|
+
crossScript?: boolean;
|
|
284
286
|
onDegradation?: (degradation: SearchDegradation) => void;
|
|
285
287
|
abortSignal?: AbortSignal;
|
|
286
288
|
},
|
|
@@ -334,6 +336,12 @@ export class RecallSearchPipelineCoordinator {
|
|
|
334
336
|
const debugSearchOptions = backendHonorsQmdSearchSignals
|
|
335
337
|
? resolvedSearchOptions
|
|
336
338
|
: undefined;
|
|
339
|
+
// Cross-lingual recall (#2197): lexical tiers cannot match a query whose
|
|
340
|
+
// dominant script differs from the corpus's, whatever the page fill.
|
|
341
|
+
// Supplement with the embedding-fallback tier ONCE, before widening.
|
|
342
|
+
const crossScriptVectorHits = options.crossScript
|
|
343
|
+
? await this.searchEmbeddingFallback(prompt, fetchLimit)
|
|
344
|
+
: [];
|
|
337
345
|
let bestFiltered = filterRecallCandidates(scopedSeedResults, {
|
|
338
346
|
namespacesEnabled: options.namespacesEnabled,
|
|
339
347
|
recallNamespaces: options.recallNamespaces,
|
|
@@ -475,6 +483,14 @@ export class RecallSearchPipelineCoordinator {
|
|
|
475
483
|
}
|
|
476
484
|
}
|
|
477
485
|
|
|
486
|
+
if (crossScriptVectorHits.length > 0) {
|
|
487
|
+
mergedResults = dedupeResultsByNamespace(
|
|
488
|
+
[...mergedResults, ...crossScriptVectorHits],
|
|
489
|
+
this.deps.namespaceFromPath,
|
|
490
|
+
fetchLimit,
|
|
491
|
+
{ filter: recallable },
|
|
492
|
+
);
|
|
493
|
+
}
|
|
478
494
|
if (scopedSeedResults.length > 0) {
|
|
479
495
|
mergedResults = dedupeResultsByNamespace(
|
|
480
496
|
[...scopedSeedResults, ...mergedResults],
|
package/src/search/port.ts
CHANGED
package/src/storage.ts
CHANGED
|
@@ -244,6 +244,7 @@ import { normalizeProjectionPreview, normalizeProjectionTags } from "./memory-pr
|
|
|
244
244
|
import { isSupportPassportPrivateMemory } from "./support-passport/card-projection.js";
|
|
245
245
|
import { parseFlexibleIsoTimestamp } from "./utils/iso-timestamp.js";
|
|
246
246
|
import { parseOriginClass } from "./security/origin-authority.js";
|
|
247
|
+
import { detectLanguageHint } from "./cross-lingual-recall.js";
|
|
247
248
|
import {
|
|
248
249
|
composeMemoryEnvelope,
|
|
249
250
|
isSealedMemoryEnvelope,
|
|
@@ -322,6 +323,7 @@ function serializeFrontmatter(fm: MemoryFrontmatter): string {
|
|
|
322
323
|
`tags: [${fm.tags.map((t) => `"${t}"`).join(", ")}]`,
|
|
323
324
|
];
|
|
324
325
|
// OKF v0.1 interop (issue #1946): inert presentation metadata; `category` stays canonical.
|
|
326
|
+
if (fm.language) lines.push(`language: ${fm.language}`);
|
|
325
327
|
if (fm.type !== undefined) lines.push(`type: ${fm.type}`);
|
|
326
328
|
if (fm.origin) lines.push(`origin: ${/^[A-Za-z0-9:_.*-]+$/.test(fm.origin) ? fm.origin : JSON.stringify(fm.origin)}`);
|
|
327
329
|
if (fm.entityRef) lines.push(`entityRef: ${fm.entityRef}`);
|
|
@@ -859,8 +861,9 @@ export function parseFrontmatter(raw: string): { frontmatter: MemoryFrontmatter;
|
|
|
859
861
|
frontmatter: {
|
|
860
862
|
id: fm.id ?? "",
|
|
861
863
|
category: (fm.category ?? "fact") as MemoryCategory,
|
|
862
|
-
type: parseFrontmatterStringValue(fm.type),
|
|
863
864
|
created: fm.created ?? new Date().toISOString(),
|
|
865
|
+
language: fm.language || undefined,
|
|
866
|
+
type: parseFrontmatterStringValue(fm.type),
|
|
864
867
|
updated: fm.updated ?? new Date().toISOString(),
|
|
865
868
|
source: fm.source ?? "unknown",
|
|
866
869
|
confidence: conf,
|
|
@@ -3729,6 +3732,7 @@ export class StorageManager extends TombstoneBlockedCaptureIndexHost {
|
|
|
3729
3732
|
category,
|
|
3730
3733
|
created: now.toISOString(),
|
|
3731
3734
|
updated: now.toISOString(),
|
|
3735
|
+
language: detectLanguageHint(content),
|
|
3732
3736
|
source: options.source ?? "extraction",
|
|
3733
3737
|
confidence: conf,
|
|
3734
3738
|
confidenceTier: tier,
|
package/src/types.ts
CHANGED
|
@@ -2807,6 +2807,8 @@ export interface MemoryFrontmatter extends SourceConnectorProvenance, OriginMeta
|
|
|
2807
2807
|
category: MemoryCategory;
|
|
2808
2808
|
/** OKF v0.1 interop metadata (issue #1946). Inert: presentation only, never overrides `category`. */
|
|
2809
2809
|
type?: string;
|
|
2810
|
+
/** Dominant-script hint (ISO 15924, e.g. `latn`/`jpan`) for cross-lingual recall (#2197). Absent on legacy files. */
|
|
2811
|
+
language?: string;
|
|
2810
2812
|
created: string;
|
|
2811
2813
|
updated: string;
|
|
2812
2814
|
source: string;
|