@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
|
@@ -40,11 +40,12 @@ import {
|
|
|
40
40
|
countEntityStructuredFacts,
|
|
41
41
|
fingerprintEntityStructuredFacts,
|
|
42
42
|
normalizeEntityName as normalizeEntityNameShared,
|
|
43
|
-
|
|
43
|
+
normalizeStructuredSectionFactsWithOrigins,
|
|
44
44
|
parseEntityFile,
|
|
45
45
|
serializeEntityFile,
|
|
46
46
|
StorageManager,
|
|
47
47
|
} from "../storage.js";
|
|
48
|
+
import { parseOriginClass } from "../security/origin-authority.js";
|
|
48
49
|
|
|
49
50
|
export interface EntityStoreDeps {
|
|
50
51
|
/** Live class object of the host instance — shared static caches (see storage.ts storageManagerClass). */
|
|
@@ -204,6 +205,7 @@ export class EntityStore {
|
|
|
204
205
|
source?: string;
|
|
205
206
|
sessionKey?: string;
|
|
206
207
|
principal?: string;
|
|
208
|
+
origin?: string;
|
|
207
209
|
structuredSections?: EntityStructuredSection[];
|
|
208
210
|
} = {},
|
|
209
211
|
): Promise<string> {
|
|
@@ -223,6 +225,7 @@ export class EntityStore {
|
|
|
223
225
|
source?: string;
|
|
224
226
|
sessionKey?: string;
|
|
225
227
|
principal?: string;
|
|
228
|
+
origin?: string;
|
|
226
229
|
structuredSections?: EntityStructuredSection[];
|
|
227
230
|
} = {},
|
|
228
231
|
): Promise<string> {
|
|
@@ -283,26 +286,35 @@ export class EntityStore {
|
|
|
283
286
|
const source = options.source?.trim() || undefined;
|
|
284
287
|
const sessionKey = options.sessionKey?.trim() || undefined;
|
|
285
288
|
const principal = options.principal?.trim() || undefined;
|
|
289
|
+
const origin = options.origin?.trim() ? parseOriginClass(options.origin) : undefined;
|
|
286
290
|
const structuredSectionMap = new Map(
|
|
287
291
|
(entity.structuredSections ?? []).map((section) => [section.key, {
|
|
288
292
|
...section,
|
|
289
293
|
facts: [...section.facts],
|
|
294
|
+
...(section.factOrigins ? { factOrigins: [...section.factOrigins] } : {}),
|
|
290
295
|
}]),
|
|
291
296
|
);
|
|
292
297
|
for (const section of options.structuredSections ?? []) {
|
|
293
298
|
const normalizedSection = normalizeEntityStructuredSection(type, section, this.deps.entitySchemas);
|
|
294
|
-
const
|
|
295
|
-
if (
|
|
299
|
+
const normalized = normalizeStructuredSectionFactsWithOrigins(section.facts, section.factOrigins, origin);
|
|
300
|
+
if (normalized.facts.length === 0) continue;
|
|
296
301
|
const existingSection = structuredSectionMap.get(normalizedSection.key);
|
|
297
302
|
if (!existingSection) {
|
|
298
303
|
structuredSectionMap.set(normalizedSection.key, {
|
|
299
304
|
key: normalizedSection.key,
|
|
300
305
|
title: normalizedSection.title,
|
|
301
|
-
|
|
306
|
+
...normalized,
|
|
302
307
|
});
|
|
303
308
|
continue;
|
|
304
309
|
}
|
|
305
|
-
|
|
310
|
+
const existingOrigins = existingSection.facts.map((_, index) => existingSection.factOrigins?.[index]);
|
|
311
|
+
const incomingOrigins = normalized.facts.map((_, index) => normalized.factOrigins?.[index]);
|
|
312
|
+
const merged = normalizeStructuredSectionFactsWithOrigins(
|
|
313
|
+
[...existingSection.facts, ...normalized.facts],
|
|
314
|
+
[...existingOrigins, ...incomingOrigins],
|
|
315
|
+
);
|
|
316
|
+
existingSection.facts = merged.facts;
|
|
317
|
+
existingSection.factOrigins = merged.factOrigins;
|
|
306
318
|
if (!existingSection.title.trim() && normalizedSection.title.trim()) {
|
|
307
319
|
existingSection.title = normalizedSection.title;
|
|
308
320
|
}
|
|
@@ -314,6 +326,7 @@ export class EntityStore {
|
|
|
314
326
|
...(source ? { source } : {}),
|
|
315
327
|
...(sessionKey ? { sessionKey } : {}),
|
|
316
328
|
...(principal ? { principal } : {}),
|
|
329
|
+
...(origin ? { origin } : {}),
|
|
317
330
|
};
|
|
318
331
|
const alreadyPresent = entity.timeline.some((entry) =>
|
|
319
332
|
entry.timestamp === nextEntry.timestamp
|
|
@@ -321,6 +334,7 @@ export class EntityStore {
|
|
|
321
334
|
&& entry.source === nextEntry.source
|
|
322
335
|
&& entry.sessionKey === nextEntry.sessionKey
|
|
323
336
|
&& entry.principal === nextEntry.principal
|
|
337
|
+
&& entry.origin === nextEntry.origin
|
|
324
338
|
);
|
|
325
339
|
if (alreadyPresent) continue;
|
|
326
340
|
entity.timeline.push(nextEntry);
|
|
@@ -762,26 +776,44 @@ export class EntityStore {
|
|
|
762
776
|
(mergedEntity.structuredSections ?? []).map((section) => [section.key, {
|
|
763
777
|
...section,
|
|
764
778
|
facts: [...section.facts],
|
|
779
|
+
factOrigins: section.factOrigins ? [...section.factOrigins] : undefined,
|
|
765
780
|
}]),
|
|
766
781
|
);
|
|
767
782
|
for (const section of parsed.structuredSections ?? []) {
|
|
768
783
|
const existingSection = mergedStructuredSectionMap.get(section.key);
|
|
769
784
|
if (!existingSection) {
|
|
785
|
+
const facts: string[] = [];
|
|
786
|
+
const factOrigins: Array<string | undefined> = [];
|
|
787
|
+
for (const [index, fact] of section.facts.entries()) {
|
|
788
|
+
const trimmed = fact.trim();
|
|
789
|
+
if (!trimmed || facts.includes(trimmed)) continue;
|
|
790
|
+
facts.push(trimmed);
|
|
791
|
+
factOrigins.push(section.factOrigins?.[index]);
|
|
792
|
+
}
|
|
770
793
|
mergedStructuredSectionMap.set(section.key, {
|
|
771
794
|
key: section.key,
|
|
772
795
|
title: section.title,
|
|
773
|
-
facts
|
|
796
|
+
facts,
|
|
797
|
+
factOrigins: section.factOrigins ? factOrigins : undefined,
|
|
774
798
|
});
|
|
775
799
|
continue;
|
|
776
800
|
}
|
|
777
801
|
|
|
778
|
-
|
|
779
|
-
|
|
802
|
+
if (section.factOrigins && !existingSection.factOrigins) {
|
|
803
|
+
existingSection.factOrigins = existingSection.facts.map(() => undefined);
|
|
804
|
+
}
|
|
805
|
+
for (const [index, fact] of section.facts.entries()) {
|
|
780
806
|
const trimmed = fact.trim();
|
|
781
807
|
if (!trimmed) continue;
|
|
782
|
-
|
|
808
|
+
const existingIndex = existingSection.facts.indexOf(trimmed);
|
|
809
|
+
const origin = section.factOrigins?.[index];
|
|
810
|
+
if (existingIndex === -1) {
|
|
811
|
+
existingSection.facts.push(trimmed);
|
|
812
|
+
existingSection.factOrigins?.push(origin);
|
|
813
|
+
} else if (existingSection.factOrigins?.[existingIndex] !== origin) {
|
|
814
|
+
existingSection.factOrigins?.splice(existingIndex, 1, undefined);
|
|
815
|
+
}
|
|
783
816
|
}
|
|
784
|
-
existingSection.facts = Array.from(mergedFacts);
|
|
785
817
|
if (!existingSection.title.trim() && section.title.trim()) {
|
|
786
818
|
existingSection.title = section.title;
|
|
787
819
|
}
|
|
@@ -802,9 +834,8 @@ export class EntityStore {
|
|
|
802
834
|
}
|
|
803
835
|
}
|
|
804
836
|
|
|
805
|
-
|
|
806
|
-
const
|
|
807
|
-
mergedEntity.timeline = mergedEntity.timeline.filter((entry) => {
|
|
837
|
+
const timelineByKey = new Map<string, (typeof mergedEntity.timeline)[number]>();
|
|
838
|
+
for (const entry of mergedEntity.timeline) {
|
|
808
839
|
const key = JSON.stringify([
|
|
809
840
|
entry.timestamp,
|
|
810
841
|
entry.source ?? "",
|
|
@@ -812,10 +843,14 @@ export class EntityStore {
|
|
|
812
843
|
entry.principal ?? "",
|
|
813
844
|
entry.text,
|
|
814
845
|
]);
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
846
|
+
const existing = timelineByKey.get(key);
|
|
847
|
+
if (!existing) {
|
|
848
|
+
timelineByKey.set(key, entry);
|
|
849
|
+
} else if (existing.origin !== entry.origin) {
|
|
850
|
+
existing.origin = undefined;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
mergedEntity.timeline = [...timelineByKey.values()];
|
|
819
854
|
// Deduplicate relationships by target+label
|
|
820
855
|
const relKeys = new Set<string>();
|
|
821
856
|
mergedEntity.relationships = mergedEntity.relationships.filter((r) => {
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
import { matchEntitySchemaSection, normalizeEntityStructuredSection } from "../entity-schema.js";
|
|
8
8
|
import type { EntityFile, EntityStructuredSection, EntityTimelineEntry, PluginConfig } from "../types.js";
|
|
9
|
+
export const ENTITY_TIMELINE_METADATA_MARKER = "remnic-meta-v1";
|
|
9
10
|
|
|
10
11
|
export function parseEntityTimelineBullet(bullet: string, fallbackTimestamp: string): EntityTimelineEntry | null {
|
|
11
12
|
const trimmed = bullet.trim();
|
|
@@ -17,10 +18,11 @@ export function parseEntityTimelineBullet(bullet: string, fallbackTimestamp: str
|
|
|
17
18
|
text: "",
|
|
18
19
|
};
|
|
19
20
|
const consumedMetadataSegments: string[] = [];
|
|
21
|
+
let metadataMarkerSeen = false;
|
|
20
22
|
let literalSingleSourceSegment: string | undefined;
|
|
21
23
|
|
|
22
24
|
if (!trimmed.startsWith("[")) {
|
|
23
|
-
entry.text = trimmed;
|
|
25
|
+
entry.text = unescapeEntityTimelineText(trimmed);
|
|
24
26
|
return entry.text ? entry : null;
|
|
25
27
|
}
|
|
26
28
|
|
|
@@ -42,6 +44,13 @@ export function parseEntityTimelineBullet(bullet: string, fallbackTimestamp: str
|
|
|
42
44
|
if (end === -1) break;
|
|
43
45
|
const rawSegment = rest.slice(0, end + 1);
|
|
44
46
|
const token = rest.slice(1, end).trim();
|
|
47
|
+
const nextRest = rest.slice(end + 1).trimStart();
|
|
48
|
+
if (token === ENTITY_TIMELINE_METADATA_MARKER) {
|
|
49
|
+
metadataMarkerSeen = true;
|
|
50
|
+
consumedMetadataSegments.push(rawSegment);
|
|
51
|
+
rest = nextRest;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
45
54
|
const equalsIdx = token.indexOf("=");
|
|
46
55
|
if (equalsIdx === -1) {
|
|
47
56
|
if (rest === trimmed) {
|
|
@@ -53,7 +62,10 @@ export function parseEntityTimelineBullet(bullet: string, fallbackTimestamp: str
|
|
|
53
62
|
const key = token.slice(0, equalsIdx).trim().toLowerCase();
|
|
54
63
|
const value = unescapeEntityTimelineMetadataValue(token.slice(equalsIdx + 1).trim());
|
|
55
64
|
if (!value) break;
|
|
56
|
-
|
|
65
|
+
if (key === "remnic-origin" && !metadataMarkerSeen) {
|
|
66
|
+
entry.text = rest.trim();
|
|
67
|
+
return entry.text ? entry : null;
|
|
68
|
+
}
|
|
57
69
|
switch (key) {
|
|
58
70
|
case "source_meta":
|
|
59
71
|
entry.source = value;
|
|
@@ -78,6 +90,9 @@ export function parseEntityTimelineBullet(bullet: string, fallbackTimestamp: str
|
|
|
78
90
|
case "principal":
|
|
79
91
|
entry.principal = value;
|
|
80
92
|
break;
|
|
93
|
+
case "remnic-origin":
|
|
94
|
+
entry.origin = value;
|
|
95
|
+
break;
|
|
81
96
|
default:
|
|
82
97
|
entry.text = rest.trim();
|
|
83
98
|
return entry.text ? entry : null;
|
|
@@ -93,8 +108,7 @@ export function parseEntityTimelineBullet(bullet: string, fallbackTimestamp: str
|
|
|
93
108
|
text: `${literalSingleSourceSegment} ${rest}`.trim(),
|
|
94
109
|
};
|
|
95
110
|
}
|
|
96
|
-
|
|
97
|
-
entry.text = rest.trim();
|
|
111
|
+
entry.text = unescapeEntityTimelineText(rest.trim());
|
|
98
112
|
if (!entry.text) return null;
|
|
99
113
|
return entry;
|
|
100
114
|
}
|
|
@@ -241,6 +255,13 @@ export function unescapeEntityTimelineMetadataValue(value: string): string {
|
|
|
241
255
|
}
|
|
242
256
|
return result;
|
|
243
257
|
}
|
|
258
|
+
export function escapeEntityTimelineText(value: string): string {
|
|
259
|
+
return /^\\*\[(?:remnic-origin=|remnic-meta-v1\])/i.test(value) ? `\\${value}` : value;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export function unescapeEntityTimelineText(value: string): string {
|
|
263
|
+
return /^\\+\[(?:remnic-origin=|remnic-meta-v1\])/i.test(value) ? value.slice(1) : value;
|
|
264
|
+
}
|
|
244
265
|
|
|
245
266
|
export function serializeEntityTimelineEntry(entry: EntityTimelineEntry): string {
|
|
246
267
|
const tokens: string[] = [];
|
|
@@ -257,8 +278,12 @@ export function serializeEntityTimelineEntry(entry: EntityTimelineEntry): string
|
|
|
257
278
|
if (entry.principal) {
|
|
258
279
|
tokens.push(`[principal=${escapeEntityTimelineMetadataValue(entry.principal)}]`);
|
|
259
280
|
}
|
|
281
|
+
if (entry.origin) {
|
|
282
|
+
tokens.push(`[${ENTITY_TIMELINE_METADATA_MARKER}]`);
|
|
283
|
+
tokens.push(`[remnic-origin=${escapeEntityTimelineMetadataValue(entry.origin)}]`);
|
|
284
|
+
}
|
|
260
285
|
const serializedMetadata = tokens.length > 0 ? `${tokens.join(" ")} ` : "";
|
|
261
|
-
return `- ${serializedMetadata}${entry.text}`.trimEnd();
|
|
286
|
+
return `- ${serializedMetadata}${escapeEntityTimelineText(entry.text)}`.trimEnd();
|
|
262
287
|
}
|
|
263
288
|
|
|
264
289
|
export function dedupeEntityTimelineFacts(timeline: EntityTimelineEntry[]): string[] {
|
|
@@ -269,6 +294,32 @@ export function normalizeEntitySectionFact(value: string): string {
|
|
|
269
294
|
return value.replace(/\s+/g, " ").trim();
|
|
270
295
|
}
|
|
271
296
|
|
|
297
|
+
export function normalizeStructuredSectionFactsWithOrigins(
|
|
298
|
+
facts: string[],
|
|
299
|
+
factOrigins?: Array<string | undefined>,
|
|
300
|
+
defaultOrigin?: string,
|
|
301
|
+
): Pick<EntityStructuredSection, "facts" | "factOrigins"> {
|
|
302
|
+
const normalizedFacts: string[] = [];
|
|
303
|
+
const origins: Array<string | undefined> = [];
|
|
304
|
+
const seen = new Map<string, number>();
|
|
305
|
+
for (const [index, fact] of facts.entries()) {
|
|
306
|
+
const normalized = normalizeEntitySectionFact(fact);
|
|
307
|
+
if (!normalized) continue;
|
|
308
|
+
const existingIndex = seen.get(normalized) ?? -1;
|
|
309
|
+
const origin = factOrigins?.[index] ?? defaultOrigin;
|
|
310
|
+
if (existingIndex >= 0) {
|
|
311
|
+
if (origins[existingIndex] !== origin) origins[existingIndex] = undefined;
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
seen.set(normalized, normalizedFacts.length);
|
|
315
|
+
normalizedFacts.push(normalized);
|
|
316
|
+
origins.push(origin);
|
|
317
|
+
}
|
|
318
|
+
return {
|
|
319
|
+
facts: normalizedFacts,
|
|
320
|
+
...(origins.some((origin) => origin !== undefined) ? { factOrigins: origins } : {}),
|
|
321
|
+
};
|
|
322
|
+
}
|
|
272
323
|
export function normalizeStructuredSectionFacts(facts: string[]): string[] {
|
|
273
324
|
return [...new Set(facts.map((fact) => normalizeEntitySectionFact(fact)).filter((fact) => fact.length > 0))];
|
|
274
325
|
}
|
|
@@ -304,14 +355,22 @@ export function compileEntityFacts(
|
|
|
304
355
|
return facts;
|
|
305
356
|
}
|
|
306
357
|
|
|
307
|
-
function parseEntityStructuredSectionFacts(
|
|
358
|
+
function parseEntityStructuredSectionFacts(
|
|
359
|
+
lines: string[],
|
|
360
|
+
): Pick<EntityStructuredSection, "facts" | "factOrigins"> {
|
|
308
361
|
const facts: string[] = [];
|
|
362
|
+
const factOrigins: Array<string | undefined> = [];
|
|
309
363
|
let currentBlock: string[] = [];
|
|
364
|
+
let currentOrigin: string | undefined;
|
|
310
365
|
|
|
311
366
|
const flushCurrentBlock = (): void => {
|
|
312
367
|
const normalized = normalizeEntitySectionFact(currentBlock.join(" "));
|
|
313
|
-
if (normalized.length > 0)
|
|
368
|
+
if (normalized.length > 0) {
|
|
369
|
+
facts.push(normalized);
|
|
370
|
+
factOrigins.push(currentOrigin);
|
|
371
|
+
}
|
|
314
372
|
currentBlock = [];
|
|
373
|
+
currentOrigin = undefined;
|
|
315
374
|
};
|
|
316
375
|
|
|
317
376
|
for (const rawLine of lines) {
|
|
@@ -322,16 +381,29 @@ function parseEntityStructuredSectionFacts(lines: string[]): string[] {
|
|
|
322
381
|
}
|
|
323
382
|
if (line.startsWith("- ")) {
|
|
324
383
|
flushCurrentBlock();
|
|
325
|
-
|
|
384
|
+
const bullet = line.slice(2).trim();
|
|
385
|
+
const metadataPrefix = `[${ENTITY_TIMELINE_METADATA_MARKER}] `;
|
|
386
|
+
const hasMarker = bullet.startsWith(metadataPrefix);
|
|
387
|
+
const originStart = metadataPrefix.length;
|
|
388
|
+
const originPrefix = hasMarker && bullet.startsWith("[remnic-origin=", originStart);
|
|
389
|
+
const originEndOffset = originPrefix
|
|
390
|
+
? findEntityTimelineTokenEnd(bullet.slice(originStart))
|
|
391
|
+
: -1;
|
|
392
|
+
const originEnd = originEndOffset >= 0 ? originEndOffset + originStart : -1;
|
|
393
|
+
const token = originEnd >= 0 ? bullet.slice(originStart + 15, originEnd) : "";
|
|
394
|
+
currentBlock = [originEnd >= 0
|
|
395
|
+
? unescapeEntityTimelineText(bullet.slice(originEnd + 1).trimStart())
|
|
396
|
+
: unescapeEntityTimelineText(hasMarker ? bullet.slice(metadataPrefix.length) : bullet)];
|
|
397
|
+
currentOrigin = originEnd >= 0
|
|
398
|
+
? unescapeEntityTimelineMetadataValue(token)
|
|
399
|
+
: undefined;
|
|
326
400
|
continue;
|
|
327
401
|
}
|
|
328
402
|
currentBlock.push(line);
|
|
329
403
|
}
|
|
330
|
-
|
|
331
404
|
flushCurrentBlock();
|
|
332
|
-
return
|
|
405
|
+
return normalizeStructuredSectionFactsWithOrigins(facts, factOrigins);
|
|
333
406
|
}
|
|
334
|
-
|
|
335
407
|
function looksLikeStructuredSectionFactList(lines: string[]): boolean {
|
|
336
408
|
const firstNonBlank = lines.find((line) => line.trim().length > 0)?.trim() ?? "";
|
|
337
409
|
return firstNonBlank.startsWith("- ");
|
|
@@ -355,27 +427,35 @@ export function partitionEntityStructuredSections(
|
|
|
355
427
|
remainingExtraSections.push(section);
|
|
356
428
|
continue;
|
|
357
429
|
}
|
|
358
|
-
const
|
|
359
|
-
if (!matchedSection && facts.length === 0) {
|
|
430
|
+
const parsedFacts = parseEntityStructuredSectionFacts(section.lines);
|
|
431
|
+
if (!matchedSection && parsedFacts.facts.length === 0) {
|
|
360
432
|
remainingExtraSections.push(section);
|
|
361
433
|
continue;
|
|
362
434
|
}
|
|
363
435
|
const normalizedSection = matchedSection
|
|
364
436
|
? { key: matchedSection.key, title: matchedSection.title }
|
|
365
437
|
: normalizeEntityStructuredSection(entityType, { key: section.title, title: section.title }, entitySchemas);
|
|
366
|
-
if (facts.length === 0) {
|
|
438
|
+
if (parsedFacts.facts.length === 0) {
|
|
367
439
|
remainingExtraSections.push(section);
|
|
368
440
|
continue;
|
|
369
441
|
}
|
|
370
442
|
const existing = structuredSectionIndex.get(normalizedSection.key);
|
|
371
443
|
if (existing) {
|
|
372
|
-
|
|
444
|
+
const existingOrigins = existing.facts.map((_, index) => existing.factOrigins?.[index]);
|
|
445
|
+
const incomingOrigins = parsedFacts.facts.map((_, index) => parsedFacts.factOrigins?.[index]);
|
|
446
|
+
const merged = normalizeStructuredSectionFactsWithOrigins(
|
|
447
|
+
[...existing.facts, ...parsedFacts.facts],
|
|
448
|
+
[...existingOrigins, ...incomingOrigins],
|
|
449
|
+
);
|
|
450
|
+
existing.facts = merged.facts;
|
|
451
|
+
existing.factOrigins = merged.factOrigins;
|
|
373
452
|
continue;
|
|
374
453
|
}
|
|
375
454
|
const structuredSection: EntityStructuredSection = {
|
|
376
455
|
key: normalizedSection.key,
|
|
377
456
|
title: normalizedSection.title,
|
|
378
|
-
facts:
|
|
457
|
+
facts: parsedFacts.facts,
|
|
458
|
+
...(parsedFacts.factOrigins ? { factOrigins: parsedFacts.factOrigins } : {}),
|
|
379
459
|
};
|
|
380
460
|
structuredSections.push(structuredSection);
|
|
381
461
|
structuredSectionIndex.set(normalizedSection.key, structuredSection);
|
package/src/storage.ts
CHANGED
|
@@ -185,11 +185,15 @@ import {
|
|
|
185
185
|
collectStructuredSectionFacts,
|
|
186
186
|
compareEntityTimestamps,
|
|
187
187
|
compileEntityFacts,
|
|
188
|
+
ENTITY_TIMELINE_METADATA_MARKER,
|
|
189
|
+
escapeEntityTimelineMetadataValue,
|
|
190
|
+
escapeEntityTimelineText,
|
|
188
191
|
isEntitySynthesisStale,
|
|
189
192
|
isEntitySynthesisTimelinePromotionBullet,
|
|
190
193
|
latestEntityTimelineTimestamp,
|
|
191
194
|
normalizeEntitySectionFact,
|
|
192
195
|
normalizeStructuredSectionFacts,
|
|
196
|
+
normalizeStructuredSectionFactsWithOrigins,
|
|
193
197
|
parseEntityTimelineBullet,
|
|
194
198
|
partitionEntityStructuredSections,
|
|
195
199
|
serializeEntityTimelineEntry,
|
|
@@ -220,6 +224,7 @@ export {
|
|
|
220
224
|
fingerprintEntityStructuredFacts,
|
|
221
225
|
isEntitySynthesisStale,
|
|
222
226
|
normalizeStructuredSectionFacts,
|
|
227
|
+
normalizeStructuredSectionFactsWithOrigins,
|
|
223
228
|
} from "./storage/entity-timeline.js";
|
|
224
229
|
import {
|
|
225
230
|
type ProjectedMemoryBrowseOptions,
|
|
@@ -244,7 +249,6 @@ import {
|
|
|
244
249
|
} from "./write-envelope.js";
|
|
245
250
|
// stripCitation import removed: legacy rebuild fallback was replaced by a
|
|
246
251
|
// skip-with-warning strategy (Finding 1 — Uhol). See ensureFactHashIndexAuthoritative.
|
|
247
|
-
|
|
248
252
|
type SharedVersionKind = "memory-status" | "artifact-write" | "cold-write" | "memory-corpus" | "entity-mutation";
|
|
249
253
|
|
|
250
254
|
type OfflineSyncDigestCacheEntry = {
|
|
@@ -255,15 +259,12 @@ type OfflineSyncDigestCacheEntry = {
|
|
|
255
259
|
sha256: string;
|
|
256
260
|
bytes: number;
|
|
257
261
|
};
|
|
258
|
-
|
|
259
|
-
|
|
260
262
|
export interface ReextractJobRequest {
|
|
261
263
|
memoryId: string;
|
|
262
264
|
model: string;
|
|
263
265
|
requestedAt: string;
|
|
264
266
|
source: "cli-migrate";
|
|
265
267
|
}
|
|
266
|
-
|
|
267
268
|
export interface MemoryLifecycleEventWriteOptions {
|
|
268
269
|
at?: Date;
|
|
269
270
|
actor?: string;
|
|
@@ -272,7 +273,6 @@ export interface MemoryLifecycleEventWriteOptions {
|
|
|
272
273
|
relatedMemoryIds?: string[];
|
|
273
274
|
correlationId?: string;
|
|
274
275
|
}
|
|
275
|
-
|
|
276
276
|
/**
|
|
277
277
|
* Validate a Memory Worth counter (`mw_success` / `mw_fail`) before we persist
|
|
278
278
|
* it. Rejects non-finite, non-integer, and negative values rather than silently
|
|
@@ -1420,10 +1420,12 @@ export function serializeEntityFile(entity: EntityFile, entitySchemas?: PluginCo
|
|
|
1420
1420
|
const structuredSections = sortStructuredSectionsBySchema(
|
|
1421
1421
|
entity.type,
|
|
1422
1422
|
(entity.structuredSections ?? [])
|
|
1423
|
-
.map((section) =>
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1423
|
+
.map((section) => {
|
|
1424
|
+
const normalized = normalizeStructuredSectionFactsWithOrigins(section.facts, section.factOrigins);
|
|
1425
|
+
const result = { ...section, ...normalized };
|
|
1426
|
+
if (normalized.factOrigins === undefined) delete result.factOrigins;
|
|
1427
|
+
return result;
|
|
1428
|
+
})
|
|
1427
1429
|
.filter((section) => section.facts.length > 0),
|
|
1428
1430
|
entitySchemas
|
|
1429
1431
|
);
|
|
@@ -1443,7 +1445,6 @@ export function serializeEntityFile(entity: EntityFile, entitySchemas?: PluginCo
|
|
|
1443
1445
|
const synthesisStructuredFactCount = entity.synthesisStructuredFactCount;
|
|
1444
1446
|
const synthesisStructuredFactDigest = entity.synthesisStructuredFactDigest?.trim() || "";
|
|
1445
1447
|
const synthesisVersion = entity.synthesisVersion ?? (synthesis ? 1 : 0);
|
|
1446
|
-
|
|
1447
1448
|
const lines: string[] = [
|
|
1448
1449
|
"---",
|
|
1449
1450
|
`created: ${created}`,
|
|
@@ -1464,14 +1465,12 @@ export function serializeEntityFile(entity: EntityFile, entitySchemas?: PluginCo
|
|
|
1464
1465
|
`**Updated:** ${updated}`,
|
|
1465
1466
|
"",
|
|
1466
1467
|
];
|
|
1467
|
-
|
|
1468
1468
|
if ((entity.preSectionLines ?? []).length > 0) {
|
|
1469
1469
|
lines.push(...(entity.preSectionLines ?? []));
|
|
1470
1470
|
if (entity.preSectionLines?.[entity.preSectionLines.length - 1] !== "") {
|
|
1471
1471
|
lines.push("");
|
|
1472
1472
|
}
|
|
1473
1473
|
}
|
|
1474
|
-
|
|
1475
1474
|
lines.push("## Synthesis", "");
|
|
1476
1475
|
if (synthesis) {
|
|
1477
1476
|
lines.push(synthesis);
|
|
@@ -1485,7 +1484,6 @@ export function serializeEntityFile(entity: EntityFile, entitySchemas?: PluginCo
|
|
|
1485
1484
|
}
|
|
1486
1485
|
lines.push("");
|
|
1487
1486
|
}
|
|
1488
|
-
|
|
1489
1487
|
if (legacyFacts.length > 0) {
|
|
1490
1488
|
lines.push("## Facts", "");
|
|
1491
1489
|
for (const fact of legacyFacts) {
|
|
@@ -1493,15 +1491,17 @@ export function serializeEntityFile(entity: EntityFile, entitySchemas?: PluginCo
|
|
|
1493
1491
|
}
|
|
1494
1492
|
lines.push("");
|
|
1495
1493
|
}
|
|
1496
|
-
|
|
1497
1494
|
for (const section of structuredSections) {
|
|
1498
1495
|
lines.push(`## ${section.title}`, "");
|
|
1499
|
-
for (const fact of section.facts) {
|
|
1500
|
-
|
|
1496
|
+
for (const [index, fact] of section.facts.entries()) {
|
|
1497
|
+
const origin = section.factOrigins?.[index];
|
|
1498
|
+
const prefix = origin
|
|
1499
|
+
? `[${ENTITY_TIMELINE_METADATA_MARKER}] [remnic-origin=${escapeEntityTimelineMetadataValue(origin)}] `
|
|
1500
|
+
: "";
|
|
1501
|
+
lines.push(`- ${prefix}${escapeEntityTimelineText(fact)}`);
|
|
1501
1502
|
}
|
|
1502
1503
|
lines.push("");
|
|
1503
1504
|
}
|
|
1504
|
-
|
|
1505
1505
|
// Connected to (optional)
|
|
1506
1506
|
if (entity.relationships.length > 0) {
|
|
1507
1507
|
lines.push("## Connected to", "");
|
|
@@ -1510,7 +1510,6 @@ export function serializeEntityFile(entity: EntityFile, entitySchemas?: PluginCo
|
|
|
1510
1510
|
}
|
|
1511
1511
|
lines.push("");
|
|
1512
1512
|
}
|
|
1513
|
-
|
|
1514
1513
|
// Activity (optional)
|
|
1515
1514
|
if (entity.activity.length > 0) {
|
|
1516
1515
|
lines.push("## Activity", "");
|
|
@@ -4239,6 +4238,7 @@ export class StorageManager extends TombstoneBlockedCaptureIndexHost {
|
|
|
4239
4238
|
source?: string;
|
|
4240
4239
|
sessionKey?: string;
|
|
4241
4240
|
principal?: string;
|
|
4241
|
+
origin?: string;
|
|
4242
4242
|
structuredSections?: EntityStructuredSection[];
|
|
4243
4243
|
} = {}
|
|
4244
4244
|
): Promise<string> {
|
package/src/types.ts
CHANGED
|
@@ -3374,19 +3374,19 @@ export interface EntityActivityEntry {
|
|
|
3374
3374
|
date: string;
|
|
3375
3375
|
note: string;
|
|
3376
3376
|
}
|
|
3377
|
-
|
|
3378
3377
|
export interface EntityTimelineEntry {
|
|
3379
3378
|
timestamp: string;
|
|
3380
3379
|
text: string;
|
|
3381
3380
|
source?: string;
|
|
3382
3381
|
sessionKey?: string;
|
|
3383
3382
|
principal?: string;
|
|
3383
|
+
origin?: string;
|
|
3384
3384
|
}
|
|
3385
|
-
|
|
3386
3385
|
export interface EntityStructuredSection {
|
|
3387
3386
|
key: string;
|
|
3388
3387
|
title: string;
|
|
3389
3388
|
facts: string[];
|
|
3389
|
+
factOrigins?: Array<string | undefined>;
|
|
3390
3390
|
}
|
|
3391
3391
|
|
|
3392
3392
|
export interface EntitySchemaSectionDefinition {
|
|
@@ -122,6 +122,29 @@ test("built-in markers elide a Korean span through conversation end", () => {
|
|
|
122
122
|
assert.equal(result.droppedSegments, 1);
|
|
123
123
|
});
|
|
124
124
|
|
|
125
|
+
test("built-in start markers cover every documented language", () => {
|
|
126
|
+
const expected = [
|
|
127
|
+
"off the record",
|
|
128
|
+
"fuera de registro",
|
|
129
|
+
"extraoficialmente",
|
|
130
|
+
"fora de registro",
|
|
131
|
+
"fora do registro",
|
|
132
|
+
"hors micro",
|
|
133
|
+
"nicht fürs protokoll",
|
|
134
|
+
"nicht für das protokoll",
|
|
135
|
+
"fuori registro",
|
|
136
|
+
"オフレコ",
|
|
137
|
+
"오프더레코드",
|
|
138
|
+
"不要记录",
|
|
139
|
+
"не для протокола",
|
|
140
|
+
"بدون تسجيل",
|
|
141
|
+
];
|
|
142
|
+
for (const phrase of expected) {
|
|
143
|
+
const result = applyOffTheRecord(conversation([phrase, "Private detail."]));
|
|
144
|
+
assert.equal(result.droppedSegments, 1, `marker did not match: ${phrase}`);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
125
148
|
test("configured markers extend the built-in phrases", () => {
|
|
126
149
|
const markers = compileOffTheRecordMarkers({
|
|
127
150
|
start: ["poza protokołem"],
|
|
@@ -180,6 +203,27 @@ test("a Latin marker phrase never matches inside a longer word", () => {
|
|
|
180
203
|
assert.equal(result.droppedSegments, 0);
|
|
181
204
|
assert.equal(result.conversation.segments.length, 2);
|
|
182
205
|
});
|
|
206
|
+
test("a Latin marker matches before an attached Hangul particle", () => {
|
|
207
|
+
const result = applyOffTheRecord(
|
|
208
|
+
conversation(["Keep this off the record입니다", "Private detail."]),
|
|
209
|
+
);
|
|
210
|
+
assert.equal(result.droppedSegments, 1);
|
|
211
|
+
assert.equal(result.conversation.segments[0]?.text, "[off the record — segment elided]");
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
test("a Latin marker matches before attached Japanese text", () => {
|
|
215
|
+
const result = applyOffTheRecord(
|
|
216
|
+
conversation(["Keep this off the recordです", "Private detail."]),
|
|
217
|
+
);
|
|
218
|
+
assert.equal(result.droppedSegments, 1);
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
test("a Latin marker matches before attached Han text", () => {
|
|
222
|
+
const result = applyOffTheRecord(
|
|
223
|
+
conversation(["Keep this off the record不要", "Private detail."]),
|
|
224
|
+
);
|
|
225
|
+
assert.equal(result.droppedSegments, 1);
|
|
226
|
+
});
|
|
183
227
|
|
|
184
228
|
test("an Arabic marker does not match inside a longer Arabic word", () => {
|
|
185
229
|
assert.equal(
|