@remnic/core 9.3.719 → 9.3.721
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-boundary.d.ts +10 -7
- package/dist/access-boundary.js +37 -34
- package/dist/access-cli.js +71 -66
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +11 -8
- package/dist/access-http.js +44 -41
- package/dist/access-mcp.d.ts +11 -8
- package/dist/access-mcp.js +40 -37
- package/dist/access-operations-batch.js +38 -35
- package/dist/access-operations.d.ts +11 -8
- package/dist/access-operations.js +39 -36
- package/dist/access-schema.d.ts +19 -19
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-CZbnt0t2.d.ts → access-service-Dj3I-VBS.d.ts} +3 -3
- package/dist/access-service.d.ts +11 -8
- package/dist/access-service.js +36 -33
- package/dist/access-surface-catalog.d.ts +10 -7
- 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 -2
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +7 -7
- package/dist/adapters/registry.js +3 -3
- package/dist/{auto-sync-24NNS3GU.js → auto-sync-F3KCSQFJ.js} +5 -5
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +11 -8
- package/dist/briefing.d.ts +1 -1
- package/dist/briefing.js +12 -10
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer.d.ts +1 -1
- package/dist/calibration.d.ts +1 -1
- package/dist/calibration.js +2 -2
- package/dist/capabilities.d.ts +30 -2
- package/dist/capabilities.js +3 -1
- package/dist/{catalog-CEYlMs9X.d.ts → catalog-F-OEVbRQ.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 +15 -13
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.d.ts +4 -0
- package/dist/causal-trajectory-graph.js +2 -2
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-TH7WMHVK.js → chunk-3NN73CM7.js} +2 -2
- package/dist/{chunk-A5TUPZ3N.js → chunk-4SF232E6.js} +60 -30
- package/dist/chunk-4SF232E6.js.map +1 -0
- package/dist/{chunk-DGTDRIUO.js → chunk-4T3BMHKD.js} +2 -2
- package/dist/{chunk-EH27LHML.js → chunk-5O42UKXI.js} +2 -2
- package/dist/{chunk-KRGC4EDX.js → chunk-6FAMMBQ3.js} +2 -2
- package/dist/{chunk-FEB7W5JG.js → chunk-6OIDDKAA.js} +27 -6
- package/dist/chunk-6OIDDKAA.js.map +1 -0
- package/dist/{chunk-67HG7KFE.js → chunk-6YKIYQU7.js} +2 -2
- package/dist/{chunk-LXSG4L55.js → chunk-7CTNUVHZ.js} +2 -2
- package/dist/{chunk-UCJ5CDTK.js → chunk-A5XNBK2D.js} +22 -14
- package/dist/chunk-A5XNBK2D.js.map +1 -0
- package/dist/{chunk-7EEVXW7X.js → chunk-A7TJZLPK.js} +2 -2
- package/dist/{chunk-P5IPFZVH.js → chunk-B7WISIAJ.js} +5 -5
- package/dist/chunk-BCDKBDSY.js +173 -0
- package/dist/chunk-BCDKBDSY.js.map +1 -0
- package/dist/{chunk-JAKYZGV4.js → chunk-BXEOHV7K.js} +3 -3
- package/dist/chunk-C4X4QGIO.js +60 -0
- package/dist/chunk-C4X4QGIO.js.map +1 -0
- package/dist/{chunk-S3OPGGZB.js → chunk-D7EBTQ24.js} +2 -2
- package/dist/{chunk-IO5NQEGZ.js → chunk-DKT3X5C3.js} +2 -2
- package/dist/{chunk-PBH4JUAB.js → chunk-DVRHLN2O.js} +18 -3
- package/dist/chunk-DVRHLN2O.js.map +1 -0
- package/dist/{chunk-S35FX6MU.js → chunk-EBDA5TYA.js} +2 -2
- package/dist/{chunk-2PTBLS2S.js → chunk-EDOQM4E4.js} +2 -2
- package/dist/{chunk-YTZLBBEB.js → chunk-EEJMD2L2.js} +3 -3
- package/dist/{chunk-YGKUAX2B.js → chunk-EHQ5HO5T.js} +11 -11
- package/dist/chunk-EHQ5HO5T.js.map +1 -0
- package/dist/{chunk-JIZGYQYH.js → chunk-EM2LDXJ2.js} +4 -4
- package/dist/{chunk-YYOK4GVF.js → chunk-EVPNWN7Z.js} +10 -10
- package/dist/{chunk-HLIR3RJ7.js → chunk-EXUCUPV2.js} +2 -2
- package/dist/{chunk-F3PVXKHP.js → chunk-GDUOCHCD.js} +27 -21
- package/dist/chunk-GDUOCHCD.js.map +1 -0
- package/dist/{chunk-L5ASZA2F.js → chunk-GJSL4WG2.js} +17 -2
- package/dist/chunk-GJSL4WG2.js.map +1 -0
- package/dist/{chunk-2SXMCQEQ.js → chunk-GZQXOQQ2.js} +3 -3
- package/dist/{chunk-2KAYTPPT.js → chunk-HCVWF657.js} +12 -12
- package/dist/{chunk-N3DUH6OO.js → chunk-ILFSEIRT.js} +1 -1
- package/dist/chunk-ILFSEIRT.js.map +1 -0
- package/dist/{chunk-4KZGLDJJ.js → chunk-J3JPB7ZI.js} +2 -2
- package/dist/{chunk-3JJWNZTT.js → chunk-L2B3EE7B.js} +102 -42
- package/dist/chunk-L2B3EE7B.js.map +1 -0
- package/dist/{chunk-NFRBADNR.js → chunk-LA3HZKES.js} +610 -369
- package/dist/chunk-LA3HZKES.js.map +1 -0
- package/dist/{chunk-LQ6JI4VH.js → chunk-LD53WPMU.js} +4 -4
- package/dist/{chunk-URM3HW2R.js → chunk-LLUGAZ3B.js} +2 -2
- package/dist/{chunk-RVLB4E6N.js → chunk-MDBZTH7N.js} +5 -32
- package/dist/chunk-MDBZTH7N.js.map +1 -0
- package/dist/{chunk-U5H7WHTS.js → chunk-N77ELJ2D.js} +4 -4
- package/dist/{chunk-2VHMVWPU.js → chunk-NXRUUDUF.js} +2 -2
- package/dist/{chunk-DIFU33GU.js → chunk-OHTOPFRF.js} +2 -2
- package/dist/{chunk-74MYJSKB.js → chunk-ORAK3LNZ.js} +2 -2
- package/dist/{chunk-REWQAFSA.js → chunk-PD42EYQN.js} +2 -2
- package/dist/chunk-PHK3HARR.js +32 -0
- package/dist/chunk-PHK3HARR.js.map +1 -0
- package/dist/{chunk-773DPI6T.js → chunk-PKMQK2WY.js} +4 -4
- package/dist/{chunk-72VDBALG.js → chunk-QD6QP5P6.js} +63 -54
- package/dist/chunk-QD6QP5P6.js.map +1 -0
- package/dist/{chunk-CTOQEZSN.js → chunk-QR67FU5G.js} +2 -2
- package/dist/{chunk-AU7Q3LSC.js → chunk-RKNJBZ55.js} +7 -7
- package/dist/{chunk-YI7RZO7Y.js → chunk-SQNED75R.js} +1 -1
- package/dist/{chunk-5CEJH5ZN.js → chunk-TAPSNIMA.js} +4 -4
- package/dist/{chunk-IF362TF6.js → chunk-TQT3USCG.js} +2 -2
- package/dist/chunk-TQT3USCG.js.map +1 -0
- package/dist/{chunk-5RHM43BJ.js → chunk-TXQCG6SE.js} +3 -3
- package/dist/{chunk-ANI5DUAE.js → chunk-UIXXE6NI.js} +7 -7
- package/dist/{chunk-2COL35PK.js → chunk-UO5ZHIIH.js} +2 -2
- package/dist/{chunk-OJU73BUX.js → chunk-VCLGUIFM.js} +2 -2
- package/dist/{chunk-5J4OL7TJ.js → chunk-VUA4S7P6.js} +4 -4
- package/dist/{chunk-A66YRSOS.js → chunk-WQYSDPMA.js} +2 -2
- package/dist/chunk-XGTBNVIU.js +79 -0
- package/dist/chunk-XGTBNVIU.js.map +1 -0
- package/dist/{chunk-OZ2KQ7HF.js → chunk-YEE5KJQQ.js} +2 -2
- package/dist/chunk-YN2UN7N3.js +217 -0
- package/dist/chunk-YN2UN7N3.js.map +1 -0
- package/dist/{chunk-WRFKZEO6.js → chunk-YQGHW5ML.js} +4 -4
- package/dist/{chunk-APUJIMDM.js → chunk-Z4RU5VPM.js} +2 -2
- package/dist/{chunk-DCWIQFNA.js → chunk-ZUDM75KG.js} +4 -4
- package/dist/{cli-1orcdXOY.d.ts → cli-P_GaYcCY.d.ts} +3 -3
- package/dist/cli.d.ts +9 -6
- package/dist/cli.js +67 -63
- package/dist/compounding/engine.d.ts +1 -1
- package/dist/compounding/engine.js +12 -10
- 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 -2
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +12 -10
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +13 -11
- package/dist/consolidation-provenance-check.d.ts +1 -1
- package/dist/consolidation-undo.d.ts +1 -1
- package/dist/contradiction/index.d.ts +1 -1
- 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/day-summary.d.ts +1 -1
- package/dist/delinearize.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-retrieval.d.ts +1 -1
- package/dist/entity-retrieval.js +12 -10
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +11 -8
- package/dist/extraction-faithfulness.d.ts +8 -2
- package/dist/extraction-faithfulness.js +4 -3
- 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-judge.js +3 -3
- package/dist/extraction.d.ts +1 -1
- package/dist/extraction.js +5 -4
- package/dist/faithfulness-config.d.ts +55 -0
- package/dist/faithfulness-config.js +11 -0
- package/dist/faithfulness-config.js.map +1 -0
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/fallback-llm.js +2 -2
- package/dist/{forget-U66KPDPY.js → forget-OEE5OELK.js} +2 -2
- package/dist/graph-dashboard-diff.d.ts +4 -0
- package/dist/graph-dashboard-key.d.ts +4 -0
- package/dist/graph-dashboard-parser.d.ts +4 -0
- package/dist/{graph-edge-decay-JLOF3YW4.js → graph-edge-decay-QPRJQ7DL.js} +3 -3
- package/dist/graph-edge-reinforcement.d.ts +4 -0
- package/dist/graph-snapshot.d.ts +7 -3
- package/dist/graph-snapshot.js +3 -3
- package/dist/graph.d.ts +7 -1
- package/dist/graph.js +2 -2
- package/dist/identity-continuity.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/index.d.ts +571 -570
- package/dist/index.js +104 -99
- package/dist/index.js.map +1 -1
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +4 -4
- 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 +96 -0
- package/dist/local-model-endpoint.js +12 -0
- package/dist/local-model-endpoint.js.map +1 -0
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +12 -10
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +12 -10
- package/dist/maintenance/rebuild-memory-projection.js +13 -11
- package/dist/mcp-memory-inspector-app.d.ts +11 -8
- 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-worth-outcomes.d.ts +1 -1
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +2 -2
- package/dist/namespaces/migrate.js +22 -20
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +9 -9
- package/dist/namespaces/storage.d.ts +2 -2
- package/dist/namespaces/storage.js +12 -10
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -2
- package/dist/operator-toolkit.js +32 -28
- package/dist/orchestration/maintenance.d.ts +2 -2
- package/dist/orchestration/maintenance.js +14 -12
- package/dist/{orchestrator-kOxredSr.d.ts → orchestrator-f5xv19kp.d.ts} +178 -81
- package/dist/orchestrator.d.ts +8 -5
- package/dist/orchestrator.js +56 -52
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/provenance.js +2 -1
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +1 -1
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-planner-llm.js +2 -2
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.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 +18 -1
- package/dist/recall-xray.js +2 -2
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/resume-bundles.js +5 -3
- package/dist/retrieval-agents.d.ts +1 -1
- 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/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +8 -8
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +14 -14
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-B58v3S-a.d.ts → semantic-consolidation-BQm1e1Pn.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +13 -11
- package/dist/semantic-rule-promotion.js +12 -10
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +12 -10
- 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/storage.d.ts +45 -1
- package/dist/storage.js +11 -9
- package/dist/summarizer.d.ts +1 -1
- package/dist/summarizer.js +3 -3
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/temporal-supersession.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 +1 -1
- 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 +1 -1
- package/dist/trust-score-stage.d.ts +178 -0
- package/dist/trust-score-stage.js +18 -0
- package/dist/trust-score-stage.js.map +1 -0
- package/dist/trust-score.d.ts +164 -0
- package/dist/trust-score.js +22 -0
- package/dist/trust-score.js.map +1 -0
- package/dist/{types-ACmDOScJ.d.ts → types-DwO1Ot4n.d.ts} +56 -2
- 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 +12 -10
- package/package.json +2 -2
- package/src/access-service.ts +8 -5
- package/src/capabilities-cluster-b.test.ts +78 -0
- package/src/capabilities.test.ts +11 -1
- package/src/capabilities.ts +58 -0
- package/src/cli/research-status-commands.ts +7 -3
- package/src/cli.ts +11 -6
- package/src/config.ts +60 -30
- package/src/extraction-faithfulness.test.ts +175 -0
- package/src/extraction-faithfulness.ts +53 -1
- package/src/faithfulness-config.test.ts +96 -0
- package/src/faithfulness-config.ts +138 -0
- package/src/graph-snapshot.ts +3 -3
- package/src/graph.ts +8 -7
- package/src/lifecycle/tombstones.test.ts +242 -1
- package/src/lifecycle/tombstones.ts +157 -70
- package/src/local-model-endpoint.test.ts +155 -0
- package/src/local-model-endpoint.ts +189 -0
- package/src/operator-toolkit.ts +24 -7
- package/src/orchestration/tier-migration-coordinator.ts +286 -0
- package/src/orchestrator.ts +331 -222
- package/src/recall-xray.test.ts +62 -0
- package/src/recall-xray.ts +34 -0
- package/src/trust-score-recall-paths.test.ts +157 -0
- package/src/trust-score-stage.test.ts +350 -0
- package/src/trust-score-stage.ts +398 -0
- package/src/trust-score.test.ts +282 -0
- package/src/trust-score.ts +449 -0
- package/src/types.ts +61 -1
- package/dist/chunk-3JJWNZTT.js.map +0 -1
- package/dist/chunk-72VDBALG.js.map +0 -1
- package/dist/chunk-A5TUPZ3N.js.map +0 -1
- package/dist/chunk-F3PVXKHP.js.map +0 -1
- package/dist/chunk-FEB7W5JG.js.map +0 -1
- package/dist/chunk-IF362TF6.js.map +0 -1
- package/dist/chunk-L5ASZA2F.js.map +0 -1
- package/dist/chunk-N3DUH6OO.js.map +0 -1
- package/dist/chunk-NFRBADNR.js.map +0 -1
- package/dist/chunk-PBH4JUAB.js.map +0 -1
- package/dist/chunk-RVLB4E6N.js.map +0 -1
- package/dist/chunk-UCJ5CDTK.js.map +0 -1
- package/dist/chunk-YGKUAX2B.js.map +0 -1
- /package/dist/{auto-sync-24NNS3GU.js.map → auto-sync-F3KCSQFJ.js.map} +0 -0
- /package/dist/{chunk-TH7WMHVK.js.map → chunk-3NN73CM7.js.map} +0 -0
- /package/dist/{chunk-DGTDRIUO.js.map → chunk-4T3BMHKD.js.map} +0 -0
- /package/dist/{chunk-EH27LHML.js.map → chunk-5O42UKXI.js.map} +0 -0
- /package/dist/{chunk-KRGC4EDX.js.map → chunk-6FAMMBQ3.js.map} +0 -0
- /package/dist/{chunk-67HG7KFE.js.map → chunk-6YKIYQU7.js.map} +0 -0
- /package/dist/{chunk-LXSG4L55.js.map → chunk-7CTNUVHZ.js.map} +0 -0
- /package/dist/{chunk-7EEVXW7X.js.map → chunk-A7TJZLPK.js.map} +0 -0
- /package/dist/{chunk-P5IPFZVH.js.map → chunk-B7WISIAJ.js.map} +0 -0
- /package/dist/{chunk-JAKYZGV4.js.map → chunk-BXEOHV7K.js.map} +0 -0
- /package/dist/{chunk-S3OPGGZB.js.map → chunk-D7EBTQ24.js.map} +0 -0
- /package/dist/{chunk-IO5NQEGZ.js.map → chunk-DKT3X5C3.js.map} +0 -0
- /package/dist/{chunk-S35FX6MU.js.map → chunk-EBDA5TYA.js.map} +0 -0
- /package/dist/{chunk-2PTBLS2S.js.map → chunk-EDOQM4E4.js.map} +0 -0
- /package/dist/{chunk-YTZLBBEB.js.map → chunk-EEJMD2L2.js.map} +0 -0
- /package/dist/{chunk-JIZGYQYH.js.map → chunk-EM2LDXJ2.js.map} +0 -0
- /package/dist/{chunk-YYOK4GVF.js.map → chunk-EVPNWN7Z.js.map} +0 -0
- /package/dist/{chunk-HLIR3RJ7.js.map → chunk-EXUCUPV2.js.map} +0 -0
- /package/dist/{chunk-2SXMCQEQ.js.map → chunk-GZQXOQQ2.js.map} +0 -0
- /package/dist/{chunk-2KAYTPPT.js.map → chunk-HCVWF657.js.map} +0 -0
- /package/dist/{chunk-4KZGLDJJ.js.map → chunk-J3JPB7ZI.js.map} +0 -0
- /package/dist/{chunk-LQ6JI4VH.js.map → chunk-LD53WPMU.js.map} +0 -0
- /package/dist/{chunk-URM3HW2R.js.map → chunk-LLUGAZ3B.js.map} +0 -0
- /package/dist/{chunk-U5H7WHTS.js.map → chunk-N77ELJ2D.js.map} +0 -0
- /package/dist/{chunk-2VHMVWPU.js.map → chunk-NXRUUDUF.js.map} +0 -0
- /package/dist/{chunk-DIFU33GU.js.map → chunk-OHTOPFRF.js.map} +0 -0
- /package/dist/{chunk-74MYJSKB.js.map → chunk-ORAK3LNZ.js.map} +0 -0
- /package/dist/{chunk-REWQAFSA.js.map → chunk-PD42EYQN.js.map} +0 -0
- /package/dist/{chunk-773DPI6T.js.map → chunk-PKMQK2WY.js.map} +0 -0
- /package/dist/{chunk-CTOQEZSN.js.map → chunk-QR67FU5G.js.map} +0 -0
- /package/dist/{chunk-AU7Q3LSC.js.map → chunk-RKNJBZ55.js.map} +0 -0
- /package/dist/{chunk-YI7RZO7Y.js.map → chunk-SQNED75R.js.map} +0 -0
- /package/dist/{chunk-5CEJH5ZN.js.map → chunk-TAPSNIMA.js.map} +0 -0
- /package/dist/{chunk-5RHM43BJ.js.map → chunk-TXQCG6SE.js.map} +0 -0
- /package/dist/{chunk-ANI5DUAE.js.map → chunk-UIXXE6NI.js.map} +0 -0
- /package/dist/{chunk-2COL35PK.js.map → chunk-UO5ZHIIH.js.map} +0 -0
- /package/dist/{chunk-OJU73BUX.js.map → chunk-VCLGUIFM.js.map} +0 -0
- /package/dist/{chunk-5J4OL7TJ.js.map → chunk-VUA4S7P6.js.map} +0 -0
- /package/dist/{chunk-A66YRSOS.js.map → chunk-WQYSDPMA.js.map} +0 -0
- /package/dist/{chunk-OZ2KQ7HF.js.map → chunk-YEE5KJQQ.js.map} +0 -0
- /package/dist/{chunk-WRFKZEO6.js.map → chunk-YQGHW5ML.js.map} +0 -0
- /package/dist/{chunk-APUJIMDM.js.map → chunk-Z4RU5VPM.js.map} +0 -0
- /package/dist/{chunk-DCWIQFNA.js.map → chunk-ZUDM75KG.js.map} +0 -0
- /package/dist/{forget-U66KPDPY.js.map → forget-OEE5OELK.js.map} +0 -0
- /package/dist/{graph-edge-decay-JLOF3YW4.js.map → graph-edge-decay-QPRJQ7DL.js.map} +0 -0
package/src/access-service.ts
CHANGED
|
@@ -243,6 +243,7 @@ import {
|
|
|
243
243
|
type ActionConfidenceResult,
|
|
244
244
|
} from "./action-confidence.js";
|
|
245
245
|
import { formatProfileTraceAscii } from "./profiling.js";
|
|
246
|
+
import { resolveAccessSetupCapabilities, resolveGraphConstructionCapabilities } from "./capabilities.js";
|
|
246
247
|
|
|
247
248
|
export class EngramAccessInputError extends Error {}
|
|
248
249
|
|
|
@@ -1299,14 +1300,15 @@ export class EngramAccessService {
|
|
|
1299
1300
|
|
|
1300
1301
|
constructor(private readonly orchestrator: Orchestrator) {
|
|
1301
1302
|
this.idempotency = new AccessIdempotencyStore(orchestrator.config.memoryDir);
|
|
1303
|
+
const accessCaps = resolveAccessSetupCapabilities(orchestrator.config); // #1566 Cluster B
|
|
1302
1304
|
this.budget = new CrossNamespaceBudget({
|
|
1303
|
-
enabled:
|
|
1305
|
+
enabled: accessCaps.recallCrossNamespaceBudget,
|
|
1304
1306
|
windowMs: orchestrator.config.recallCrossNamespaceBudgetWindowMs,
|
|
1305
1307
|
softLimit: orchestrator.config.recallCrossNamespaceBudgetSoftLimit,
|
|
1306
1308
|
hardLimit: orchestrator.config.recallCrossNamespaceBudgetHardLimit,
|
|
1307
1309
|
});
|
|
1308
1310
|
|
|
1309
|
-
const auditEnabled =
|
|
1311
|
+
const auditEnabled = accessCaps.recallAuditAnomalyDetection;
|
|
1310
1312
|
const auditLogEnabled = false; // Audit JSONL logging — off until wired to a directory
|
|
1311
1313
|
if (auditEnabled || auditLogEnabled) {
|
|
1312
1314
|
const auditConfig: AccessAuditConfig = {
|
|
@@ -7512,6 +7514,7 @@ export class EngramAccessService {
|
|
|
7512
7514
|
);
|
|
7513
7515
|
const storage = await this.orchestrator.getStorage(namespace);
|
|
7514
7516
|
const cfg = this.orchestrator.config;
|
|
7517
|
+
const graphCaps = resolveGraphConstructionCapabilities(cfg);
|
|
7515
7518
|
// Canonicalize the storage root once — through `realpath` so that any
|
|
7516
7519
|
// symlink in the namespace root path itself is resolved before we
|
|
7517
7520
|
// compare children against it. This is required because
|
|
@@ -7608,9 +7611,9 @@ export class EngramAccessService {
|
|
|
7608
7611
|
return buildGraphSnapshot({
|
|
7609
7612
|
memoryDir: namespaceRootReal,
|
|
7610
7613
|
graphConfig: {
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
+
entityGraph: graphCaps.entityGraph,
|
|
7615
|
+
timeGraph: graphCaps.timeGraph,
|
|
7616
|
+
causalGraph: graphCaps.causalGraph,
|
|
7614
7617
|
},
|
|
7615
7618
|
request: {
|
|
7616
7619
|
limit: request.limit,
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import { parseConfig } from "./config.js";
|
|
5
|
+
import {
|
|
6
|
+
resolveAccessSetupCapabilities,
|
|
7
|
+
type AccessSetupCapabilitySet,
|
|
8
|
+
} from "./capabilities.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Parity tests for the access-setup capability set (issue #1566 Cluster B).
|
|
12
|
+
*
|
|
13
|
+
* Every access-setup capability field must project from its `<field>Enabled`
|
|
14
|
+
* config flag, and the default-off semantics for both flags must be preserved.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const ACCESS_FIELD_TO_FLAG: Record<keyof AccessSetupCapabilitySet, string> = {
|
|
18
|
+
recallCrossNamespaceBudget: "recallCrossNamespaceBudgetEnabled",
|
|
19
|
+
recallAuditAnomalyDetection: "recallAuditAnomalyDetectionEnabled",
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const ACCESS_FIELDS = Object.keys(ACCESS_FIELD_TO_FLAG) as Array<
|
|
23
|
+
keyof AccessSetupCapabilitySet
|
|
24
|
+
>;
|
|
25
|
+
|
|
26
|
+
test("resolveAccessSetupCapabilities projects every field from its flag (true variant)", () => {
|
|
27
|
+
const overrides: Record<string, boolean> = {};
|
|
28
|
+
for (const flag of Object.values(ACCESS_FIELD_TO_FLAG)) overrides[flag] = true;
|
|
29
|
+
const config = parseConfig(overrides);
|
|
30
|
+
const accessCaps = resolveAccessSetupCapabilities(config);
|
|
31
|
+
|
|
32
|
+
for (const field of ACCESS_FIELDS) {
|
|
33
|
+
const flag = ACCESS_FIELD_TO_FLAG[field];
|
|
34
|
+
assert.equal(
|
|
35
|
+
accessCaps[field],
|
|
36
|
+
(config as unknown as Record<string, boolean>)[flag],
|
|
37
|
+
`accessCaps.${field} must equal config.${flag} (true variant)`,
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test("resolveAccessSetupCapabilities projects every field from its flag (false variant)", () => {
|
|
43
|
+
const overrides: Record<string, boolean> = {};
|
|
44
|
+
for (const flag of Object.values(ACCESS_FIELD_TO_FLAG)) overrides[flag] = false;
|
|
45
|
+
const config = parseConfig(overrides);
|
|
46
|
+
const accessCaps = resolveAccessSetupCapabilities(config);
|
|
47
|
+
|
|
48
|
+
for (const field of ACCESS_FIELDS) {
|
|
49
|
+
assert.equal(
|
|
50
|
+
accessCaps[field],
|
|
51
|
+
false,
|
|
52
|
+
`accessCaps.${field} must be false when its flag is false`,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test("resolveAccessSetupCapabilities preserves default-off semantics when flags are undefined", () => {
|
|
58
|
+
// parseConfig with no overrides exercises the documented defaults. Both
|
|
59
|
+
// access-setup flags default to false.
|
|
60
|
+
const config = parseConfig({});
|
|
61
|
+
const accessCaps = resolveAccessSetupCapabilities(config);
|
|
62
|
+
|
|
63
|
+
assert.equal(
|
|
64
|
+
accessCaps.recallCrossNamespaceBudget,
|
|
65
|
+
false,
|
|
66
|
+
"recallCrossNamespaceBudget must default to false",
|
|
67
|
+
);
|
|
68
|
+
assert.equal(
|
|
69
|
+
accessCaps.recallAuditAnomalyDetection,
|
|
70
|
+
false,
|
|
71
|
+
"recallAuditAnomalyDetection must default to false",
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test("resolveAccessSetupCapabilities returns a frozen object", () => {
|
|
76
|
+
const accessCaps = resolveAccessSetupCapabilities(parseConfig({}));
|
|
77
|
+
assert.equal(Object.isFrozen(accessCaps), true, "AccessSetupCapabilitySet must be frozen");
|
|
78
|
+
});
|
package/src/capabilities.test.ts
CHANGED
|
@@ -2,7 +2,12 @@ import assert from "node:assert/strict";
|
|
|
2
2
|
import test from "node:test";
|
|
3
3
|
|
|
4
4
|
import { parseConfig } from "./config.js";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
resolveCapabilities,
|
|
7
|
+
resolveAccessSetupCapabilities,
|
|
8
|
+
type CapabilitySet,
|
|
9
|
+
type AccessSetupCapabilitySet,
|
|
10
|
+
} from "./capabilities.js";
|
|
6
11
|
|
|
7
12
|
/**
|
|
8
13
|
* Characterization tests for the recall-operation CapabilitySet (issue #1523).
|
|
@@ -22,6 +27,7 @@ const FIELD_TO_FLAG: Record<keyof CapabilitySet, string> = {
|
|
|
22
27
|
rerankCache: "rerankCacheEnabled",
|
|
23
28
|
recallDirectAnswer: "recallDirectAnswerEnabled",
|
|
24
29
|
recallMemoryWorthFilter: "recallMemoryWorthFilterEnabled",
|
|
30
|
+
recallTrustScore: "trustScoreEnabled",
|
|
25
31
|
recallMmr: "recallMmrEnabled",
|
|
26
32
|
recallReasoningTraceBoost: "recallReasoningTraceBoostEnabled",
|
|
27
33
|
recallPlannerLlm: "recallPlannerLlmEnabled",
|
|
@@ -30,6 +36,10 @@ const FIELD_TO_FLAG: Record<keyof CapabilitySet, string> = {
|
|
|
30
36
|
graphRecall: "graphRecallEnabled",
|
|
31
37
|
graphAssistInFullMode: "graphAssistInFullModeEnabled",
|
|
32
38
|
graphExpandedIntent: "graphExpandedIntentEnabled",
|
|
39
|
+
// Issue #1566 Cluster C: mixed-operation flags.
|
|
40
|
+
rerank: "rerankEnabled",
|
|
41
|
+
harmonicRetrieval: "harmonicRetrievalEnabled",
|
|
42
|
+
parallelRetrieval: "parallelRetrievalEnabled",
|
|
33
43
|
};
|
|
34
44
|
|
|
35
45
|
const FIELDS = Object.keys(FIELD_TO_FLAG) as Array<keyof CapabilitySet>;
|
package/src/capabilities.ts
CHANGED
|
@@ -38,6 +38,8 @@ export interface CapabilitySet {
|
|
|
38
38
|
readonly recallDirectAnswer: boolean;
|
|
39
39
|
/** `recallMemoryWorthFilterEnabled` — Memory-Worth score reweighting. */
|
|
40
40
|
readonly recallMemoryWorthFilter: boolean;
|
|
41
|
+
/** `trustScoreEnabled` — unified TrustScore recall stage (issue #1577). */
|
|
42
|
+
readonly recallTrustScore: boolean;
|
|
41
43
|
/** `recallMmrEnabled` — maximal-marginal-relevance diversification. */
|
|
42
44
|
readonly recallMmr: boolean;
|
|
43
45
|
/** `recallReasoningTraceBoostEnabled` — boost reasoning-trace memories. */
|
|
@@ -54,6 +56,13 @@ export interface CapabilitySet {
|
|
|
54
56
|
readonly graphAssistInFullMode: boolean;
|
|
55
57
|
/** `graphExpandedIntentEnabled` — promote broad-intent asks to graph mode. */
|
|
56
58
|
readonly graphExpandedIntent: boolean;
|
|
59
|
+
// --- Issue #1566 Cluster C: mixed-operation flags (recall + summarizer/CLI/writes) ---
|
|
60
|
+
/** `rerankEnabled` — optional LLM reranking of recall candidates. */
|
|
61
|
+
readonly rerank: boolean;
|
|
62
|
+
/** `harmonicRetrievalEnabled` — abstraction-node harmonic retrieval tier. */
|
|
63
|
+
readonly harmonicRetrieval: boolean;
|
|
64
|
+
/** `parallelRetrievalEnabled` — three-agent parallel retrieval (DirectFact + Contextual + Temporal). */
|
|
65
|
+
readonly parallelRetrieval: boolean;
|
|
57
66
|
}
|
|
58
67
|
|
|
59
68
|
/**
|
|
@@ -72,6 +81,9 @@ export function resolveCapabilities(config: PluginConfig): CapabilitySet {
|
|
|
72
81
|
rerankCache: config.rerankCacheEnabled,
|
|
73
82
|
recallDirectAnswer: config.recallDirectAnswerEnabled,
|
|
74
83
|
recallMemoryWorthFilter: config.recallMemoryWorthFilterEnabled,
|
|
84
|
+
// Issue #1577: TrustScore subsumes the Memory Worth multiplier when on;
|
|
85
|
+
// the orchestrator runs exactly one of the two (mutual exclusion, rule 39).
|
|
86
|
+
recallTrustScore: config.trustScoreEnabled === true,
|
|
75
87
|
recallMmr: config.recallMmrEnabled,
|
|
76
88
|
recallReasoningTraceBoost: config.recallReasoningTraceBoostEnabled,
|
|
77
89
|
recallPlannerLlm: config.recallPlannerLlmEnabled,
|
|
@@ -82,6 +94,10 @@ export function resolveCapabilities(config: PluginConfig): CapabilitySet {
|
|
|
82
94
|
// migrated call sites used (`!== false` = default-on, `=== true` = default-off).
|
|
83
95
|
graphAssistInFullMode: config.graphAssistInFullModeEnabled !== false,
|
|
84
96
|
graphExpandedIntent: config.graphExpandedIntentEnabled === true,
|
|
97
|
+
// Issue #1566 Cluster C: mixed-operation flags resolved once per recall op.
|
|
98
|
+
rerank: config.rerankEnabled,
|
|
99
|
+
harmonicRetrieval: config.harmonicRetrievalEnabled,
|
|
100
|
+
parallelRetrieval: config.parallelRetrievalEnabled,
|
|
85
101
|
});
|
|
86
102
|
}
|
|
87
103
|
|
|
@@ -145,3 +161,45 @@ export function resolveGraphConstructionCapabilities(
|
|
|
145
161
|
graphWriteSessionAdjacency: config.graphWriteSessionAdjacencyEnabled !== false,
|
|
146
162
|
});
|
|
147
163
|
}
|
|
164
|
+
|
|
165
|
+
// ---------------------------------------------------------------------------
|
|
166
|
+
// Access-setup capability set (issue #1566 Cluster B).
|
|
167
|
+
//
|
|
168
|
+
// These two flags gate cross-namespace recall budgeting and anomaly-detection
|
|
169
|
+
// auditing. Resolved once at access-service handler entry (and the operator
|
|
170
|
+
// doctor check) rather than re-derived from raw config at each site.
|
|
171
|
+
// ---------------------------------------------------------------------------
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Frozen projection of access-setup feature gates (issue #1566 Cluster B).
|
|
175
|
+
*
|
|
176
|
+
* Every field is `readonly boolean`. Composition (including the default-off
|
|
177
|
+
* semantics for the optional `recallAuditAnomalyDetectionEnabled`) lives ONLY
|
|
178
|
+
* in {@link resolveAccessSetupCapabilities}.
|
|
179
|
+
*/
|
|
180
|
+
export interface AccessSetupCapabilitySet {
|
|
181
|
+
/** `recallCrossNamespaceBudgetEnabled` — rolling cross-namespace recall budget. */
|
|
182
|
+
readonly recallCrossNamespaceBudget: boolean;
|
|
183
|
+
/** `recallAuditAnomalyDetectionEnabled` — access-audit anomaly detection (default-off). */
|
|
184
|
+
readonly recallAuditAnomalyDetection: boolean;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Resolve the {@link AccessSetupCapabilitySet} from parsed config.
|
|
189
|
+
*
|
|
190
|
+
* Call this ONCE at access-service handler entry and thread the result down.
|
|
191
|
+
*/
|
|
192
|
+
export type AccessSetupConfigProjection = Pick<
|
|
193
|
+
PluginConfig,
|
|
194
|
+
"recallCrossNamespaceBudgetEnabled" | "recallAuditAnomalyDetectionEnabled"
|
|
195
|
+
>;
|
|
196
|
+
|
|
197
|
+
export function resolveAccessSetupCapabilities(
|
|
198
|
+
config: AccessSetupConfigProjection,
|
|
199
|
+
): AccessSetupCapabilitySet {
|
|
200
|
+
return Object.freeze({
|
|
201
|
+
recallCrossNamespaceBudget: config.recallCrossNamespaceBudgetEnabled,
|
|
202
|
+
// Optional/default-off flag: preserve `=== true` semantics.
|
|
203
|
+
recallAuditAnomalyDetection: config.recallAuditAnomalyDetectionEnabled === true,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
import type { Orchestrator } from "../orchestrator.js";
|
|
21
|
+
import { resolveCapabilities } from "../capabilities.js";
|
|
21
22
|
import type { CliCommand } from "../cli.js";
|
|
22
23
|
import type { UtilityTelemetryEvent } from "../utility-telemetry.js";
|
|
23
24
|
import {
|
|
@@ -42,6 +43,9 @@ export function registerResearchStatusCommands(
|
|
|
42
43
|
cmd: CliCommand,
|
|
43
44
|
orchestrator: Orchestrator,
|
|
44
45
|
): void {
|
|
46
|
+
// Resolve recall-operation gates once (#1566 Cluster C — harmonicRetrieval is a
|
|
47
|
+
// mixed-op flag read here on the CLI-search path as well as in recall).
|
|
48
|
+
const caps = resolveCapabilities(orchestrator.config);
|
|
45
49
|
cmd
|
|
46
50
|
.command("objective-state-status")
|
|
47
51
|
.description("Show objective-state store status, snapshot counts, and latest stored snapshot")
|
|
@@ -111,7 +115,7 @@ cmd
|
|
|
111
115
|
const status = await runAbstractionNodeStatusCliCommand({
|
|
112
116
|
memoryDir: orchestrator.config.memoryDir,
|
|
113
117
|
abstractionNodeStoreDir: orchestrator.config.abstractionNodeStoreDir,
|
|
114
|
-
harmonicRetrievalEnabled:
|
|
118
|
+
harmonicRetrievalEnabled: caps.harmonicRetrieval,
|
|
115
119
|
abstractionAnchorsEnabled: orchestrator.config.abstractionAnchorsEnabled,
|
|
116
120
|
});
|
|
117
121
|
console.log(JSON.stringify(status, null, 2));
|
|
@@ -125,7 +129,7 @@ cmd
|
|
|
125
129
|
const status = await runCueAnchorStatusCliCommand({
|
|
126
130
|
memoryDir: orchestrator.config.memoryDir,
|
|
127
131
|
abstractionNodeStoreDir: orchestrator.config.abstractionNodeStoreDir,
|
|
128
|
-
harmonicRetrievalEnabled:
|
|
132
|
+
harmonicRetrievalEnabled: caps.harmonicRetrieval,
|
|
129
133
|
abstractionAnchorsEnabled: orchestrator.config.abstractionAnchorsEnabled,
|
|
130
134
|
});
|
|
131
135
|
console.log(JSON.stringify(status, null, 2));
|
|
@@ -147,7 +151,7 @@ cmd
|
|
|
147
151
|
const results = await runHarmonicSearchCliCommand({
|
|
148
152
|
memoryDir: orchestrator.config.memoryDir,
|
|
149
153
|
abstractionNodeStoreDir: orchestrator.config.abstractionNodeStoreDir,
|
|
150
|
-
harmonicRetrievalEnabled:
|
|
154
|
+
harmonicRetrievalEnabled: caps.harmonicRetrieval,
|
|
151
155
|
abstractionAnchorsEnabled: orchestrator.config.abstractionAnchorsEnabled,
|
|
152
156
|
query,
|
|
153
157
|
maxResults: Number.isFinite(maxResults) ? maxResults : 3,
|
package/src/cli.ts
CHANGED
|
@@ -125,6 +125,7 @@ import {
|
|
|
125
125
|
validateEvalBenchmarkPack,
|
|
126
126
|
} from "./evals.js";
|
|
127
127
|
import { analyzeGraphHealth, type GraphHealthReport } from "./graph.js";
|
|
128
|
+
import { resolveGraphConstructionCapabilities } from "./capabilities.js";
|
|
128
129
|
import {
|
|
129
130
|
getCausalTrajectoryStoreStatus,
|
|
130
131
|
type CausalTrajectoryStoreStatus,
|
|
@@ -6360,11 +6361,12 @@ export function registerCli(
|
|
|
6360
6361
|
.option("--repair-guidance", "Include non-destructive repair guidance")
|
|
6361
6362
|
.action(async (...args: unknown[]) => {
|
|
6362
6363
|
const options = (args[0] ?? {}) as Record<string, unknown>;
|
|
6364
|
+
const graphCaps = resolveGraphConstructionCapabilities(orchestrator.config);
|
|
6363
6365
|
const report = await runGraphHealthCliCommand({
|
|
6364
6366
|
memoryDir: orchestrator.config.memoryDir,
|
|
6365
|
-
entityGraphEnabled:
|
|
6366
|
-
timeGraphEnabled:
|
|
6367
|
-
causalGraphEnabled:
|
|
6367
|
+
entityGraphEnabled: graphCaps.entityGraph,
|
|
6368
|
+
timeGraphEnabled: graphCaps.timeGraph,
|
|
6369
|
+
causalGraphEnabled: graphCaps.causalGraph,
|
|
6368
6370
|
includeRepairGuidance: options.repairGuidance === true,
|
|
6369
6371
|
});
|
|
6370
6372
|
console.log(JSON.stringify(report, null, 2));
|
|
@@ -6415,12 +6417,15 @@ export function registerCli(
|
|
|
6415
6417
|
.option("--json", "Emit machine-readable JSON only")
|
|
6416
6418
|
.action(async (...args: unknown[]) => {
|
|
6417
6419
|
const options = (args[0] ?? {}) as Record<string, unknown>;
|
|
6420
|
+
const repairGraphCaps = resolveGraphConstructionCapabilities(orchestrator.config);
|
|
6418
6421
|
const report = await runOperatorRepair({
|
|
6419
6422
|
config: {
|
|
6420
6423
|
memoryDir: orchestrator.config.memoryDir,
|
|
6421
|
-
entityGraphEnabled:
|
|
6422
|
-
timeGraphEnabled:
|
|
6423
|
-
causalGraphEnabled:
|
|
6424
|
+
entityGraphEnabled: repairGraphCaps.entityGraph,
|
|
6425
|
+
timeGraphEnabled: repairGraphCaps.timeGraph,
|
|
6426
|
+
causalGraphEnabled: repairGraphCaps.causalGraph,
|
|
6427
|
+
multiGraphMemoryEnabled: repairGraphCaps.multiGraphMemory,
|
|
6428
|
+
graphWriteSessionAdjacencyEnabled: repairGraphCaps.graphWriteSessionAdjacency,
|
|
6424
6429
|
},
|
|
6425
6430
|
apply: options.apply === true,
|
|
6426
6431
|
dryRun: options.dryRun === true,
|
package/src/config.ts
CHANGED
|
@@ -28,6 +28,7 @@ import type {
|
|
|
28
28
|
SlotBehaviorConfig,
|
|
29
29
|
SlotMismatchMode,
|
|
30
30
|
TriggerMode,
|
|
31
|
+
TrustWeights,
|
|
31
32
|
} from "./types.js";
|
|
32
33
|
import { log } from "./logger.js";
|
|
33
34
|
import { cloneDefaultSessionObserverBands } from "./session-observer-bands.js";
|
|
@@ -48,6 +49,7 @@ import { parseWearablesConfig } from "./wearables/config.js";
|
|
|
48
49
|
import { parseProvenanceConfig } from "./provenance.js";
|
|
49
50
|
import { parseCodingKnowledgeConfig } from "./coding/coding-knowledge-config.js";
|
|
50
51
|
import { parseChatConfig } from "./chat/chat-config.js";
|
|
52
|
+
import { parseCorrectionIntentConfig, parseFaithfulnessGateConfig } from "./faithfulness-config.js";
|
|
51
53
|
const DEFAULT_MEMORY_DIR = path.join(
|
|
52
54
|
resolveHomeDir(),
|
|
53
55
|
".openclaw",
|
|
@@ -2336,6 +2338,27 @@ export function parseConfig(
|
|
|
2336
2338
|
const n = coerceNumber(cfg.recallMemoryWorthHalfLifeMs);
|
|
2337
2339
|
return n !== undefined && n >= 0 ? n : 0;
|
|
2338
2340
|
})(),
|
|
2341
|
+
// Unified TrustScore recall stage (issue #1577). Default off: the stage
|
|
2342
|
+
// is absent and ranking is byte-identical to the pre-feature pipeline
|
|
2343
|
+
// (rule 39). Flip the master gate via #1574 ablation evidence only.
|
|
2344
|
+
trustScoreEnabled: coerceBool(cfg.trustScoreEnabled) ?? false,
|
|
2345
|
+
// Epistemic rendering ships behind its own gate so scoring can land first.
|
|
2346
|
+
trustScoreEpistemicRendering: coerceBool(cfg.trustScoreEpistemicRendering) ?? false,
|
|
2347
|
+
// Quarantine defaults on (only effective under the master gate); keeps
|
|
2348
|
+
// hard negatives out of injection but visible in X-ray (rule 34).
|
|
2349
|
+
trustScoreQuarantine: coerceBool(cfg.trustScoreQuarantine) ?? true,
|
|
2350
|
+
trustScoreMinMultiplier: (() => {
|
|
2351
|
+
const n = coerceNumber(cfg.trustScoreMinMultiplier);
|
|
2352
|
+
return n !== undefined && n >= 0 && n <= 1 ? n : 0.5;
|
|
2353
|
+
})(),
|
|
2354
|
+
trustScoreMaxMultiplier: (() => {
|
|
2355
|
+
const n = coerceNumber(cfg.trustScoreMaxMultiplier);
|
|
2356
|
+
return n !== undefined && n >= 1 && n <= 4 ? n : 1.25;
|
|
2357
|
+
})(),
|
|
2358
|
+
// Per-component weights. Accept a nested object from config; invalid
|
|
2359
|
+
// entries (non-finite, outside [0,1]) are dropped by resolveTrustWeights,
|
|
2360
|
+
// which falls back to the documented defaults (rule 51).
|
|
2361
|
+
trustScoreWeights: parseTrustScoreWeights(cfg.trustScoreWeights),
|
|
2339
2362
|
// Memory Linking (Phase 3A)
|
|
2340
2363
|
memoryLinkingEnabled: cfg.memoryLinkingEnabled === true, // Off by default initially
|
|
2341
2364
|
// Conversation Threading (Phase 3B)
|
|
@@ -2996,36 +3019,14 @@ export function parseConfig(
|
|
|
2996
3019
|
collectJudgeTrainingPairs: coerceBool(cfg.collectJudgeTrainingPairs) === true,
|
|
2997
3020
|
judgeTrainingDir:
|
|
2998
3021
|
typeof cfg.judgeTrainingDir === "string" ? cfg.judgeTrainingDir : "",
|
|
2999
|
-
// Extraction faithfulness gate (issue #1576)
|
|
3000
|
-
//
|
|
3001
|
-
// (
|
|
3002
|
-
//
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
const raw = typeof v === "string" ? v.trim().toLowerCase() : v;
|
|
3008
|
-
if (raw === "off" || raw === "shadow" || raw === "enforce") return raw;
|
|
3009
|
-
throw new Error(
|
|
3010
|
-
`extractionFaithfulnessGate must be one of "off" | "shadow" | "enforce" (got ${JSON.stringify(v)})`,
|
|
3011
|
-
);
|
|
3012
|
-
})(),
|
|
3013
|
-
extractionFaithfulnessModel:
|
|
3014
|
-
typeof cfg.extractionFaithfulnessModel === "string"
|
|
3015
|
-
? cfg.extractionFaithfulnessModel
|
|
3016
|
-
: "",
|
|
3017
|
-
// Issue #1634 (#1576 follow-up): strict-integer validation via
|
|
3018
|
-
// parseIntegerAtLeast — reject non-numeric, <=0, non-integer, NaN,
|
|
3019
|
-
// Infinity, booleans, objects (gotcha #51). Mirrors qmdDaemonTimeoutMs.
|
|
3020
|
-
// Valid CLI-string integers still coerce and clamp to the budget cap.
|
|
3021
|
-
extractionFaithfulnessContextChars: Math.min(
|
|
3022
|
-
parseIntegerAtLeast(cfg.extractionFaithfulnessContextChars, 400, 1, "extractionFaithfulnessContextChars"),
|
|
3023
|
-
4000,
|
|
3024
|
-
),
|
|
3025
|
-
extractionFaithfulnessTimeoutMs: Math.min(
|
|
3026
|
-
parseIntegerAtLeast(cfg.extractionFaithfulnessTimeoutMs, 8000, 1, "extractionFaithfulnessTimeoutMs"),
|
|
3027
|
-
60_000,
|
|
3028
|
-
),
|
|
3022
|
+
// Extraction faithfulness gate (issue #1576) + model-lab pointer
|
|
3023
|
+
// `extractionFaithfulnessBaseUrl` (issue #1585), and the correction-intent
|
|
3024
|
+
// model-lab pointer (issue #1581 / #1585). Parsed in faithfulness-config.ts
|
|
3025
|
+
// (extracted from this god file so the block can grow without tripping the
|
|
3026
|
+
// ratchet). Defaults preserve the byte-identical pre-feature pipeline
|
|
3027
|
+
// (rule 39); invalid values reject (rule 51 / #1634).
|
|
3028
|
+
...parseFaithfulnessGateConfig(cfg),
|
|
3029
|
+
...parseCorrectionIntentConfig(cfg),
|
|
3029
3030
|
// Inline source attribution (issue #369). Opt-in to preserve
|
|
3030
3031
|
// backwards compatibility with existing downstream consumers.
|
|
3031
3032
|
inlineSourceAttributionEnabled: cfg.inlineSourceAttributionEnabled === true,
|
|
@@ -4639,3 +4640,32 @@ function buildRecallPipelineConfig(cfg: Record<string, unknown>): RecallPipeline
|
|
|
4639
4640
|
|
|
4640
4641
|
return { recallBudgetChars, pipeline };
|
|
4641
4642
|
}
|
|
4643
|
+
|
|
4644
|
+
/**
|
|
4645
|
+
* Parse the `trustScoreWeights` config value into a {@link TrustWeights}
|
|
4646
|
+
* object. Accepts a plain object of per-component numbers; non-finite or
|
|
4647
|
+
* out-of-`[0,1]` entries are dropped (the scorer falls back to defaults via
|
|
4648
|
+
* `resolveTrustWeights`). A non-object value yields `{}` → all defaults.
|
|
4649
|
+
* Rule 51: invalid weight rejected, never silently clamped to an extreme.
|
|
4650
|
+
*/
|
|
4651
|
+
function parseTrustScoreWeights(value: unknown): TrustWeights {
|
|
4652
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
4653
|
+
const src = value as Record<string, unknown>;
|
|
4654
|
+
const out: TrustWeights = {};
|
|
4655
|
+
const keys: Array<keyof TrustWeights> = [
|
|
4656
|
+
"memoryWorth",
|
|
4657
|
+
"provenance",
|
|
4658
|
+
"faithfulness",
|
|
4659
|
+
"corroboration",
|
|
4660
|
+
"contradiction",
|
|
4661
|
+
"domainCalibration",
|
|
4662
|
+
"feedback",
|
|
4663
|
+
"recency",
|
|
4664
|
+
];
|
|
4665
|
+
for (const key of keys) {
|
|
4666
|
+
const raw = src[key as string];
|
|
4667
|
+
if (typeof raw !== "number" || !Number.isFinite(raw) || raw < 0 || raw > 1) continue;
|
|
4668
|
+
(out as Record<string, number>)[key as string] = raw;
|
|
4669
|
+
}
|
|
4670
|
+
return out;
|
|
4671
|
+
}
|
|
@@ -1254,3 +1254,178 @@ test("parseFaithfulnessResponse: object-wrapped arrays unwrap (results/verdicts/
|
|
|
1254
1254
|
// A wrapper object with no recognized array key still returns null (no over-match).
|
|
1255
1255
|
assert.equal(parseFaithfulnessResponse('{"data": {"nested": []}}', 1), null);
|
|
1256
1256
|
});
|
|
1257
|
+
|
|
1258
|
+
// ---------------------------------------------------------------------------
|
|
1259
|
+
// Issue #1585 model-lab pointer: local fine-tuned endpoint path
|
|
1260
|
+
// ---------------------------------------------------------------------------
|
|
1261
|
+
|
|
1262
|
+
/**
|
|
1263
|
+
* Build a fake fetch that responds for a specific base URL with a canned
|
|
1264
|
+
* openai-compatible chat-completions body. Records the request body so tests
|
|
1265
|
+
* can assert the gate routed to the local model.
|
|
1266
|
+
*/
|
|
1267
|
+
function fakeFetchFor(
|
|
1268
|
+
baseUrl: string,
|
|
1269
|
+
responder: (body: Record<string, unknown>) => unknown,
|
|
1270
|
+
): { fetch: typeof fetch; requests: Array<{ url: string; body: Record<string, unknown> }> } {
|
|
1271
|
+
const requests: Array<{ url: string; body: Record<string, unknown> }> = [];
|
|
1272
|
+
const fake = ((url: string, init: RequestInit) => {
|
|
1273
|
+
requests.push({ url, body: JSON.parse(String(init.body)) });
|
|
1274
|
+
const body = JSON.parse(String(init.body));
|
|
1275
|
+
const payload = responder(body);
|
|
1276
|
+
return Promise.resolve(
|
|
1277
|
+
new Response(JSON.stringify(payload), {
|
|
1278
|
+
status: 200,
|
|
1279
|
+
headers: { "content-type": "application/json" },
|
|
1280
|
+
}),
|
|
1281
|
+
);
|
|
1282
|
+
}) as typeof fetch;
|
|
1283
|
+
return { fetch: fake, requests };
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
test("checkFaithfulnessBatch: local model-lab endpoint is tried first when configured (#1585)", async () => {
|
|
1287
|
+
const inputs = [{ factText: "Fact", quote: "Quote" }];
|
|
1288
|
+
const config = parseConfig({
|
|
1289
|
+
extractionFaithfulnessModel: "remnic-faithfulness-gate-v1",
|
|
1290
|
+
extractionFaithfulnessBaseUrl: "http://localhost:11434/v1",
|
|
1291
|
+
extractionFaithfulnessTimeoutMs: 5000,
|
|
1292
|
+
});
|
|
1293
|
+
const fallbackCalls: Array<{ messages: unknown; options: unknown }> = [];
|
|
1294
|
+
const { fetch: fakeFetch, requests } = fakeFetchFor("http://localhost:11434/v1", (body) => ({
|
|
1295
|
+
model: body.model,
|
|
1296
|
+
choices: [{ message: { content: JSON.stringify([{ index: 0, verdict: "contradicted" }]) } }],
|
|
1297
|
+
}));
|
|
1298
|
+
const result = await checkFaithfulnessBatch(
|
|
1299
|
+
inputs,
|
|
1300
|
+
config,
|
|
1301
|
+
null,
|
|
1302
|
+
stubFallbackLlm("[]", fallbackCalls),
|
|
1303
|
+
fakeFetch,
|
|
1304
|
+
);
|
|
1305
|
+
assert.equal(requests.length, 1, "local model-lab endpoint must be called");
|
|
1306
|
+
assert.equal(requests[0]?.url, "http://localhost:11434/v1/chat/completions");
|
|
1307
|
+
assert.equal(requests[0]?.body.model, "remnic-faithfulness-gate-v1");
|
|
1308
|
+
assert.equal(fallbackCalls.length, 0, "gateway fallback must NOT run when the local endpoint succeeds");
|
|
1309
|
+
assert.equal(result.results[0]?.ok, true);
|
|
1310
|
+
if (result.results[0]?.ok) {
|
|
1311
|
+
assert.equal(result.results[0].verdict, "contradicted", "local model verdict is used");
|
|
1312
|
+
assert.equal(result.results[0].model, "remnic-faithfulness-gate-v1");
|
|
1313
|
+
}
|
|
1314
|
+
});
|
|
1315
|
+
|
|
1316
|
+
test("checkFaithfulnessBatch: local endpoint failure falls back to the configured chain (#1585 graceful)", async () => {
|
|
1317
|
+
const inputs = [{ factText: "Fact", quote: "Quote" }];
|
|
1318
|
+
const config = parseConfig({
|
|
1319
|
+
extractionFaithfulnessModel: "remnic-faithfulness-gate-v1",
|
|
1320
|
+
extractionFaithfulnessBaseUrl: "http://localhost:11434/v1",
|
|
1321
|
+
extractionFaithfulnessTimeoutMs: 5000,
|
|
1322
|
+
});
|
|
1323
|
+
const fallbackCalls: Array<{ messages: unknown; options: unknown }> = [];
|
|
1324
|
+
// Local endpoint returns 500 → caller returns null → gate falls through to fallback.
|
|
1325
|
+
const failingFetch = (() =>
|
|
1326
|
+
Promise.resolve(new Response("err", { status: 500 }))) as unknown as typeof fetch;
|
|
1327
|
+
const result = await checkFaithfulnessBatch(
|
|
1328
|
+
inputs,
|
|
1329
|
+
config,
|
|
1330
|
+
null,
|
|
1331
|
+
stubFallbackLlm(JSON.stringify([{ index: 0, verdict: "entailed" }]), fallbackCalls),
|
|
1332
|
+
failingFetch,
|
|
1333
|
+
);
|
|
1334
|
+
assert.equal(fallbackCalls.length, 1, "must fall back to the configured chain on local-endpoint failure");
|
|
1335
|
+
assert.equal(result.results[0]?.ok, true);
|
|
1336
|
+
if (result.results[0]?.ok) {
|
|
1337
|
+
assert.equal(result.results[0].verdict, "entailed", "fallback chain verdict is used");
|
|
1338
|
+
}
|
|
1339
|
+
});
|
|
1340
|
+
|
|
1341
|
+
test("checkFaithfulnessBatch: a wedged local endpoint falls back to the chain BEFORE the batch timeout (codex P2 — probe budget)", async () => {
|
|
1342
|
+
// The local probe must use a SMALLER budget than the outer batch timeout so a
|
|
1343
|
+
// hanging endpoint returns null and the configured chain runs before the batch
|
|
1344
|
+
// timer fires. extractionFaithfulnessTimeoutMs: 1000 → probe budget = 500ms.
|
|
1345
|
+
const inputs = [{ factText: "Fact", quote: "Quote" }];
|
|
1346
|
+
const config = parseConfig({
|
|
1347
|
+
extractionFaithfulnessModel: "remnic-faithfulness-gate-v1",
|
|
1348
|
+
extractionFaithfulnessBaseUrl: "http://localhost:11434/v1",
|
|
1349
|
+
extractionFaithfulnessTimeoutMs: 1000,
|
|
1350
|
+
});
|
|
1351
|
+
const fallbackCalls: Array<{ messages: unknown; options: unknown }> = [];
|
|
1352
|
+
// A fetch that hangs forever on its own but HONORS the probe's AbortSignal —
|
|
1353
|
+
// the probe's controller aborts it at 500ms (half the batch budget), the call
|
|
1354
|
+
// returns null, and the gate falls through to the configured chain.
|
|
1355
|
+
const wedgedFetch = ((_url: string, init: RequestInit) =>
|
|
1356
|
+
new Promise<Response>((_resolve, reject) => {
|
|
1357
|
+
const sig = init.signal;
|
|
1358
|
+
if (!sig) return;
|
|
1359
|
+
if (sig.aborted) reject(new Error("aborted"));
|
|
1360
|
+
else sig.addEventListener("abort", () => reject(new Error("aborted")), { once: true });
|
|
1361
|
+
})) as unknown as typeof fetch;
|
|
1362
|
+
const result = await checkFaithfulnessBatch(
|
|
1363
|
+
inputs,
|
|
1364
|
+
config,
|
|
1365
|
+
null,
|
|
1366
|
+
stubFallbackLlm(JSON.stringify([{ index: 0, verdict: "entailed" }]), fallbackCalls),
|
|
1367
|
+
wedgedFetch,
|
|
1368
|
+
);
|
|
1369
|
+
assert.equal(
|
|
1370
|
+
fallbackCalls.length,
|
|
1371
|
+
1,
|
|
1372
|
+
"a wedged local probe must reach the configured chain before the batch budget elapses",
|
|
1373
|
+
);
|
|
1374
|
+
assert.equal(result.results[0]?.ok, true);
|
|
1375
|
+
if (result.results[0]?.ok) {
|
|
1376
|
+
assert.equal(result.results[0].verdict, "entailed", "fallback chain verdict is used");
|
|
1377
|
+
}
|
|
1378
|
+
});
|
|
1379
|
+
|
|
1380
|
+
test("checkFaithfulnessBatch: no local endpoint pointer → byte-identical routing (regression guard)", async () => {
|
|
1381
|
+
// Default config (no baseUrl) must never attempt a local-endpoint fetch.
|
|
1382
|
+
const inputs = [{ factText: "Fact", quote: "Quote" }];
|
|
1383
|
+
const config = baseConfig();
|
|
1384
|
+
let fetchCalled = false;
|
|
1385
|
+
const spyFetch = (() => {
|
|
1386
|
+
fetchCalled = true;
|
|
1387
|
+
return Promise.resolve(new Response("{}", { status: 200 }));
|
|
1388
|
+
}) as unknown as typeof fetch;
|
|
1389
|
+
await checkFaithfulnessBatch(
|
|
1390
|
+
inputs,
|
|
1391
|
+
config,
|
|
1392
|
+
null,
|
|
1393
|
+
stubFallbackLlm(JSON.stringify([{ index: 0, verdict: "entailed" }])),
|
|
1394
|
+
spyFetch,
|
|
1395
|
+
);
|
|
1396
|
+
assert.equal(fetchCalled, false, "no local-endpoint fetch when pointer is unset");
|
|
1397
|
+
});
|
|
1398
|
+
|
|
1399
|
+
|
|
1400
|
+
test("checkFaithfulnessBatch: local-endpoint failure does NOT leak the local model name into the fallback chain (codex P2 PRRT_kwDORJXyws6Otp-L)", async () => {
|
|
1401
|
+
// extractionFaithfulnessModel is the LOCAL served model's name. When the
|
|
1402
|
+
// local endpoint is configured but fails, that name must NOT be forwarded to
|
|
1403
|
+
// the gateway/fallback as options.model — otherwise the configured chain is
|
|
1404
|
+
// forced onto an unavailable local-only model and a local outage becomes
|
|
1405
|
+
// backend_unavailable instead of graceful fallback to the configured chain.
|
|
1406
|
+
const inputs = [{ factText: "Fact", quote: "Quote" }];
|
|
1407
|
+
const config = parseConfig({
|
|
1408
|
+
extractionFaithfulnessModel: "remnic-faithfulness-gate-v1",
|
|
1409
|
+
extractionFaithfulnessBaseUrl: "http://localhost:11434/v1",
|
|
1410
|
+
extractionFaithfulnessTimeoutMs: 5000,
|
|
1411
|
+
});
|
|
1412
|
+
const fallbackCalls: Array<{ messages: unknown; options: unknown }> = [];
|
|
1413
|
+
// Local endpoint returns 500 -> caller returns null -> gate falls through.
|
|
1414
|
+
const failingFetch = (() =>
|
|
1415
|
+
Promise.resolve(new Response("err", { status: 500 }))) as unknown as typeof fetch;
|
|
1416
|
+
const result = await checkFaithfulnessBatch(
|
|
1417
|
+
inputs,
|
|
1418
|
+
config,
|
|
1419
|
+
null,
|
|
1420
|
+
stubFallbackLlm(JSON.stringify([{ index: 0, verdict: "entailed" }]), fallbackCalls),
|
|
1421
|
+
failingFetch,
|
|
1422
|
+
);
|
|
1423
|
+
assert.equal(fallbackCalls.length, 1, "fallback chain must run on local-endpoint failure");
|
|
1424
|
+
const opts = fallbackCalls[0]?.options as Record<string, unknown>;
|
|
1425
|
+
assert.equal(
|
|
1426
|
+
opts?.model,
|
|
1427
|
+
undefined,
|
|
1428
|
+
"local-only model name must NOT leak into the fallback chain on endpoint failure",
|
|
1429
|
+
);
|
|
1430
|
+
assert.equal(result.results[0]?.ok, true);
|
|
1431
|
+
});
|