@remnic/core 9.65.5 → 9.65.7
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 +26 -26
- package/dist/access-authorization-probe.d.ts +11 -11
- package/dist/access-authorization-probe.js +27 -27
- package/dist/access-boundary.d.ts +11 -11
- package/dist/access-boundary.js +26 -26
- package/dist/access-cli.js +110 -104
- 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 +26 -26
- 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.d.ts +2 -2
- package/dist/access-http-query.js +28 -28
- package/dist/access-http.d.ts +13 -18
- package/dist/access-http.js +46 -44
- package/dist/access-identity-continuity-surface.d.ts +9 -9
- package/dist/access-identity-continuity-surface.js +26 -26
- package/dist/access-lcm-surface.d.ts +11 -11
- package/dist/access-lcm-surface.js +26 -26
- package/dist/access-mcp-output-schemas.js +1 -1
- package/dist/access-mcp.d.ts +11 -11
- package/dist/access-mcp.js +37 -35
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-D_6mo8ms.d.ts → access-namespace-preflight-8VYKmRX0.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +26 -26
- package/dist/access-observe-write-surface.d.ts +11 -11
- package/dist/access-observe-write-surface.js +26 -26
- package/dist/access-offline-manifest.d.ts +9 -9
- package/dist/access-operations-batch.js +29 -29
- package/dist/access-operations.d.ts +12 -12
- package/dist/access-operations.js +34 -32
- package/dist/access-recall-concurrency.d.ts +11 -11
- package/dist/access-recall-concurrency.js +26 -26
- package/dist/access-recall-response.d.ts +11 -11
- package/dist/access-recall-response.js +26 -26
- package/dist/access-recall-surface.d.ts +11 -11
- package/dist/access-recall-surface.js +26 -26
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-sbiNS5UB.d.ts → access-service-Crk__Git.d.ts} +8 -8
- package/dist/access-service-helpers.d.ts +11 -11
- package/dist/access-service.d.ts +11 -11
- package/dist/access-service.js +26 -26
- package/dist/access-surface-catalog.d.ts +11 -11
- package/dist/access-surface-catalog.js +38 -28
- 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-recall.d.ts +1 -1
- package/dist/active-recall.js +4 -4
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/ambient-provenance.d.ts +1 -1
- package/dist/artifact-search.d.ts +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +9 -9
- package/dist/briefing-window.d.ts +2 -2
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +8 -8
- 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/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-YO5QJ6L3.js → capsule-crypto-7FJQINUR.js} +2 -2
- package/dist/{catalog-DO_7zfkv.d.ts → catalog-DybwVNW3.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 +11 -11
- 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-BXLOS5AJ.js → chunk-2NLLXCJG.js} +2 -2
- package/dist/{chunk-NZPFCP5A.js → chunk-2PSX5BJU.js} +2 -2
- package/dist/chunk-3BCULS4U.js +1093 -0
- package/dist/chunk-3BCULS4U.js.map +1 -0
- package/dist/{chunk-IIRCHGWD.js → chunk-3RI5Y7KU.js} +2 -2
- package/dist/{chunk-H7BZBSP6.js → chunk-52II7PB6.js} +4 -4
- package/dist/{chunk-J3ATBB7M.js → chunk-5DH6PG4B.js} +2 -2
- package/dist/{chunk-M4AHBM72.js → chunk-5HERQ5FX.js} +10 -10
- package/dist/{chunk-W675UJCZ.js → chunk-5HK3CJAR.js} +2 -2
- package/dist/{chunk-2MVTAIL3.js → chunk-5S4LQOPE.js} +2 -2
- package/dist/{chunk-OZDFB22S.js → chunk-5VPQSRQO.js} +3 -3
- package/dist/{chunk-YZJM6CLF.js → chunk-6CPUQ5D6.js} +10 -10
- package/dist/{chunk-2IXQSGCU.js → chunk-7F27PCSN.js} +2 -2
- package/dist/{chunk-OWQNJJY2.js → chunk-7TCGNUVP.js} +2 -2
- package/dist/{chunk-3NH3VP3U.js → chunk-7WR462EM.js} +2 -2
- package/dist/{chunk-NH6LC57D.js → chunk-A32YEQAM.js} +2 -2
- package/dist/{chunk-HF5BUTI6.js → chunk-ACOC27BB.js} +2 -2
- package/dist/{chunk-N56GVOWR.js → chunk-AFR6AIM4.js} +144 -78
- package/dist/chunk-AFR6AIM4.js.map +1 -0
- package/dist/{chunk-LYBIHM4N.js → chunk-ANJXPFRS.js} +47 -26
- package/dist/chunk-ANJXPFRS.js.map +1 -0
- package/dist/{chunk-FC7TIRFS.js → chunk-AX7UXCHJ.js} +6 -1
- package/dist/chunk-AX7UXCHJ.js.map +1 -0
- package/dist/{chunk-THVI4Y7X.js → chunk-BJTHRFFC.js} +6 -6
- package/dist/chunk-BWGCOLEL.js +61 -0
- package/dist/chunk-BWGCOLEL.js.map +1 -0
- package/dist/{chunk-BW4GAF57.js → chunk-CFGU52XJ.js} +2 -2
- package/dist/{chunk-DPNXADEI.js → chunk-D4QVPP3G.js} +2 -2
- package/dist/{chunk-BK5G2MHO.js → chunk-EOHKUWXW.js} +2 -2
- package/dist/{chunk-YNDLCWXS.js → chunk-EZ25VE3G.js} +4 -4
- package/dist/{chunk-ZK4BFABK.js → chunk-F635GAL7.js} +4 -4
- package/dist/{chunk-IURMJBGP.js → chunk-F6QHHRWP.js} +2 -2
- package/dist/{chunk-BA2GLSIP.js → chunk-FMQ4MOQO.js} +91 -28
- package/dist/chunk-FMQ4MOQO.js.map +1 -0
- package/dist/{chunk-LDBFXD4F.js → chunk-FP7YTTVO.js} +3 -1
- package/dist/chunk-FP7YTTVO.js.map +1 -0
- package/dist/{chunk-TJFI3K2O.js → chunk-GEPACVWN.js} +2 -2
- package/dist/{chunk-PP7R754B.js → chunk-GPFZFCRN.js} +1 -1
- package/dist/{chunk-UCKG36HO.js → chunk-GTSVEEP3.js} +2 -2
- package/dist/{chunk-KTPXXVDQ.js → chunk-I4343FIA.js} +79 -6
- package/dist/chunk-I4343FIA.js.map +1 -0
- package/dist/{chunk-DPGH6LHQ.js → chunk-I7EX6KSH.js} +57 -57
- package/dist/{chunk-JPAKBNTM.js → chunk-IP4ZNT4U.js} +2 -2
- package/dist/{chunk-AXGFOFNY.js → chunk-IY7UXD3J.js} +2 -2
- package/dist/{chunk-YHCBJULX.js → chunk-JAQXUGLN.js} +2 -2
- package/dist/{chunk-RKNJBZ55.js → chunk-JBPKEARU.js} +4 -4
- package/dist/chunk-JCCWJHOP.js +240 -0
- package/dist/chunk-JCCWJHOP.js.map +1 -0
- package/dist/{chunk-VDX2J7OX.js → chunk-KQAFEZQX.js} +2 -2
- package/dist/{chunk-D2YNNDML.js → chunk-KWIGDKM2.js} +2 -2
- package/dist/{chunk-YB4GBWBU.js → chunk-LLQCM2U2.js} +81 -81
- package/dist/{chunk-OLBZ2WGG.js → chunk-LTBKKSCX.js} +2 -2
- package/dist/{chunk-DORFF5N5.js → chunk-NG3MBQV4.js} +2 -2
- package/dist/{chunk-DUEDOYZD.js → chunk-OPGL46PX.js} +2 -2
- package/dist/{chunk-OUKBMQ2O.js → chunk-PD66CVSD.js} +2 -2
- package/dist/{chunk-CQBIN77D.js → chunk-PDDSFELN.js} +2 -2
- package/dist/{chunk-6433HV72.js → chunk-PMVPCZJZ.js} +2 -2
- package/dist/{chunk-DJZWNKFO.js → chunk-RGCF4XNH.js} +7 -7
- package/dist/{chunk-CV3GNPOE.js → chunk-RQE4TITU.js} +29 -24
- package/dist/chunk-RQE4TITU.js.map +1 -0
- package/dist/{chunk-4JSF7UUP.js → chunk-S3K2CIK5.js} +2 -2
- package/dist/chunk-SDEPLF7V.js +325 -0
- package/dist/chunk-SDEPLF7V.js.map +1 -0
- package/dist/{chunk-OCCHUEZB.js → chunk-SEA6M7SS.js} +2 -2
- package/dist/{chunk-KOO37E4Y.js → chunk-SVVIASVX.js} +2 -2
- package/dist/{chunk-4K7IW3F7.js → chunk-UD7UNYRD.js} +34 -3
- package/dist/chunk-UD7UNYRD.js.map +1 -0
- package/dist/chunk-ULM7JCDH.js +154 -0
- package/dist/chunk-ULM7JCDH.js.map +1 -0
- package/dist/{chunk-FBR7PIL4.js → chunk-VKCAHCBI.js} +2 -2
- package/dist/{chunk-WDXD6ITO.js → chunk-VXVZ2GM3.js} +2 -2
- package/dist/chunk-W2UOAATB.js +521 -0
- package/dist/chunk-W2UOAATB.js.map +1 -0
- package/dist/{chunk-DUZARALI.js → chunk-WTOZBZNN.js} +3 -3
- package/dist/{chunk-DQEMWVMT.js → chunk-X7Y7WX73.js} +1 -1
- package/dist/{chunk-2EPOGPKO.js → chunk-YKWFK7XA.js} +5 -5
- package/dist/{chunk-BIJAWZYW.js → chunk-YMOPYG3K.js} +6 -6
- package/dist/{chunk-UFR6HX7A.js → chunk-YRVAKONL.js} +1 -1
- package/dist/{chunk-ECLJ4LA2.js → chunk-YWSQD2IB.js} +2 -2
- package/dist/{chunk-NLEH4RTB.js → chunk-Z4U3UN56.js} +2 -2
- package/dist/{chunk-YDKF4MSJ.js → chunk-ZAOHJDKH.js} +3 -3
- package/dist/{chunk-KFIOPZ25.js → chunk-ZIJDI4CP.js} +2 -2
- package/dist/{cli-BqdqPdG_.d.ts → cli-B322UMvB.d.ts} +6 -6
- package/dist/cli.d.ts +14 -14
- package/dist/cli.js +73 -72
- 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 +8 -8
- 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 +4 -4
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +8 -8
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +8 -8
- package/dist/consolidation-provenance-check.d.ts +2 -2
- package/dist/consolidation-undo.d.ts +2 -2
- package/dist/contradiction/index.d.ts +3 -3
- package/dist/converge-config.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +2 -2
- package/dist/convergence-refresh.js +10 -10
- 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 +10 -10
- package/dist/cross-lingual-recall.d.ts +1 -1
- 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-D23_x-s5.d.ts → dependency-propagation-delivery-BGcNairQ.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 +1 -1
- package/dist/entity-retrieval.d.ts +2 -2
- package/dist/entity-retrieval.js +8 -8
- package/dist/entity-schema.d.ts +1 -1
- package/dist/episodic-context.d.ts +1 -1
- package/dist/eval-trajectory-contracts.d.ts +256 -0
- package/dist/eval-trajectory-contracts.js +56 -0
- package/dist/eval-trajectory-store.d.ts +39 -0
- package/dist/eval-trajectory-store.js +19 -0
- package/dist/eval-trajectory-store.js.map +1 -0
- package/dist/eval-trajectory.d.ts +67 -0
- package/dist/eval-trajectory.js +46 -0
- package/dist/eval-trajectory.js.map +1 -0
- package/dist/event-order-recall.js +2 -2
- package/dist/explicit-capture.d.ts +9 -9
- package/dist/external-wiki-access.d.ts +11 -11
- package/dist/external-wiki-access.js +27 -27
- 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 +10 -10
- 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-decay-FXGELBFA.js → graph-edge-decay-A4SDFMMS.js} +4 -4
- package/dist/graph-edge-decay-A4SDFMMS.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--QhGIXF2.d.ts → index-By2QUAMh.d.ts} +2 -2
- package/dist/index.d.ts +27 -23
- package/dist/index.js +199 -141
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/engine.js +4 -4
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +10 -10
- 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/location/index.d.ts +128 -1
- package/dist/location/index.js +60 -750
- package/dist/location/index.js.map +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +8 -8
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +8 -8
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +9 -9
- package/dist/{maintenance-PFvY1Pw_.d.ts → maintenance-Dm2McrIx.d.ts} +4 -3
- package/dist/mcp-memory-inspector-app.d.ts +11 -11
- package/dist/mcp-read-only-tools.js +1 -1
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-controller.d.ts +203 -0
- package/dist/memory-controller.js +23 -0
- package/dist/memory-controller.js.map +1 -0
- 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-subject-cli.d.ts +11 -11
- package/dist/memory-subject.d.ts +11 -11
- package/dist/memory-worth-outcomes.d.ts +47 -3
- package/dist/memory-worth-outcomes.js +5 -3
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +3 -3
- package/dist/namespaces/migrate.js +9 -9
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +5 -5
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +8 -8
- 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 +11 -11
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +22 -22
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +16 -14
- package/dist/{orchestrator-4wzJrPVm.d.ts → orchestrator-Co1DyfuP.d.ts} +8 -8
- package/dist/orchestrator.d.ts +9 -9
- package/dist/orchestrator.js +110 -104
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-CgXgdIrF.d.ts → pipeline-DotMnb6y.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-BP3VQDl5.d.ts → public-http-PJRtnSi-.d.ts} +1 -1
- package/dist/{qmd-BppGGxsi.d.ts → qmd-BP0n11fR.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +2 -2
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +2 -2
- package/dist/recall-concurrency-config.d.ts +1 -1
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-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-renderer.d.ts +1 -1
- package/dist/recall-xray.d.ts +1 -1
- 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 +5 -5
- 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-ChZUtxDU.d.ts → scope-profiles-6ChZKTy-.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +4 -4
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +10 -10
- 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-mSPwQSmF.d.ts → semantic-consolidation-DziYcW5J.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +9 -9
- package/dist/semantic-rule-promotion.js +8 -8
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +8 -8
- package/dist/{service-BICWLwSP.d.ts → service-C7rIBuK_.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 +1 -1
- package/dist/signal.d.ts +1 -1
- package/dist/source-agent-qualifier.d.ts +1 -1
- package/dist/source-agent-qualifier.js +8 -8
- package/dist/{storage-B7urx1K3.d.ts → storage-B1hEx8Xg.d.ts} +1 -1
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +7 -7
- package/dist/subject-config.d.ts +1 -1
- 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 +29 -29
- 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/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-ETU5N6nB.d.ts → types-BHDNxGTT.d.ts} +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +8 -8
- package/dist/who-knows-cli.d.ts +11 -11
- package/dist/who-knows-cli.js +9 -9
- package/dist/who-knows.d.ts +11 -11
- package/dist/who-knows.js +8 -8
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -2
- package/src/access-boundary.ts +5 -0
- package/src/access-http.ts +15 -16
- package/src/access-mcp-output-schemas.ts +5 -0
- package/src/access-mcp.ts +6 -6
- package/src/access-operations.ts +2 -0
- package/src/access-surface-catalog.ts +10 -0
- package/src/eval-trajectory-contracts.ts +411 -0
- package/src/eval-trajectory-store.ts +306 -0
- package/src/eval-trajectory.test.ts +534 -0
- package/src/eval-trajectory.ts +773 -0
- package/src/index.ts +5 -0
- package/src/location/access-operations.ts +84 -0
- package/src/location/http-glue.test.ts +100 -0
- package/src/location/http-glue.ts +85 -0
- package/src/location/index.ts +3 -0
- package/src/location/mcp-tools.ts +82 -0
- package/src/location/provider-setup.test.ts +106 -0
- package/src/location/provider-setup.ts +103 -0
- package/src/location/scheduler.test.ts +113 -0
- package/src/location/scheduler.ts +98 -0
- package/src/location/surfaces.test.ts +241 -0
- package/src/location/surfaces.ts +329 -0
- package/src/maintenance/day-summary-cron.ts +45 -0
- package/src/mcp-read-only-tools.ts +2 -0
- package/src/memory-controller.test.ts +347 -0
- package/src/memory-controller.ts +547 -0
- package/src/memory-worth-outcomes.test.ts +53 -18
- package/src/memory-worth-outcomes.ts +91 -9
- package/src/orchestration/maintenance.ts +22 -30
- package/src/wearables/http-glue.ts +28 -0
- package/dist/chunk-4K7IW3F7.js.map +0 -1
- package/dist/chunk-BA2GLSIP.js.map +0 -1
- package/dist/chunk-CV3GNPOE.js.map +0 -1
- package/dist/chunk-FC7TIRFS.js.map +0 -1
- package/dist/chunk-KTPXXVDQ.js.map +0 -1
- package/dist/chunk-LDBFXD4F.js.map +0 -1
- package/dist/chunk-LYBIHM4N.js.map +0 -1
- package/dist/chunk-N56GVOWR.js.map +0 -1
- /package/dist/{capsule-crypto-YO5QJ6L3.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
- /package/dist/{chunk-BXLOS5AJ.js.map → chunk-2NLLXCJG.js.map} +0 -0
- /package/dist/{chunk-NZPFCP5A.js.map → chunk-2PSX5BJU.js.map} +0 -0
- /package/dist/{chunk-IIRCHGWD.js.map → chunk-3RI5Y7KU.js.map} +0 -0
- /package/dist/{chunk-H7BZBSP6.js.map → chunk-52II7PB6.js.map} +0 -0
- /package/dist/{chunk-J3ATBB7M.js.map → chunk-5DH6PG4B.js.map} +0 -0
- /package/dist/{chunk-M4AHBM72.js.map → chunk-5HERQ5FX.js.map} +0 -0
- /package/dist/{chunk-W675UJCZ.js.map → chunk-5HK3CJAR.js.map} +0 -0
- /package/dist/{chunk-2MVTAIL3.js.map → chunk-5S4LQOPE.js.map} +0 -0
- /package/dist/{chunk-OZDFB22S.js.map → chunk-5VPQSRQO.js.map} +0 -0
- /package/dist/{chunk-YZJM6CLF.js.map → chunk-6CPUQ5D6.js.map} +0 -0
- /package/dist/{chunk-2IXQSGCU.js.map → chunk-7F27PCSN.js.map} +0 -0
- /package/dist/{chunk-OWQNJJY2.js.map → chunk-7TCGNUVP.js.map} +0 -0
- /package/dist/{chunk-3NH3VP3U.js.map → chunk-7WR462EM.js.map} +0 -0
- /package/dist/{chunk-NH6LC57D.js.map → chunk-A32YEQAM.js.map} +0 -0
- /package/dist/{chunk-HF5BUTI6.js.map → chunk-ACOC27BB.js.map} +0 -0
- /package/dist/{chunk-THVI4Y7X.js.map → chunk-BJTHRFFC.js.map} +0 -0
- /package/dist/{chunk-BW4GAF57.js.map → chunk-CFGU52XJ.js.map} +0 -0
- /package/dist/{chunk-DPNXADEI.js.map → chunk-D4QVPP3G.js.map} +0 -0
- /package/dist/{chunk-BK5G2MHO.js.map → chunk-EOHKUWXW.js.map} +0 -0
- /package/dist/{chunk-YNDLCWXS.js.map → chunk-EZ25VE3G.js.map} +0 -0
- /package/dist/{chunk-ZK4BFABK.js.map → chunk-F635GAL7.js.map} +0 -0
- /package/dist/{chunk-IURMJBGP.js.map → chunk-F6QHHRWP.js.map} +0 -0
- /package/dist/{chunk-TJFI3K2O.js.map → chunk-GEPACVWN.js.map} +0 -0
- /package/dist/{chunk-PP7R754B.js.map → chunk-GPFZFCRN.js.map} +0 -0
- /package/dist/{chunk-UCKG36HO.js.map → chunk-GTSVEEP3.js.map} +0 -0
- /package/dist/{chunk-DPGH6LHQ.js.map → chunk-I7EX6KSH.js.map} +0 -0
- /package/dist/{chunk-JPAKBNTM.js.map → chunk-IP4ZNT4U.js.map} +0 -0
- /package/dist/{chunk-AXGFOFNY.js.map → chunk-IY7UXD3J.js.map} +0 -0
- /package/dist/{chunk-YHCBJULX.js.map → chunk-JAQXUGLN.js.map} +0 -0
- /package/dist/{chunk-RKNJBZ55.js.map → chunk-JBPKEARU.js.map} +0 -0
- /package/dist/{chunk-VDX2J7OX.js.map → chunk-KQAFEZQX.js.map} +0 -0
- /package/dist/{chunk-D2YNNDML.js.map → chunk-KWIGDKM2.js.map} +0 -0
- /package/dist/{chunk-YB4GBWBU.js.map → chunk-LLQCM2U2.js.map} +0 -0
- /package/dist/{chunk-OLBZ2WGG.js.map → chunk-LTBKKSCX.js.map} +0 -0
- /package/dist/{chunk-DORFF5N5.js.map → chunk-NG3MBQV4.js.map} +0 -0
- /package/dist/{chunk-DUEDOYZD.js.map → chunk-OPGL46PX.js.map} +0 -0
- /package/dist/{chunk-OUKBMQ2O.js.map → chunk-PD66CVSD.js.map} +0 -0
- /package/dist/{chunk-CQBIN77D.js.map → chunk-PDDSFELN.js.map} +0 -0
- /package/dist/{chunk-6433HV72.js.map → chunk-PMVPCZJZ.js.map} +0 -0
- /package/dist/{chunk-DJZWNKFO.js.map → chunk-RGCF4XNH.js.map} +0 -0
- /package/dist/{chunk-4JSF7UUP.js.map → chunk-S3K2CIK5.js.map} +0 -0
- /package/dist/{chunk-OCCHUEZB.js.map → chunk-SEA6M7SS.js.map} +0 -0
- /package/dist/{chunk-KOO37E4Y.js.map → chunk-SVVIASVX.js.map} +0 -0
- /package/dist/{chunk-FBR7PIL4.js.map → chunk-VKCAHCBI.js.map} +0 -0
- /package/dist/{chunk-WDXD6ITO.js.map → chunk-VXVZ2GM3.js.map} +0 -0
- /package/dist/{chunk-DUZARALI.js.map → chunk-WTOZBZNN.js.map} +0 -0
- /package/dist/{chunk-DQEMWVMT.js.map → chunk-X7Y7WX73.js.map} +0 -0
- /package/dist/{chunk-2EPOGPKO.js.map → chunk-YKWFK7XA.js.map} +0 -0
- /package/dist/{chunk-BIJAWZYW.js.map → chunk-YMOPYG3K.js.map} +0 -0
- /package/dist/{chunk-UFR6HX7A.js.map → chunk-YRVAKONL.js.map} +0 -0
- /package/dist/{chunk-ECLJ4LA2.js.map → chunk-YWSQD2IB.js.map} +0 -0
- /package/dist/{chunk-NLEH4RTB.js.map → chunk-Z4U3UN56.js.map} +0 -0
- /package/dist/{chunk-YDKF4MSJ.js.map → chunk-ZAOHJDKH.js.map} +0 -0
- /package/dist/{chunk-KFIOPZ25.js.map → chunk-ZIJDI4CP.js.map} +0 -0
- /package/dist/{graph-edge-decay-FXGELBFA.js.map → eval-trajectory-contracts.js.map} +0 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import test from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
MemoryControllerCoordinator,
|
|
6
|
+
chooseAction,
|
|
7
|
+
computeEvidenceReportHash,
|
|
8
|
+
controllerConfigHash,
|
|
9
|
+
evaluateActiveGates,
|
|
10
|
+
hashControllerState,
|
|
11
|
+
type ActiveContextPlan,
|
|
12
|
+
type MemoryControllerConfig,
|
|
13
|
+
type MemoryControllerDeps,
|
|
14
|
+
type MemoryControllerEvent,
|
|
15
|
+
type MemoryControllerEvidence,
|
|
16
|
+
type MemoryControllerExecutors,
|
|
17
|
+
type MemoryControllerMode,
|
|
18
|
+
} from "./memory-controller.js";
|
|
19
|
+
|
|
20
|
+
const NOW = new Date("2026-08-18T12:00:00.000Z");
|
|
21
|
+
|
|
22
|
+
function config(mode: MemoryControllerMode): MemoryControllerConfig {
|
|
23
|
+
return {
|
|
24
|
+
mode,
|
|
25
|
+
reportVersion: "2345-v1",
|
|
26
|
+
evidenceMaxAgeMs: 24 * 60 * 60 * 1000,
|
|
27
|
+
minPairedSeeds: 2,
|
|
28
|
+
shadowMinRecords: 3,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function evidence(overrides?: {
|
|
33
|
+
report?: Partial<MemoryControllerEvidence["report"]>;
|
|
34
|
+
pairedSeed?: Partial<MemoryControllerEvidence["pairedSeed"]>;
|
|
35
|
+
}): MemoryControllerEvidence {
|
|
36
|
+
const report = {
|
|
37
|
+
status: "pass",
|
|
38
|
+
version: "2345-v1",
|
|
39
|
+
configHash: controllerConfigHash(config("active")),
|
|
40
|
+
generatedAt: NOW.toISOString(),
|
|
41
|
+
...overrides?.report,
|
|
42
|
+
} as MemoryControllerEvidence["report"];
|
|
43
|
+
return {
|
|
44
|
+
report: { ...report, reportHash: computeEvidenceReportHash(report) },
|
|
45
|
+
pairedSeed: {
|
|
46
|
+
status: "pass",
|
|
47
|
+
seedCount: 3,
|
|
48
|
+
generatedAt: NOW.toISOString(),
|
|
49
|
+
...overrides?.pairedSeed,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function echoReceipt(input: { decisionId: string }): { decisionId: string; ok: true } {
|
|
55
|
+
return { decisionId: input.decisionId, ok: true };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function harness(options?: {
|
|
59
|
+
mode?: MemoryControllerMode;
|
|
60
|
+
evidenceOverride?: MemoryControllerEvidence | null;
|
|
61
|
+
shadowRecords?: number;
|
|
62
|
+
recordThrows?: boolean;
|
|
63
|
+
executors?: MemoryControllerExecutors;
|
|
64
|
+
adapterPlan?: ActiveContextPlan | null;
|
|
65
|
+
}) {
|
|
66
|
+
const events: MemoryControllerEvent[] = [];
|
|
67
|
+
const calls: string[] = [];
|
|
68
|
+
let dispatched = false;
|
|
69
|
+
const markDispatch =
|
|
70
|
+
<T>(label: string) =>
|
|
71
|
+
async (input: T & { decisionId: string }) => {
|
|
72
|
+
calls.push(label);
|
|
73
|
+
dispatched = true;
|
|
74
|
+
return echoReceipt(input);
|
|
75
|
+
};
|
|
76
|
+
const deps: MemoryControllerDeps = {
|
|
77
|
+
config: config(options?.mode ?? "active"),
|
|
78
|
+
reportReader: {
|
|
79
|
+
read: async () =>
|
|
80
|
+
options?.evidenceOverride === undefined || options.evidenceOverride !== null
|
|
81
|
+
? (options?.evidenceOverride ?? evidence())
|
|
82
|
+
: null,
|
|
83
|
+
},
|
|
84
|
+
recorder: {
|
|
85
|
+
record: async (event) => {
|
|
86
|
+
if (options?.recordThrows) throw new Error("recorder down");
|
|
87
|
+
if (event.phase === "choice") {
|
|
88
|
+
// Gate proof: the choice record must precede any dispatch.
|
|
89
|
+
assert.ok(!dispatched, "choice event recorded after dispatch");
|
|
90
|
+
}
|
|
91
|
+
events.push(event);
|
|
92
|
+
},
|
|
93
|
+
countShadowRecords: async () => options?.shadowRecords ?? 10,
|
|
94
|
+
},
|
|
95
|
+
executors:
|
|
96
|
+
options?.executors ??
|
|
97
|
+
({
|
|
98
|
+
executePersistentMemory: markDispatch("persistent"),
|
|
99
|
+
executeRecall: markDispatch("recall"),
|
|
100
|
+
executeActiveContext: markDispatch("context"),
|
|
101
|
+
} as MemoryControllerExecutors),
|
|
102
|
+
activeContextAdapter:
|
|
103
|
+
options?.adapterPlan === null
|
|
104
|
+
? undefined
|
|
105
|
+
: {
|
|
106
|
+
plan: () => options?.adapterPlan ?? { transform: "FILTER", messageIds: ["m1"], planId: "p1" },
|
|
107
|
+
},
|
|
108
|
+
telemetry: (event) => calls.push(`telemetry:${event.phase}`),
|
|
109
|
+
clock: () => NOW,
|
|
110
|
+
};
|
|
111
|
+
return { deps, events, calls };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const RECALL_PROMPT = "what did we decide last time?";
|
|
115
|
+
|
|
116
|
+
test("off mode makes no choice, no read, no write, no call", async () => {
|
|
117
|
+
const h = harness({ mode: "off" });
|
|
118
|
+
const explode = async () => {
|
|
119
|
+
throw new Error("touched in off mode");
|
|
120
|
+
};
|
|
121
|
+
h.deps.reportReader = { read: explode };
|
|
122
|
+
h.deps.recorder = { record: explode, countShadowRecords: explode };
|
|
123
|
+
h.deps.executors = { executeRecall: explode } as MemoryControllerExecutors;
|
|
124
|
+
h.deps.policyRuntime = { loadRuntimeValues: explode };
|
|
125
|
+
h.deps.readUtilityRuntime = explode;
|
|
126
|
+
|
|
127
|
+
const result = await new MemoryControllerCoordinator(h.deps).run({ prompt: RECALL_PROMPT });
|
|
128
|
+
|
|
129
|
+
assert.equal(result.effectiveMode, "off");
|
|
130
|
+
assert.equal(result.executed, false);
|
|
131
|
+
assert.equal(result.recorded, false);
|
|
132
|
+
assert.deepEqual(h.events, []);
|
|
133
|
+
assert.deepEqual(h.calls, []);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
test("shadow mode records the choice but calls no executor", async () => {
|
|
137
|
+
const h = harness({ mode: "shadow" });
|
|
138
|
+
const result = await new MemoryControllerCoordinator(h.deps).run({ prompt: RECALL_PROMPT });
|
|
139
|
+
|
|
140
|
+
assert.equal(result.effectiveMode, "shadow");
|
|
141
|
+
assert.equal(result.recorded, true);
|
|
142
|
+
assert.equal(result.executed, false);
|
|
143
|
+
assert.deepEqual(h.calls, ["telemetry:choice"]);
|
|
144
|
+
assert.equal(h.events.length, 1);
|
|
145
|
+
assert.equal(h.events[0].phase, "choice");
|
|
146
|
+
assert.ok(h.events[0].stateHash.length > 0);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
test("active mode with passing gates executes and links one id across events", async () => {
|
|
150
|
+
const h = harness();
|
|
151
|
+
const result = await new MemoryControllerCoordinator(h.deps).run({ prompt: RECALL_PROMPT });
|
|
152
|
+
|
|
153
|
+
assert.equal(result.effectiveMode, "active");
|
|
154
|
+
assert.deepEqual(result.demotionReasons, []);
|
|
155
|
+
assert.equal(result.choice.family, "recall");
|
|
156
|
+
assert.ok(h.calls.includes("recall"));
|
|
157
|
+
const ids = new Set(h.events.map((event) => event.decisionId));
|
|
158
|
+
ids.add(result.decisionId);
|
|
159
|
+
if (result.receipt) ids.add(result.receipt.decisionId);
|
|
160
|
+
assert.equal(ids.size, 1, "one id joins each event");
|
|
161
|
+
assert.equal(result.executed, true);
|
|
162
|
+
const outcome = h.events.find((event) => event.phase === "outcome");
|
|
163
|
+
assert.equal(outcome?.receipt?.decisionId, result.decisionId);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
test("bad or old evidence forces shadow: report gates", async () => {
|
|
167
|
+
const cases: { name: string; options: Parameters<typeof harness>[0] }[] = [
|
|
168
|
+
{ name: "no evidence", options: { evidenceOverride: null } },
|
|
169
|
+
{
|
|
170
|
+
name: "report not passing",
|
|
171
|
+
options: { evidenceOverride: evidence({ report: { status: "fail" } }) },
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "version mismatch",
|
|
175
|
+
options: { evidenceOverride: evidence({ report: { version: "2345-v0" } }) },
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: "config unbound",
|
|
179
|
+
options: {
|
|
180
|
+
evidenceOverride: evidence({
|
|
181
|
+
report: { configHash: controllerConfigHash({ ...config("active"), shadowMinRecords: 99 }) },
|
|
182
|
+
}),
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: "report hash invalid",
|
|
187
|
+
options: {
|
|
188
|
+
evidenceOverride: {
|
|
189
|
+
report: { ...evidence().report, reportHash: "0".repeat(64) },
|
|
190
|
+
pairedSeed: evidence().pairedSeed,
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "report stale",
|
|
196
|
+
options: { evidenceOverride: evidence({ report: { generatedAt: "2020-01-01T00:00:00.000Z" } }) },
|
|
197
|
+
},
|
|
198
|
+
];
|
|
199
|
+
for (const testCase of cases) {
|
|
200
|
+
const h = harness(testCase.options);
|
|
201
|
+
const result = await new MemoryControllerCoordinator(h.deps).run({ prompt: RECALL_PROMPT });
|
|
202
|
+
assert.equal(result.effectiveMode, "shadow", testCase.name);
|
|
203
|
+
assert.equal(result.executed, false, testCase.name);
|
|
204
|
+
assert.ok(!h.calls.some((c) => c !== "telemetry:choice"), testCase.name);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
test("bad or old paired-seed evidence forces shadow", async () => {
|
|
209
|
+
const pairedSeeds = [
|
|
210
|
+
{ status: "fail" as const, seedCount: 3, generatedAt: NOW.toISOString() },
|
|
211
|
+
{ status: "pass" as const, seedCount: 1, generatedAt: NOW.toISOString() },
|
|
212
|
+
{ status: "pass" as const, seedCount: 3, generatedAt: "2020-01-01T00:00:00.000Z" },
|
|
213
|
+
];
|
|
214
|
+
for (const pairedSeed of pairedSeeds) {
|
|
215
|
+
const h = harness({ evidenceOverride: evidence({ pairedSeed }) });
|
|
216
|
+
const result = await new MemoryControllerCoordinator(h.deps).run({ prompt: RECALL_PROMPT });
|
|
217
|
+
assert.equal(result.effectiveMode, "shadow", JSON.stringify(pairedSeed));
|
|
218
|
+
assert.ok(result.demotionReasons.some((r) => r.startsWith("paired_seed")));
|
|
219
|
+
assert.equal(result.executed, false);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
test("active promotion requires prior shadow records (shadow before active)", async () => {
|
|
224
|
+
const h = harness({ shadowRecords: 1 });
|
|
225
|
+
const result = await new MemoryControllerCoordinator(h.deps).run({ prompt: RECALL_PROMPT });
|
|
226
|
+
assert.equal(result.effectiveMode, "shadow");
|
|
227
|
+
assert.ok(result.demotionReasons.includes("shadow_history_insufficient"));
|
|
228
|
+
assert.equal(result.executed, false);
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
test("failed receipt forces shadow on the next run", async () => {
|
|
232
|
+
const h = harness({
|
|
233
|
+
executors: {
|
|
234
|
+
executeRecall: async () => ({ decisionId: "wrong-id", ok: true }),
|
|
235
|
+
},
|
|
236
|
+
});
|
|
237
|
+
const coordinator = new MemoryControllerCoordinator(h.deps);
|
|
238
|
+
const first = await coordinator.run({ prompt: RECALL_PROMPT });
|
|
239
|
+
assert.equal(first.executed, false, "mismatched receipt id is a bad receipt");
|
|
240
|
+
assert.ok(h.events.find((event) => event.phase === "outcome")?.failureClass === "bad_receipt");
|
|
241
|
+
|
|
242
|
+
const second = await coordinator.run({ prompt: RECALL_PROMPT });
|
|
243
|
+
assert.equal(second.effectiveMode, "shadow");
|
|
244
|
+
assert.ok(second.demotionReasons.includes("recent_receipt_failures"));
|
|
245
|
+
assert.equal(second.executed, false);
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
test("executor error or missing executor records a failure class and demotes next run", async () => {
|
|
249
|
+
const h = harness({
|
|
250
|
+
executors: {
|
|
251
|
+
executeRecall: async () => Promise.reject(new Error("boom")),
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
const coordinator = new MemoryControllerCoordinator(h.deps);
|
|
255
|
+
const failed = await coordinator.run({ prompt: RECALL_PROMPT });
|
|
256
|
+
assert.equal(failed.executed, false);
|
|
257
|
+
assert.equal(h.events.find((event) => event.phase === "outcome")?.failureClass, "executor_error");
|
|
258
|
+
const next = await coordinator.run({ prompt: RECALL_PROMPT });
|
|
259
|
+
assert.equal(next.effectiveMode, "shadow");
|
|
260
|
+
|
|
261
|
+
const h2 = harness({ executors: {} });
|
|
262
|
+
const missing = await new MemoryControllerCoordinator(h2.deps).run({ prompt: RECALL_PROMPT });
|
|
263
|
+
assert.equal(missing.executed, false);
|
|
264
|
+
assert.equal(h2.events.find((event) => event.phase === "outcome")?.failureClass, "no_executor");
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
test("bad scores fail closed to no_op", () => {
|
|
268
|
+
const { choice, scores } = chooseAction({
|
|
269
|
+
state: {
|
|
270
|
+
prompt: RECALL_PROMPT,
|
|
271
|
+
persistentMemoryCandidate: {
|
|
272
|
+
action: "store_note",
|
|
273
|
+
eligibility: {
|
|
274
|
+
confidence: Number.NaN,
|
|
275
|
+
lifecycleState: "active",
|
|
276
|
+
importance: 0.5,
|
|
277
|
+
source: "extraction",
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
});
|
|
282
|
+
assert.deepEqual(choice, { family: "no_op" });
|
|
283
|
+
assert.ok(Number.isNaN(scores.persistent_memory));
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
test("discard stays review-only in active mode", async () => {
|
|
287
|
+
const h = harness();
|
|
288
|
+
const result = await new MemoryControllerCoordinator(h.deps).run({
|
|
289
|
+
prompt: "ok",
|
|
290
|
+
persistentMemoryCandidate: {
|
|
291
|
+
action: "discard",
|
|
292
|
+
eligibility: {
|
|
293
|
+
confidence: 0.9,
|
|
294
|
+
lifecycleState: "active",
|
|
295
|
+
importance: 0.1,
|
|
296
|
+
source: "extraction",
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
});
|
|
300
|
+
assert.equal(result.choice.family, "persistent_memory");
|
|
301
|
+
assert.equal(result.choice.action, "discard");
|
|
302
|
+
assert.equal(result.reviewOnly, true);
|
|
303
|
+
assert.equal(result.executed, false);
|
|
304
|
+
assert.deepEqual(h.calls, ["telemetry:choice", "telemetry:outcome"]);
|
|
305
|
+
assert.equal(h.events.find((event) => event.phase === "outcome")?.reviewOnly, true);
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
test("record failure stops work before dispatch", async () => {
|
|
309
|
+
const h = harness({ recordThrows: true });
|
|
310
|
+
const result = await new MemoryControllerCoordinator(h.deps).run({ prompt: RECALL_PROMPT });
|
|
311
|
+
assert.equal(result.recorded, false);
|
|
312
|
+
assert.equal(result.executed, false);
|
|
313
|
+
assert.ok(result.demotionReasons.includes("record_failed"));
|
|
314
|
+
assert.deepEqual(h.calls, []);
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
test("one hash names each state", () => {
|
|
318
|
+
assert.equal(hashControllerState({ prompt: "same" }), hashControllerState({ prompt: "same" }));
|
|
319
|
+
assert.notEqual(hashControllerState({ prompt: "same" }), hashControllerState({ prompt: "other" }));
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
test("no counterfactual lift is claimed in events or results", async () => {
|
|
323
|
+
const h = harness();
|
|
324
|
+
const result = await new MemoryControllerCoordinator(h.deps).run({ prompt: RECALL_PROMPT });
|
|
325
|
+
const banned = /lift|counterfactual/i;
|
|
326
|
+
for (const event of h.events) {
|
|
327
|
+
for (const key of Object.keys(event)) assert.ok(!banned.test(key), `event key ${key}`);
|
|
328
|
+
}
|
|
329
|
+
for (const key of Object.keys(result)) assert.ok(!banned.test(key), `result key ${key}`);
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
test("evaluateActiveGates returns empty only when all gates pass", async () => {
|
|
333
|
+
const passing = await evaluateActiveGates({
|
|
334
|
+
config: config("active"),
|
|
335
|
+
reportReader: { read: async () => evidence() },
|
|
336
|
+
recorder: { record: async () => {}, countShadowRecords: async () => 5 },
|
|
337
|
+
consecutiveReceiptFailures: 0,
|
|
338
|
+
now: NOW,
|
|
339
|
+
});
|
|
340
|
+
assert.deepEqual(passing, []);
|
|
341
|
+
const noReader = await evaluateActiveGates({
|
|
342
|
+
config: config("active"),
|
|
343
|
+
consecutiveReceiptFailures: 0,
|
|
344
|
+
now: NOW,
|
|
345
|
+
});
|
|
346
|
+
assert.deepEqual(noReader, ["no_report_reader"]);
|
|
347
|
+
});
|