@remnic/core 9.54.7 → 9.55.0
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 +64 -62
- package/dist/access-authorization-probe.d.ts +11 -11
- package/dist/access-authorization-probe.js +65 -63
- package/dist/access-boundary.d.ts +11 -11
- package/dist/access-boundary.js +64 -62
- package/dist/access-cli.js +141 -138
- 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 +64 -62
- 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 +64 -62
- package/dist/access-http.d.ts +12 -12
- package/dist/access-http.js +80 -78
- package/dist/access-identity-continuity-surface.d.ts +9 -9
- package/dist/access-identity-continuity-surface.js +64 -62
- package/dist/access-lcm-surface.d.ts +11 -11
- package/dist/access-lcm-surface.js +64 -62
- package/dist/access-mcp.d.ts +11 -11
- package/dist/access-mcp.js +73 -71
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/access-memory-search-fanout.js +3 -3
- package/dist/{access-namespace-preflight-CCNn_6NE.d.ts → access-namespace-preflight-Bpt-SYP0.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +64 -62
- package/dist/access-observe-write-surface.d.ts +11 -11
- package/dist/access-observe-write-surface.js +64 -62
- package/dist/access-offline-manifest.d.ts +9 -9
- package/dist/access-offline-manifest.js +9 -9
- package/dist/access-operations-batch.js +68 -66
- package/dist/access-operations.d.ts +14 -14
- package/dist/access-operations.js +72 -70
- package/dist/access-recall-concurrency.d.ts +11 -11
- package/dist/access-recall-concurrency.js +64 -62
- package/dist/access-recall-response.d.ts +11 -11
- package/dist/access-recall-response.js +64 -62
- package/dist/access-recall-surface.d.ts +11 -11
- package/dist/access-recall-surface.js +64 -62
- package/dist/access-schema.d.ts +88 -88
- package/dist/access-schema.js +4 -4
- package/dist/{access-service-DK82xdNi.d.ts → access-service-4DO8XMq6.d.ts} +71 -71
- package/dist/access-service-helpers.d.ts +11 -11
- package/dist/access-service.d.ts +11 -11
- package/dist/access-service.js +64 -62
- package/dist/access-surface-catalog.d.ts +11 -11
- package/dist/access-surface-catalog.js +66 -64
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-wearables-meetings-surface.d.ts +3 -3
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-memory-bridge.js +3 -3
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +4 -2
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +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-NR3GPCOA.js → auto-sync-5HVRCMGZ.js} +3 -3
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-learner.js +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +9 -9
- package/dist/briefing-window.d.ts +36 -0
- package/dist/briefing-window.js +9 -0
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +24 -22
- 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 +8 -7
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +1 -1
- package/dist/capabilities.d.ts +8 -8
- package/dist/capabilities.js +1 -1
- package/dist/{capsule-crypto-7FJQINUR.js → capsule-crypto-YO5QJ6L3.js} +2 -2
- package/dist/{catalog-DGFf8mD9.d.ts → catalog-BasnO3Bw.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +26 -25
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/causal-trajectory-graph.js +2 -2
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-LEPOP46W.js → chunk-227UFSEQ.js} +4 -4
- package/dist/{chunk-I6WYQSX4.js → chunk-2NKY7OC6.js} +14 -2
- package/dist/chunk-2NKY7OC6.js.map +1 -0
- package/dist/{chunk-FTPONF6B.js → chunk-2YREVL4T.js} +2 -2
- package/dist/{chunk-PG4QBPVG.js → chunk-3VFVQDZO.js} +8 -4
- package/dist/chunk-3VFVQDZO.js.map +1 -0
- package/dist/{chunk-KM55SMLG.js → chunk-4KM3V6VS.js} +2 -2
- package/dist/{chunk-HAEU3ZW7.js → chunk-4OW2T32G.js} +2 -2
- package/dist/{chunk-43SEBY2M.js → chunk-4QFCAKNM.js} +1 -1
- package/dist/{chunk-RZQ6W2W4.js → chunk-4THNU7OF.js} +427 -52
- package/dist/chunk-4THNU7OF.js.map +1 -0
- package/dist/{chunk-76JJSXK7.js → chunk-5QHDXMXP.js} +1 -1
- package/dist/chunk-5QHDXMXP.js.map +1 -0
- package/dist/{chunk-KFBOPMF6.js → chunk-5ZIWRMZM.js} +5 -5
- package/dist/{chunk-GWFSVJ4P.js → chunk-6KTXE6A3.js} +2 -2
- package/dist/{chunk-FPLM2TKD.js → chunk-6P2NUVM5.js} +26 -24
- package/dist/chunk-6P2NUVM5.js.map +1 -0
- package/dist/chunk-6Q3ZTEF6.js +54 -0
- package/dist/chunk-6Q3ZTEF6.js.map +1 -0
- package/dist/{chunk-GJ776BC2.js → chunk-7NSC4IVA.js} +4 -3
- package/dist/{chunk-GJ776BC2.js.map → chunk-7NSC4IVA.js.map} +1 -1
- package/dist/{chunk-GN3WRFJY.js → chunk-7PKNOXYB.js} +14 -14
- package/dist/{chunk-AHVEHR6K.js → chunk-7ZNJN5WZ.js} +13 -1
- package/dist/chunk-7ZNJN5WZ.js.map +1 -0
- package/dist/{chunk-RZRUV6N2.js → chunk-ANMIOQPU.js} +2 -2
- package/dist/{chunk-RPSYDM6C.js → chunk-BPWZDHFM.js} +2 -2
- package/dist/{chunk-CIAI24TQ.js → chunk-BVRREV3N.js} +2 -2
- package/dist/{chunk-M4YHAODQ.js → chunk-BWJMBJCY.js} +306 -244
- package/dist/chunk-BWJMBJCY.js.map +1 -0
- package/dist/{chunk-2NLLXCJG.js → chunk-BXLOS5AJ.js} +2 -2
- package/dist/{chunk-I3MSGFGD.js → chunk-CKSEJD7K.js} +2 -2
- package/dist/{chunk-46SZBVDS.js → chunk-CME347TM.js} +2 -2
- package/dist/{chunk-BGLY7EEM.js → chunk-CMRUIKVA.js} +3 -3
- package/dist/{chunk-HGJ6NJ4E.js → chunk-D4LVHPOA.js} +2 -2
- package/dist/{chunk-YK6BDDHP.js → chunk-DFEODULB.js} +2 -2
- package/dist/{chunk-X7Y7WX73.js → chunk-DQEMWVMT.js} +1 -1
- package/dist/{chunk-W6FNX2LP.js → chunk-E57E5SCS.js} +2 -2
- package/dist/{chunk-M23RF3LJ.js → chunk-ER4BLWI6.js} +2 -2
- package/dist/{chunk-QZLDRQ4I.js → chunk-F7M36OG2.js} +5 -5
- package/dist/{chunk-D3LBIUWV.js → chunk-FK7T55BA.js} +80 -61
- package/dist/{chunk-D3LBIUWV.js.map → chunk-FK7T55BA.js.map} +1 -1
- package/dist/{chunk-5FD7JMTX.js → chunk-FONW766A.js} +2 -2
- package/dist/{chunk-3TIZPSJC.js → chunk-FR3FNPCJ.js} +3 -3
- package/dist/{chunk-G6DFSS6A.js → chunk-GUNIXT36.js} +2 -2
- package/dist/{chunk-K2UGPTYY.js → chunk-H6ZXNH5I.js} +2 -2
- package/dist/{chunk-BRR5EUTF.js → chunk-HC55YCNK.js} +2 -2
- package/dist/{chunk-PT54WISF.js → chunk-HQ2VGCGP.js} +14 -14
- package/dist/{chunk-AHZOMHWN.js → chunk-HXXGZ4KV.js} +1 -1
- package/dist/{chunk-ZRZVLB7O.js → chunk-HYVBJLEK.js} +5 -5
- package/dist/{chunk-W5ZKPI34.js → chunk-IFFW25NG.js} +330 -202
- package/dist/chunk-IFFW25NG.js.map +1 -0
- package/dist/{chunk-3GD2HFR6.js → chunk-IGWVMA4Y.js} +2 -2
- package/dist/{chunk-FONWBCVY.js → chunk-IKT6ZVO7.js} +3 -3
- package/dist/{chunk-TO7ZTWJW.js → chunk-ION47U3Z.js} +3 -3
- package/dist/{chunk-OCIP6YMD.js → chunk-IXGQP4RZ.js} +3 -3
- package/dist/{chunk-UPLZNJKN.js → chunk-JFPZEWY3.js} +3 -3
- package/dist/{chunk-SMNYAMJD.js → chunk-JKL53MOY.js} +4 -4
- package/dist/{chunk-2FKEIPIT.js → chunk-JOA4Q765.js} +3 -3
- package/dist/{chunk-2XRE6FLM.js → chunk-JUOZ62Y7.js} +3 -1
- package/dist/chunk-JUOZ62Y7.js.map +1 -0
- package/dist/{chunk-MLPTFODV.js → chunk-KHQ57QLJ.js} +4 -4
- package/dist/{chunk-NSVDUN76.js → chunk-LCU5R6TQ.js} +8 -3
- package/dist/chunk-LCU5R6TQ.js.map +1 -0
- package/dist/{chunk-IQ4NVWEF.js → chunk-LYPG7GOO.js} +4 -4
- package/dist/{chunk-IQ4NVWEF.js.map → chunk-LYPG7GOO.js.map} +1 -1
- package/dist/{chunk-KRTY3ENI.js → chunk-MDVBCPOS.js} +2 -2
- package/dist/{chunk-UCTS3DDH.js → chunk-N655QIA2.js} +4 -4
- package/dist/{chunk-5NB726GV.js → chunk-NFQB6RJT.js} +3 -3
- package/dist/{chunk-UYYW2KPU.js → chunk-NP7FLVZW.js} +2 -2
- package/dist/{chunk-CX5SW2EW.js → chunk-NRFU5MVH.js} +4 -4
- package/dist/{chunk-NISZQW72.js → chunk-O4TTIMOP.js} +2 -2
- package/dist/{chunk-7BD6O7ZV.js → chunk-O54B5YNM.js} +3 -3
- package/dist/{chunk-UKYS3NU5.js → chunk-ONCWJBWV.js} +3 -3
- package/dist/{chunk-OUKBMQ2O.js → chunk-PD66CVSD.js} +2 -2
- package/dist/{chunk-QYN5PXDZ.js → chunk-PPUTUOC3.js} +2 -2
- package/dist/{chunk-MIH3CJPN.js → chunk-PSH3VFZ7.js} +4 -4
- package/dist/{chunk-MK5VEWCR.js → chunk-QKPDN325.js} +2 -2
- package/dist/{chunk-EVWWT3KE.js → chunk-QP2IZTUR.js} +2 -2
- package/dist/{chunk-K26NWEOC.js → chunk-QSDPVZPD.js} +5 -5
- package/dist/{chunk-S354QO4R.js → chunk-QV7OEHFN.js} +2 -2
- package/dist/{chunk-HBUFQRIM.js → chunk-QZR3WT3L.js} +2 -2
- package/dist/{chunk-EEAMSNSG.js → chunk-R7TZ2HCS.js} +2 -2
- package/dist/{chunk-YXQEKCZM.js → chunk-R7UHWPYI.js} +2 -2
- package/dist/{chunk-2QSZNTDO.js → chunk-RKNJBZ55.js} +4 -4
- package/dist/{chunk-L6Z5OAS4.js → chunk-RL3EGL7A.js} +2 -2
- package/dist/{chunk-QCECHYZL.js → chunk-RVO6TCTU.js} +6 -6
- package/dist/{chunk-JYG4OLWH.js → chunk-S6AH7WSF.js} +3 -3
- package/dist/{chunk-6CYHUWCO.js → chunk-SFCJCMZQ.js} +5 -5
- package/dist/{chunk-V6ERBR7U.js → chunk-T3HC7RJ7.js} +2 -2
- package/dist/chunk-T3JQTCCO.js +94 -0
- package/dist/chunk-T3JQTCCO.js.map +1 -0
- package/dist/{chunk-FFRTNF3L.js → chunk-T6EQPZ6E.js} +4 -4
- package/dist/{chunk-FWX7W5PM.js → chunk-TAMY4NKO.js} +2 -2
- package/dist/{chunk-7TBXNYLO.js → chunk-TAPFJ3ET.js} +2 -2
- package/dist/{chunk-RUNORG2P.js → chunk-TF3LMM5E.js} +6 -11
- package/dist/chunk-TF3LMM5E.js.map +1 -0
- package/dist/{chunk-ZUKIUXHQ.js → chunk-TFXYQNBH.js} +12 -12
- package/dist/{chunk-26ZXBTYN.js → chunk-THACANBI.js} +4 -4
- package/dist/{chunk-37DZZFFM.js → chunk-TLVLJSWS.js} +2 -2
- package/dist/{chunk-6QPI2ITJ.js → chunk-TVKWT2CY.js} +4 -4
- package/dist/{chunk-H7NAZ3UB.js → chunk-U7BMN33M.js} +2 -2
- package/dist/chunk-UBCBDJOB.js +22 -0
- package/dist/chunk-UBCBDJOB.js.map +1 -0
- package/dist/{chunk-XZHE2DEN.js → chunk-UTDMY476.js} +50 -6
- package/dist/chunk-UTDMY476.js.map +1 -0
- package/dist/{chunk-6LKEUCEM.js → chunk-UXREWVW4.js} +2 -2
- package/dist/{chunk-SUPEYLH2.js → chunk-UYCIS6V5.js} +2 -2
- package/dist/{chunk-EKTP7MNS.js → chunk-V3IT3XNG.js} +7 -7
- package/dist/{chunk-IPLYGWQF.js → chunk-VDX2J7OX.js} +6 -6
- package/dist/{chunk-IKP5OYQQ.js → chunk-VWP5DEHU.js} +2 -2
- package/dist/{chunk-NQMSEB5D.js → chunk-X5OIPQME.js} +2 -2
- package/dist/{chunk-RBII7637.js → chunk-XRPPHIRI.js} +2 -2
- package/dist/{chunk-BIJAWZYW.js → chunk-YMOPYG3K.js} +6 -6
- package/dist/{cli-BPDUXnAl.d.ts → cli-CQdYilcx.d.ts} +61 -11
- package/dist/cli.d.ts +18 -18
- package/dist/cli.js +107 -102
- package/dist/coding/pre-action-gate.d.ts +1 -1
- package/dist/coding/pre-action-gate.js +2 -2
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +25 -24
- package/dist/compounding/preference-consolidator.d.ts +1 -1
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config-security.d.ts +7 -0
- package/dist/config-security.js +12 -0
- package/dist/config.d.ts +1 -1
- package/dist/config.js +4 -2
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +23 -22
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +24 -23
- 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/{contradiction-scan-JDTBXRGW.js → contradiction-scan-522AYLQC.js} +3 -3
- package/dist/converge-config.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +2 -2
- package/dist/convergence-refresh.js +25 -24
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/backend.js +2 -2
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/corpus-watermark.d.ts +1 -1
- package/dist/corpus-watermark.js +25 -24
- package/dist/day-summary.d.ts +1 -1
- package/dist/day-summary.js +2 -2
- package/dist/delinearize.d.ts +1 -1
- package/dist/dependency-propagation-config.d.ts +1 -1
- package/dist/{dependency-propagation-delivery-CzEfB31P.d.ts → dependency-propagation-delivery-C_K_AHcv.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/embedding-fallback.js +2 -2
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +4 -2
- package/dist/entity-retrieval.js +24 -22
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +9 -9
- package/dist/explicit-capture.js +6 -6
- package/dist/external-wiki-access.d.ts +11 -11
- package/dist/external-wiki-access.js +65 -63
- 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-normalization.js +3 -3
- package/dist/extraction-prompt.d.ts +1 -1
- package/dist/extraction-prompt.js +2 -2
- 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 +38 -37
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/{first-start-migration-CRZCZAJN.js → first-start-migration-HZ4VPRFQ.js} +2 -2
- package/dist/{forget-EHGGJZLX.js → forget-5TWK7CZT.js} +3 -3
- 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-decay-65KMOJWY.js → graph-edge-decay-ZXGBXNPW.js} +4 -4
- package/dist/graph-edge-decay-ZXGBXNPW.js.map +1 -0
- 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-snapshot.js +3 -3
- package/dist/graph.d.ts +1 -1
- package/dist/graph.js +3 -3
- 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 +755 -706
- package/dist/index.js +214 -188
- 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-llm.js +3 -3
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +23 -22
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +23 -22
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +24 -23
- package/dist/{maintenance-C8aRWfhq.d.ts → maintenance-DdP931i9.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 +24 -23
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/principal.js +2 -2
- 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 +23 -22
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/offline-sync-impression-drain.d.ts +1 -1
- package/dist/offline-sync-impression-drain.js +5 -5
- package/dist/operator-doctor-corpus.d.ts +1 -1
- package/dist/operator-doctor-corpus.js +26 -25
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +38 -36
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/compression-guideline-coordinator.js +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +31 -30
- package/dist/{orchestrator-D85CzDDY.d.ts → orchestrator-DxUWX7gs.d.ts} +26 -20
- package/dist/orchestrator.d.ts +9 -9
- package/dist/orchestrator.js +171 -168
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-DPcUifCO.d.ts → pipeline-BKUMU1vU.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/policy-runtime.js +1 -1
- package/dist/proactive-contention.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/{public-http-D3GBeII4.d.ts → public-http-Dw0bJhcC.d.ts} +1 -1
- package/dist/{qmd-dFCHp1r0.d.ts → qmd-DJP-GLFe.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-context-composition.d.ts +11 -1
- package/dist/recall-context-composition.js +4 -1
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +1 -1
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-planner-llm.js +3 -3
- 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/manifest.js +3 -3
- 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/{resolution-MMOD5WC4.js → resolution-DKMBPXHI.js} +3 -3
- package/dist/resolution-DKMBPXHI.js.map +1 -0
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/resume-bundles.js +5 -3
- package/dist/retrieval-agents.d.ts +2 -2
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +1 -1
- package/dist/routing/store.d.ts +1 -1
- package/dist/salvage-envelope.d.ts +1 -1
- package/dist/salvage-envelope.js +2 -2
- package/dist/schemas.d.ts +138 -138
- package/dist/{scope-profiles-DICK7GtN.d.ts → scope-profiles-CaKcnB-6.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/embed-helper.js +2 -2
- 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/meilisearch-backend.d.ts +1 -1
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-BP7NAX0N.d.ts → semantic-consolidation-P0eMWqh-.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +24 -23
- package/dist/semantic-rule-promotion.js +23 -22
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +23 -22
- package/dist/{service-DT-pJyda.d.ts → service-D5GQLxq_.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +9 -9
- package/dist/shared-context/manager.js +2 -2
- package/dist/signal.d.ts +1 -1
- package/dist/source-agent-qualifier.d.ts +1 -1
- package/dist/source-agent-qualifier.js +31 -30
- package/dist/{storage-qOnaJ1Lw.d.ts → storage-DIyil2ll.d.ts} +18 -10
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +22 -21
- package/dist/summarizer.d.ts +1 -1
- package/dist/summarizer.js +4 -4
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/support-passport/index.d.ts +14 -14
- package/dist/support-passport/index.js +67 -65
- package/dist/temporal-supersession.d.ts +2 -2
- package/dist/temporal-timeline-recall.d.ts +3 -1
- package/dist/temporal-timeline-recall.js +3 -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/{tier-stats-EXYSKSVN.js → tier-stats-7E6OBUSD.js} +2 -2
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transfer/autodetect.js +1 -1
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-export.js +3 -3
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/types.d.ts +66 -66
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-ed-SvS2t.d.ts → types-CbXieHKr.d.ts} +15 -3
- 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 +23 -22
- package/dist/write-envelope.d.ts +5 -2
- package/dist/write-envelope.js +1 -1
- package/package.json +2 -2
- package/src/bitemporal-frontmatter.test.ts +20 -1
- package/src/briefing-window.ts +27 -0
- package/src/briefing.test.ts +29 -0
- package/src/briefing.ts +2 -9
- package/src/capabilities.test.ts +2 -0
- package/src/capabilities.ts +17 -17
- package/src/cli.ts +14 -0
- package/src/config-security.ts +131 -0
- package/src/config.test.ts +61 -0
- package/src/config.ts +2 -1
- package/src/entity-retrieval.ts +31 -24
- package/src/index.ts +4 -6
- package/src/maintenance/memory-governance.ts +1 -0
- package/src/orchestration/conversation-index-coordinator.ts +13 -2
- package/src/orchestration/extraction-injection-gate.ts +154 -0
- package/src/orchestration/extraction-origin-context.ts +90 -0
- package/src/orchestration/extraction-persist.ts +66 -64
- package/src/orchestration/extraction-run.ts +4 -2
- package/src/orchestration/extraction-security.test.ts +271 -0
- package/src/orchestration/graph-recall-coordinator.ts +2 -0
- package/src/orchestration/namespace-read-fanout.ts +1 -0
- package/src/orchestration/qmd-result-resolver.ts +1 -0
- package/src/orchestration/recall-internal.ts +17 -11
- package/src/orchestration/recall-result-formatter.ts +35 -6
- package/src/orchestration/recall-search-pipeline.ts +3 -5
- package/src/orchestration/recall-search-prefilter.ts +1 -0
- package/src/orchestrator.ts +2 -1
- package/src/procedural/procedure-recall.ts +11 -1
- package/src/recall-authority-fence.test.ts +180 -0
- package/src/recall-context-composition.ts +28 -0
- package/src/security/audit-memory-cli.ts +42 -0
- package/src/security/audit-memory.test.ts +252 -0
- package/src/security/audit-memory.ts +318 -0
- package/src/security/injection-screen.test.ts +77 -0
- package/src/security/injection-screen.ts +158 -0
- package/src/security/origin-authority.test.ts +61 -0
- package/src/security/origin-authority.ts +88 -0
- package/src/security/types.ts +14 -0
- package/src/semantic-rule-promotion.ts +1 -1
- package/src/storage/memory-read-store.ts +1 -0
- package/src/storage/windowed-memory-read.ts +109 -0
- package/src/storage.ts +17 -15
- package/src/temporal-timeline-recall.test.ts +18 -0
- package/src/temporal-timeline-recall.ts +12 -1
- package/src/testing/subjects/windowed-memory-read.test.ts +146 -0
- package/src/types.ts +4 -4
- package/src/write-envelope.test.ts +1 -0
- package/src/write-envelope.ts +9 -0
- package/dist/chunk-2XRE6FLM.js.map +0 -1
- package/dist/chunk-76JJSXK7.js.map +0 -1
- package/dist/chunk-AHVEHR6K.js.map +0 -1
- package/dist/chunk-FPLM2TKD.js.map +0 -1
- package/dist/chunk-I6WYQSX4.js.map +0 -1
- package/dist/chunk-M4YHAODQ.js.map +0 -1
- package/dist/chunk-NSVDUN76.js.map +0 -1
- package/dist/chunk-PG4QBPVG.js.map +0 -1
- package/dist/chunk-RUNORG2P.js.map +0 -1
- package/dist/chunk-RZQ6W2W4.js.map +0 -1
- package/dist/chunk-W5ZKPI34.js.map +0 -1
- package/dist/chunk-XZHE2DEN.js.map +0 -1
- /package/dist/{auto-sync-NR3GPCOA.js.map → auto-sync-5HVRCMGZ.js.map} +0 -0
- /package/dist/{capsule-crypto-7FJQINUR.js.map → briefing-window.js.map} +0 -0
- /package/dist/{contradiction-scan-JDTBXRGW.js.map → capsule-crypto-YO5QJ6L3.js.map} +0 -0
- /package/dist/{chunk-LEPOP46W.js.map → chunk-227UFSEQ.js.map} +0 -0
- /package/dist/{chunk-FTPONF6B.js.map → chunk-2YREVL4T.js.map} +0 -0
- /package/dist/{chunk-KM55SMLG.js.map → chunk-4KM3V6VS.js.map} +0 -0
- /package/dist/{chunk-HAEU3ZW7.js.map → chunk-4OW2T32G.js.map} +0 -0
- /package/dist/{chunk-43SEBY2M.js.map → chunk-4QFCAKNM.js.map} +0 -0
- /package/dist/{chunk-KFBOPMF6.js.map → chunk-5ZIWRMZM.js.map} +0 -0
- /package/dist/{chunk-GWFSVJ4P.js.map → chunk-6KTXE6A3.js.map} +0 -0
- /package/dist/{chunk-GN3WRFJY.js.map → chunk-7PKNOXYB.js.map} +0 -0
- /package/dist/{chunk-RZRUV6N2.js.map → chunk-ANMIOQPU.js.map} +0 -0
- /package/dist/{chunk-RPSYDM6C.js.map → chunk-BPWZDHFM.js.map} +0 -0
- /package/dist/{chunk-CIAI24TQ.js.map → chunk-BVRREV3N.js.map} +0 -0
- /package/dist/{chunk-2NLLXCJG.js.map → chunk-BXLOS5AJ.js.map} +0 -0
- /package/dist/{chunk-I3MSGFGD.js.map → chunk-CKSEJD7K.js.map} +0 -0
- /package/dist/{chunk-46SZBVDS.js.map → chunk-CME347TM.js.map} +0 -0
- /package/dist/{chunk-BGLY7EEM.js.map → chunk-CMRUIKVA.js.map} +0 -0
- /package/dist/{chunk-HGJ6NJ4E.js.map → chunk-D4LVHPOA.js.map} +0 -0
- /package/dist/{chunk-YK6BDDHP.js.map → chunk-DFEODULB.js.map} +0 -0
- /package/dist/{chunk-X7Y7WX73.js.map → chunk-DQEMWVMT.js.map} +0 -0
- /package/dist/{chunk-W6FNX2LP.js.map → chunk-E57E5SCS.js.map} +0 -0
- /package/dist/{chunk-M23RF3LJ.js.map → chunk-ER4BLWI6.js.map} +0 -0
- /package/dist/{chunk-QZLDRQ4I.js.map → chunk-F7M36OG2.js.map} +0 -0
- /package/dist/{chunk-5FD7JMTX.js.map → chunk-FONW766A.js.map} +0 -0
- /package/dist/{chunk-3TIZPSJC.js.map → chunk-FR3FNPCJ.js.map} +0 -0
- /package/dist/{chunk-G6DFSS6A.js.map → chunk-GUNIXT36.js.map} +0 -0
- /package/dist/{chunk-K2UGPTYY.js.map → chunk-H6ZXNH5I.js.map} +0 -0
- /package/dist/{chunk-BRR5EUTF.js.map → chunk-HC55YCNK.js.map} +0 -0
- /package/dist/{chunk-PT54WISF.js.map → chunk-HQ2VGCGP.js.map} +0 -0
- /package/dist/{chunk-AHZOMHWN.js.map → chunk-HXXGZ4KV.js.map} +0 -0
- /package/dist/{chunk-ZRZVLB7O.js.map → chunk-HYVBJLEK.js.map} +0 -0
- /package/dist/{chunk-3GD2HFR6.js.map → chunk-IGWVMA4Y.js.map} +0 -0
- /package/dist/{chunk-FONWBCVY.js.map → chunk-IKT6ZVO7.js.map} +0 -0
- /package/dist/{chunk-TO7ZTWJW.js.map → chunk-ION47U3Z.js.map} +0 -0
- /package/dist/{chunk-OCIP6YMD.js.map → chunk-IXGQP4RZ.js.map} +0 -0
- /package/dist/{chunk-UPLZNJKN.js.map → chunk-JFPZEWY3.js.map} +0 -0
- /package/dist/{chunk-SMNYAMJD.js.map → chunk-JKL53MOY.js.map} +0 -0
- /package/dist/{chunk-2FKEIPIT.js.map → chunk-JOA4Q765.js.map} +0 -0
- /package/dist/{chunk-MLPTFODV.js.map → chunk-KHQ57QLJ.js.map} +0 -0
- /package/dist/{chunk-KRTY3ENI.js.map → chunk-MDVBCPOS.js.map} +0 -0
- /package/dist/{chunk-UCTS3DDH.js.map → chunk-N655QIA2.js.map} +0 -0
- /package/dist/{chunk-5NB726GV.js.map → chunk-NFQB6RJT.js.map} +0 -0
- /package/dist/{chunk-UYYW2KPU.js.map → chunk-NP7FLVZW.js.map} +0 -0
- /package/dist/{chunk-CX5SW2EW.js.map → chunk-NRFU5MVH.js.map} +0 -0
- /package/dist/{chunk-NISZQW72.js.map → chunk-O4TTIMOP.js.map} +0 -0
- /package/dist/{chunk-7BD6O7ZV.js.map → chunk-O54B5YNM.js.map} +0 -0
- /package/dist/{chunk-UKYS3NU5.js.map → chunk-ONCWJBWV.js.map} +0 -0
- /package/dist/{chunk-OUKBMQ2O.js.map → chunk-PD66CVSD.js.map} +0 -0
- /package/dist/{chunk-QYN5PXDZ.js.map → chunk-PPUTUOC3.js.map} +0 -0
- /package/dist/{chunk-MIH3CJPN.js.map → chunk-PSH3VFZ7.js.map} +0 -0
- /package/dist/{chunk-MK5VEWCR.js.map → chunk-QKPDN325.js.map} +0 -0
- /package/dist/{chunk-EVWWT3KE.js.map → chunk-QP2IZTUR.js.map} +0 -0
- /package/dist/{chunk-K26NWEOC.js.map → chunk-QSDPVZPD.js.map} +0 -0
- /package/dist/{chunk-S354QO4R.js.map → chunk-QV7OEHFN.js.map} +0 -0
- /package/dist/{chunk-HBUFQRIM.js.map → chunk-QZR3WT3L.js.map} +0 -0
- /package/dist/{chunk-EEAMSNSG.js.map → chunk-R7TZ2HCS.js.map} +0 -0
- /package/dist/{chunk-YXQEKCZM.js.map → chunk-R7UHWPYI.js.map} +0 -0
- /package/dist/{chunk-2QSZNTDO.js.map → chunk-RKNJBZ55.js.map} +0 -0
- /package/dist/{chunk-L6Z5OAS4.js.map → chunk-RL3EGL7A.js.map} +0 -0
- /package/dist/{chunk-QCECHYZL.js.map → chunk-RVO6TCTU.js.map} +0 -0
- /package/dist/{chunk-JYG4OLWH.js.map → chunk-S6AH7WSF.js.map} +0 -0
- /package/dist/{chunk-6CYHUWCO.js.map → chunk-SFCJCMZQ.js.map} +0 -0
- /package/dist/{chunk-V6ERBR7U.js.map → chunk-T3HC7RJ7.js.map} +0 -0
- /package/dist/{chunk-FFRTNF3L.js.map → chunk-T6EQPZ6E.js.map} +0 -0
- /package/dist/{chunk-FWX7W5PM.js.map → chunk-TAMY4NKO.js.map} +0 -0
- /package/dist/{chunk-7TBXNYLO.js.map → chunk-TAPFJ3ET.js.map} +0 -0
- /package/dist/{chunk-ZUKIUXHQ.js.map → chunk-TFXYQNBH.js.map} +0 -0
- /package/dist/{chunk-26ZXBTYN.js.map → chunk-THACANBI.js.map} +0 -0
- /package/dist/{chunk-37DZZFFM.js.map → chunk-TLVLJSWS.js.map} +0 -0
- /package/dist/{chunk-6QPI2ITJ.js.map → chunk-TVKWT2CY.js.map} +0 -0
- /package/dist/{chunk-H7NAZ3UB.js.map → chunk-U7BMN33M.js.map} +0 -0
- /package/dist/{chunk-6LKEUCEM.js.map → chunk-UXREWVW4.js.map} +0 -0
- /package/dist/{chunk-SUPEYLH2.js.map → chunk-UYCIS6V5.js.map} +0 -0
- /package/dist/{chunk-EKTP7MNS.js.map → chunk-V3IT3XNG.js.map} +0 -0
- /package/dist/{chunk-IPLYGWQF.js.map → chunk-VDX2J7OX.js.map} +0 -0
- /package/dist/{chunk-IKP5OYQQ.js.map → chunk-VWP5DEHU.js.map} +0 -0
- /package/dist/{chunk-NQMSEB5D.js.map → chunk-X5OIPQME.js.map} +0 -0
- /package/dist/{chunk-RBII7637.js.map → chunk-XRPPHIRI.js.map} +0 -0
- /package/dist/{chunk-BIJAWZYW.js.map → chunk-YMOPYG3K.js.map} +0 -0
- /package/dist/{graph-edge-decay-65KMOJWY.js.map → config-security.js.map} +0 -0
- /package/dist/{resolution-MMOD5WC4.js.map → contradiction-scan-522AYLQC.js.map} +0 -0
- /package/dist/{first-start-migration-CRZCZAJN.js.map → first-start-migration-HZ4VPRFQ.js.map} +0 -0
- /package/dist/{forget-EHGGJZLX.js.map → forget-5TWK7CZT.js.map} +0 -0
- /package/dist/{tier-stats-EXYSKSVN.js.map → tier-stats-7E6OBUSD.js.map} +0 -0
package/dist/write-envelope.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { w as MemoryCategory } from './types-
|
|
1
|
+
import { w as MemoryCategory } from './types-CbXieHKr.js';
|
|
2
2
|
import './message-parts/index.js';
|
|
3
3
|
import './bounded-jsonl-state.js';
|
|
4
4
|
import './operator-doctor-types.js';
|
|
@@ -59,6 +59,8 @@ interface MemoryWriteInput {
|
|
|
59
59
|
validAt?: string;
|
|
60
60
|
/** Connector identity that produced this write (issue #1852). */
|
|
61
61
|
sourceConnector?: string;
|
|
62
|
+
/** Origin class stamped at creation time (issue #1955). */
|
|
63
|
+
origin?: string;
|
|
62
64
|
/** Human-readable provenance note. */
|
|
63
65
|
sourceReason?: string;
|
|
64
66
|
}
|
|
@@ -146,6 +148,7 @@ interface SealedMemoryEnvelope {
|
|
|
146
148
|
readonly ttl: string | undefined;
|
|
147
149
|
readonly validAt: string | undefined;
|
|
148
150
|
readonly sourceConnector: string | undefined;
|
|
151
|
+
readonly origin: string | undefined;
|
|
149
152
|
readonly sourceReason: string | undefined;
|
|
150
153
|
readonly source: string;
|
|
151
154
|
/** ISO timestamp the envelope was composed (from ctx.now). */
|
|
@@ -223,7 +226,7 @@ declare const WRITE_FINGERPRINT_FIELDS: readonly ["content", "category", "tags",
|
|
|
223
226
|
* is a visible, reviewable decision — this list exists so the exhaustiveness
|
|
224
227
|
* guard can force every new `MemoryWriteInput` field to be classified.
|
|
225
228
|
*/
|
|
226
|
-
declare const FINGERPRINT_EXEMPT_FIELDS: readonly ["confidence", "sourceReason"];
|
|
229
|
+
declare const FINGERPRINT_EXEMPT_FIELDS: readonly ["confidence", "origin", "sourceReason"];
|
|
227
230
|
/** Scope keys always folded into the fingerprint payload. */
|
|
228
231
|
declare const FINGERPRINT_SCOPE_FIELDS: readonly ["surface", "namespace", "principal", "codingContext"];
|
|
229
232
|
/**
|
package/dist/write-envelope.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/core",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.55.0",
|
|
4
4
|
"description": "Framework-agnostic Remnic memory engine — orchestrator, storage, extraction, search, trust zones",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -3136,7 +3136,7 @@
|
|
|
3136
3136
|
"core"
|
|
3137
3137
|
],
|
|
3138
3138
|
"peerDependencies": {
|
|
3139
|
-
"@remnic/coding-graph": "^9.
|
|
3139
|
+
"@remnic/coding-graph": "^9.55.0"
|
|
3140
3140
|
},
|
|
3141
3141
|
"peerDependenciesMeta": {
|
|
3142
3142
|
"@remnic/coding-graph": {
|
|
@@ -2,7 +2,7 @@ import test from "node:test";
|
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
3
|
import os from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
import { mkdtemp, rm } from "node:fs/promises";
|
|
5
|
+
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
6
6
|
|
|
7
7
|
import { StorageManager } from "./storage.js";
|
|
8
8
|
import { isValidityExpiredNow } from "./temporal-validity.js";
|
|
@@ -54,6 +54,25 @@ test("round-trip: observedAt + eventTimeSource + valid_at survive write → read
|
|
|
54
54
|
await rm(dir, { recursive: true, force: true });
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
+
test("writeMemory normalizes arbitrary origin strings to unknown", async () => {
|
|
58
|
+
const dir = await mkdtemp(path.join(os.tmpdir(), "remnic-origin-normalize-"));
|
|
59
|
+
try {
|
|
60
|
+
const storage = new StorageManager(dir);
|
|
61
|
+
await storage.ensureDirectories();
|
|
62
|
+
|
|
63
|
+
const { id } = await storage.writeMemory("fact", "Origin boundary test.", {
|
|
64
|
+
origin: "weird\nvalue",
|
|
65
|
+
});
|
|
66
|
+
const written = (await storage.readAllMemories()).find((memory) => memory.frontmatter.id === id);
|
|
67
|
+
assert.ok(written);
|
|
68
|
+
const raw = await readFile(written!.path, "utf8");
|
|
69
|
+
assert.match(raw, /^origin: unknown$/m);
|
|
70
|
+
assert.doesNotMatch(raw, /weird/);
|
|
71
|
+
assert.equal(written!.frontmatter.origin, "unknown");
|
|
72
|
+
} finally {
|
|
73
|
+
await rm(dir, { recursive: true, force: true });
|
|
74
|
+
}
|
|
75
|
+
});
|
|
57
76
|
|
|
58
77
|
test("round-trip: invalid_at + forgottenAt coexist with observedAt/eventTimeSource (parser not corrupted)", async () => {
|
|
59
78
|
// Exercises the full serialize→parse round trip through the
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { log } from "./logger.js";
|
|
2
|
+
import type { MemoryFile } from "./types.js";
|
|
3
|
+
type BriefingMemoryReader = {
|
|
4
|
+
readMemoriesWindow?: (options: { updatedAfter?: Date }) => Promise<{ memories: MemoryFile[] }>;
|
|
5
|
+
readAllMemories: () => Promise<MemoryFile[]>;
|
|
6
|
+
};
|
|
7
|
+
import type { ParsedBriefingWindow } from "./briefing.js";
|
|
8
|
+
|
|
9
|
+
/** Read only the memories needed by a briefing, with compatibility fallback. */
|
|
10
|
+
export async function safeReadMemories(
|
|
11
|
+
storage: BriefingMemoryReader,
|
|
12
|
+
window: ParsedBriefingWindow
|
|
13
|
+
): Promise<MemoryFile[]> {
|
|
14
|
+
try {
|
|
15
|
+
// A briefing only needs memories inside its lookback window. Avoid parsing
|
|
16
|
+
// the full corpus on cache misses; keep the full-read fallback for custom
|
|
17
|
+
// StorageManager-compatible callers that predate readMemoriesWindow().
|
|
18
|
+
if (typeof storage.readMemoriesWindow === "function") {
|
|
19
|
+
const result = await storage.readMemoriesWindow({ updatedAfter: window.from });
|
|
20
|
+
return result.memories;
|
|
21
|
+
}
|
|
22
|
+
return await storage.readAllMemories();
|
|
23
|
+
} catch (err) {
|
|
24
|
+
log.warn(`briefing: read memories failed: ${err}`);
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
}
|
package/src/briefing.test.ts
CHANGED
|
@@ -913,6 +913,35 @@ function makeEmptyStorage(): StorageManager {
|
|
|
913
913
|
readAllEntityFiles: async () => [],
|
|
914
914
|
} as unknown as StorageManager;
|
|
915
915
|
}
|
|
916
|
+
test("buildBriefing reads only memories updated inside the briefing window", async () => {
|
|
917
|
+
let readWindowOptions: { updatedAfter?: Date } | undefined;
|
|
918
|
+
const atWindowStart = makeMemory("2026-04-10T00:00:00.000Z");
|
|
919
|
+
const atWindowEnd = makeMemory("2026-04-11T00:00:00.000Z");
|
|
920
|
+
const storage = {
|
|
921
|
+
readAllMemories: async () => {
|
|
922
|
+
throw new Error("full corpus read must not be used by briefing");
|
|
923
|
+
},
|
|
924
|
+
readMemoriesWindow: async (options: { updatedAfter?: Date }) => {
|
|
925
|
+
readWindowOptions = options;
|
|
926
|
+
return {
|
|
927
|
+
memories: [atWindowStart, atWindowEnd],
|
|
928
|
+
filePaths: [atWindowStart.path, atWindowEnd.path],
|
|
929
|
+
};
|
|
930
|
+
},
|
|
931
|
+
readAllEntityFiles: async () => [],
|
|
932
|
+
} as unknown as StorageManager;
|
|
933
|
+
|
|
934
|
+
const result = await buildBriefing({
|
|
935
|
+
storage,
|
|
936
|
+
window: makeWindow("2026-04-10T00:00:00.000Z", "2026-04-11T00:00:00.000Z"),
|
|
937
|
+
allowLlm: false,
|
|
938
|
+
now: new Date("2026-04-11T10:00:00.000Z"),
|
|
939
|
+
});
|
|
940
|
+
|
|
941
|
+
assert.equal(readWindowOptions?.updatedAfter?.toISOString(), "2026-04-10T00:00:00.000Z");
|
|
942
|
+
assert.equal(result.sections.activeThreads.length, 1);
|
|
943
|
+
});
|
|
944
|
+
|
|
916
945
|
|
|
917
946
|
test("buildBriefing excludes support passport records from generated context", async () => {
|
|
918
947
|
const generatedPrompts: unknown[] = [];
|
package/src/briefing.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { extractJsonCandidates } from "./json-extract.js";
|
|
|
23
23
|
import { drainPassiveCorrectionNotifications } from "./correction/passive-correction-notifications.js";
|
|
24
24
|
import { excludeSupportPassportPrivateMemories } from "./support-passport/card-projection.js";
|
|
25
25
|
import { normalizeEntityName, StorageManager } from "./storage.js";
|
|
26
|
+
import { safeReadMemories } from "./briefing-window.js";
|
|
26
27
|
import { readEnvVar, resolveHomeDir } from "./runtime/env.js";
|
|
27
28
|
import type {
|
|
28
29
|
BriefingActiveThread,
|
|
@@ -834,7 +835,7 @@ export async function buildBriefing(options: BuildBriefingOptions): Promise<Brie
|
|
|
834
835
|
const focus = options.focus ?? null;
|
|
835
836
|
|
|
836
837
|
const [allMemories, allEntities] = await Promise.all([
|
|
837
|
-
safeReadMemories(options.storage),
|
|
838
|
+
safeReadMemories(options.storage, window).then(excludeSupportPassportPrivateMemories),
|
|
838
839
|
safeReadEntities(options.storage),
|
|
839
840
|
]);
|
|
840
841
|
|
|
@@ -977,14 +978,6 @@ function defaultWindow(now: Date): ParsedBriefingWindow {
|
|
|
977
978
|
return { from: new Date(now.getTime() - DAY_MS), to: now, label: "yesterday" };
|
|
978
979
|
}
|
|
979
980
|
|
|
980
|
-
async function safeReadMemories(storage: StorageManager): Promise<MemoryFile[]> {
|
|
981
|
-
try {
|
|
982
|
-
return excludeSupportPassportPrivateMemories(await storage.readAllMemories());
|
|
983
|
-
} catch (err) { log.warn(`briefing: readAllMemories failed: ${err}`);
|
|
984
|
-
return [];
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
|
|
988
981
|
async function safeReadEntities(storage: StorageManager): Promise<EntityFile[]> {
|
|
989
982
|
try {
|
|
990
983
|
return await storage.readAllEntityFiles();
|
package/src/capabilities.test.ts
CHANGED
|
@@ -857,6 +857,8 @@ const SECURITY_FIELD_TO_FLAG: Record<keyof SecurityCapabilitySet, string> = {
|
|
|
857
857
|
trustZones: "trustZonesEnabled",
|
|
858
858
|
quarantinePromotion: "quarantinePromotionEnabled",
|
|
859
859
|
memoryPoisoningDefense: "memoryPoisoningDefenseEnabled",
|
|
860
|
+
originAuthority: "originAuthorityEnabled",
|
|
861
|
+
injectionScreen: "injectionScreenEnabled",
|
|
860
862
|
trustZoneRecall: "trustZoneRecallEnabled",
|
|
861
863
|
};
|
|
862
864
|
|
package/src/capabilities.ts
CHANGED
|
@@ -616,13 +616,12 @@ export function resolveLocalLlmCapabilities(
|
|
|
616
616
|
}
|
|
617
617
|
|
|
618
618
|
// ---------------------------------------------------------------------------
|
|
619
|
-
// Security capability set (issue #1523 batch 7).
|
|
620
|
-
//
|
|
621
|
-
//
|
|
622
|
-
//
|
|
623
|
-
//
|
|
624
|
-
//
|
|
625
|
-
// a pure pass-through.
|
|
619
|
+
// Security capability set (issue #1523 batch 7). The six security/trust-zone
|
|
620
|
+
// flags gate quarantine promotion, poisoning defense, origin authority,
|
|
621
|
+
// injection screening, and trust-zone recall. Read sites span orchestrator,
|
|
622
|
+
// access-service, CLI, and research-status commands. All flags are
|
|
623
|
+
// non-optional booleans on PluginConfig (defaults resolved at the parse
|
|
624
|
+
// boundary), so the projection is a pure pass-through.
|
|
626
625
|
// ---------------------------------------------------------------------------
|
|
627
626
|
|
|
628
627
|
/**
|
|
@@ -635,26 +634,27 @@ export interface SecurityCapabilitySet {
|
|
|
635
634
|
readonly quarantinePromotion: boolean;
|
|
636
635
|
/** `memoryPoisoningDefenseEnabled` — detect and defend against memory poisoning. */
|
|
637
636
|
readonly memoryPoisoningDefense: boolean;
|
|
637
|
+
/** `originAuthorityEnabled` — preserve origin-bound write authority. */
|
|
638
|
+
readonly originAuthority: boolean;
|
|
639
|
+
/** `injectionScreenEnabled` — quarantine deterministic injection findings. */
|
|
640
|
+
readonly injectionScreen: boolean;
|
|
638
641
|
/** `trustZoneRecallEnabled` — restrict recall to trusted zones. */
|
|
639
642
|
readonly trustZoneRecall: boolean;
|
|
640
643
|
}
|
|
641
644
|
|
|
642
|
-
/**
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
PluginConfig,
|
|
647
|
-
"trustZonesEnabled" | "quarantinePromotionEnabled" | "memoryPoisoningDefenseEnabled" | "trustZoneRecallEnabled"
|
|
648
|
-
>;
|
|
645
|
+
/** Config projection consumed by {@link resolveSecurityCapabilities}. */
|
|
646
|
+
export type SecurityConfigProjection = Pick<PluginConfig,
|
|
647
|
+
| "trustZonesEnabled" | "quarantinePromotionEnabled" | "memoryPoisoningDefenseEnabled"
|
|
648
|
+
| "originAuthorityEnabled" | "injectionScreenEnabled" | "trustZoneRecallEnabled">;
|
|
649
649
|
|
|
650
|
-
/**
|
|
651
|
-
* Resolve the {@link SecurityCapabilitySet} from parsed config.
|
|
652
|
-
*/
|
|
650
|
+
/** Resolve the {@link SecurityCapabilitySet} from parsed config. */
|
|
653
651
|
export function resolveSecurityCapabilities(config: SecurityConfigProjection): SecurityCapabilitySet {
|
|
654
652
|
return Object.freeze({
|
|
655
653
|
trustZones: config.trustZonesEnabled,
|
|
656
654
|
quarantinePromotion: config.quarantinePromotionEnabled,
|
|
657
655
|
memoryPoisoningDefense: config.memoryPoisoningDefenseEnabled,
|
|
656
|
+
originAuthority: config.originAuthorityEnabled,
|
|
657
|
+
injectionScreen: config.injectionScreenEnabled,
|
|
658
658
|
trustZoneRecall: config.trustZoneRecallEnabled,
|
|
659
659
|
});
|
|
660
660
|
}
|
package/src/cli.ts
CHANGED
|
@@ -66,6 +66,11 @@ import {
|
|
|
66
66
|
restoreMemoryGovernanceRun,
|
|
67
67
|
runMemoryGovernance,
|
|
68
68
|
} from "./maintenance/memory-governance.js";
|
|
69
|
+
import {
|
|
70
|
+
auditMemoryStore,
|
|
71
|
+
type AuditMemoryStoreOptions,
|
|
72
|
+
} from "./security/audit-memory.js";
|
|
73
|
+
import { registerSecurityCommands } from "./security/audit-memory-cli.js";
|
|
69
74
|
import {
|
|
70
75
|
rebuildMemoryProjection,
|
|
71
76
|
repairMemoryProjection,
|
|
@@ -534,6 +539,8 @@ export interface MemoryReviewDispositionCliCommandOptions {
|
|
|
534
539
|
now?: Date;
|
|
535
540
|
}
|
|
536
541
|
|
|
542
|
+
export interface AuditMemoryCliCommandOptions extends AuditMemoryStoreOptions {}
|
|
543
|
+
|
|
537
544
|
export interface MigrateObservationsCliCommandOptions {
|
|
538
545
|
memoryDir: string;
|
|
539
546
|
write?: boolean;
|
|
@@ -1130,6 +1137,11 @@ export async function runMemoryReviewDispositionCliCommand(
|
|
|
1130
1137
|
reasonCode: options.reasonCode,
|
|
1131
1138
|
};
|
|
1132
1139
|
}
|
|
1140
|
+
export async function runAuditMemoryCliCommand(
|
|
1141
|
+
options: AuditMemoryCliCommandOptions,
|
|
1142
|
+
) {
|
|
1143
|
+
return auditMemoryStore(options);
|
|
1144
|
+
}
|
|
1133
1145
|
|
|
1134
1146
|
export async function runMigrateObservationsCliCommand(
|
|
1135
1147
|
options: MigrateObservationsCliCommandOptions,
|
|
@@ -7187,6 +7199,8 @@ export function registerCli(
|
|
|
7187
7199
|
console.log("OK");
|
|
7188
7200
|
});
|
|
7189
7201
|
|
|
7202
|
+
registerSecurityCommands(cmd, orchestrator);
|
|
7203
|
+
|
|
7190
7204
|
cmd
|
|
7191
7205
|
.command("governance-run")
|
|
7192
7206
|
.description("Run memory governance in shadow/apply mode and write audit artifacts")
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { coerceBool } from "./connectors/coerce.js";
|
|
2
|
+
import { readEnvVar } from "./runtime/env.js";
|
|
3
|
+
import { DEFAULT_UNTRUSTED_ORIGINS } from "./security/origin-authority.js";
|
|
4
|
+
|
|
5
|
+
// Memory-poisoning hardening (#1955): preserve explicit config, but let env
|
|
6
|
+
// values replace schema-materialized defaults from the host config loader.
|
|
7
|
+
function resolveSecurityBooleanConfig(
|
|
8
|
+
value: unknown,
|
|
9
|
+
rawOperatorConfig: Record<string, unknown> | null | undefined,
|
|
10
|
+
flagName: string,
|
|
11
|
+
envName: string,
|
|
12
|
+
defaultValue: boolean,
|
|
13
|
+
): boolean {
|
|
14
|
+
const rawAuthored =
|
|
15
|
+
rawOperatorConfig !== undefined &&
|
|
16
|
+
rawOperatorConfig !== null &&
|
|
17
|
+
Object.prototype.hasOwnProperty.call(rawOperatorConfig, flagName) &&
|
|
18
|
+
rawOperatorConfig[flagName] !== undefined &&
|
|
19
|
+
rawOperatorConfig[flagName] !== null;
|
|
20
|
+
const schemaDefaultMaterialized =
|
|
21
|
+
rawOperatorConfig !== undefined &&
|
|
22
|
+
!rawAuthored &&
|
|
23
|
+
value === defaultValue;
|
|
24
|
+
if (!schemaDefaultMaterialized && value !== undefined && value !== null) {
|
|
25
|
+
return resolveBooleanConfig(value, defaultValue, flagName);
|
|
26
|
+
}
|
|
27
|
+
if (rawAuthored) {
|
|
28
|
+
return resolveBooleanConfig(value ?? rawOperatorConfig?.[flagName], defaultValue, flagName);
|
|
29
|
+
}
|
|
30
|
+
const envValue = readEnvVar(envName);
|
|
31
|
+
return envValue === undefined
|
|
32
|
+
? defaultValue
|
|
33
|
+
: resolveBooleanConfig(envValue, defaultValue, flagName);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function resolveBooleanConfig(
|
|
37
|
+
value: unknown,
|
|
38
|
+
defaultValue: boolean,
|
|
39
|
+
keyName: string,
|
|
40
|
+
): boolean {
|
|
41
|
+
if (value === undefined || value === null) return defaultValue;
|
|
42
|
+
const coerced = coerceBool(value);
|
|
43
|
+
if (coerced === undefined) {
|
|
44
|
+
throw new Error(
|
|
45
|
+
`${keyName} must be a boolean-like value (true/false/1/0/yes/no/on/off); got ${JSON.stringify(value)}`,
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
return coerced;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Memory-poisoning hardening (#1955): keep origin allow-list parsing in the
|
|
52
|
+
// parser module so config-contract extraction covers this delegated surface.
|
|
53
|
+
function resolveUntrustedOrigins(
|
|
54
|
+
value: unknown,
|
|
55
|
+
rawOperatorConfig: Record<string, unknown> | null | undefined,
|
|
56
|
+
): string[] {
|
|
57
|
+
const rawAuthored =
|
|
58
|
+
rawOperatorConfig !== undefined &&
|
|
59
|
+
rawOperatorConfig !== null &&
|
|
60
|
+
Object.prototype.hasOwnProperty.call(rawOperatorConfig, "untrustedOrigins") &&
|
|
61
|
+
rawOperatorConfig.untrustedOrigins !== undefined &&
|
|
62
|
+
rawOperatorConfig.untrustedOrigins !== null;
|
|
63
|
+
const schemaDefaultMaterialized =
|
|
64
|
+
rawOperatorConfig !== undefined &&
|
|
65
|
+
!rawAuthored &&
|
|
66
|
+
Array.isArray(value) &&
|
|
67
|
+
value.length === DEFAULT_UNTRUSTED_ORIGINS.length &&
|
|
68
|
+
value.every((entry, index) => entry === DEFAULT_UNTRUSTED_ORIGINS[index]);
|
|
69
|
+
const configValue = schemaDefaultMaterialized ? undefined : value;
|
|
70
|
+
const fromEnv = configValue === undefined || configValue === null;
|
|
71
|
+
const envValue = fromEnv ? readEnvVar("REMNIC_UNTRUSTED_ORIGINS") : undefined;
|
|
72
|
+
const source = fromEnv ? envValue : configValue;
|
|
73
|
+
if (source === undefined || source === null) return [...DEFAULT_UNTRUSTED_ORIGINS];
|
|
74
|
+
|
|
75
|
+
let entries: unknown[];
|
|
76
|
+
if (Array.isArray(source)) {
|
|
77
|
+
entries = source;
|
|
78
|
+
} else if (fromEnv && typeof source === "string" && source.trim().length > 0) {
|
|
79
|
+
const trimmed = source.trim();
|
|
80
|
+
if (trimmed.startsWith("[")) {
|
|
81
|
+
try {
|
|
82
|
+
const parsed: unknown = JSON.parse(trimmed);
|
|
83
|
+
if (!Array.isArray(parsed)) throw new Error("not an array");
|
|
84
|
+
entries = parsed;
|
|
85
|
+
} catch {
|
|
86
|
+
throw new Error("untrustedOrigins must be an array of strings");
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
entries = trimmed.split(",");
|
|
90
|
+
}
|
|
91
|
+
} else {
|
|
92
|
+
throw new Error("untrustedOrigins must be an array of strings");
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const normalized: string[] = [];
|
|
96
|
+
for (const entry of entries) {
|
|
97
|
+
if (typeof entry !== "string") {
|
|
98
|
+
throw new Error("untrustedOrigins must be an array of strings");
|
|
99
|
+
}
|
|
100
|
+
const trimmed = entry.trim();
|
|
101
|
+
if (trimmed.length > 0) normalized.push(trimmed);
|
|
102
|
+
}
|
|
103
|
+
return normalized.length > 0 ? normalized : [...DEFAULT_UNTRUSTED_ORIGINS];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function parseSecurityConfig(
|
|
107
|
+
cfg: Record<string, unknown>,
|
|
108
|
+
rawOperatorConfig: Record<string, unknown> | null | undefined,
|
|
109
|
+
): {
|
|
110
|
+
originAuthorityEnabled: boolean;
|
|
111
|
+
injectionScreenEnabled: boolean;
|
|
112
|
+
untrustedOrigins: string[];
|
|
113
|
+
} {
|
|
114
|
+
return {
|
|
115
|
+
originAuthorityEnabled: resolveSecurityBooleanConfig(
|
|
116
|
+
cfg.originAuthorityEnabled,
|
|
117
|
+
rawOperatorConfig,
|
|
118
|
+
"originAuthorityEnabled",
|
|
119
|
+
"REMNIC_ORIGIN_AUTHORITY_ENABLED",
|
|
120
|
+
false,
|
|
121
|
+
),
|
|
122
|
+
injectionScreenEnabled: resolveSecurityBooleanConfig(
|
|
123
|
+
cfg.injectionScreenEnabled,
|
|
124
|
+
rawOperatorConfig,
|
|
125
|
+
"injectionScreenEnabled",
|
|
126
|
+
"REMNIC_INJECTION_SCREEN_ENABLED",
|
|
127
|
+
true,
|
|
128
|
+
),
|
|
129
|
+
untrustedOrigins: resolveUntrustedOrigins(cfg.untrustedOrigins, rawOperatorConfig),
|
|
130
|
+
};
|
|
131
|
+
}
|
package/src/config.test.ts
CHANGED
|
@@ -31,6 +31,67 @@ function withIsolatedConnectorsDir<T>(
|
|
|
31
31
|
rmSync(root, { recursive: true, force: true });
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
+
test("parseConfig memory-poisoning hardening defaults and validation (#1955)", () => {
|
|
35
|
+
const previousOrigin = process.env.REMNIC_ORIGIN_AUTHORITY_ENABLED;
|
|
36
|
+
const previousInjection = process.env.REMNIC_INJECTION_SCREEN_ENABLED;
|
|
37
|
+
const previousOrigins = process.env.REMNIC_UNTRUSTED_ORIGINS;
|
|
38
|
+
delete process.env.REMNIC_ORIGIN_AUTHORITY_ENABLED;
|
|
39
|
+
delete process.env.REMNIC_INJECTION_SCREEN_ENABLED;
|
|
40
|
+
delete process.env.REMNIC_UNTRUSTED_ORIGINS;
|
|
41
|
+
try {
|
|
42
|
+
const defaults = parseConfig({});
|
|
43
|
+
assert.equal(defaults.originAuthorityEnabled, false);
|
|
44
|
+
assert.equal(defaults.injectionScreenEnabled, true);
|
|
45
|
+
assert.deepEqual(defaults.untrustedOrigins, ["tool_output", "import:*", "unknown"]);
|
|
46
|
+
|
|
47
|
+
const configured = parseConfig({
|
|
48
|
+
originAuthorityEnabled: "true",
|
|
49
|
+
injectionScreenEnabled: "off",
|
|
50
|
+
untrustedOrigins: [" connector:calendar ", "unknown", ""],
|
|
51
|
+
});
|
|
52
|
+
assert.equal(configured.originAuthorityEnabled, true);
|
|
53
|
+
assert.equal(configured.injectionScreenEnabled, false);
|
|
54
|
+
assert.deepEqual(configured.untrustedOrigins, ["connector:calendar", "unknown"]);
|
|
55
|
+
|
|
56
|
+
process.env.REMNIC_ORIGIN_AUTHORITY_ENABLED = "yes";
|
|
57
|
+
process.env.REMNIC_INJECTION_SCREEN_ENABLED = "0";
|
|
58
|
+
process.env.REMNIC_UNTRUSTED_ORIGINS = "connector:calendar, import:legacy, unknown";
|
|
59
|
+
const fromEnv = parseConfig({});
|
|
60
|
+
assert.equal(fromEnv.originAuthorityEnabled, true);
|
|
61
|
+
assert.equal(fromEnv.injectionScreenEnabled, false);
|
|
62
|
+
assert.deepEqual(fromEnv.untrustedOrigins, ["connector:calendar", "import:legacy", "unknown"]);
|
|
63
|
+
const envWithSchemaDefaults = parseConfig(
|
|
64
|
+
{
|
|
65
|
+
originAuthorityEnabled: false,
|
|
66
|
+
injectionScreenEnabled: true,
|
|
67
|
+
untrustedOrigins: ["tool_output", "import:*", "unknown"],
|
|
68
|
+
},
|
|
69
|
+
{},
|
|
70
|
+
);
|
|
71
|
+
assert.equal(envWithSchemaDefaults.originAuthorityEnabled, true);
|
|
72
|
+
assert.equal(envWithSchemaDefaults.injectionScreenEnabled, false);
|
|
73
|
+
assert.deepEqual(
|
|
74
|
+
envWithSchemaDefaults.untrustedOrigins,
|
|
75
|
+
["connector:calendar", "import:legacy", "unknown"],
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
assert.throws(
|
|
79
|
+
() => parseConfig({ originAuthorityEnabled: "maybe" }),
|
|
80
|
+
/originAuthorityEnabled must be a boolean-like value/,
|
|
81
|
+
);
|
|
82
|
+
assert.throws(
|
|
83
|
+
() => parseConfig({ untrustedOrigins: "unknown" }),
|
|
84
|
+
/untrustedOrigins must be an array of strings/,
|
|
85
|
+
);
|
|
86
|
+
} finally {
|
|
87
|
+
if (previousOrigin === undefined) delete process.env.REMNIC_ORIGIN_AUTHORITY_ENABLED;
|
|
88
|
+
else process.env.REMNIC_ORIGIN_AUTHORITY_ENABLED = previousOrigin;
|
|
89
|
+
if (previousInjection === undefined) delete process.env.REMNIC_INJECTION_SCREEN_ENABLED;
|
|
90
|
+
else process.env.REMNIC_INJECTION_SCREEN_ENABLED = previousInjection;
|
|
91
|
+
if (previousOrigins === undefined) delete process.env.REMNIC_UNTRUSTED_ORIGINS;
|
|
92
|
+
else process.env.REMNIC_UNTRUSTED_ORIGINS = previousOrigins;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
34
95
|
|
|
35
96
|
test("parseConfig emitLegacyTools sticky-legacy default (issue #1550)", () => {
|
|
36
97
|
// Fresh install (no legacy connector entries): canonical-only surface.
|
package/src/config.ts
CHANGED
|
@@ -55,6 +55,7 @@ import {
|
|
|
55
55
|
parseQmdSubprocessStrategy,
|
|
56
56
|
parseQmdSupportedVersion,
|
|
57
57
|
} from "./config-qmd.js";
|
|
58
|
+
import { parseSecurityConfig } from "./config-security.js";
|
|
58
59
|
import {
|
|
59
60
|
resolveEmitLegacyTools,
|
|
60
61
|
resolveNamespaceCatalogEnabled,
|
|
@@ -357,7 +358,6 @@ function resolveBooleanConfig(
|
|
|
357
358
|
return coerced;
|
|
358
359
|
}
|
|
359
360
|
|
|
360
|
-
|
|
361
361
|
function resolvePositiveIntegerConfig(
|
|
362
362
|
value: unknown,
|
|
363
363
|
defaultValue: number,
|
|
@@ -1554,6 +1554,7 @@ export function parseConfig(
|
|
|
1554
1554
|
model,
|
|
1555
1555
|
reasoningEffort,
|
|
1556
1556
|
triggerMode,
|
|
1557
|
+
...parseSecurityConfig(cfg, rawOperatorConfig),
|
|
1557
1558
|
bufferMaxTurns:
|
|
1558
1559
|
typeof cfg.bufferMaxTurns === "number" ? cfg.bufferMaxTurns : 5,
|
|
1559
1560
|
bufferMaxMinutes:
|
package/src/entity-retrieval.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { resolveNamespaceCapabilities } from "./capabilities.js";
|
|
2
|
+
import { renderAuthorityBoundContent } from "./recall-context-composition.js";
|
|
2
3
|
import { createHash } from "node:crypto";
|
|
3
4
|
import { sanitizeMemoryContent } from "./sanitize.js";
|
|
4
5
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
@@ -44,7 +45,7 @@ type EntityMentionIndexEntry = {
|
|
|
44
45
|
relationships: Array<{ target: string; label: string }>;
|
|
45
46
|
activity: Array<{ date: string; note: string }>;
|
|
46
47
|
factCount: number;
|
|
47
|
-
memorySnippets: string[];
|
|
48
|
+
memorySnippets: string[]; memorySnippetOrigins?: Array<string | undefined>;
|
|
48
49
|
nativeChunks: Array<{
|
|
49
50
|
chunkId: string;
|
|
50
51
|
title: string;
|
|
@@ -72,9 +73,8 @@ type EntityCandidate = {
|
|
|
72
73
|
type EntityHintSnippet = {
|
|
73
74
|
text: string;
|
|
74
75
|
score: number;
|
|
75
|
-
kind: "summary" | "fact" | "section" | "relationship" | "activity" | "memory" | "native";
|
|
76
|
+
kind: "summary" | "fact" | "section" | "relationship" | "activity" | "memory" | "native"; origin?: string;
|
|
76
77
|
};
|
|
77
|
-
|
|
78
78
|
export interface BuildEntityRecallSectionOptions {
|
|
79
79
|
config: PluginConfig;
|
|
80
80
|
storage: StorageManager;
|
|
@@ -87,6 +87,7 @@ export interface BuildEntityRecallSectionOptions {
|
|
|
87
87
|
maxRelatedEntities: number;
|
|
88
88
|
maxChars: number;
|
|
89
89
|
transcriptEntries: TranscriptEntry[];
|
|
90
|
+
originAuthorityEnabled?: boolean; untrustedOrigins?: readonly string[];
|
|
90
91
|
/**
|
|
91
92
|
* Cancels the build at its next checkpoint (issue #2291). Entity recall reads
|
|
92
93
|
* every entity and memory file across the recalled namespaces, which is
|
|
@@ -617,16 +618,13 @@ async function buildEntityMentionIndex(
|
|
|
617
618
|
for (const memory of memories) {
|
|
618
619
|
scanned += 1;
|
|
619
620
|
await yieldEntityRecallScanEvery(scanned, abortSignal);
|
|
620
|
-
const
|
|
621
|
-
if (!entityRef) continue;
|
|
622
|
-
const entry = entities.get(entityRef);
|
|
621
|
+
const entry = typeof memory.frontmatter.entityRef === "string" ? entities.get(memory.frontmatter.entityRef) : undefined;
|
|
623
622
|
if (!entry) continue;
|
|
624
623
|
const snippet = await readMemorySnippet(memory);
|
|
625
|
-
if (
|
|
626
|
-
|
|
627
|
-
|
|
624
|
+
if (entry.memorySnippets.includes(snippet)) continue;
|
|
625
|
+
entry.memorySnippets.push(snippet);
|
|
626
|
+
entry.memorySnippetOrigins = [...(entry.memorySnippetOrigins ?? []), memory.frontmatter.origin];
|
|
628
627
|
}
|
|
629
|
-
|
|
630
628
|
// Each remaining phase is another synchronous pass over the whole index
|
|
631
629
|
// (alias map, native-chunk merge, sort, two full serializations). Yield between
|
|
632
630
|
// them so a section deadline can fire between passes instead of only after all
|
|
@@ -908,12 +906,8 @@ async function buildHintSnippets(
|
|
|
908
906
|
});
|
|
909
907
|
}
|
|
910
908
|
|
|
911
|
-
for (const memorySnippet of entry.memorySnippets.slice(0, Math.min(maxSupportingFacts, 4))) {
|
|
912
|
-
snippets.push({
|
|
913
|
-
text: memorySnippet,
|
|
914
|
-
score: 5,
|
|
915
|
-
kind: "memory",
|
|
916
|
-
});
|
|
909
|
+
for (const [index, memorySnippet] of entry.memorySnippets.slice(0, Math.min(maxSupportingFacts, 4)).entries()) {
|
|
910
|
+
snippets.push({ text: memorySnippet, score: 5, kind: "memory", origin: entry.memorySnippetOrigins?.[index] });
|
|
917
911
|
}
|
|
918
912
|
|
|
919
913
|
for (const chunk of entry.nativeChunks) {
|
|
@@ -968,9 +962,18 @@ function formatEntityHintSection(
|
|
|
968
962
|
mode: EntityQueryMode,
|
|
969
963
|
maxRelatedEntities: number,
|
|
970
964
|
maxChars: number,
|
|
965
|
+
originAuthorityEnabled: boolean, untrustedOrigins: readonly string[],
|
|
971
966
|
): string | null {
|
|
972
967
|
if (candidates.length === 0) return null;
|
|
973
968
|
const lines: string[] = ["## entity_answer_hints", ""];
|
|
969
|
+
// #1955 review: non-native snippet kinds may embed extraction-written content
|
|
970
|
+
// without per-field origin — fence as unknown (least privilege; plumbing #2397).
|
|
971
|
+
const renderSnippet = (snippet: EntityHintSnippet): string => snippet.kind !== "native"
|
|
972
|
+
? renderAuthorityBoundContent(snippet.text, snippet.origin, { enabled: originAuthorityEnabled, untrustedOrigins }) : snippet.text;
|
|
973
|
+
// (see comment above)
|
|
974
|
+
// #1955 review: inline fields (names/types/aliases/targets) cannot carry the
|
|
975
|
+
// multi-line block fence without collapsing the hint list structure —
|
|
976
|
+
// per-field origin plumbing is tracked in #2397.
|
|
974
977
|
for (const { candidate, snippets, uncertainty } of candidates) {
|
|
975
978
|
const hasSummary = Boolean(candidate.entry.summary?.trim());
|
|
976
979
|
const preferredTopSnippets = hasSummary
|
|
@@ -1020,16 +1023,12 @@ function formatEntityHintSection(
|
|
|
1020
1023
|
}
|
|
1021
1024
|
const topSnippetTexts = new Set(topSnippets.map((snippet) => normalizeEntityText(snippet.text)));
|
|
1022
1025
|
lines.push(`- target: ${candidate.entry.name} (${candidate.entry.type})`);
|
|
1023
|
-
|
|
1024
|
-
lines.push(`- resolution: carried forward from recent turns via alias "${candidate.alias}"`);
|
|
1025
|
-
} else {
|
|
1026
|
-
lines.push(`- resolution: matched alias "${candidate.alias}" in the query`);
|
|
1027
|
-
}
|
|
1026
|
+
lines.push(`- resolution: ${candidate.source === "recent_turn" ? "carried forward from recent turns via alias" : "matched alias"} "${candidate.alias}"${candidate.source === "recent_turn" ? "" : " in the query"}`);
|
|
1028
1027
|
if (uncertainty) lines.push(`- uncertainty: ${uncertainty}`);
|
|
1029
1028
|
if (topSnippets.length > 0) {
|
|
1030
1029
|
lines.push("- likely answer:");
|
|
1031
1030
|
for (const snippet of topSnippets) {
|
|
1032
|
-
lines.push(` - ${snippet
|
|
1031
|
+
lines.push(` - ${renderSnippet(snippet)}`);
|
|
1033
1032
|
}
|
|
1034
1033
|
}
|
|
1035
1034
|
if (mode !== "direct") {
|
|
@@ -1039,7 +1038,7 @@ function formatEntityHintSection(
|
|
|
1039
1038
|
if (fallbackTimeline.length > 0) {
|
|
1040
1039
|
lines.push("- recent timeline:");
|
|
1041
1040
|
for (const snippet of fallbackTimeline) {
|
|
1042
|
-
lines.push(` - ${snippet
|
|
1041
|
+
lines.push(` - ${renderSnippet(snippet)}`);
|
|
1043
1042
|
}
|
|
1044
1043
|
}
|
|
1045
1044
|
}
|
|
@@ -1172,7 +1171,15 @@ export async function buildEntityRecallSection(options: BuildEntityRecallSection
|
|
|
1172
1171
|
}),
|
|
1173
1172
|
);
|
|
1174
1173
|
|
|
1175
|
-
const section = formatEntityHintSection(
|
|
1174
|
+
const section = formatEntityHintSection(
|
|
1175
|
+
enriched,
|
|
1176
|
+
queryTokens,
|
|
1177
|
+
mode,
|
|
1178
|
+
options.maxRelatedEntities,
|
|
1179
|
+
options.maxChars,
|
|
1180
|
+
options.originAuthorityEnabled === true,
|
|
1181
|
+
options.untrustedOrigins ?? [],
|
|
1182
|
+
);
|
|
1176
1183
|
// `entityRecallSectionAbsent` so a cancelled build is not recorded as a
|
|
1177
1184
|
// successful section that simply found no entities.
|
|
1178
1185
|
if (!section) return entityRecallSectionAbsent(options.abortSignal);
|