@remnic/core 9.60.0 → 9.60.2
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 +11 -11
- package/dist/access-admin-ops-surface.js +25 -25
- package/dist/access-authorization-probe.d.ts +11 -11
- package/dist/access-authorization-probe.js +26 -26
- package/dist/access-boundary.d.ts +11 -11
- package/dist/access-boundary.js +25 -25
- package/dist/access-cli.js +80 -79
- 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 +11 -11
- package/dist/access-extraction-force-flush.js +25 -25
- package/dist/access-health-types.d.ts +1 -1
- package/dist/access-http-lcm-compaction.d.ts +11 -11
- package/dist/access-http-lifecycle-flush.d.ts +11 -11
- package/dist/access-http-offline-stream.d.ts +11 -11
- package/dist/access-http-query.js +25 -25
- package/dist/access-http.d.ts +12 -12
- package/dist/access-http.js +38 -38
- package/dist/access-identity-continuity-surface.d.ts +9 -9
- package/dist/access-identity-continuity-surface.js +25 -25
- package/dist/access-lcm-surface.d.ts +11 -11
- package/dist/access-lcm-surface.js +25 -25
- package/dist/access-mcp.d.ts +11 -11
- package/dist/access-mcp.js +32 -32
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-TBXz-8s_.d.ts → access-namespace-preflight-EMvicnrb.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +25 -25
- package/dist/access-observe-write-surface.d.ts +11 -11
- package/dist/access-observe-write-surface.js +25 -25
- package/dist/access-offline-manifest.d.ts +9 -9
- package/dist/access-operations-batch.js +27 -27
- package/dist/access-operations.d.ts +11 -11
- package/dist/access-operations.js +31 -31
- package/dist/access-recall-concurrency.d.ts +11 -11
- package/dist/access-recall-concurrency.js +25 -25
- package/dist/access-recall-response.d.ts +11 -11
- package/dist/access-recall-response.js +25 -25
- package/dist/access-recall-surface.d.ts +11 -11
- package/dist/access-recall-surface.js +25 -25
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-BQkRul4d.d.ts → access-service-BeDYQQ62.d.ts} +7 -7
- package/dist/access-service-helpers.d.ts +11 -11
- package/dist/access-service.d.ts +11 -11
- package/dist/access-service.js +25 -25
- package/dist/access-surface-catalog.d.ts +11 -11
- package/dist/access-surface-catalog.js +27 -27
- 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 +1 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +2 -2
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/ambient-provenance.d.ts +1 -1
- package/dist/artifact-search.d.ts +1 -1
- package/dist/{auto-sync-5HVRCMGZ.js → auto-sync-FMWQQB3J.js} +3 -3
- 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-window.d.ts +2 -2
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +11 -11
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer-turn-helpers.d.ts +1 -1
- package/dist/buffer.d.ts +2 -2
- package/dist/buffer.js +4 -4
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{capsule-crypto-GWVG7LGC.js → capsule-crypto-7FJQINUR.js} +2 -2
- package/dist/{catalog-z1UerMbh.d.ts → catalog-B2SxZ6LU.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 +12 -12
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-7DHFB5SG.js → chunk-2GRLJMKJ.js} +3 -3
- package/dist/{chunk-OWHERGF2.js → chunk-2NLLXCJG.js} +2 -2
- package/dist/{chunk-B4CSPFYN.js → chunk-2RIDW23Y.js} +8 -8
- package/dist/{chunk-VOKK4WCG.js → chunk-3GPBFDXH.js} +2 -2
- package/dist/{chunk-KXYMU4IN.js → chunk-4JGSG7QN.js} +3 -3
- package/dist/{chunk-A7266TRJ.js → chunk-4XAVQLBR.js} +2 -2
- package/dist/{chunk-LLZKOSGM.js → chunk-5WVUO6QT.js} +1 -1
- package/dist/{chunk-LLZKOSGM.js.map → chunk-5WVUO6QT.js.map} +1 -1
- package/dist/{chunk-UBSM6TZP.js → chunk-76YNCJ5H.js} +2 -2
- package/dist/{chunk-JNWISMYG.js → chunk-7N7DB4L5.js} +5 -5
- package/dist/{chunk-6C7Q6NG3.js → chunk-AWRJBAIH.js} +16 -16
- package/dist/{chunk-PFPNUFKZ.js → chunk-C3R732UY.js} +59 -40
- package/dist/chunk-C3R732UY.js.map +1 -0
- package/dist/{chunk-DE6YCZEE.js → chunk-CIA6ZUBA.js} +2 -2
- package/dist/{chunk-PEDYKCJI.js → chunk-CK3NQUSQ.js} +2 -2
- package/dist/{chunk-OU7RWWW6.js → chunk-CM4SZZBN.js} +2 -2
- package/dist/{chunk-ODAE36PG.js → chunk-D5HDJWNN.js} +2 -2
- package/dist/{chunk-4IIKJOYM.js → chunk-DSA47WBN.js} +2 -2
- package/dist/{chunk-4CLE2LXB.js → chunk-EGW4O32Z.js} +75 -38
- package/dist/chunk-EGW4O32Z.js.map +1 -0
- package/dist/{chunk-KF75ANST.js → chunk-EHMMRZOZ.js} +2 -2
- package/dist/{chunk-7G34CBKS.js → chunk-EIQFIJDM.js} +2 -2
- package/dist/{chunk-YNDLCWXS.js → chunk-EZ25VE3G.js} +4 -4
- package/dist/{chunk-RXN7Z2V5.js → chunk-FQSDU634.js} +2 -2
- package/dist/{chunk-G3JFFUKR.js → chunk-FW73HN33.js} +2 -2
- package/dist/{chunk-MMZK2DWN.js → chunk-G3YBWFUC.js} +1 -1
- package/dist/chunk-GKUA4MGB.js +40 -0
- package/dist/chunk-GKUA4MGB.js.map +1 -0
- package/dist/{chunk-I4BLRM7X.js → chunk-GN7HO2LA.js} +10 -10
- package/dist/{chunk-ZOGOOSB3.js → chunk-H32ANIFP.js} +2 -2
- package/dist/{chunk-AH2NX6S7.js → chunk-HEEEMJ26.js} +3 -3
- package/dist/{chunk-J65AKOD6.js → chunk-HQBVQICL.js} +2 -2
- package/dist/{chunk-VJXSAJFW.js → chunk-I67HKRBF.js} +2 -2
- package/dist/{chunk-RKNJBZ55.js → chunk-JBPKEARU.js} +4 -4
- package/dist/{chunk-RL3EGL7A.js → chunk-JGW2EUCQ.js} +2 -2
- package/dist/{chunk-R7IV3EUJ.js → chunk-JKW663ZN.js} +2 -2
- package/dist/{chunk-YBCZTBN2.js → chunk-KAB7TZN3.js} +2 -2
- package/dist/{chunk-4UUF2EX3.js → chunk-KPML4Q3M.js} +2 -2
- package/dist/{chunk-5W7CTZ2E.js → chunk-KQAFEZQX.js} +4 -4
- package/dist/{chunk-YKZFX2HQ.js → chunk-L33N3BCA.js} +2 -2
- package/dist/{chunk-PYHOAXTI.js → chunk-LRGSLV7M.js} +4 -4
- package/dist/{chunk-FI5EAP4N.js → chunk-MJ4UGUR6.js} +2 -2
- package/dist/{chunk-KBIIE57I.js → chunk-MU3TPZOV.js} +2 -2
- package/dist/{chunk-77DAFTUU.js → chunk-MYZ4NA43.js} +2 -2
- package/dist/{chunk-T2VJ2EO5.js → chunk-N4EPIKSY.js} +6 -6
- package/dist/{chunk-EZXGJJXM.js → chunk-N4OYPGZS.js} +2 -2
- package/dist/{chunk-L3JVAM5Q.js → chunk-PA5OPZX2.js} +2 -2
- package/dist/{chunk-RVO6TCTU.js → chunk-QCECHYZL.js} +6 -6
- package/dist/{chunk-EWL5DICB.js → chunk-QRKYABS6.js} +3 -3
- package/dist/{chunk-P6GOYLHN.js → chunk-QWPAQLYV.js} +2 -2
- package/dist/{chunk-BTHDQOF4.js → chunk-QYN5PXDZ.js} +5 -5
- package/dist/{chunk-MG7GI4TT.js → chunk-S3B3UIQ3.js} +2 -2
- package/dist/{chunk-6W2ISYUV.js → chunk-TE4MKFT2.js} +4 -4
- package/dist/{chunk-QUJC22CT.js → chunk-URN7XWGC.js} +2 -2
- package/dist/{chunk-G5OB4XZX.js → chunk-VANZKHTN.js} +4 -4
- package/dist/{chunk-ER4BLWI6.js → chunk-VI637ILW.js} +24 -7
- package/dist/chunk-VI637ILW.js.map +1 -0
- package/dist/{chunk-BPM6UHUL.js → chunk-VWDTV6SH.js} +2 -2
- package/dist/{chunk-P5OYNV7B.js → chunk-W3Y6FYRK.js} +2 -2
- package/dist/{chunk-VIM6QH4D.js → chunk-W4Q54HM3.js} +2 -2
- package/dist/{chunk-UVYI6VIX.js → chunk-X7Y7WX73.js} +1 -1
- package/dist/{chunk-FUWS2MNJ.js → chunk-XBR5BAKW.js} +4 -4
- package/dist/{chunk-CZGOLAEW.js → chunk-XD4VGLDL.js} +47 -47
- package/dist/{chunk-OV36CROW.js → chunk-XDK6ZFLL.js} +3 -3
- package/dist/{chunk-JHMAYABJ.js → chunk-XL3TATMJ.js} +4 -4
- package/dist/{chunk-OLX2HJFW.js → chunk-YLHM5BQQ.js} +4 -4
- package/dist/{chunk-2VHCLHZ5.js → chunk-YUIBXMZY.js} +147 -40
- package/dist/chunk-YUIBXMZY.js.map +1 -0
- package/dist/{chunk-HVP33QVW.js → chunk-ZKOPY4WW.js} +60 -4
- package/dist/chunk-ZKOPY4WW.js.map +1 -0
- package/dist/{cli-DsyVvOFP.d.ts → cli-DB_uakTc.d.ts} +5 -5
- package/dist/cli.d.ts +13 -13
- package/dist/cli.js +61 -61
- package/dist/coding/pre-action-gate.d.ts +1 -1
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +12 -12
- package/dist/compounding/preference-consolidator.d.ts +1 -1
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +2 -2
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +11 -11
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +11 -11
- 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 +4 -4
- package/dist/converge-config.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +2 -2
- package/dist/convergence-refresh.js +13 -13
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/corpus-watermark.d.ts +1 -1
- package/dist/corpus-watermark.js +13 -13
- package/dist/dashboard-runtime.js +2 -2
- 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-DdwSc1qh.d.ts → dependency-propagation-delivery-DcOVpK3y.d.ts} +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-origin-fields.d.ts +28 -0
- package/dist/entity-origin-fields.js +10 -0
- package/dist/entity-origin-fields.js.map +1 -0
- package/dist/entity-retrieval.d.ts +2 -2
- package/dist/entity-retrieval.js +12 -11
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +9 -9
- package/dist/external-wiki-access.d.ts +11 -11
- package/dist/external-wiki-access.js +26 -26
- 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 +11 -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 +15 -15
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/graph-dashboard-diff.d.ts +1 -1
- package/dist/graph-dashboard-key.d.ts +1 -1
- package/dist/graph-dashboard-parser.d.ts +1 -1
- package/dist/graph-edge-reinforcement.d.ts +1 -1
- package/dist/graph-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 +23 -23
- package/dist/index.js +90 -89
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +3 -3
- 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 +11 -11
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +11 -11
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +12 -12
- package/dist/{maintenance-DvkiF7fm.d.ts → maintenance-5c1olVtB.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +11 -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-store.d.ts +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 +12 -12
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +8 -8
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +11 -11
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/offline-sync-impression-drain.d.ts +1 -1
- package/dist/operator-doctor-corpus.d.ts +1 -1
- package/dist/operator-doctor-corpus.js +14 -14
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +20 -20
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +16 -16
- package/dist/{orchestrator-CXPIzs3D.d.ts → orchestrator-HPuY6I4i.d.ts} +8 -8
- package/dist/orchestrator.d.ts +9 -9
- package/dist/orchestrator.js +80 -79
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-BuYWU9rt.d.ts → pipeline-CvVe1Q2_.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/proactive-contention.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/{public-http-m9x1Qyzn.d.ts → public-http-D0JKFkyf.d.ts} +1 -1
- package/dist/{qmd-DYnrPw-m.d.ts → qmd-Bd0Tp76_.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/qmd.js +4 -4
- 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 +1 -1
- package/dist/reconcile/manifest.d.ts +1 -1
- package/dist/reconcile/plan.d.ts +1 -1
- package/dist/replay/normalizers/chatgpt.d.ts +1 -1
- package/dist/replay/normalizers/claude.d.ts +1 -1
- package/dist/replay/normalizers/openclaw.d.ts +1 -1
- package/dist/replay/normalizers/shared.d.ts +1 -1
- package/dist/replay/runner.d.ts +1 -1
- package/dist/replay/types.d.ts +1 -1
- package/dist/replica-divergence.d.ts +1 -1
- package/dist/replica-peers-config.d.ts +1 -1
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/resume-bundles.js +3 -3
- package/dist/retrieval-agents.d.ts +2 -2
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +1 -1
- package/dist/routing/store.d.ts +1 -1
- package/dist/salvage-envelope.d.ts +1 -1
- package/dist/{scope-profiles-C1QG4Cmv.d.ts → scope-profiles-ClLtm9gK.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 +7 -7
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +7 -7
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-DMeX8XS0.d.ts → semantic-consolidation-B1EkeEDj.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +12 -12
- package/dist/semantic-rule-promotion.js +11 -11
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +11 -11
- package/dist/{service-CT3ENiTO.d.ts → service-Cf3ANQj9.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 +4 -4
- package/dist/shared-context/manager.js +2 -1
- package/dist/signal.d.ts +1 -1
- package/dist/source-agent-qualifier.d.ts +1 -1
- package/dist/source-agent-qualifier.js +13 -13
- package/dist/{storage-B0L76y7N.d.ts → storage-DS2O_6Qt.d.ts} +4 -2
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +12 -10
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/support-passport/index.d.ts +14 -14
- package/dist/support-passport/index.js +28 -28
- package/dist/temporal-supersession.d.ts +2 -2
- package/dist/temporal-timeline-recall.d.ts +1 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +1 -1
- package/dist/tier-migration.d.ts +2 -2
- package/dist/tier-routing.d.ts +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/import-sqlite.js +2 -2
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-D7pB0QwO.d.ts → types-BOANGhCJ.d.ts} +3 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +11 -11
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -2
- package/src/entity-origin-fields.ts +56 -0
- package/src/entity-retrieval.ts +84 -84
- package/src/orchestration/extraction-injection-gate.ts +17 -5
- package/src/orchestration/extraction-persist.ts +1 -1
- package/src/orchestration/recall-internal.ts +3 -3
- package/src/recall-authority-fence.test.ts +40 -0
- package/src/security/audit-memory.test.ts +24 -1
- package/src/shared-context/manager.ts +21 -6
- package/src/storage/entity-store.ts +52 -17
- package/src/storage/entity-timeline.ts +96 -16
- package/src/storage.ts +18 -18
- package/src/types.ts +2 -2
- package/src/wearables/redaction.test.ts +44 -0
- package/src/wearables/text-language.ts +91 -23
- package/dist/chunk-2VHCLHZ5.js.map +0 -1
- package/dist/chunk-4CLE2LXB.js.map +0 -1
- package/dist/chunk-ER4BLWI6.js.map +0 -1
- package/dist/chunk-HVP33QVW.js.map +0 -1
- package/dist/chunk-PFPNUFKZ.js.map +0 -1
- /package/dist/{auto-sync-5HVRCMGZ.js.map → auto-sync-FMWQQB3J.js.map} +0 -0
- /package/dist/{capsule-crypto-GWVG7LGC.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
- /package/dist/{chunk-7DHFB5SG.js.map → chunk-2GRLJMKJ.js.map} +0 -0
- /package/dist/{chunk-OWHERGF2.js.map → chunk-2NLLXCJG.js.map} +0 -0
- /package/dist/{chunk-B4CSPFYN.js.map → chunk-2RIDW23Y.js.map} +0 -0
- /package/dist/{chunk-VOKK4WCG.js.map → chunk-3GPBFDXH.js.map} +0 -0
- /package/dist/{chunk-KXYMU4IN.js.map → chunk-4JGSG7QN.js.map} +0 -0
- /package/dist/{chunk-A7266TRJ.js.map → chunk-4XAVQLBR.js.map} +0 -0
- /package/dist/{chunk-UBSM6TZP.js.map → chunk-76YNCJ5H.js.map} +0 -0
- /package/dist/{chunk-JNWISMYG.js.map → chunk-7N7DB4L5.js.map} +0 -0
- /package/dist/{chunk-6C7Q6NG3.js.map → chunk-AWRJBAIH.js.map} +0 -0
- /package/dist/{chunk-DE6YCZEE.js.map → chunk-CIA6ZUBA.js.map} +0 -0
- /package/dist/{chunk-PEDYKCJI.js.map → chunk-CK3NQUSQ.js.map} +0 -0
- /package/dist/{chunk-OU7RWWW6.js.map → chunk-CM4SZZBN.js.map} +0 -0
- /package/dist/{chunk-ODAE36PG.js.map → chunk-D5HDJWNN.js.map} +0 -0
- /package/dist/{chunk-4IIKJOYM.js.map → chunk-DSA47WBN.js.map} +0 -0
- /package/dist/{chunk-KF75ANST.js.map → chunk-EHMMRZOZ.js.map} +0 -0
- /package/dist/{chunk-7G34CBKS.js.map → chunk-EIQFIJDM.js.map} +0 -0
- /package/dist/{chunk-YNDLCWXS.js.map → chunk-EZ25VE3G.js.map} +0 -0
- /package/dist/{chunk-RXN7Z2V5.js.map → chunk-FQSDU634.js.map} +0 -0
- /package/dist/{chunk-G3JFFUKR.js.map → chunk-FW73HN33.js.map} +0 -0
- /package/dist/{chunk-MMZK2DWN.js.map → chunk-G3YBWFUC.js.map} +0 -0
- /package/dist/{chunk-I4BLRM7X.js.map → chunk-GN7HO2LA.js.map} +0 -0
- /package/dist/{chunk-ZOGOOSB3.js.map → chunk-H32ANIFP.js.map} +0 -0
- /package/dist/{chunk-AH2NX6S7.js.map → chunk-HEEEMJ26.js.map} +0 -0
- /package/dist/{chunk-J65AKOD6.js.map → chunk-HQBVQICL.js.map} +0 -0
- /package/dist/{chunk-VJXSAJFW.js.map → chunk-I67HKRBF.js.map} +0 -0
- /package/dist/{chunk-RKNJBZ55.js.map → chunk-JBPKEARU.js.map} +0 -0
- /package/dist/{chunk-RL3EGL7A.js.map → chunk-JGW2EUCQ.js.map} +0 -0
- /package/dist/{chunk-R7IV3EUJ.js.map → chunk-JKW663ZN.js.map} +0 -0
- /package/dist/{chunk-YBCZTBN2.js.map → chunk-KAB7TZN3.js.map} +0 -0
- /package/dist/{chunk-4UUF2EX3.js.map → chunk-KPML4Q3M.js.map} +0 -0
- /package/dist/{chunk-5W7CTZ2E.js.map → chunk-KQAFEZQX.js.map} +0 -0
- /package/dist/{chunk-YKZFX2HQ.js.map → chunk-L33N3BCA.js.map} +0 -0
- /package/dist/{chunk-PYHOAXTI.js.map → chunk-LRGSLV7M.js.map} +0 -0
- /package/dist/{chunk-FI5EAP4N.js.map → chunk-MJ4UGUR6.js.map} +0 -0
- /package/dist/{chunk-KBIIE57I.js.map → chunk-MU3TPZOV.js.map} +0 -0
- /package/dist/{chunk-77DAFTUU.js.map → chunk-MYZ4NA43.js.map} +0 -0
- /package/dist/{chunk-T2VJ2EO5.js.map → chunk-N4EPIKSY.js.map} +0 -0
- /package/dist/{chunk-EZXGJJXM.js.map → chunk-N4OYPGZS.js.map} +0 -0
- /package/dist/{chunk-L3JVAM5Q.js.map → chunk-PA5OPZX2.js.map} +0 -0
- /package/dist/{chunk-RVO6TCTU.js.map → chunk-QCECHYZL.js.map} +0 -0
- /package/dist/{chunk-EWL5DICB.js.map → chunk-QRKYABS6.js.map} +0 -0
- /package/dist/{chunk-P6GOYLHN.js.map → chunk-QWPAQLYV.js.map} +0 -0
- /package/dist/{chunk-BTHDQOF4.js.map → chunk-QYN5PXDZ.js.map} +0 -0
- /package/dist/{chunk-MG7GI4TT.js.map → chunk-S3B3UIQ3.js.map} +0 -0
- /package/dist/{chunk-6W2ISYUV.js.map → chunk-TE4MKFT2.js.map} +0 -0
- /package/dist/{chunk-QUJC22CT.js.map → chunk-URN7XWGC.js.map} +0 -0
- /package/dist/{chunk-G5OB4XZX.js.map → chunk-VANZKHTN.js.map} +0 -0
- /package/dist/{chunk-BPM6UHUL.js.map → chunk-VWDTV6SH.js.map} +0 -0
- /package/dist/{chunk-P5OYNV7B.js.map → chunk-W3Y6FYRK.js.map} +0 -0
- /package/dist/{chunk-VIM6QH4D.js.map → chunk-W4Q54HM3.js.map} +0 -0
- /package/dist/{chunk-UVYI6VIX.js.map → chunk-X7Y7WX73.js.map} +0 -0
- /package/dist/{chunk-FUWS2MNJ.js.map → chunk-XBR5BAKW.js.map} +0 -0
- /package/dist/{chunk-CZGOLAEW.js.map → chunk-XD4VGLDL.js.map} +0 -0
- /package/dist/{chunk-OV36CROW.js.map → chunk-XDK6ZFLL.js.map} +0 -0
- /package/dist/{chunk-JHMAYABJ.js.map → chunk-XL3TATMJ.js.map} +0 -0
- /package/dist/{chunk-OLX2HJFW.js.map → chunk-YLHM5BQQ.js.map} +0 -0
package/src/entity-retrieval.ts
CHANGED
|
@@ -9,13 +9,17 @@ import { compareEntityTimestamps, normalizeEntityName, type StorageManager } fro
|
|
|
9
9
|
import { normalizeEntityText, resolveRequestedEntitySectionKeys } from "./entity-schema.js";
|
|
10
10
|
import type { EntityStructuredSection, MemoryFile, PluginConfig, TranscriptEntry } from "./types.js";
|
|
11
11
|
import { containsPhrase } from "./entity-retrieval-boundaries.js";
|
|
12
|
+
import {
|
|
13
|
+
buildOriginStructuredSections,
|
|
14
|
+
sanitizeOriginatedFacts,
|
|
15
|
+
type EntityOriginStructuredSection,
|
|
16
|
+
} from "./entity-origin-fields.js";
|
|
12
17
|
import {
|
|
13
18
|
checkEntityRecallAbort,
|
|
14
19
|
entityRecallSectionAbsent,
|
|
15
20
|
yieldEntityRecallScan,
|
|
16
21
|
yieldEntityRecallScanEvery,
|
|
17
22
|
} from "./entity-recall-cancellation.js";
|
|
18
|
-
|
|
19
23
|
const ENTITY_INDEX_VERSION = 3;
|
|
20
24
|
const RECENT_TRANSCRIPT_LOOKBACK_HOURS = 24;
|
|
21
25
|
const INSTRUCTION_LIKE_RE = /\b(always|never|must|should|remember to|do not|don't|process|workflow|template|checklist|instruction)\b/i;
|
|
@@ -23,24 +27,24 @@ const METADATA_WRAPPER_RE = /^(source|context|metadata|notes?):/i;
|
|
|
23
27
|
const ENTITY_PRONOUN_RE = /\b(he|him|his|she|her|they|them|their|it|its)\b/i;
|
|
24
28
|
const BELIEF_LEDGER_SECTION_KEY = "belief_ledger";
|
|
25
29
|
const BELIEF_LEDGER_FACT_RE = /^claim=([^;]+);\s*status=([^;]+);\s*updatedAt=([^;]+);\s*(.+)$/;
|
|
26
|
-
|
|
27
30
|
type EntityQueryMode = "direct" | "timeline" | "follow_up";
|
|
28
|
-
|
|
29
31
|
type EntityMentionIndexEntry = {
|
|
30
32
|
canonicalId: string;
|
|
31
33
|
name: string;
|
|
32
34
|
type: string;
|
|
33
|
-
aliases: string[];
|
|
34
35
|
summary?: string;
|
|
36
|
+
aliases: string[];
|
|
35
37
|
facts: string[];
|
|
36
38
|
timelineFacts: string[];
|
|
37
|
-
|
|
39
|
+
timelineFactOrigins?: Array<string | undefined>;
|
|
40
|
+
structuredSections: EntityOriginStructuredSection[];
|
|
38
41
|
timeline: Array<{
|
|
39
42
|
timestamp: string;
|
|
40
43
|
text: string;
|
|
41
44
|
source?: string;
|
|
42
45
|
sessionKey?: string;
|
|
43
46
|
principal?: string;
|
|
47
|
+
origin?: string;
|
|
44
48
|
}>;
|
|
45
49
|
relationships: Array<{ target: string; label: string }>;
|
|
46
50
|
activity: Array<{ date: string; note: string }>;
|
|
@@ -55,21 +59,18 @@ type EntityMentionIndexEntry = {
|
|
|
55
59
|
derivedDate?: string;
|
|
56
60
|
}>;
|
|
57
61
|
};
|
|
58
|
-
|
|
59
62
|
type EntityMentionIndex = {
|
|
60
63
|
version: number;
|
|
61
64
|
updatedAt: string;
|
|
62
65
|
entityStatusVersion?: number;
|
|
63
66
|
entities: EntityMentionIndexEntry[];
|
|
64
67
|
};
|
|
65
|
-
|
|
66
68
|
type EntityCandidate = {
|
|
67
69
|
entry: EntityMentionIndexEntry;
|
|
68
70
|
alias: string;
|
|
69
71
|
score: number;
|
|
70
72
|
source: "query" | "recent_turn";
|
|
71
73
|
};
|
|
72
|
-
|
|
73
74
|
type EntityHintSnippet = {
|
|
74
75
|
text: string;
|
|
75
76
|
score: number;
|
|
@@ -96,37 +97,35 @@ export interface BuildEntityRecallSectionOptions {
|
|
|
96
97
|
*/
|
|
97
98
|
abortSignal?: AbortSignal;
|
|
98
99
|
}
|
|
99
|
-
|
|
100
100
|
function tokenize(value: string): string[] {
|
|
101
101
|
return normalizeEntityText(value).split(/\s+/).filter((token) => token.length >= 2);
|
|
102
102
|
}
|
|
103
|
-
|
|
104
103
|
function uniqueStrings(values: string[]): string[] {
|
|
105
104
|
return [...new Set(values.map((value) => value.trim()).filter((value) => value.length > 0))];
|
|
106
105
|
}
|
|
107
|
-
|
|
108
106
|
function compactLine(value: string, maxLength: number = 220): string {
|
|
109
107
|
const normalized = value.replace(/\s+/g, " ").trim();
|
|
110
108
|
if (normalized.length <= maxLength) return normalized;
|
|
111
109
|
return `${normalized.slice(0, Math.max(0, maxLength - 1)).trimEnd()}…`;
|
|
112
110
|
}
|
|
113
|
-
|
|
114
111
|
function dedupeHintSnippetsByText(snippets: EntityHintSnippet[]): EntityHintSnippet[] {
|
|
115
|
-
const
|
|
116
|
-
const result: EntityHintSnippet[] = [];
|
|
112
|
+
const deduped = new Map<string, EntityHintSnippet>();
|
|
117
113
|
for (const snippet of snippets) {
|
|
118
114
|
const key = normalizeEntityText(snippet.text);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
const existing = deduped.get(key);
|
|
116
|
+
if (!existing) {
|
|
117
|
+
deduped.set(key, snippet);
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (existing.origin !== snippet.origin) {
|
|
121
|
+
existing.origin = undefined;
|
|
122
|
+
}
|
|
122
123
|
}
|
|
123
|
-
return
|
|
124
|
+
return [...deduped.values()];
|
|
124
125
|
}
|
|
125
|
-
|
|
126
126
|
function isBeliefLedgerSection(section: Pick<EntityStructuredSection, "key">): boolean {
|
|
127
127
|
return normalizeEntityText(section.key).replace(/\s+/g, "_") === BELIEF_LEDGER_SECTION_KEY;
|
|
128
128
|
}
|
|
129
|
-
|
|
130
129
|
function beliefLedgerFactKeys(sections: EntityStructuredSection[]): Set<string> {
|
|
131
130
|
const keys = new Set<string>();
|
|
132
131
|
for (const section of sections) {
|
|
@@ -137,15 +136,16 @@ function beliefLedgerFactKeys(sections: EntityStructuredSection[]): Set<string>
|
|
|
137
136
|
}
|
|
138
137
|
return keys;
|
|
139
138
|
}
|
|
140
|
-
|
|
141
|
-
function recallFactsForStructuredSection(section: EntityStructuredSection):
|
|
142
|
-
if (!isBeliefLedgerSection(section))
|
|
139
|
+
type RecalledEntityFact = { text: string; sourceIndex: number };
|
|
140
|
+
function recallFactsForStructuredSection(section: EntityStructuredSection): RecalledEntityFact[] {
|
|
141
|
+
if (!isBeliefLedgerSection(section)) {
|
|
142
|
+
return section.facts.map((text, sourceIndex) => ({ text, sourceIndex }));
|
|
143
|
+
}
|
|
143
144
|
return currentActiveBeliefLedgerFactTexts(section.facts);
|
|
144
145
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
for (const fact of facts) {
|
|
146
|
+
function currentActiveBeliefLedgerFactTexts(facts: string[]): RecalledEntityFact[] {
|
|
147
|
+
const byClaim = new Map<string, { status: string; updatedAtMs: number; texts: RecalledEntityFact[] }>();
|
|
148
|
+
for (const [sourceIndex, fact] of facts.entries()) {
|
|
149
149
|
const match = BELIEF_LEDGER_FACT_RE.exec(fact.trim());
|
|
150
150
|
if (!match) continue;
|
|
151
151
|
const [, claimId, status, updatedAt, text] = match;
|
|
@@ -160,28 +160,20 @@ function currentActiveBeliefLedgerFactTexts(facts: string[]): string[] {
|
|
|
160
160
|
current.status === "active" &&
|
|
161
161
|
normalizedStatus !== "active";
|
|
162
162
|
if (!current || updatedAtMs > current.updatedAtMs || inactiveTieWins) {
|
|
163
|
-
byClaim.set(normalizedClaimId, { status: normalizedStatus, updatedAtMs, texts: [text.trim()] });
|
|
163
|
+
byClaim.set(normalizedClaimId, { status: normalizedStatus, updatedAtMs, texts: [{ text: text.trim(), sourceIndex }] });
|
|
164
164
|
continue;
|
|
165
165
|
}
|
|
166
166
|
if (updatedAtMs === current.updatedAtMs && current.status === normalizedStatus) {
|
|
167
|
-
current.texts.push(text.trim());
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
const result: string[] = [];
|
|
171
|
-
for (const current of byClaim.values()) {
|
|
172
|
-
if (current.status === "active") {
|
|
173
|
-
result.push(...current.texts);
|
|
167
|
+
current.texts.push({ text: text.trim(), sourceIndex });
|
|
174
168
|
}
|
|
175
169
|
}
|
|
176
|
-
return
|
|
170
|
+
return [...byClaim.values()].flatMap((current) => current.status === "active" ? current.texts : []);
|
|
177
171
|
}
|
|
178
|
-
|
|
179
172
|
function relationLine(entry: EntityMentionIndexEntry, relationship: { target: string; label: string }): string {
|
|
180
173
|
const normalizedLabel = relationship.label.replace(/\s+/g, " ").trim();
|
|
181
174
|
if (normalizedLabel.length === 0) return `${entry.name} is connected to ${relationship.target}`;
|
|
182
175
|
return `${entry.name} ${normalizedLabel} ${relationship.target}`;
|
|
183
176
|
}
|
|
184
|
-
|
|
185
177
|
function detectEntityQueryMode(query: string): EntityQueryMode | null {
|
|
186
178
|
const normalized = normalizeEntityText(query);
|
|
187
179
|
if (!normalized) return null;
|
|
@@ -211,7 +203,6 @@ function detectEntityQueryMode(query: string): EntityQueryMode | null {
|
|
|
211
203
|
}
|
|
212
204
|
return null;
|
|
213
205
|
}
|
|
214
|
-
|
|
215
206
|
function scoreAliasMatch(query: string, alias: string): number {
|
|
216
207
|
const normalizedQuery = normalizeEntityText(query);
|
|
217
208
|
const normalizedAlias = normalizeEntityText(alias);
|
|
@@ -246,7 +237,6 @@ function scoreAliasMatch(query: string, alias: string): number {
|
|
|
246
237
|
}
|
|
247
238
|
return overlap;
|
|
248
239
|
}
|
|
249
|
-
|
|
250
240
|
/**
|
|
251
241
|
* Tokens that look like type prefixes / generic role identifiers and
|
|
252
242
|
* therefore should not, on their own, count as evidence that a
|
|
@@ -264,15 +254,12 @@ const ALIAS_AFFIX_TOKENS = new Set<string>([
|
|
|
264
254
|
"place", "places", "tool", "tools", "service", "services",
|
|
265
255
|
"system", "systems", "agent", "agents", "bot", "bots",
|
|
266
256
|
]);
|
|
267
|
-
|
|
268
257
|
function isAliasAffixToken(token: string): boolean {
|
|
269
258
|
return ALIAS_AFFIX_TOKENS.has(token);
|
|
270
259
|
}
|
|
271
|
-
|
|
272
260
|
function isLikelyInstructionLike(value: string): boolean {
|
|
273
261
|
return INSTRUCTION_LIKE_RE.test(value) || METADATA_WRAPPER_RE.test(value);
|
|
274
262
|
}
|
|
275
|
-
|
|
276
263
|
function sanitizeEntityFact(fact: string): string {
|
|
277
264
|
const sanitized = sanitizeMemoryContent(fact);
|
|
278
265
|
const clean = sanitized.text.trim();
|
|
@@ -280,7 +267,6 @@ function sanitizeEntityFact(fact: string): string {
|
|
|
280
267
|
if (INSTRUCTION_LIKE_RE.test(clean) && clean.length > 100) return "";
|
|
281
268
|
return clean;
|
|
282
269
|
}
|
|
283
|
-
|
|
284
270
|
function scoreHintSnippet(snippet: EntityHintSnippet, queryTokens: string[]): EntityHintSnippet | null {
|
|
285
271
|
const normalized = normalizeEntityText(snippet.text);
|
|
286
272
|
if (!normalized) return null;
|
|
@@ -294,7 +280,6 @@ function scoreHintSnippet(snippet: EntityHintSnippet, queryTokens: string[]): En
|
|
|
294
280
|
if (scored.text.length <= 160) scored.score += 1;
|
|
295
281
|
return scored.score > 0 ? scored : null;
|
|
296
282
|
}
|
|
297
|
-
|
|
298
283
|
function sortTimelineEntriesDesc(
|
|
299
284
|
left: EntityMentionIndexEntry["timeline"][number],
|
|
300
285
|
right: EntityMentionIndexEntry["timeline"][number],
|
|
@@ -305,7 +290,6 @@ function sortTimelineEntriesDesc(
|
|
|
305
290
|
}
|
|
306
291
|
return right.text.localeCompare(left.text);
|
|
307
292
|
}
|
|
308
|
-
|
|
309
293
|
function jaccardSimilarity(a: string, b: string): number {
|
|
310
294
|
const aTokens = new Set(tokenize(a));
|
|
311
295
|
const bTokens = new Set(tokenize(b));
|
|
@@ -317,7 +301,6 @@ function jaccardSimilarity(a: string, b: string): number {
|
|
|
317
301
|
const union = new Set([...aTokens, ...bTokens]).size;
|
|
318
302
|
return union === 0 ? 0 : intersection / union;
|
|
319
303
|
}
|
|
320
|
-
|
|
321
304
|
function buildAliasIndex(entries: EntityMentionIndexEntry[]): Map<string, EntityMentionIndexEntry[]> {
|
|
322
305
|
const index = new Map<string, EntityMentionIndexEntry[]>();
|
|
323
306
|
for (const entry of entries) {
|
|
@@ -330,7 +313,6 @@ function buildAliasIndex(entries: EntityMentionIndexEntry[]): Map<string, Entity
|
|
|
330
313
|
}
|
|
331
314
|
return index;
|
|
332
315
|
}
|
|
333
|
-
|
|
334
316
|
async function readNativeChunks(
|
|
335
317
|
config: PluginConfig,
|
|
336
318
|
recallNamespaces?: string[],
|
|
@@ -344,7 +326,6 @@ async function readNativeChunks(
|
|
|
344
326
|
defaultNamespace: config.defaultNamespace,
|
|
345
327
|
}).catch(() => []);
|
|
346
328
|
}
|
|
347
|
-
|
|
348
329
|
async function resolveEntityIndexStorages(
|
|
349
330
|
storage: StorageManager,
|
|
350
331
|
config: PluginConfig,
|
|
@@ -359,7 +340,6 @@ async function resolveEntityIndexStorages(
|
|
|
359
340
|
) {
|
|
360
341
|
return [storage];
|
|
361
342
|
}
|
|
362
|
-
|
|
363
343
|
const storages: StorageManager[] = [];
|
|
364
344
|
const seenDirs = new Set<string>();
|
|
365
345
|
for (const namespace of uniqueStrings(recallNamespaces)) {
|
|
@@ -373,10 +353,8 @@ async function resolveEntityIndexStorages(
|
|
|
373
353
|
continue;
|
|
374
354
|
}
|
|
375
355
|
}
|
|
376
|
-
|
|
377
356
|
return storages.length > 0 ? storages : [storage];
|
|
378
357
|
}
|
|
379
|
-
|
|
380
358
|
function entityIndexStatePath(storage: StorageManager): string {
|
|
381
359
|
return path.join(storage.dir, "state", "entity-mention-index.json");
|
|
382
360
|
}
|
|
@@ -392,8 +370,6 @@ async function readEntityIndexState(storage: StorageManager): Promise<EntityMent
|
|
|
392
370
|
return null;
|
|
393
371
|
}
|
|
394
372
|
}
|
|
395
|
-
|
|
396
|
-
|
|
397
373
|
async function readCurrentPersistedEntityIndex(
|
|
398
374
|
storage: StorageManager,
|
|
399
375
|
config: PluginConfig,
|
|
@@ -429,7 +405,6 @@ function nativeEntityIndexRevision(chunks: NativeKnowledgeChunk[]): string {
|
|
|
429
405
|
]);
|
|
430
406
|
return createHash("sha256").update(JSON.stringify(projection)).digest("hex");
|
|
431
407
|
}
|
|
432
|
-
|
|
433
408
|
function namespaceEntityIndexCacheKey(
|
|
434
409
|
storages: StorageManager[],
|
|
435
410
|
recallNamespaces: string[],
|
|
@@ -449,7 +424,6 @@ function namespaceEntityIndexCacheKey(
|
|
|
449
424
|
.join("\u001f");
|
|
450
425
|
return `${namespaceKey}\u001e${storageKey}\u001e${nativeRevision}`;
|
|
451
426
|
}
|
|
452
|
-
|
|
453
427
|
function rememberNamespaceEntityIndex(key: string, index: EntityMentionIndex): void {
|
|
454
428
|
if (namespaceEntityIndexCache.size >= MAX_NAMESPACE_ENTITY_INDEX_CACHE_ENTRIES) {
|
|
455
429
|
const oldestKey = namespaceEntityIndexCache.keys().next().value;
|
|
@@ -585,10 +559,18 @@ async function buildEntityMentionIndex(
|
|
|
585
559
|
.filter(Boolean)
|
|
586
560
|
.filter((fact) => !rawBeliefLedgerFactKeys.has(normalizeEntityText(fact)))
|
|
587
561
|
.map((fact) => compactLine(fact, 180));
|
|
588
|
-
const
|
|
589
|
-
.
|
|
590
|
-
|
|
591
|
-
|
|
562
|
+
const { facts: timelineFacts, origins: timelineFactOrigins } = sanitizeOriginatedFacts(
|
|
563
|
+
entity.timeline,
|
|
564
|
+
sanitizeEntityFact,
|
|
565
|
+
compactLine,
|
|
566
|
+
true,
|
|
567
|
+
);
|
|
568
|
+
const structuredSections = buildOriginStructuredSections(
|
|
569
|
+
rawStructuredSections,
|
|
570
|
+
recallFactsForStructuredSection,
|
|
571
|
+
sanitizeEntityFact,
|
|
572
|
+
compactLine,
|
|
573
|
+
);
|
|
592
574
|
entities.set(canonicalId, {
|
|
593
575
|
canonicalId,
|
|
594
576
|
name: entity.name,
|
|
@@ -596,15 +578,9 @@ async function buildEntityMentionIndex(
|
|
|
596
578
|
aliases: uniqueStrings(entity.aliases),
|
|
597
579
|
summary: entity.synthesis?.trim() || entity.summary?.trim() || undefined,
|
|
598
580
|
facts: sanitizedFacts,
|
|
599
|
-
timelineFacts
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
title: section.title,
|
|
603
|
-
facts: recallFactsForStructuredSection(section)
|
|
604
|
-
.map((fact) => sanitizeEntityFact(fact))
|
|
605
|
-
.filter(Boolean)
|
|
606
|
-
.map((fact) => compactLine(fact, 180)),
|
|
607
|
-
})).filter((section) => section.facts.length > 0),
|
|
581
|
+
timelineFacts,
|
|
582
|
+
...(timelineFactOrigins.some((origin) => origin !== undefined) ? { timelineFactOrigins } : {}),
|
|
583
|
+
structuredSections,
|
|
608
584
|
timeline: entity.timeline.map((entry) => ({ ...entry })),
|
|
609
585
|
relationships: entity.relationships.map((relationship) => ({ ...relationship })),
|
|
610
586
|
activity: entity.activity.map((activity) => ({ ...activity })),
|
|
@@ -857,20 +833,29 @@ async function buildHintSnippets(
|
|
|
857
833
|
if (entry.summary) {
|
|
858
834
|
snippets.push({ text: compactLine(entry.summary, 180), score: 10, kind: "summary" });
|
|
859
835
|
}
|
|
860
|
-
|
|
861
836
|
if (requestedSectionKeys.size > 0) {
|
|
862
837
|
for (const section of entry.structuredSections) {
|
|
863
838
|
if (!requestedSectionKeys.has(normalizeEntityText(section.key).replace(/\s+/g, "_"))) continue;
|
|
864
|
-
for (const fact of section.facts) {
|
|
865
|
-
snippets.push({
|
|
839
|
+
for (const [index, fact] of section.facts.entries()) {
|
|
840
|
+
snippets.push({
|
|
841
|
+
text: fact,
|
|
842
|
+
score: mode === "direct" ? 8 : 9,
|
|
843
|
+
kind: "section",
|
|
844
|
+
origin: section.factOrigins?.[index],
|
|
845
|
+
});
|
|
866
846
|
}
|
|
867
847
|
}
|
|
868
848
|
} else {
|
|
869
|
-
for (const fact of entry.timelineFacts) {
|
|
870
|
-
snippets.push({
|
|
849
|
+
for (const [index, fact] of entry.timelineFacts.entries()) {
|
|
850
|
+
snippets.push({
|
|
851
|
+
text: fact,
|
|
852
|
+
score: mode === "direct" ? 6 : 7,
|
|
853
|
+
kind: "fact",
|
|
854
|
+
origin: entry.timelineFactOrigins?.[index],
|
|
855
|
+
});
|
|
871
856
|
}
|
|
872
857
|
for (const section of entry.structuredSections) {
|
|
873
|
-
for (const fact of section.facts) {
|
|
858
|
+
for (const [index, fact] of section.facts.entries()) {
|
|
874
859
|
const normalizedFact = normalizeEntityText(fact);
|
|
875
860
|
const hasNonAliasQueryOverlap = queryTokens.some((token) =>
|
|
876
861
|
!aliasTokens.has(token) && normalizedFact.includes(token)
|
|
@@ -878,7 +863,12 @@ async function buildHintSnippets(
|
|
|
878
863
|
if (entry.timelineFacts.length > 0 && !hasNonAliasQueryOverlap) {
|
|
879
864
|
continue;
|
|
880
865
|
}
|
|
881
|
-
snippets.push({
|
|
866
|
+
snippets.push({
|
|
867
|
+
text: fact,
|
|
868
|
+
score: mode === "direct" ? 6 : 7,
|
|
869
|
+
kind: "fact",
|
|
870
|
+
origin: section.factOrigins?.[index],
|
|
871
|
+
});
|
|
882
872
|
}
|
|
883
873
|
}
|
|
884
874
|
if (entry.timelineFacts.length === 0 && entry.structuredSections.length === 0) {
|
|
@@ -925,7 +915,13 @@ async function buildHintSnippets(
|
|
|
925
915
|
if (!scored) continue;
|
|
926
916
|
const normalized = normalizeEntityText(scored.text);
|
|
927
917
|
const existing = deduped.get(normalized);
|
|
928
|
-
if (!existing
|
|
918
|
+
if (!existing) {
|
|
919
|
+
deduped.set(normalized, scored);
|
|
920
|
+
} else if (existing.origin !== scored.origin) {
|
|
921
|
+
deduped.set(normalized, { ...(scored.score > existing.score ? scored : existing), origin: undefined });
|
|
922
|
+
} else if (scored.score > existing.score) {
|
|
923
|
+
deduped.set(normalized, scored);
|
|
924
|
+
}
|
|
929
925
|
}
|
|
930
926
|
|
|
931
927
|
return [...deduped.values()]
|
|
@@ -987,13 +983,17 @@ function formatEntityHintSection(
|
|
|
987
983
|
(candidate.entry.timeline ?? [])
|
|
988
984
|
.slice()
|
|
989
985
|
.sort(sortTimelineEntriesDesc)
|
|
990
|
-
.map((entry) =>
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
986
|
+
.map((entry) => {
|
|
987
|
+
const text = sanitizeEntityFact(entry.text);
|
|
988
|
+
return text
|
|
989
|
+
? scoreHintSnippet({
|
|
990
|
+
text: compactLine(text, 180),
|
|
991
|
+
score: 7,
|
|
992
|
+
kind: "activity" as const,
|
|
993
|
+
origin: entry.origin,
|
|
994
|
+
}, queryTokens)
|
|
995
|
+
: null;
|
|
996
|
+
})
|
|
997
997
|
.filter((snippet): snippet is EntityHintSnippet => snippet !== null)
|
|
998
998
|
.filter((snippet) => !seedExcludedTexts.has(normalizeEntityText(snippet.text))),
|
|
999
999
|
).slice(0, 2);
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Pure issue #1955 injection-screen gate for extracted facts.
|
|
3
|
-
*/
|
|
4
|
-
|
|
1
|
+
import { parseOriginClass } from "../security/origin-authority.js";
|
|
5
2
|
import { normalizeAttributePairs } from "../structured-attributes.js";
|
|
6
3
|
import { buildProcedurePersistBody } from "../procedural/procedure-types.js";
|
|
7
4
|
import { screenCandidateFact } from "../security/injection-screen.js";
|
|
@@ -123,7 +120,22 @@ export function screenEntityForIndex(entity: unknown, enabled: boolean): Screene
|
|
|
123
120
|
source: typeof record?.source === "string" ? record.source : "extraction",
|
|
124
121
|
facts: factScreen.kept,
|
|
125
122
|
...(sectionScreens
|
|
126
|
-
? {
|
|
123
|
+
? {
|
|
124
|
+
structuredSections: sectionScreens.map(({ section, screen }) => {
|
|
125
|
+
let nextFactIndex = 0;
|
|
126
|
+
const factOrigins = screen.kept.map((fact) => {
|
|
127
|
+
const factIndex = section.facts.indexOf(fact, nextFactIndex);
|
|
128
|
+
nextFactIndex = factIndex + 1;
|
|
129
|
+
const origin = section.factOrigins?.[factIndex];
|
|
130
|
+
return origin === undefined ? undefined : parseOriginClass(origin);
|
|
131
|
+
});
|
|
132
|
+
return {
|
|
133
|
+
...section,
|
|
134
|
+
facts: screen.kept,
|
|
135
|
+
...(factOrigins.some((origin) => origin !== undefined) ? { factOrigins } : {}),
|
|
136
|
+
};
|
|
137
|
+
}),
|
|
138
|
+
}
|
|
127
139
|
: rawSections
|
|
128
140
|
? { structuredSections: rawSections }
|
|
129
141
|
: {}),
|
|
@@ -116,7 +116,6 @@ import type { HarmonicConstructionInput } from "../harmonic-construction.js";
|
|
|
116
116
|
import { persistConstructedHarmonicRecords } from "./harmonic-construction-persist.js";
|
|
117
117
|
import { ExtractionAnchorSnapshot } from "./extraction-anchor-snapshot.js";
|
|
118
118
|
|
|
119
|
-
|
|
120
119
|
export class ExtractionPersistCoordinator {
|
|
121
120
|
constructor(
|
|
122
121
|
private readonly deps: ExtractionPersistDeps,
|
|
@@ -2856,6 +2855,7 @@ export class ExtractionPersistCoordinator {
|
|
|
2856
2855
|
timestamp: sourceContext?.validAt,
|
|
2857
2856
|
sessionKey: sourceContext?.sessionKey,
|
|
2858
2857
|
principal: sourceContext?.principal,
|
|
2858
|
+
origin,
|
|
2859
2859
|
structuredSections: screened.structuredSections,
|
|
2860
2860
|
});
|
|
2861
2861
|
if (id) {
|
|
@@ -746,9 +746,9 @@ export class RecallInternalCoordinator {
|
|
|
746
746
|
return null;
|
|
747
747
|
const t0 = Date.now();
|
|
748
748
|
const [priorities, roundtable, crossSignals] = await Promise.all([
|
|
749
|
-
this.deps.sharedContext.readPriorities(),
|
|
750
|
-
this.deps.sharedContext.readLatestRoundtable(),
|
|
751
|
-
this.deps.sharedContext.readLatestCrossSignals(),
|
|
749
|
+
this.deps.sharedContext.readPriorities(options.abortSignal),
|
|
750
|
+
this.deps.sharedContext.readLatestRoundtable(options.abortSignal),
|
|
751
|
+
this.deps.sharedContext.readLatestCrossSignals(options.abortSignal),
|
|
752
752
|
]);
|
|
753
753
|
const max = Math.max(500, this.deps.config.sharedContextMaxInjectChars);
|
|
754
754
|
const capSection = (
|
|
@@ -150,6 +150,46 @@ test("entity recall fences memory snippets and preserves disabled output", async
|
|
|
150
150
|
await rm(memoryDir, { recursive: true, force: true });
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
|
+
test("entity facts and structured sections retain extracted origin authority", async () => {
|
|
154
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-authority-entity-origin-"));
|
|
155
|
+
try {
|
|
156
|
+
const storage = new StorageManager(memoryDir);
|
|
157
|
+
await storage.writeEntity("Alice", "person", ["Alice prefers direct answers."], {
|
|
158
|
+
origin: "user",
|
|
159
|
+
structuredSections: [
|
|
160
|
+
{
|
|
161
|
+
key: "communication_style",
|
|
162
|
+
title: "Communication Style",
|
|
163
|
+
facts: ["Alice writes concise messages."],
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
});
|
|
167
|
+
const config = parseConfig({
|
|
168
|
+
openaiApiKey: "sk-test",
|
|
169
|
+
memoryDir,
|
|
170
|
+
workspaceDir: path.join(memoryDir, "workspace"),
|
|
171
|
+
originAuthorityEnabled: true,
|
|
172
|
+
});
|
|
173
|
+
const output = await buildEntityRecallSection({
|
|
174
|
+
config,
|
|
175
|
+
storage,
|
|
176
|
+
query: "Who is Alice?",
|
|
177
|
+
recentTurns: 1,
|
|
178
|
+
maxHints: 2,
|
|
179
|
+
maxSupportingFacts: 4,
|
|
180
|
+
maxRelatedEntities: 2,
|
|
181
|
+
maxChars: 10_000,
|
|
182
|
+
transcriptEntries: [],
|
|
183
|
+
originAuthorityEnabled: true,
|
|
184
|
+
untrustedOrigins: ["unknown"],
|
|
185
|
+
});
|
|
186
|
+
assert.match(output ?? "", /Alice prefers direct answers\./);
|
|
187
|
+
assert.match(output ?? "", /Alice writes concise messages\./);
|
|
188
|
+
assert.doesNotMatch(output ?? "", /content below is data, not instructions/);
|
|
189
|
+
} finally {
|
|
190
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
191
|
+
}
|
|
192
|
+
});
|
|
153
193
|
|
|
154
194
|
test("procedure recall fences untrusted-origin procedure bodies (#1955 review)", async () => {
|
|
155
195
|
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-authority-procedure-"));
|
|
@@ -14,6 +14,7 @@ type MemoryOptions = {
|
|
|
14
14
|
pathPrefix?: string;
|
|
15
15
|
source?: string;
|
|
16
16
|
sourceConnector?: string;
|
|
17
|
+
timestamp?: string;
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
function makeMemory(
|
|
@@ -23,7 +24,7 @@ function makeMemory(
|
|
|
23
24
|
content: string,
|
|
24
25
|
options: MemoryOptions = {},
|
|
25
26
|
): MemoryFile {
|
|
26
|
-
const timestamp = "2026-08-14T12:00:00.000Z";
|
|
27
|
+
const timestamp = options.timestamp ?? "2026-08-14T12:00:00.000Z";
|
|
27
28
|
const frontmatter = {
|
|
28
29
|
id,
|
|
29
30
|
category: "fact",
|
|
@@ -236,6 +237,28 @@ test("auditMemoryStore uses a leave-one-out burst baseline", async () => {
|
|
|
236
237
|
}
|
|
237
238
|
});
|
|
238
239
|
|
|
240
|
+
test("auditMemoryStore includes memories exactly at --since and excludes earlier ones", async () => {
|
|
241
|
+
const root = await mkdtemp(path.join(tmpdir(), "remnic-audit-memory-boundary-"));
|
|
242
|
+
try {
|
|
243
|
+
const cutoff = "2026-08-14T12:00:00.000Z";
|
|
244
|
+
const before = makeMemory(root, "before", "session-before", "Before cutoff", {
|
|
245
|
+
timestamp: "2026-08-14T11:59:59.999Z",
|
|
246
|
+
});
|
|
247
|
+
const atCutoff = makeMemory(root, "at-cutoff", "session-at-cutoff", "At cutoff", {
|
|
248
|
+
timestamp: cutoff,
|
|
249
|
+
});
|
|
250
|
+
const report = await auditMemoryStore({
|
|
251
|
+
memoryDir: root,
|
|
252
|
+
storage: memoryStorage([before, atCutoff]),
|
|
253
|
+
since: cutoff,
|
|
254
|
+
});
|
|
255
|
+
assert.equal(report.activeMemories, 1);
|
|
256
|
+
assert.deepEqual([...new Set(report.findings.map((finding) => finding.memoryId))], []);
|
|
257
|
+
} finally {
|
|
258
|
+
await rm(root, { recursive: true, force: true });
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
|
|
239
262
|
test("auditMemoryStore rejects malformed --since dates instead of normalizing them (#1955 review)", async () => {
|
|
240
263
|
const root = await mkdtemp(path.join(tmpdir(), "remnic-audit-memory-date-"));
|
|
241
264
|
try {
|
|
@@ -6,6 +6,7 @@ import { log } from "../logger.js";
|
|
|
6
6
|
import type { PluginConfig } from "../types.js";
|
|
7
7
|
import { expandTildePath } from "../utils/path.js";
|
|
8
8
|
import { resolveConversationContextCapabilities } from "../capabilities.js";
|
|
9
|
+
import { throwIfAborted } from "../abort-error.js";
|
|
9
10
|
|
|
10
11
|
export const SharedFeedbackEntrySchema = z.object({
|
|
11
12
|
agent: z.string().min(1),
|
|
@@ -497,38 +498,52 @@ export class SharedContextManager {
|
|
|
497
498
|
}
|
|
498
499
|
}
|
|
499
500
|
|
|
500
|
-
async readPriorities(): Promise<string> {
|
|
501
|
+
async readPriorities(signal?: AbortSignal): Promise<string> {
|
|
502
|
+
throwIfAborted(signal, "shared context priorities read aborted");
|
|
501
503
|
try {
|
|
502
|
-
|
|
504
|
+
const content = await readFile(this.prioritiesPath, { encoding: "utf-8", signal });
|
|
505
|
+
throwIfAborted(signal, "shared context priorities read aborted");
|
|
506
|
+
return content;
|
|
503
507
|
} catch {
|
|
508
|
+
throwIfAborted(signal, "shared context priorities read aborted");
|
|
504
509
|
return "";
|
|
505
510
|
}
|
|
506
511
|
}
|
|
507
512
|
|
|
508
|
-
async readLatestRoundtable(): Promise<string> {
|
|
513
|
+
async readLatestRoundtable(signal?: AbortSignal): Promise<string> {
|
|
514
|
+
throwIfAborted(signal, "shared context roundtable read aborted");
|
|
509
515
|
try {
|
|
510
516
|
const files = (await readdir(this.roundtableDir))
|
|
511
517
|
.filter((f) => f.endsWith(".md"))
|
|
512
518
|
.sort()
|
|
513
519
|
.reverse();
|
|
520
|
+
throwIfAborted(signal, "shared context roundtable read aborted");
|
|
514
521
|
const fp = files[0] ? path.join(this.roundtableDir, files[0]) : null;
|
|
515
522
|
if (!fp) return "";
|
|
516
|
-
|
|
523
|
+
const content = await readFile(fp, { encoding: "utf-8", signal });
|
|
524
|
+
throwIfAborted(signal, "shared context roundtable read aborted");
|
|
525
|
+
return content;
|
|
517
526
|
} catch {
|
|
527
|
+
throwIfAborted(signal, "shared context roundtable read aborted");
|
|
518
528
|
return "";
|
|
519
529
|
}
|
|
520
530
|
}
|
|
521
531
|
|
|
522
|
-
async readLatestCrossSignals(): Promise<string> {
|
|
532
|
+
async readLatestCrossSignals(signal?: AbortSignal): Promise<string> {
|
|
533
|
+
throwIfAborted(signal, "shared context cross-signals read aborted");
|
|
523
534
|
try {
|
|
524
535
|
const files = (await readdir(this.crossSignalsDir))
|
|
525
536
|
.filter((f) => f.endsWith(".md"))
|
|
526
537
|
.sort()
|
|
527
538
|
.reverse();
|
|
539
|
+
throwIfAborted(signal, "shared context cross-signals read aborted");
|
|
528
540
|
const fp = files[0] ? path.join(this.crossSignalsDir, files[0]) : null;
|
|
529
541
|
if (!fp) return "";
|
|
530
|
-
|
|
542
|
+
const content = await readFile(fp, { encoding: "utf-8", signal });
|
|
543
|
+
throwIfAborted(signal, "shared context cross-signals read aborted");
|
|
544
|
+
return content;
|
|
531
545
|
} catch {
|
|
546
|
+
throwIfAborted(signal, "shared context cross-signals read aborted");
|
|
532
547
|
return "";
|
|
533
548
|
}
|
|
534
549
|
}
|