@remnic/core 9.3.726 → 9.3.728
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 +5 -5
- package/dist/access-boundary.js +22 -22
- package/dist/access-cli.js +45 -45
- package/dist/access-http.d.ts +20 -5
- package/dist/access-http.js +27 -27
- package/dist/access-mcp.d.ts +5 -5
- package/dist/access-mcp.js +26 -26
- package/dist/access-operations-batch.js +23 -23
- package/dist/access-operations.d.ts +6 -6
- package/dist/access-operations.js +25 -25
- package/dist/access-schema.d.ts +4 -4
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-B2PlPtxh.d.ts → access-service-Bgpjxo4f.d.ts} +36 -4
- package/dist/access-service.d.ts +5 -5
- package/dist/access-service.js +21 -21
- package/dist/access-surface-catalog.d.ts +5 -5
- 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 +3 -3
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +4 -4
- package/dist/briefing.d.ts +1 -1
- package/dist/briefing.js +7 -7
- 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/capabilities.d.ts +44 -2
- package/dist/capabilities.js +5 -3
- package/dist/{capsule-crypto-GWVG7LGC.js → capsule-crypto-7FJQINUR.js} +2 -2
- package/dist/{catalog-CzUb-GyD.d.ts → catalog-bMczlO2G.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +8 -8
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-OWHERGF2.js → chunk-2NLLXCJG.js} +2 -2
- package/dist/{chunk-BIA7ELIB.js → chunk-36SEDFAU.js} +3 -3
- package/dist/{chunk-UQSVUEN2.js → chunk-37436GML.js} +2 -2
- package/dist/{chunk-DVRHLN2O.js → chunk-3RCBIOOJ.js} +18 -2
- package/dist/{chunk-DVRHLN2O.js.map → chunk-3RCBIOOJ.js.map} +1 -1
- package/dist/{chunk-RRHHQYJS.js → chunk-3TSTGI6F.js} +2 -2
- package/dist/{chunk-5OOA7SGX.js → chunk-4ESAR77N.js} +2 -2
- package/dist/{chunk-FO3HO52S.js → chunk-4H4F3BFL.js} +2 -2
- package/dist/{chunk-BEUCACTV.js → chunk-4NOI577P.js} +2 -2
- package/dist/{chunk-BBIE7W52.js → chunk-4NR2PDZ5.js} +2 -2
- package/dist/{chunk-WGTWGDR5.js → chunk-76NHR6ZL.js} +5 -5
- package/dist/{chunk-PKMQK2WY.js → chunk-773DPI6T.js} +4 -4
- package/dist/{chunk-MQVKHFIU.js → chunk-7RLCCNHU.js} +8 -8
- package/dist/{chunk-XGTBNVIU.js → chunk-AAD2ZS6P.js} +11 -1
- package/dist/chunk-AAD2ZS6P.js.map +1 -0
- package/dist/{chunk-EZNDNMRH.js → chunk-AQLOP5F4.js} +2 -2
- package/dist/{chunk-UNNDFYUX.js → chunk-ARV3AUOM.js} +5 -5
- package/dist/{chunk-NPL7VDM6.js → chunk-ASKXIAHD.js} +2 -2
- package/dist/{chunk-TQQH2FTX.js → chunk-BQCHEV7O.js} +106 -15
- package/dist/{chunk-TQQH2FTX.js.map → chunk-BQCHEV7O.js.map} +1 -1
- package/dist/{chunk-ZA2S2VLL.js → chunk-C2PG7IEH.js} +5 -2
- package/dist/chunk-C2PG7IEH.js.map +1 -0
- package/dist/{chunk-K4ZNARDO.js → chunk-CBWI22JN.js} +2 -2
- package/dist/{chunk-ZOHMPFOB.js → chunk-CKFLLAIS.js} +3 -3
- package/dist/{chunk-JPUT5NGH.js → chunk-DMQWV6SQ.js} +2 -2
- package/dist/{chunk-F3XZN24Z.js → chunk-DRUDC2UX.js} +2 -2
- package/dist/{chunk-KJR66XOM.js → chunk-EY6MDMHK.js} +2 -2
- package/dist/{chunk-3TUT4PWB.js → chunk-FVZ2ISIX.js} +2 -2
- package/dist/{chunk-C4X4QGIO.js → chunk-G6NKALRN.js} +5 -2
- package/dist/chunk-G6NKALRN.js.map +1 -0
- package/dist/{chunk-6SQQOJ4U.js → chunk-GKRLPHPU.js} +2 -2
- package/dist/{chunk-PLG6JHQS.js → chunk-H5BWGCRZ.js} +43 -42
- package/dist/chunk-H5BWGCRZ.js.map +1 -0
- package/dist/{chunk-2NBP25BG.js → chunk-HGNOCPZX.js} +171 -79
- package/dist/chunk-HGNOCPZX.js.map +1 -0
- package/dist/{chunk-5NWYQUQC.js → chunk-HOHVIVDR.js} +2 -2
- package/dist/{chunk-DCKNMLEQ.js → chunk-I5REUWLH.js} +11 -5
- package/dist/chunk-I5REUWLH.js.map +1 -0
- package/dist/{chunk-6WAJQKBS.js → chunk-JYLFZWUX.js} +2 -2
- package/dist/{chunk-5W7CTZ2E.js → chunk-KQAFEZQX.js} +4 -4
- package/dist/{chunk-UKTDXTWX.js → chunk-M4AYVEWS.js} +7 -7
- package/dist/{chunk-YTZ3VGC7.js → chunk-M4V2JVSZ.js} +2 -2
- package/dist/{chunk-TA3Y6GEX.js → chunk-MLKWJOAJ.js} +2 -2
- package/dist/{chunk-DQXPJ6HD.js → chunk-O6YH5F47.js} +4 -4
- package/dist/{chunk-7AG54AF3.js → chunk-PUR2CKX2.js} +1 -1
- package/dist/chunk-PUR2CKX2.js.map +1 -0
- package/dist/{chunk-OAHOL3ZC.js → chunk-QNEUZIAH.js} +152 -62
- package/dist/chunk-QNEUZIAH.js.map +1 -0
- package/dist/{chunk-Q6D75LVH.js → chunk-UM5AWJNQ.js} +79 -17
- package/dist/chunk-UM5AWJNQ.js.map +1 -0
- package/dist/{chunk-53EEQYE5.js → chunk-UTHQPSRC.js} +8 -8
- package/dist/{chunk-BB57OZWC.js → chunk-UVPL565C.js} +2 -2
- package/dist/{chunk-6AFVIOVZ.js → chunk-V4GNSDFH.js} +2 -2
- package/dist/{chunk-EHISUJFN.js → chunk-WAS3NV46.js} +6 -3
- package/dist/chunk-WAS3NV46.js.map +1 -0
- package/dist/{chunk-UVYI6VIX.js → chunk-X7Y7WX73.js} +1 -1
- package/dist/{chunk-V7CMKMHM.js → chunk-Y4YD5TYW.js} +3 -3
- package/dist/{chunk-7NS7AWMZ.js → chunk-YGIQORJ3.js} +3 -3
- package/dist/{chunk-MDBZTH7N.js → chunk-YKBHOBJK.js} +44 -10
- package/dist/chunk-YKBHOBJK.js.map +1 -0
- package/dist/{chunk-3MS3QVX6.js → chunk-YOLZS7NY.js} +2 -2
- package/dist/{chunk-6OIDDKAA.js → chunk-YTU7WKYN.js} +35 -9
- package/dist/chunk-YTU7WKYN.js.map +1 -0
- package/dist/{cli-IOlDHSBT.d.ts → cli-BLME420h.d.ts} +3 -3
- package/dist/cli.d.ts +6 -6
- package/dist/cli.js +49 -49
- package/dist/compat/codex-cli-fallback.d.ts +1 -0
- package/dist/compat/codex-cli-fallback.js +22 -0
- package/dist/compat/codex-cli-fallback.js.map +1 -0
- package/dist/compat/codex-thread-key.d.ts +1 -0
- package/dist/compat/codex-thread-key.js +18 -0
- package/dist/compat/codex-thread-key.js.map +1 -0
- package/dist/compounding/engine.d.ts +1 -1
- package/dist/compounding/engine.js +7 -7
- 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 +3 -3
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +7 -7
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +7 -7
- 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/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/embedding-fallback.js +2 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +1 -1
- package/dist/entity-retrieval.js +7 -7
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +4 -4
- package/dist/extraction-faithfulness.d.ts +1 -1
- package/dist/extraction-faithfulness.js +2 -2
- 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.d.ts +1 -1
- package/dist/extraction.js +3 -2
- package/dist/faithfulness-config.d.ts +1 -0
- package/dist/faithfulness-config.js +1 -1
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/{first-start-migration-PG5HBC3K.js → first-start-migration-22LPFHD5.js} +6 -2
- package/dist/first-start-migration-22LPFHD5.js.map +1 -0
- package/dist/graph-dashboard-diff.d.ts +1 -1
- package/dist/graph-dashboard-key.d.ts +1 -1
- package/dist/graph-dashboard-parser.d.ts +1 -1
- package/dist/graph-edge-reinforcement.d.ts +1 -1
- package/dist/graph-snapshot.d.ts +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/identity-continuity.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +64 -64
- 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 +7 -7
- 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 +9 -4
- package/dist/local-model-endpoint.js +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +7 -7
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +7 -7
- package/dist/maintenance/rebuild-memory-projection.js +8 -8
- package/dist/mcp-memory-inspector-app.d.ts +5 -5
- 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 +14 -13
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +6 -5
- package/dist/namespaces/storage.d.ts +2 -2
- package/dist/namespaces/storage.js +7 -7
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +1 -1
- package/dist/operator-toolkit.js +20 -20
- package/dist/orchestration/maintenance.d.ts +2 -2
- package/dist/orchestration/maintenance.js +9 -9
- package/dist/{orchestrator-C_OMSIMZ.d.ts → orchestrator-DqPAz8ot.d.ts} +3 -3
- package/dist/orchestrator.d.ts +4 -4
- package/dist/orchestrator.js +33 -33
- 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 +1 -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-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 +1 -1
- package/dist/recall-xray.js +2 -2
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/resume-bundles.js +4 -4
- 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/embed-helper.js +2 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +5 -4
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +9 -8
- 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-B8LiYtvx.d.ts → semantic-consolidation-Cl15ksZy.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +8 -8
- package/dist/semantic-rule-promotion.js +7 -7
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +7 -7
- 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 +1 -1
- package/dist/storage.js +6 -6
- package/dist/summarizer.d.ts +1 -1
- 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 +2 -2
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-DmTaqob2.d.ts → types-ChQb9D6s.d.ts} +8 -0
- 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 +7 -7
- package/package.json +26 -2
- package/src/access-http.ts +68 -1
- package/src/access-service.ts +2 -1
- package/src/admin/admin-surfaces.test.ts +289 -0
- package/src/admin/admin-surfaces.ts +138 -7
- package/src/bitemporal-dedup-backfill.test.ts +294 -0
- package/src/capabilities.test.ts +155 -0
- package/src/capabilities.ts +91 -0
- package/src/chat/chat-engine.test.ts +104 -1
- package/src/chat/chat-http.test.ts +119 -1
- package/src/chat/chat-http.ts +252 -97
- package/src/chat/chat-session.ts +166 -7
- package/src/cli.ts +3 -2
- package/src/compat/codex-cli-fallback.ts +23 -0
- package/src/compat/codex-subpath-aliases.test.ts +93 -0
- package/src/compat/codex-thread-key.ts +23 -0
- package/src/embedding-fallback.ts +2 -1
- package/src/extraction-faithfulness.test.ts +240 -0
- package/src/extraction-faithfulness.ts +58 -6
- package/src/extraction.ts +7 -3
- package/src/faithfulness-config.ts +16 -1
- package/src/local-model-endpoint.ts +24 -3
- package/src/maintenance/first-start-migration.ts +3 -1
- package/src/orchestrator.ts +238 -34
- package/src/provenance-extraction.test.ts +266 -0
- package/src/provenance.ts +66 -16
- package/src/search/embed-helper.ts +3 -2
- package/src/types.ts +8 -0
- package/dist/chunk-2NBP25BG.js.map +0 -1
- package/dist/chunk-6OIDDKAA.js.map +0 -1
- package/dist/chunk-7AG54AF3.js.map +0 -1
- package/dist/chunk-C4X4QGIO.js.map +0 -1
- package/dist/chunk-DCKNMLEQ.js.map +0 -1
- package/dist/chunk-EHISUJFN.js.map +0 -1
- package/dist/chunk-MDBZTH7N.js.map +0 -1
- package/dist/chunk-OAHOL3ZC.js.map +0 -1
- package/dist/chunk-PLG6JHQS.js.map +0 -1
- package/dist/chunk-Q6D75LVH.js.map +0 -1
- package/dist/chunk-XGTBNVIU.js.map +0 -1
- package/dist/chunk-ZA2S2VLL.js.map +0 -1
- package/dist/first-start-migration-PG5HBC3K.js.map +0 -1
- /package/dist/{capsule-crypto-GWVG7LGC.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
- /package/dist/{chunk-OWHERGF2.js.map → chunk-2NLLXCJG.js.map} +0 -0
- /package/dist/{chunk-BIA7ELIB.js.map → chunk-36SEDFAU.js.map} +0 -0
- /package/dist/{chunk-UQSVUEN2.js.map → chunk-37436GML.js.map} +0 -0
- /package/dist/{chunk-RRHHQYJS.js.map → chunk-3TSTGI6F.js.map} +0 -0
- /package/dist/{chunk-5OOA7SGX.js.map → chunk-4ESAR77N.js.map} +0 -0
- /package/dist/{chunk-FO3HO52S.js.map → chunk-4H4F3BFL.js.map} +0 -0
- /package/dist/{chunk-BEUCACTV.js.map → chunk-4NOI577P.js.map} +0 -0
- /package/dist/{chunk-BBIE7W52.js.map → chunk-4NR2PDZ5.js.map} +0 -0
- /package/dist/{chunk-WGTWGDR5.js.map → chunk-76NHR6ZL.js.map} +0 -0
- /package/dist/{chunk-PKMQK2WY.js.map → chunk-773DPI6T.js.map} +0 -0
- /package/dist/{chunk-MQVKHFIU.js.map → chunk-7RLCCNHU.js.map} +0 -0
- /package/dist/{chunk-EZNDNMRH.js.map → chunk-AQLOP5F4.js.map} +0 -0
- /package/dist/{chunk-UNNDFYUX.js.map → chunk-ARV3AUOM.js.map} +0 -0
- /package/dist/{chunk-NPL7VDM6.js.map → chunk-ASKXIAHD.js.map} +0 -0
- /package/dist/{chunk-K4ZNARDO.js.map → chunk-CBWI22JN.js.map} +0 -0
- /package/dist/{chunk-ZOHMPFOB.js.map → chunk-CKFLLAIS.js.map} +0 -0
- /package/dist/{chunk-JPUT5NGH.js.map → chunk-DMQWV6SQ.js.map} +0 -0
- /package/dist/{chunk-F3XZN24Z.js.map → chunk-DRUDC2UX.js.map} +0 -0
- /package/dist/{chunk-KJR66XOM.js.map → chunk-EY6MDMHK.js.map} +0 -0
- /package/dist/{chunk-3TUT4PWB.js.map → chunk-FVZ2ISIX.js.map} +0 -0
- /package/dist/{chunk-6SQQOJ4U.js.map → chunk-GKRLPHPU.js.map} +0 -0
- /package/dist/{chunk-5NWYQUQC.js.map → chunk-HOHVIVDR.js.map} +0 -0
- /package/dist/{chunk-6WAJQKBS.js.map → chunk-JYLFZWUX.js.map} +0 -0
- /package/dist/{chunk-5W7CTZ2E.js.map → chunk-KQAFEZQX.js.map} +0 -0
- /package/dist/{chunk-UKTDXTWX.js.map → chunk-M4AYVEWS.js.map} +0 -0
- /package/dist/{chunk-YTZ3VGC7.js.map → chunk-M4V2JVSZ.js.map} +0 -0
- /package/dist/{chunk-TA3Y6GEX.js.map → chunk-MLKWJOAJ.js.map} +0 -0
- /package/dist/{chunk-DQXPJ6HD.js.map → chunk-O6YH5F47.js.map} +0 -0
- /package/dist/{chunk-53EEQYE5.js.map → chunk-UTHQPSRC.js.map} +0 -0
- /package/dist/{chunk-BB57OZWC.js.map → chunk-UVPL565C.js.map} +0 -0
- /package/dist/{chunk-6AFVIOVZ.js.map → chunk-V4GNSDFH.js.map} +0 -0
- /package/dist/{chunk-UVYI6VIX.js.map → chunk-X7Y7WX73.js.map} +0 -0
- /package/dist/{chunk-V7CMKMHM.js.map → chunk-Y4YD5TYW.js.map} +0 -0
- /package/dist/{chunk-7NS7AWMZ.js.map → chunk-YGIQORJ3.js.map} +0 -0
- /package/dist/{chunk-3MS3QVX6.js.map → chunk-YOLZS7NY.js.map} +0 -0
|
@@ -220,6 +220,27 @@ export function parseFaithfulnessResponse(
|
|
|
220
220
|
return null;
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
/**
|
|
224
|
+
* True when `map` contains an entry for every integer index in
|
|
225
|
+
* [0, expectedCount). The local parse-fallback gate uses this to accept a
|
|
226
|
+
* local model-lab response only when it is COMPLETE: size alone is
|
|
227
|
+
* insufficient because a malformed response with duplicate/fractional indexes
|
|
228
|
+
* can yield expectedCount distinct map keys without covering index 0..N-1
|
|
229
|
+
* (codex P2 PRRT_kwDORJXyws6O7PfY). parseEntries now rejects non-integer
|
|
230
|
+
* indexes so the two checks agree, but the explicit coverage loop documents
|
|
231
|
+
* the invariant and stays robust to any future parser relaxation.
|
|
232
|
+
*/
|
|
233
|
+
function coversAllIndexes(
|
|
234
|
+
map: Map<number, ParsedFaithfulnessEntry>,
|
|
235
|
+
expectedCount: number,
|
|
236
|
+
): boolean {
|
|
237
|
+
if (map.size < expectedCount) return false;
|
|
238
|
+
for (let i = 0; i < expectedCount; i++) {
|
|
239
|
+
if (!map.has(i)) return false;
|
|
240
|
+
}
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
|
|
223
244
|
function parseEntries(
|
|
224
245
|
data: unknown,
|
|
225
246
|
expectedCount: number,
|
|
@@ -243,7 +264,7 @@ function parseEntries(
|
|
|
243
264
|
if (!entry || typeof entry !== "object") continue;
|
|
244
265
|
const obj = entry as Record<string, unknown>;
|
|
245
266
|
const idx = typeof obj.index === "number" ? obj.index : undefined;
|
|
246
|
-
if (idx === undefined || idx < 0 || idx >= expectedCount) continue;
|
|
267
|
+
if (idx === undefined || !Number.isInteger(idx) || idx < 0 || idx >= expectedCount) continue;
|
|
247
268
|
const verdictRaw = typeof obj.verdict === "string" ? obj.verdict : undefined;
|
|
248
269
|
if (!verdictRaw || !VALID_VERDICTS.has(verdictRaw)) continue;
|
|
249
270
|
const rationale =
|
|
@@ -279,6 +300,7 @@ interface LlmCallResult {
|
|
|
279
300
|
async function callFaithfulnessLlm(
|
|
280
301
|
systemPrompt: string,
|
|
281
302
|
userPrompt: string,
|
|
303
|
+
expectedCount: number,
|
|
282
304
|
config: PluginConfig,
|
|
283
305
|
localLlm: LocalLlmClient | null,
|
|
284
306
|
fallbackLlm: FallbackLlmClient | null,
|
|
@@ -311,15 +333,44 @@ async function callFaithfulnessLlm(
|
|
|
311
333
|
const result = await callOpenAiCompatibleChat(
|
|
312
334
|
localEndpoint,
|
|
313
335
|
messages,
|
|
314
|
-
{
|
|
336
|
+
{
|
|
337
|
+
temperature: 0.1,
|
|
338
|
+
maxTokens: 2048,
|
|
339
|
+
responseFormatJson: true,
|
|
340
|
+
timeoutMs: probeBudgetMs,
|
|
341
|
+
// Forward the batch signal so the probe aborts the instant the batch
|
|
342
|
+
// budget elapses, not after probeBudgetMs (issue #1700 nit #5).
|
|
343
|
+
...(signal ? { signal } : {}),
|
|
344
|
+
},
|
|
315
345
|
fetchImpl,
|
|
316
346
|
);
|
|
317
347
|
if (result?.content) {
|
|
318
|
-
|
|
348
|
+
// Issue #1700 nit #6: pre-validate the local endpoint response shape.
|
|
349
|
+
// Default (extractionFaithfulnessLocalParseFallback=false) returns the
|
|
350
|
+
// content as-is -- a 200-with-garbage local response surfaces
|
|
351
|
+
// malformed_output, alerting the operator to a misconfigured endpoint.
|
|
352
|
+
// When the operator opts into resilient fallback, an unparseable OR
|
|
353
|
+
// PARTIAL local response falls through to the configured chain instead
|
|
354
|
+
// of surfacing. parseFaithfulnessResponse is truthy as soon as ONE entry
|
|
355
|
+
// is valid, so accept the local response only when the parsed verdict
|
|
356
|
+
// map covers every expected index -- otherwise the missing indexes would
|
|
357
|
+
// surface as malformed_output downstream, defeating the resilient
|
|
358
|
+
// fallback (codex P2 PRRT_kwDORJXyws6O6zwZ).
|
|
359
|
+
if (!config.extractionFaithfulnessLocalParseFallback) {
|
|
360
|
+
return { content: result.content, modelUsed: result.modelUsed };
|
|
361
|
+
}
|
|
362
|
+
const parsedLocal = parseFaithfulnessResponse(result.content, expectedCount);
|
|
363
|
+
if (parsedLocal && coversAllIndexes(parsedLocal, expectedCount)) {
|
|
364
|
+
return { content: result.content, modelUsed: result.modelUsed };
|
|
365
|
+
}
|
|
366
|
+
log.debug(
|
|
367
|
+
"extraction-faithfulness: local endpoint returned incomplete/unparseable output; falling back to configured chain",
|
|
368
|
+
);
|
|
369
|
+
} else {
|
|
370
|
+
log.debug(
|
|
371
|
+
"extraction-faithfulness: local model-lab endpoint unavailable, trying configured chain",
|
|
372
|
+
);
|
|
319
373
|
}
|
|
320
|
-
log.debug(
|
|
321
|
-
"extraction-faithfulness: local model-lab endpoint unavailable, trying configured chain",
|
|
322
|
-
);
|
|
323
374
|
}
|
|
324
375
|
|
|
325
376
|
// extractionFaithfulnessModel is the LOCAL served model's name (e.g.
|
|
@@ -532,6 +583,7 @@ export async function checkFaithfulnessBatch(
|
|
|
532
583
|
const callPromise = callFaithfulnessLlm(
|
|
533
584
|
FAITHFULNESS_SYSTEM_PROMPT,
|
|
534
585
|
userPrompt,
|
|
586
|
+
checkableInputs.length,
|
|
535
587
|
config,
|
|
536
588
|
localLlm,
|
|
537
589
|
fallbackLlm,
|
package/src/extraction.ts
CHANGED
|
@@ -38,6 +38,7 @@ import { normalizeProcedureSteps } from "./procedural/procedure-types.js";
|
|
|
38
38
|
import { normalizeReasoningTrace } from "./reasoning-trace-types.js";
|
|
39
39
|
import { looksLikeMechanicalTelemetryTranscript } from "./telemetry-transcript.js";
|
|
40
40
|
import { buildFactProvenance, type ProvenanceTurnInput } from "./provenance.js";
|
|
41
|
+
import { resolveMemoryLifecycleCapabilities } from "./capabilities.js";
|
|
41
42
|
|
|
42
43
|
type ExtractionQuestion = ExtractionResult["questions"][number];
|
|
43
44
|
type ExtractedFactResult = ExtractionResult["facts"][number];
|
|
@@ -1055,6 +1056,7 @@ export class ExtractionEngine {
|
|
|
1055
1056
|
}
|
|
1056
1057
|
|
|
1057
1058
|
async extract(turns: BufferTurn[], existingEntities?: string[]): Promise<ExtractionResult> {
|
|
1059
|
+
const lifecycleCaps = resolveMemoryLifecycleCapabilities(this.config);
|
|
1058
1060
|
|
|
1059
1061
|
// Guard: skip if buffer is empty or all turns are whitespace-only
|
|
1060
1062
|
const substantiveTurns = turns.filter((t) => t.content.trim().length > 0);
|
|
@@ -1083,7 +1085,7 @@ export class ExtractionEngine {
|
|
|
1083
1085
|
return { facts: [], profileUpdates: [], entities: [], questions: [] };
|
|
1084
1086
|
}
|
|
1085
1087
|
if (
|
|
1086
|
-
|
|
1088
|
+
lifecycleCaps.extractionTelemetryPrefilter &&
|
|
1087
1089
|
looksLikeMechanicalTelemetryTranscript(conversation)
|
|
1088
1090
|
) {
|
|
1089
1091
|
log.debug("extraction skipped — mechanical action/state telemetry without durable-memory cues");
|
|
@@ -1331,6 +1333,7 @@ export class ExtractionEngine {
|
|
|
1331
1333
|
* Uses a minimal prompt to fit within local model context limits (typically 4k-8k).
|
|
1332
1334
|
*/
|
|
1333
1335
|
private async extractWithLocalLlm(conversation: string, existingEntities?: string[]): Promise<ExtractionResult | null> {
|
|
1336
|
+
const lifecycleCaps = resolveMemoryLifecycleCapabilities(this.config);
|
|
1334
1337
|
log.debug(
|
|
1335
1338
|
`extractWithLocalLlm: starting extraction, localLlmEnabled=${this.shouldUseLocalLlm}, model=${this.config.localLlmModel}`,
|
|
1336
1339
|
);
|
|
@@ -1406,7 +1409,7 @@ These are durable insights - capture them:
|
|
|
1406
1409
|
- CRITICAL: Use canonical hyphenated entity names (e.g., "jane-doe" not "janedoe")
|
|
1407
1410
|
- CRITICAL: NEVER extract the same fact twice - check for duplicates before adding to facts array
|
|
1408
1411
|
- CRITICAL: NEVER extract cron job schedules, automation configurations, or system monitoring details (these are operational noise)
|
|
1409
|
-
- If uncertain about relevance, prefer NOT extracting${
|
|
1412
|
+
- If uncertain about relevance, prefer NOT extracting${lifecycleCaps.extractionScopeClassification ? `
|
|
1410
1413
|
- For each fact, set "scope" to "global" (cross-project knowledge: framework bugs, library behavior, user preferences, tool configs, general patterns) or "project" (codebase-specific: file paths, env configs, deployment details, project workarounds). When in doubt, prefer "project".` : ""}
|
|
1411
1414
|
|
|
1412
1415
|
=== Structured Attributes ===
|
|
@@ -1645,6 +1648,7 @@ Omit "eventTime" when the fact has no explicit temporal anchor — do NOT guess
|
|
|
1645
1648
|
* Build extraction instructions shared between local and cloud LLM.
|
|
1646
1649
|
*/
|
|
1647
1650
|
private buildExtractionInstructions(existingEntities?: string[]): string {
|
|
1651
|
+
const lifecycleCaps = resolveMemoryLifecycleCapabilities(this.config);
|
|
1648
1652
|
return `You are a memory extraction system. Analyze the following conversation and extract durable, reusable memories.
|
|
1649
1653
|
|
|
1650
1654
|
Memory categories:
|
|
@@ -1681,7 +1685,7 @@ Rules:
|
|
|
1681
1685
|
* Inferred (0.40-0.69): Pattern recognition — reasonable guess from limited evidence
|
|
1682
1686
|
* Speculative (0.00-0.39): Tentative hypothesis — weak signal, needs future confirmation. Speculative memories auto-expire after 30 days if not confirmed.${this.config.provenance?.enabled ? `
|
|
1683
1687
|
- Source quotes: For each fact, include a "quote" field containing the EXACT verbatim words from the conversation that support the fact. Copy a contiguous span from a single speaker turn (not a paraphrase, not a summary). Cap at ~300 characters. This grounds every memory in the literal utterance that created it.` : ""}
|
|
1684
|
-
- For commitments: include any deadline or timeframe mentioned${
|
|
1688
|
+
- For commitments: include any deadline or timeframe mentioned${lifecycleCaps.extractionScopeClassification ? `
|
|
1685
1689
|
|
|
1686
1690
|
Scope classification:
|
|
1687
1691
|
For each fact, set "scope" to one of:
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* `config.ts` spread the result in one line.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { coerceNumber } from "./connectors/coerce.js";
|
|
20
|
+
import { coerceBool, coerceNumber } from "./connectors/coerce.js";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Parse a value as a strict integer >= `min`, throwing on anything else.
|
|
@@ -67,6 +67,7 @@ export function parseFaithfulnessGateConfig(cfg: Record<string, unknown>): {
|
|
|
67
67
|
extractionFaithfulnessBaseUrl: string;
|
|
68
68
|
extractionFaithfulnessContextChars: number;
|
|
69
69
|
extractionFaithfulnessTimeoutMs: number;
|
|
70
|
+
extractionFaithfulnessLocalParseFallback: boolean;
|
|
70
71
|
} {
|
|
71
72
|
const gateValue = cfg.extractionFaithfulnessGate;
|
|
72
73
|
let extractionFaithfulnessGate: "off" | "shadow" | "enforce";
|
|
@@ -105,12 +106,26 @@ export function parseFaithfulnessGateConfig(cfg: Record<string, unknown>): {
|
|
|
105
106
|
60_000,
|
|
106
107
|
);
|
|
107
108
|
|
|
109
|
+
// Issue #1700 nit #6: resilient-fallback toggle for the local model-lab
|
|
110
|
+
// endpoint. Default false preserves the loud-signal behavior (a 200-with-
|
|
111
|
+
// garbage local response surfaces malformed_output so a misconfigured
|
|
112
|
+
// endpoint is visible); true falls back to the configured chain on local
|
|
113
|
+
// parse failure. Byte-identical pre-feature when unset (rule 39).
|
|
114
|
+
// coerceBool for CLI-string parity: a CLI override like
|
|
115
|
+
// --config extractionFaithfulnessLocalParseFallback=true reaches here as the
|
|
116
|
+
// string "true"; === true would silently leave the flag disabled. Matches
|
|
117
|
+
// every other CLI-settable boolean in config.ts (gotcha 36, codex P2
|
|
118
|
+
// PRRT_kwDORJXyws6O6gDQ / cursor BUGBOT e273b22c).
|
|
119
|
+
const extractionFaithfulnessLocalParseFallback =
|
|
120
|
+
coerceBool(cfg.extractionFaithfulnessLocalParseFallback) === true;
|
|
121
|
+
|
|
108
122
|
return {
|
|
109
123
|
extractionFaithfulnessGate,
|
|
110
124
|
extractionFaithfulnessModel,
|
|
111
125
|
extractionFaithfulnessBaseUrl,
|
|
112
126
|
extractionFaithfulnessContextChars,
|
|
113
127
|
extractionFaithfulnessTimeoutMs,
|
|
128
|
+
extractionFaithfulnessLocalParseFallback,
|
|
114
129
|
};
|
|
115
130
|
}
|
|
116
131
|
|
|
@@ -42,10 +42,15 @@ export interface EndpointChatMessage {
|
|
|
42
42
|
|
|
43
43
|
/** Options for a single local-endpoint chat call. */
|
|
44
44
|
export interface EndpointChatOptions {
|
|
45
|
-
/** Per-call timeout in ms.
|
|
46
|
-
* (matches the local-LLM precedent
|
|
47
|
-
* timer so one slow server can't starve the batch). */
|
|
45
|
+
/** Per-call timeout in ms. Bounds each attempt so one slow server can't
|
|
46
|
+
* starve the batch (matches the local-LLM precedent). */
|
|
48
47
|
timeoutMs: number;
|
|
48
|
+
/** Optional batch AbortSignal forwarded into the probe (issue #1700 nit #5).
|
|
49
|
+
* When the batch budget elapses (or the caller aborts), the in-flight probe
|
|
50
|
+
* aborts immediately instead of waiting for its own `timeoutMs` — a
|
|
51
|
+
* micro-optimization, not a correctness fix (the outer race already bounds
|
|
52
|
+
* the total). Undefined preserves the prior per-attempt-only behavior. */
|
|
53
|
+
signal?: AbortSignal;
|
|
49
54
|
/** Sampling temperature — classification wants low entropy (0.0–0.2). */
|
|
50
55
|
temperature?: number;
|
|
51
56
|
/** Max output tokens. */
|
|
@@ -119,6 +124,21 @@ export async function callOpenAiCompatibleChat(
|
|
|
119
124
|
const url = joinBaseUrl(endpoint.baseUrl, "/chat/completions");
|
|
120
125
|
const controller = new AbortController();
|
|
121
126
|
const timer = setTimeout(() => controller.abort(), options.timeoutMs);
|
|
127
|
+
// Forward the batch AbortSignal into the probe (issue #1700 nit #5): if the
|
|
128
|
+
// batch budget already elapsed, abort the in-flight probe immediately rather
|
|
129
|
+
// than waiting for the probe's own timeoutMs. AbortSignal.any is ES2024
|
|
130
|
+
// (forbidden here); wire the listener manually + guard the already-aborted
|
|
131
|
+
// case. The fetch still uses the probe's controller, so clearing the timer
|
|
132
|
+
// below is the only cleanup needed.
|
|
133
|
+
const batchSignal = options.signal;
|
|
134
|
+
const onBatchAbort = () => controller.abort();
|
|
135
|
+
if (batchSignal) {
|
|
136
|
+
if (batchSignal.aborted) {
|
|
137
|
+
controller.abort();
|
|
138
|
+
} else {
|
|
139
|
+
batchSignal.addEventListener("abort", onBatchAbort, { once: true });
|
|
140
|
+
}
|
|
141
|
+
}
|
|
122
142
|
try {
|
|
123
143
|
const body: Record<string, unknown> = {
|
|
124
144
|
model: endpoint.model,
|
|
@@ -150,6 +170,7 @@ export async function callOpenAiCompatibleChat(
|
|
|
150
170
|
return { content, modelUsed: extractModel(parsed) ?? endpoint.model };
|
|
151
171
|
} finally {
|
|
152
172
|
clearTimeout(timer);
|
|
173
|
+
if (batchSignal) batchSignal.removeEventListener("abort", onBatchAbort);
|
|
153
174
|
}
|
|
154
175
|
}
|
|
155
176
|
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
import path from "node:path";
|
|
20
20
|
import { access, mkdir, readFile, unlink, writeFile } from "node:fs/promises";
|
|
21
|
+
import { resolveMemoryLifecycleCapabilities } from "../capabilities.js";
|
|
21
22
|
import type { StorageManager } from "../storage.js";
|
|
22
23
|
import type { PluginConfig } from "../types.js";
|
|
23
24
|
import {
|
|
@@ -179,6 +180,7 @@ export async function runFirstStartMigration(
|
|
|
179
180
|
signal,
|
|
180
181
|
} = options;
|
|
181
182
|
const now = (options.now ?? (() => new Date()))();
|
|
183
|
+
const lifecycleCaps = resolveMemoryLifecycleCapabilities(config);
|
|
182
184
|
const abortedResult = (candidateCount = 0, demotedCount = 0, failureCount = 0): FirstStartMigrationResult => ({
|
|
183
185
|
skipped: candidateCount === 0 && demotedCount === 0 && failureCount === 0,
|
|
184
186
|
skipReason: candidateCount === 0 && demotedCount === 0 && failureCount === 0 ? "aborted" : undefined,
|
|
@@ -193,7 +195,7 @@ export async function runFirstStartMigration(
|
|
|
193
195
|
return abortedResult();
|
|
194
196
|
}
|
|
195
197
|
|
|
196
|
-
if (!
|
|
198
|
+
if (!lifecycleCaps.lifecyclePolicy) {
|
|
197
199
|
return {
|
|
198
200
|
skipped: true,
|
|
199
201
|
skipReason: "lifecyclePolicyEnabled is false",
|