@remnic/core 9.3.720 → 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 +5 -5
- package/dist/access-boundary.js +35 -33
- package/dist/access-cli.js +69 -66
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +5 -5
- package/dist/access-http.js +39 -37
- package/dist/access-mcp.d.ts +5 -5
- package/dist/access-mcp.js +38 -36
- package/dist/access-operations-batch.js +36 -34
- package/dist/access-operations.d.ts +5 -5
- package/dist/access-operations.js +37 -35
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-Dw-tK1pa.d.ts → access-service-Dj3I-VBS.d.ts} +3 -3
- package/dist/access-service.d.ts +5 -5
- package/dist/access-service.js +34 -32
- 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 +4 -2
- package/dist/active-recall.js.map +1 -1
- 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 +4 -4
- package/dist/briefing.d.ts +1 -1
- package/dist/briefing.js +11 -9
- 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 +1 -1
- package/dist/{catalog-B9SPfcsE.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 +14 -12
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/causal-trajectory-graph.js +2 -2
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-TH7WMHVK.js → chunk-3NN73CM7.js} +2 -2
- package/dist/{chunk-ZKUW2MJG.js → chunk-4SF232E6.js} +18 -30
- package/dist/chunk-4SF232E6.js.map +1 -0
- package/dist/{chunk-DGTDRIUO.js → chunk-4T3BMHKD.js} +2 -2
- package/dist/{chunk-RX7EBFFJ.js → chunk-5O42UKXI.js} +2 -2
- package/dist/{chunk-5YQN2XYC.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-V7UUIIR7.js → chunk-7CTNUVHZ.js} +2 -2
- package/dist/{chunk-HU4EBIXO.js → chunk-A5XNBK2D.js} +8 -8
- package/dist/{chunk-2RBMGTK4.js → chunk-A7TJZLPK.js} +2 -2
- package/dist/{chunk-BGQ7WKMT.js → chunk-B7WISIAJ.js} +5 -5
- package/dist/{chunk-CYJV5AYC.js → chunk-BXEOHV7K.js} +3 -3
- package/dist/chunk-C4X4QGIO.js +60 -0
- package/dist/chunk-C4X4QGIO.js.map +1 -0
- package/dist/{chunk-RIW3UDDY.js → chunk-D7EBTQ24.js} +2 -2
- package/dist/{chunk-IO5NQEGZ.js → chunk-DKT3X5C3.js} +2 -2
- package/dist/{chunk-H2AGJ5SV.js → chunk-EBDA5TYA.js} +2 -2
- package/dist/{chunk-NBYXOEO7.js → chunk-EDOQM4E4.js} +2 -2
- package/dist/{chunk-YMPEGBLL.js → chunk-EEJMD2L2.js} +3 -3
- package/dist/{chunk-XROP4ZHB.js → chunk-EHQ5HO5T.js} +4 -4
- package/dist/{chunk-ATGRQ2NE.js → chunk-EM2LDXJ2.js} +4 -4
- package/dist/{chunk-422TIKIH.js → chunk-EVPNWN7Z.js} +9 -9
- package/dist/{chunk-WBHQ5LP5.js → chunk-EXUCUPV2.js} +2 -2
- package/dist/{chunk-M3GBOKUX.js → chunk-GDUOCHCD.js} +16 -16
- package/dist/{chunk-3XEGHEQ2.js → chunk-GJSL4WG2.js} +2 -2
- package/dist/{chunk-2SXMCQEQ.js → chunk-GZQXOQQ2.js} +3 -3
- package/dist/{chunk-UUMYB3FR.js → chunk-HCVWF657.js} +11 -11
- package/dist/{chunk-ZW5I3UNP.js → chunk-ILFSEIRT.js} +1 -1
- package/dist/chunk-ILFSEIRT.js.map +1 -0
- package/dist/{chunk-HHSO6VCQ.js → chunk-J3JPB7ZI.js} +2 -2
- package/dist/{chunk-Y4I7SOJN.js → chunk-LA3HZKES.js} +78 -78
- package/dist/{chunk-LQ6JI4VH.js → chunk-LD53WPMU.js} +4 -4
- package/dist/{chunk-NE5WFIY6.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-KNN6DAZQ.js → chunk-N77ELJ2D.js} +4 -4
- package/dist/{chunk-HTIL3EJK.js → chunk-NXRUUDUF.js} +2 -2
- package/dist/{chunk-JV7Q226R.js → chunk-OHTOPFRF.js} +2 -2
- package/dist/{chunk-ZG2WP425.js → chunk-ORAK3LNZ.js} +2 -2
- package/dist/{chunk-NERBFQNY.js → chunk-PD42EYQN.js} +2 -2
- package/dist/chunk-PHK3HARR.js +32 -0
- package/dist/chunk-PHK3HARR.js.map +1 -0
- package/dist/{chunk-NO4DWSQE.js → chunk-PKMQK2WY.js} +7 -7
- package/dist/{chunk-V5EGLYXE.js → chunk-QD6QP5P6.js} +42 -42
- package/dist/{chunk-IPJD7WJH.js → chunk-QR67FU5G.js} +2 -2
- package/dist/{chunk-ZE7GJ76H.js → chunk-SQNED75R.js} +1 -1
- package/dist/{chunk-5CEJH5ZN.js → chunk-TAPSNIMA.js} +4 -4
- package/dist/{chunk-PMBWVQ7D.js → chunk-TQT3USCG.js} +2 -2
- package/dist/{chunk-LLLG5PTE.js → chunk-TXQCG6SE.js} +3 -3
- package/dist/{chunk-6S5ZI7HB.js → chunk-UIXXE6NI.js} +6 -6
- package/dist/{chunk-T3XSXAWK.js → chunk-UO5ZHIIH.js} +2 -2
- package/dist/{chunk-PPVCZPYA.js → chunk-VCLGUIFM.js} +2 -2
- package/dist/{chunk-5J4OL7TJ.js → chunk-VUA4S7P6.js} +4 -4
- package/dist/{chunk-HAPVZ4CO.js → chunk-WQYSDPMA.js} +2 -2
- package/dist/chunk-XGTBNVIU.js +79 -0
- package/dist/chunk-XGTBNVIU.js.map +1 -0
- package/dist/{chunk-O6SEGJNV.js → chunk-YEE5KJQQ.js} +2 -2
- package/dist/{chunk-WRFKZEO6.js → chunk-YQGHW5ML.js} +4 -4
- package/dist/{chunk-DG3ORVCU.js → chunk-Z4RU5VPM.js} +2 -2
- package/dist/{chunk-DCWIQFNA.js → chunk-ZUDM75KG.js} +4 -4
- package/dist/{cli-qcLCJlOD.d.ts → cli-P_GaYcCY.d.ts} +3 -3
- package/dist/cli.d.ts +6 -6
- package/dist/cli.js +63 -60
- package/dist/compounding/engine.d.ts +1 -1
- package/dist/compounding/engine.js +11 -9
- 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 +11 -9
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +12 -10
- 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 +11 -9
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +4 -4
- 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/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-QDDC6AVV.js → graph-edge-decay-QPRJQ7DL.js} +3 -3
- package/dist/graph-edge-reinforcement.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 +2 -2
- 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 +101 -98
- 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 +3 -3
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +5 -5
- 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 +11 -9
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +11 -9
- package/dist/maintenance/rebuild-memory-projection.js +12 -10
- 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 +21 -19
- 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 +11 -9
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +1 -1
- package/dist/operator-toolkit.js +30 -27
- package/dist/orchestration/maintenance.d.ts +2 -2
- package/dist/orchestration/maintenance.js +13 -11
- package/dist/{orchestrator-Bg5Fnza6.d.ts → orchestrator-f5xv19kp.d.ts} +3 -3
- package/dist/orchestrator.d.ts +4 -4
- package/dist/orchestrator.js +54 -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 +1 -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 +13 -13
- 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-ClOiS6KP.d.ts → semantic-consolidation-BQm1e1Pn.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +12 -10
- package/dist/semantic-rule-promotion.js +11 -9
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +11 -9
- 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 +10 -8
- 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 +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-BSdUWePh.d.ts → types-DwO1Ot4n.d.ts} +19 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +11 -9
- package/package.json +2 -2
- package/src/config.ts +9 -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/local-model-endpoint.test.ts +155 -0
- package/src/local-model-endpoint.ts +189 -0
- package/src/types.ts +19 -1
- package/dist/chunk-FEB7W5JG.js.map +0 -1
- package/dist/chunk-RVLB4E6N.js.map +0 -1
- package/dist/chunk-ZKUW2MJG.js.map +0 -1
- package/dist/chunk-ZW5I3UNP.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-RX7EBFFJ.js.map → chunk-5O42UKXI.js.map} +0 -0
- /package/dist/{chunk-5YQN2XYC.js.map → chunk-6FAMMBQ3.js.map} +0 -0
- /package/dist/{chunk-67HG7KFE.js.map → chunk-6YKIYQU7.js.map} +0 -0
- /package/dist/{chunk-V7UUIIR7.js.map → chunk-7CTNUVHZ.js.map} +0 -0
- /package/dist/{chunk-HU4EBIXO.js.map → chunk-A5XNBK2D.js.map} +0 -0
- /package/dist/{chunk-2RBMGTK4.js.map → chunk-A7TJZLPK.js.map} +0 -0
- /package/dist/{chunk-BGQ7WKMT.js.map → chunk-B7WISIAJ.js.map} +0 -0
- /package/dist/{chunk-CYJV5AYC.js.map → chunk-BXEOHV7K.js.map} +0 -0
- /package/dist/{chunk-RIW3UDDY.js.map → chunk-D7EBTQ24.js.map} +0 -0
- /package/dist/{chunk-IO5NQEGZ.js.map → chunk-DKT3X5C3.js.map} +0 -0
- /package/dist/{chunk-H2AGJ5SV.js.map → chunk-EBDA5TYA.js.map} +0 -0
- /package/dist/{chunk-NBYXOEO7.js.map → chunk-EDOQM4E4.js.map} +0 -0
- /package/dist/{chunk-YMPEGBLL.js.map → chunk-EEJMD2L2.js.map} +0 -0
- /package/dist/{chunk-XROP4ZHB.js.map → chunk-EHQ5HO5T.js.map} +0 -0
- /package/dist/{chunk-ATGRQ2NE.js.map → chunk-EM2LDXJ2.js.map} +0 -0
- /package/dist/{chunk-422TIKIH.js.map → chunk-EVPNWN7Z.js.map} +0 -0
- /package/dist/{chunk-WBHQ5LP5.js.map → chunk-EXUCUPV2.js.map} +0 -0
- /package/dist/{chunk-M3GBOKUX.js.map → chunk-GDUOCHCD.js.map} +0 -0
- /package/dist/{chunk-3XEGHEQ2.js.map → chunk-GJSL4WG2.js.map} +0 -0
- /package/dist/{chunk-2SXMCQEQ.js.map → chunk-GZQXOQQ2.js.map} +0 -0
- /package/dist/{chunk-UUMYB3FR.js.map → chunk-HCVWF657.js.map} +0 -0
- /package/dist/{chunk-HHSO6VCQ.js.map → chunk-J3JPB7ZI.js.map} +0 -0
- /package/dist/{chunk-Y4I7SOJN.js.map → chunk-LA3HZKES.js.map} +0 -0
- /package/dist/{chunk-LQ6JI4VH.js.map → chunk-LD53WPMU.js.map} +0 -0
- /package/dist/{chunk-NE5WFIY6.js.map → chunk-LLUGAZ3B.js.map} +0 -0
- /package/dist/{chunk-KNN6DAZQ.js.map → chunk-N77ELJ2D.js.map} +0 -0
- /package/dist/{chunk-HTIL3EJK.js.map → chunk-NXRUUDUF.js.map} +0 -0
- /package/dist/{chunk-JV7Q226R.js.map → chunk-OHTOPFRF.js.map} +0 -0
- /package/dist/{chunk-ZG2WP425.js.map → chunk-ORAK3LNZ.js.map} +0 -0
- /package/dist/{chunk-NERBFQNY.js.map → chunk-PD42EYQN.js.map} +0 -0
- /package/dist/{chunk-NO4DWSQE.js.map → chunk-PKMQK2WY.js.map} +0 -0
- /package/dist/{chunk-V5EGLYXE.js.map → chunk-QD6QP5P6.js.map} +0 -0
- /package/dist/{chunk-IPJD7WJH.js.map → chunk-QR67FU5G.js.map} +0 -0
- /package/dist/{chunk-ZE7GJ76H.js.map → chunk-SQNED75R.js.map} +0 -0
- /package/dist/{chunk-5CEJH5ZN.js.map → chunk-TAPSNIMA.js.map} +0 -0
- /package/dist/{chunk-PMBWVQ7D.js.map → chunk-TQT3USCG.js.map} +0 -0
- /package/dist/{chunk-LLLG5PTE.js.map → chunk-TXQCG6SE.js.map} +0 -0
- /package/dist/{chunk-6S5ZI7HB.js.map → chunk-UIXXE6NI.js.map} +0 -0
- /package/dist/{chunk-T3XSXAWK.js.map → chunk-UO5ZHIIH.js.map} +0 -0
- /package/dist/{chunk-PPVCZPYA.js.map → chunk-VCLGUIFM.js.map} +0 -0
- /package/dist/{chunk-5J4OL7TJ.js.map → chunk-VUA4S7P6.js.map} +0 -0
- /package/dist/{chunk-HAPVZ4CO.js.map → chunk-WQYSDPMA.js.map} +0 -0
- /package/dist/{chunk-O6SEGJNV.js.map → chunk-YEE5KJQQ.js.map} +0 -0
- /package/dist/{chunk-WRFKZEO6.js.map → chunk-YQGHW5ML.js.map} +0 -0
- /package/dist/{chunk-DG3ORVCU.js.map → chunk-Z4RU5VPM.js.map} +0 -0
- /package/dist/{chunk-DCWIQFNA.js.map → chunk-ZUDM75KG.js.map} +0 -0
- /package/dist/{graph-edge-decay-QDDC6AVV.js.map → graph-edge-decay-QPRJQ7DL.js.map} +0 -0
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
loadSyncState,
|
|
5
5
|
syncWearableSource,
|
|
6
6
|
wearableSourceLabel
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4T3BMHKD.js";
|
|
8
8
|
import {
|
|
9
9
|
MaintenanceScheduler
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-Z4RU5VPM.js";
|
|
11
11
|
import {
|
|
12
12
|
migrateFromEngram
|
|
13
13
|
} from "./chunk-7HYPN2GC.js";
|
|
14
14
|
import {
|
|
15
15
|
LcmEngine
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-PKMQK2WY.js";
|
|
17
17
|
import {
|
|
18
18
|
chunkTranscriptEntries
|
|
19
19
|
} from "./chunk-TECVW3JP.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
CompoundingEngine,
|
|
25
25
|
defaultTierMigrationCycleBudget
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-WQYSDPMA.js";
|
|
27
27
|
import {
|
|
28
28
|
SharedContextManager
|
|
29
29
|
} from "./chunk-UFS7OXGL.js";
|
|
@@ -32,6 +32,12 @@ import {
|
|
|
32
32
|
applyUtilityRankingRuntimeDelta,
|
|
33
33
|
loadUtilityRuntimeValues
|
|
34
34
|
} from "./chunk-LXOM6IQU.js";
|
|
35
|
+
import {
|
|
36
|
+
TierMigrationExecutor
|
|
37
|
+
} from "./chunk-VOUOLGIP.js";
|
|
38
|
+
import {
|
|
39
|
+
decideTierTransition
|
|
40
|
+
} from "./chunk-S75M5ZRK.js";
|
|
35
41
|
import {
|
|
36
42
|
TmtBuilder
|
|
37
43
|
} from "./chunk-ECZU5BJH.js";
|
|
@@ -46,39 +52,19 @@ import {
|
|
|
46
52
|
import {
|
|
47
53
|
renderEpistemicHedge
|
|
48
54
|
} from "./chunk-YN2UN7N3.js";
|
|
55
|
+
import {
|
|
56
|
+
buildTargetedFactRecallSection,
|
|
57
|
+
shouldRecallTargetedFactEvidence
|
|
58
|
+
} from "./chunk-4SBW47WK.js";
|
|
49
59
|
import {
|
|
50
60
|
CODEX_THREAD_KEY_PREFIX
|
|
51
61
|
} from "./chunk-4EX5WZ4M.js";
|
|
52
|
-
import {
|
|
53
|
-
TierMigrationExecutor
|
|
54
|
-
} from "./chunk-VOUOLGIP.js";
|
|
55
|
-
import {
|
|
56
|
-
decideTierTransition
|
|
57
|
-
} from "./chunk-S75M5ZRK.js";
|
|
58
62
|
import {
|
|
59
63
|
HourlySummarizer
|
|
60
|
-
} from "./chunk-
|
|
61
|
-
import {
|
|
62
|
-
buildTargetedFactRecallSection,
|
|
63
|
-
shouldRecallTargetedFactEvidence
|
|
64
|
-
} from "./chunk-4SBW47WK.js";
|
|
64
|
+
} from "./chunk-DKT3X5C3.js";
|
|
65
65
|
import {
|
|
66
66
|
SessionObserverState
|
|
67
67
|
} from "./chunk-DKTSR7EK.js";
|
|
68
|
-
import {
|
|
69
|
-
applyRuntimeRetrievalPolicy
|
|
70
|
-
} from "./chunk-5IZL4DCV.js";
|
|
71
|
-
import {
|
|
72
|
-
RelevanceStore
|
|
73
|
-
} from "./chunk-GG6AJN7A.js";
|
|
74
|
-
import {
|
|
75
|
-
RerankCache,
|
|
76
|
-
rerankLocalOrNoop
|
|
77
|
-
} from "./chunk-E3VODCC3.js";
|
|
78
|
-
import {
|
|
79
|
-
buildResponseGuidanceRecallSection,
|
|
80
|
-
shouldRecallResponseGuidance
|
|
81
|
-
} from "./chunk-L6W77GWW.js";
|
|
82
68
|
import {
|
|
83
69
|
mergeWithAgentResults,
|
|
84
70
|
runDirectAgent,
|
|
@@ -97,27 +83,44 @@ import {
|
|
|
97
83
|
recencyWindowFromPrompt,
|
|
98
84
|
resolvePromptTagPrefilterAsync
|
|
99
85
|
} from "./chunk-MGN7VHWQ.js";
|
|
86
|
+
import {
|
|
87
|
+
applyRuntimeRetrievalPolicy
|
|
88
|
+
} from "./chunk-5IZL4DCV.js";
|
|
89
|
+
import {
|
|
90
|
+
findUnresolvedEntityRefs
|
|
91
|
+
} from "./chunk-X7XN6YU4.js";
|
|
92
|
+
import {
|
|
93
|
+
RelevanceStore
|
|
94
|
+
} from "./chunk-GG6AJN7A.js";
|
|
95
|
+
import {
|
|
96
|
+
RerankCache,
|
|
97
|
+
rerankLocalOrNoop
|
|
98
|
+
} from "./chunk-E3VODCC3.js";
|
|
99
|
+
import {
|
|
100
|
+
buildResponseGuidanceRecallSection,
|
|
101
|
+
shouldRecallResponseGuidance
|
|
102
|
+
} from "./chunk-L6W77GWW.js";
|
|
103
|
+
import {
|
|
104
|
+
createRecallSectionMetricRecorder
|
|
105
|
+
} from "./chunk-VQ34TERH.js";
|
|
100
106
|
import {
|
|
101
107
|
LastRecallStore,
|
|
102
108
|
RecallHandleHistoryStore,
|
|
103
109
|
TierMigrationStatusStore,
|
|
104
110
|
clampGraphRecallExpandedEntries
|
|
105
111
|
} from "./chunk-UC4YOAC2.js";
|
|
106
|
-
import {
|
|
107
|
-
findUnresolvedEntityRefs
|
|
108
|
-
} from "./chunk-X7XN6YU4.js";
|
|
109
112
|
import {
|
|
110
113
|
reorderRecallResultsWithMmr
|
|
111
114
|
} from "./chunk-YDBIWGNI.js";
|
|
112
|
-
import {
|
|
113
|
-
createRecallSectionMetricRecorder
|
|
114
|
-
} from "./chunk-VQ34TERH.js";
|
|
115
115
|
import {
|
|
116
116
|
applyReasoningTraceBoost
|
|
117
117
|
} from "./chunk-ZZTOURJI.js";
|
|
118
118
|
import {
|
|
119
119
|
NegativeExampleStore
|
|
120
120
|
} from "./chunk-EXM3CQTZ.js";
|
|
121
|
+
import {
|
|
122
|
+
evaluateMemoryActionPolicy
|
|
123
|
+
} from "./chunk-H63EDPFJ.js";
|
|
121
124
|
import {
|
|
122
125
|
applyMemoryWorthFilter,
|
|
123
126
|
buildMemoryWorthCounterMap
|
|
@@ -125,9 +128,6 @@ import {
|
|
|
125
128
|
import {
|
|
126
129
|
runLiveConnectorsOnce
|
|
127
130
|
} from "./chunk-VU3SVYMA.js";
|
|
128
|
-
import {
|
|
129
|
-
evaluateMemoryActionPolicy
|
|
130
|
-
} from "./chunk-H63EDPFJ.js";
|
|
131
131
|
import {
|
|
132
132
|
hasBroadGraphIntent,
|
|
133
133
|
inferIntentFromText,
|
|
@@ -144,10 +144,10 @@ import {
|
|
|
144
144
|
getVerdictKind,
|
|
145
145
|
judgeFactDurability,
|
|
146
146
|
validateProcedureExtraction
|
|
147
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-3NN73CM7.js";
|
|
148
148
|
import {
|
|
149
149
|
ExtractionEngine
|
|
150
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-GZQXOQQ2.js";
|
|
151
151
|
import {
|
|
152
152
|
parseMemoryActionEligibilityContext
|
|
153
153
|
} from "./chunk-5GSUBCZM.js";
|
|
@@ -184,47 +184,47 @@ import {
|
|
|
184
184
|
buildEntityRecallSection,
|
|
185
185
|
entityRecentTranscriptLookbackHours,
|
|
186
186
|
readRecentEntityTranscriptEntries
|
|
187
|
-
} from "./chunk-
|
|
187
|
+
} from "./chunk-5O42UKXI.js";
|
|
188
188
|
import {
|
|
189
189
|
formatDaySummaryMemories
|
|
190
190
|
} from "./chunk-EO5QWINU.js";
|
|
191
|
-
import {
|
|
192
|
-
RoutingRulesStore
|
|
193
|
-
} from "./chunk-WIWPSQYU.js";
|
|
194
191
|
import {
|
|
195
192
|
normalizeReplaySessionKey
|
|
196
193
|
} from "./chunk-2PRQG7PV.js";
|
|
194
|
+
import {
|
|
195
|
+
RoutingRulesStore
|
|
196
|
+
} from "./chunk-WIWPSQYU.js";
|
|
197
197
|
import {
|
|
198
198
|
compareVerifiedEpisodeResults,
|
|
199
199
|
searchVerifiedEpisodes
|
|
200
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-EBDA5TYA.js";
|
|
201
201
|
import {
|
|
202
202
|
ThreadingManager
|
|
203
203
|
} from "./chunk-QRDOSYOR.js";
|
|
204
204
|
import {
|
|
205
205
|
compareVerifiedSemanticRuleResults,
|
|
206
206
|
searchVerifiedSemanticRules
|
|
207
|
-
} from "./chunk-
|
|
207
|
+
} from "./chunk-YEE5KJQQ.js";
|
|
208
208
|
import {
|
|
209
209
|
searchWorkProductLedgerEntries
|
|
210
210
|
} from "./chunk-ZRWB5D4H.js";
|
|
211
211
|
import {
|
|
212
212
|
TranscriptManager
|
|
213
213
|
} from "./chunk-GY3SKOS4.js";
|
|
214
|
+
import {
|
|
215
|
+
PolicyRuntimeManager
|
|
216
|
+
} from "./chunk-33JBK2XP.js";
|
|
214
217
|
import {
|
|
215
218
|
runNamespaceMaintenanceFanout,
|
|
216
219
|
summarizeNamespaceMaintenanceHealth
|
|
217
|
-
} from "./chunk-
|
|
220
|
+
} from "./chunk-PD42EYQN.js";
|
|
218
221
|
import {
|
|
219
222
|
NamespaceCatalog,
|
|
220
223
|
planNamespaceMaintenance
|
|
221
|
-
} from "./chunk-
|
|
224
|
+
} from "./chunk-EXUCUPV2.js";
|
|
222
225
|
import {
|
|
223
226
|
NamespaceStorageRouter
|
|
224
|
-
} from "./chunk-
|
|
225
|
-
import {
|
|
226
|
-
PolicyRuntimeManager
|
|
227
|
-
} from "./chunk-33JBK2XP.js";
|
|
227
|
+
} from "./chunk-OHTOPFRF.js";
|
|
228
228
|
import {
|
|
229
229
|
isAboveImportanceThreshold,
|
|
230
230
|
scoreImportance
|
|
@@ -262,7 +262,7 @@ import {
|
|
|
262
262
|
materializeAfterSemanticConsolidation,
|
|
263
263
|
parseConsolidationResponse,
|
|
264
264
|
parseOperatorAwareConsolidationResponse
|
|
265
|
-
} from "./chunk-
|
|
265
|
+
} from "./chunk-NXRUUDUF.js";
|
|
266
266
|
import {
|
|
267
267
|
buildRecallQueryPolicy
|
|
268
268
|
} from "./chunk-LBJBNWS2.js";
|
|
@@ -303,7 +303,7 @@ import {
|
|
|
303
303
|
clusterByKey,
|
|
304
304
|
createCorrectionService,
|
|
305
305
|
detectPassiveCorrections
|
|
306
|
-
} from "./chunk-
|
|
306
|
+
} from "./chunk-VCLGUIFM.js";
|
|
307
307
|
import {
|
|
308
308
|
listTrustZoneRecords,
|
|
309
309
|
searchTrustZoneRecords
|
|
@@ -313,25 +313,25 @@ import {
|
|
|
313
313
|
} from "./chunk-FF4KLI5W.js";
|
|
314
314
|
import {
|
|
315
315
|
buildXraySnapshot
|
|
316
|
-
} from "./chunk-
|
|
317
|
-
import {
|
|
318
|
-
combineNamespaces,
|
|
319
|
-
getConfiguredNamespaces,
|
|
320
|
-
resolveCodingNamespaceOverlay,
|
|
321
|
-
resolveNamespaceFromStorageDir,
|
|
322
|
-
resolveScopePlan,
|
|
323
|
-
resolveScopeProfilePlan
|
|
324
|
-
} from "./chunk-J6BH2OBA.js";
|
|
316
|
+
} from "./chunk-GJSL4WG2.js";
|
|
325
317
|
import {
|
|
326
318
|
NamespaceSearchRouter
|
|
327
|
-
} from "./chunk-
|
|
319
|
+
} from "./chunk-QR67FU5G.js";
|
|
328
320
|
import {
|
|
329
321
|
createConversationIndexRuntime,
|
|
330
322
|
createSearchBackend
|
|
331
|
-
} from "./chunk-
|
|
323
|
+
} from "./chunk-HCVWF657.js";
|
|
332
324
|
import {
|
|
333
325
|
NoopSearchBackend
|
|
334
326
|
} from "./chunk-CYEPCZN5.js";
|
|
327
|
+
import {
|
|
328
|
+
combineNamespaces,
|
|
329
|
+
getConfiguredNamespaces,
|
|
330
|
+
resolveCodingNamespaceOverlay,
|
|
331
|
+
resolveNamespaceFromStorageDir,
|
|
332
|
+
resolveScopePlan,
|
|
333
|
+
resolveScopeProfilePlan
|
|
334
|
+
} from "./chunk-J6BH2OBA.js";
|
|
335
335
|
import {
|
|
336
336
|
namespaceIdentityFromToken,
|
|
337
337
|
namespaceIdentityToken,
|
|
@@ -362,17 +362,17 @@ import {
|
|
|
362
362
|
} from "./chunk-DVRHLN2O.js";
|
|
363
363
|
import {
|
|
364
364
|
searchCausalTrajectories
|
|
365
|
-
} from "./chunk-
|
|
365
|
+
} from "./chunk-SQNED75R.js";
|
|
366
366
|
import {
|
|
367
367
|
GraphIndex
|
|
368
|
-
} from "./chunk-
|
|
368
|
+
} from "./chunk-EHQ5HO5T.js";
|
|
369
369
|
import {
|
|
370
370
|
decideLifecycleTransition,
|
|
371
371
|
resolveLifecycleState
|
|
372
372
|
} from "./chunk-TBBDFYXW.js";
|
|
373
373
|
import {
|
|
374
374
|
buildChainFollowupGenerator
|
|
375
|
-
} from "./chunk-
|
|
375
|
+
} from "./chunk-UO5ZHIIH.js";
|
|
376
376
|
import {
|
|
377
377
|
ContentHashIndex,
|
|
378
378
|
StorageManager,
|
|
@@ -380,7 +380,7 @@ import {
|
|
|
380
380
|
fingerprintEntityStructuredFacts,
|
|
381
381
|
normalizeAttributePairs,
|
|
382
382
|
parseEntityFile
|
|
383
|
-
} from "./chunk-
|
|
383
|
+
} from "./chunk-EVPNWN7Z.js";
|
|
384
384
|
import {
|
|
385
385
|
buildRetiredFactTombstoneInputs
|
|
386
386
|
} from "./chunk-L2B3EE7B.js";
|
|
@@ -414,16 +414,16 @@ import {
|
|
|
414
414
|
} from "./chunk-SVOZFLIQ.js";
|
|
415
415
|
import {
|
|
416
416
|
confidenceTier
|
|
417
|
-
} from "./chunk-
|
|
418
|
-
import {
|
|
419
|
-
inferMemoryStatus,
|
|
420
|
-
isActiveMemoryStatus
|
|
421
|
-
} from "./chunk-RULE4VG5.js";
|
|
417
|
+
} from "./chunk-ILFSEIRT.js";
|
|
422
418
|
import {
|
|
423
419
|
buildQmdRecallCacheKey,
|
|
424
420
|
getCachedQmdRecall,
|
|
425
421
|
setCachedQmdRecall
|
|
426
422
|
} from "./chunk-42JKGUFJ.js";
|
|
423
|
+
import {
|
|
424
|
+
inferMemoryStatus,
|
|
425
|
+
isActiveMemoryStatus
|
|
426
|
+
} from "./chunk-RULE4VG5.js";
|
|
427
427
|
import {
|
|
428
428
|
lintWorkspaceFiles,
|
|
429
429
|
rotateMarkdownFileToArchive
|
|
@@ -432,12 +432,12 @@ import {
|
|
|
432
432
|
applyFaithfulnessVerdict,
|
|
433
433
|
createFaithfulnessCounters,
|
|
434
434
|
runFaithfulnessGateBatch
|
|
435
|
-
} from "./chunk-
|
|
435
|
+
} from "./chunk-6OIDDKAA.js";
|
|
436
436
|
import {
|
|
437
437
|
FallbackLlmClient,
|
|
438
438
|
fallbackLlmRuntimeContextFromConfig,
|
|
439
439
|
gatewayTaskChainOptions
|
|
440
|
-
} from "./chunk-
|
|
440
|
+
} from "./chunk-VUA4S7P6.js";
|
|
441
441
|
import {
|
|
442
442
|
keyring_exports,
|
|
443
443
|
secureStoreDir
|
|
@@ -3931,7 +3931,7 @@ var Orchestrator = class _Orchestrator {
|
|
|
3931
3931
|
if (signal.aborted) return;
|
|
3932
3932
|
if (!this.wearablesAutoSyncHandle && this.config.wearables.enabled && this.config.wearables.autoSyncEnabled && Object.values(this.config.wearables.sources).some((source) => source.enabled)) {
|
|
3933
3933
|
try {
|
|
3934
|
-
const { startWearablesAutoSync } = await import("./auto-sync-
|
|
3934
|
+
const { startWearablesAutoSync } = await import("./auto-sync-F3KCSQFJ.js");
|
|
3935
3935
|
if (signal.aborted) return;
|
|
3936
3936
|
this.wearablesAutoSyncHandle = startWearablesAutoSync(
|
|
3937
3937
|
{
|
|
@@ -15793,4 +15793,4 @@ export {
|
|
|
15793
15793
|
resolvePersistedMemoryRelativePath,
|
|
15794
15794
|
Orchestrator
|
|
15795
15795
|
};
|
|
15796
|
-
//# sourceMappingURL=chunk-
|
|
15796
|
+
//# sourceMappingURL=chunk-LA3HZKES.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
scanMemoryDir
|
|
3
|
-
} from "./chunk-AER6MT24.js";
|
|
4
1
|
import {
|
|
5
2
|
isSearchAborted,
|
|
6
3
|
throwIfSearchAborted
|
|
7
4
|
} from "./chunk-CINZGPSJ.js";
|
|
5
|
+
import {
|
|
6
|
+
scanMemoryDir
|
|
7
|
+
} from "./chunk-AER6MT24.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveEnsureCollectionArgs
|
|
10
10
|
} from "./chunk-YNQ6DFSV.js";
|
|
@@ -605,4 +605,4 @@ export {
|
|
|
605
605
|
resolveOramaCollectionDbFilePath,
|
|
606
606
|
OramaBackend
|
|
607
607
|
};
|
|
608
|
-
//# sourceMappingURL=chunk-
|
|
608
|
+
//# sourceMappingURL=chunk-LD53WPMU.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EngramAccessInputError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GDUOCHCD.js";
|
|
4
4
|
import {
|
|
5
5
|
expandTildePath
|
|
6
6
|
} from "./chunk-EYIEWJNI.js";
|
|
@@ -104,4 +104,4 @@ export {
|
|
|
104
104
|
listRegisteredOperations,
|
|
105
105
|
__resetRegistryForTest
|
|
106
106
|
};
|
|
107
|
-
//# sourceMappingURL=chunk-
|
|
107
|
+
//# sourceMappingURL=chunk-LLUGAZ3B.js.map
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
coerceBool,
|
|
3
|
+
coerceNumber
|
|
4
|
+
} from "./chunk-PHK3HARR.js";
|
|
1
5
|
import {
|
|
2
6
|
isSafeMemoryContent
|
|
3
7
|
} from "./chunk-5GKPFL3S.js";
|
|
@@ -10,34 +14,6 @@ import {
|
|
|
10
14
|
|
|
11
15
|
// src/provenance.ts
|
|
12
16
|
import { z } from "zod";
|
|
13
|
-
|
|
14
|
-
// src/connectors/coerce.ts
|
|
15
|
-
function coerceBool(value) {
|
|
16
|
-
if (typeof value === "boolean") return value;
|
|
17
|
-
if (typeof value === "string") {
|
|
18
|
-
const v = value.trim().toLowerCase();
|
|
19
|
-
if (["false", "0", "no", "off"].includes(v)) return false;
|
|
20
|
-
if (["true", "1", "yes", "on"].includes(v)) return true;
|
|
21
|
-
}
|
|
22
|
-
return void 0;
|
|
23
|
-
}
|
|
24
|
-
function coerceInstallExtension(value) {
|
|
25
|
-
return coerceBool(value);
|
|
26
|
-
}
|
|
27
|
-
function coerceNumber(value) {
|
|
28
|
-
if (typeof value === "number") {
|
|
29
|
-
return Number.isFinite(value) ? value : void 0;
|
|
30
|
-
}
|
|
31
|
-
if (typeof value === "string") {
|
|
32
|
-
const trimmed = value.trim();
|
|
33
|
-
if (trimmed.length === 0) return void 0;
|
|
34
|
-
const n = Number(trimmed);
|
|
35
|
-
return Number.isFinite(n) ? n : void 0;
|
|
36
|
-
}
|
|
37
|
-
return void 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// src/provenance.ts
|
|
41
17
|
var PROVENANCE_SOURCE_KEY_ORDER = [
|
|
42
18
|
"sessionKey",
|
|
43
19
|
"turnId",
|
|
@@ -315,9 +291,6 @@ function buildFactProvenance(factQuote, turns, config) {
|
|
|
315
291
|
}
|
|
316
292
|
|
|
317
293
|
export {
|
|
318
|
-
coerceBool,
|
|
319
|
-
coerceInstallExtension,
|
|
320
|
-
coerceNumber,
|
|
321
294
|
serializeProvenanceFields,
|
|
322
295
|
parseProvenanceTag,
|
|
323
296
|
reconcileProvenanceRead,
|
|
@@ -325,4 +298,4 @@ export {
|
|
|
325
298
|
parseProvenanceConfig,
|
|
326
299
|
buildFactProvenance
|
|
327
300
|
};
|
|
328
|
-
//# sourceMappingURL=chunk-
|
|
301
|
+
//# sourceMappingURL=chunk-MDBZTH7N.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/provenance.ts"],"sourcesContent":["/**\n * Claim-level provenance spans (issue #1575 PR 1).\n *\n * Centralizes the parse/serialize logic for the `sources` array and the\n * coarse `provenance` strength tag, plus the `provenance` config-block\n * parser. Extracted from `storage.ts` and `config.ts` so those files keep\n * only thin delegation call-sites — the frontmatter round-trip and config\n * parsing growth lives here (issue #1520 ratchet discipline).\n *\n * Contract:\n * - When no provenance fields are present, output is byte-identical to\n * pre-feature behavior (rule 39).\n * - Corrupt `sources` lines / unknown `provenance` tags drop to\n * `undefined` on read so a malformed frontmatter never poisons\n * downstream readers (rule 34 spirit — drop corrupt rather than poison).\n * - Validation lives on the write path; this module only parses.\n * - Invariant (review round 5, cursor thread KQN): a `verified` or\n * `unverified` tag is NEVER persisted/read without surviving sources —\n * without excerpts the tag is indistinguishable from a grounded fact to\n * downstream faithfulness/correction/TrustScore surfaces. The invariant\n * is enforced symmetrically: `serializeProvenanceFields` (write) and\n * `reconcileProvenanceRead` (read) both downgrade the tag to `none`\n * when no source survives.\n */\n\nimport { z } from \"zod\";\n\nimport { coerceBool, coerceNumber } from \"./connectors/coerce.js\";\nimport { readEnvVar } from \"./runtime/env.js\";\nimport { collapseWhitespace } from \"./whitespace.js\";\nimport type { MemoryFrontmatter, ProvenanceConfig, ProvenanceSource } from \"./types.js\";\nimport { isSafeMemoryContent } from \"./sanitize.js\";\n\n/**\n * Canonical key order for a serialized `ProvenanceSource` (issue #1575).\n * Deterministic emission (rule 38) — readers and the byte-identical-when-off\n * contract (rule 39) depend on this order never drifting.\n */\nconst PROVENANCE_SOURCE_KEY_ORDER = [\n \"sessionKey\",\n \"turnId\",\n \"observedAt\",\n \"quote\",\n \"charStart\",\n \"charEnd\",\n] as const;\n\n/**\n * Build a single `ProvenanceSource` object whose keys appear in the canonical\n * order, omitting absent optional fields. The result is what gets fed to\n * `JSON.stringify` so the on-disk line is deterministic.\n */\nfunction canonicalProvenanceSource(src: ProvenanceSource): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const key of PROVENANCE_SOURCE_KEY_ORDER) {\n const value = src[key];\n if (value !== undefined) out[key] = value;\n }\n return out;\n}\n\n/**\n * Serialize the `sources` array (issue #1575) as a single JSON line, matching\n * the `structuredAttributes` precedent. Each entry is rebuilt in canonical key\n * order (rule 38) so the output is byte-stable. The `provenance` enum is\n * emitted bare (same style as `status`) — only the three documented values\n * are ever written.\n *\n * Verified-requires-evidence invariant (review round 5, cursor thread KQN):\n * a `verified`/`unverified` tag is downgraded to `none` whenever no source\n * survives write validation — whether sources were absent, an empty array,\n * or all entries failed the schema. This covers all three failure shapes the\n * earlier 3-branch logic left open (`{provenance:\"verified\"}`,\n * `{sources:[],provenance:\"verified\"}`, `{sources:[invalid…],provenance:\"verified\"}`).\n */\nexport function serializeProvenanceFields(fm: MemoryFrontmatter, lines: string[]): void {\n let hasValidSources = false;\n if (fm.sources && fm.sources.length > 0) {\n // Validate each entry against the same schema used on read so invalid\n // in-memory sources are dropped at write time, not silently lost on the\n // next read (review thread 4 — write-path validation parity).\n const canonical: Record<string, unknown>[] = [];\n for (const src of fm.sources) {\n const result = ProvenanceSourceSchema.safeParse(src);\n if (result.success) canonical.push(canonicalProvenanceSource(result.data));\n }\n if (canonical.length > 0) {\n lines.push(`sources: ${JSON.stringify(canonical)}`);\n hasValidSources = true;\n }\n }\n // A verified/unverified tag requires surviving evidence; without it the\n // tag is meaningless downstream (faithfulness/TrustScore cannot distinguish\n // it from a grounded fact). Downgrade to \"none\" regardless of WHY no source\n // survived (absent / empty / all-invalid) — single invariant, all cases.\n const tag =\n (fm.provenance === \"verified\" || fm.provenance === \"unverified\") && !hasValidSources\n ? \"none\"\n : fm.provenance;\n if (tag) {\n lines.push(`provenance: ${tag}`);\n }\n}\n\n/**\n * Parse the coarse `provenance` strength tag (issue #1575). Returns\n * `undefined` for missing/blank/unknown values so a corrupt or hand-edited\n * field fails safely to the legacy-equivalent `\"none\"` semantics on read\n * (rule 34 spirit — drop corrupt rather than poison).\n */\nexport function parseProvenanceTag(\n raw: string | undefined,\n): \"verified\" | \"unverified\" | \"none\" | undefined {\n if (raw === undefined) return undefined;\n const trimmed = raw.trim();\n if (trimmed.length === 0) return undefined;\n if (trimmed === \"verified\" || trimmed === \"unverified\" || trimmed === \"none\") {\n return trimmed;\n }\n return undefined;\n}\n\n/**\n * Enforce the verified-requires-evidence invariant on the READ path.\n * `parseProvenanceTag` and `parseProvenanceSources` are independent (they\n * parse separate frontmatter lines), so a hand-edited or imported memory may\n * carry `provenance: verified` with no surviving `sources` — a corrupt line,\n * an empty array, or all-invalid entries. Downgrade such a tag to `none` so\n * the in-memory object never exposes an ungrounded \"verified\" fact\n * (review round 5, cursor thread KQN — read-path parity with the write-path\n * downgrade in `serializeProvenanceFields`). `none`/`undefined` tags pass\n * through unchanged.\n */\nexport function reconcileProvenanceRead(\n tag: \"verified\" | \"unverified\" | \"none\" | undefined,\n sources: ProvenanceSource[] | undefined,\n): \"verified\" | \"unverified\" | \"none\" | undefined {\n if ((tag === \"verified\" || tag === \"unverified\") && (!sources || sources.length === 0)) {\n return \"none\";\n }\n return tag;\n}\n\n/**\n * Strict ISO-8601 timestamp check (review round 6, codex thread OXPAp).\n * `Date.parse` accepts non-ISO strings (bare years like `\"123\"`) and\n * silently normalizes calendar overflow (`2026-02-30` -> March 2, hour 25\n * -> next day), so malformed provenance survives as if valid. Require the\n * full `YYYY-MM-DDTHH:MM:SS[.fff](Z|±HH:MM)` shape and reject overflow via a\n * `Date.UTC` round-trip component check — the offset does not affect whether\n * a wall-clock field overflows, so this is correct for any timezone suffix.\n */\nfunction isStrictIsoTimestamp(s: string): boolean {\n const m = /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$/.exec(s);\n if (!m) return false;\n const y = Number(m[1]), mo = Number(m[2]), da = Number(m[3]);\n const h = Number(m[4]), mi = Number(m[5]), se = Number(m[6]);\n // Date.UTC normalizes overflow (Feb 30 -> Mar 2); a component round-trip\n // catches what Date.parse silently accepts.\n const d = new Date(Date.UTC(y, mo - 1, da, h, mi, se));\n // The component round-trip validates wall-clock overflow (Feb 30 -> Mar 2);\n // Date.parse additionally rejects impossible timezone offsets such as\n // +99:99, which the regex accepts but the runtime treats as NaN\n // (codex thread OXQ0e).\n return (\n !Number.isNaN(Date.parse(s)) &&\n d.getUTCFullYear() === y &&\n d.getUTCMonth() === mo - 1 &&\n d.getUTCDate() === da &&\n d.getUTCHours() === h &&\n d.getUTCMinutes() === mi &&\n d.getUTCSeconds() === se\n );\n}\n\n/**\n * Coerce a turn timestamp to a strict ISO-8601 string (cursor thread Ocveu —\n * \"Non-ISO turn timestamps drop sources\"). The write-path `ProvenanceSourceSchema`\n * rejects anything `isStrictIsoTimestamp` fails, so a turn whose `timestamp`\n * parses via `new Date(...)` but isn't already strict ISO (e.g.\n * `\"2026/01/15 12:00:00\"` or `\"Jan 15 2026\"`) would be silently dropped at\n * serialization — clearing the whole `sources` array and downgrading the tag\n * to `\"none\"`. Normalizing at extraction time preserves the source.\n *\n * Returns the strict ISO string when the timestamp already passes or\n * `Date.parse` can round-trip it; `undefined` for empty / unparseable input\n * so callers can decide whether to skip the source or fall back.\n */\nfunction toStrictIsoTimestamp(ts: string | undefined | null): string | undefined {\n if (typeof ts !== \"string\" || ts.length === 0) return undefined;\n if (isStrictIsoTimestamp(ts)) return ts;\n const parsed = Date.parse(ts);\n if (Number.isNaN(parsed)) return undefined;\n // Reject bare-year / numeric-only strings that Date.parse accepts (e.g.\n // \"123\") — isStrictIsoTimestamp already rejected them, and the round-trip\n // below would otherwise resurrect them. Require at least one date/time\n // separator so a plain number never round-trips into a fake epoch.\n if (!/[-:T]/.test(ts)) return undefined;\n // Reject calendar-overflow dates (chatgpt-codex-connector thread dANc):\n // Date.parse silently rolls over invalid components — \"2026-02-30\" becomes\n // 2026-03-02 — fabricating the observation date. For strings that carry an\n // explicit numeric Y/M/D prefix (the common import/provider shape), validate\n // the calendar components are in range before accepting the shifted result.\n // isStrictIsoTimestamp already does this for full ISO strings; this closes\n // the gap for the non-ISO normalization path.\n const ymd = /^(\\d{4})\\D(\\d{1,2})\\D(\\d{1,2})/.exec(ts);\n if (ymd) {\n const [_, ys, ms, ds] = ymd;\n const y = Number(ys), mo = Number(ms), da = Number(ds);\n if (!isValidCalendarDate(y, mo, da)) return undefined;\n }\n // Also validate M/D/Y or D/M/Y formats (provider/import common shapes:\n // 02/30/2026, 30-02-2026, etc.). Date.parse silently shifts overflow in\n // these too. Try both month-first and day-first interpretations; if\n // neither is a valid calendar date, reject (chatgpt-codex-connector thread\n // dH47 — non-YMD overflow timestamps).\n const mdy = /^(\\d{1,2})\\D(\\d{1,2})\\D(\\d{4})/.exec(ts);\n if (mdy) {\n const a = Number(mdy[1]), b = Number(mdy[2]), yr = Number(mdy[3]);\n if (!isValidCalendarDate(yr, a, b) && !isValidCalendarDate(yr, b, a)) {\n return undefined;\n }\n }\n const iso = new Date(parsed).toISOString();\n return isStrictIsoTimestamp(iso) ? iso : undefined;\n}\n\n/**\n * Validate numeric calendar components without Date overflow (review thread\n * dANc). Date.UTC silently normalizes Feb 30 -> Mar 2; a component round-trip\n * catches what Date.parse accepts. Mirrors the same technique isStrictIsoTimestamp\n * uses for full ISO strings, applied here to the non-ISO normalization path.\n */\nfunction isValidCalendarDate(y: number, mo: number, da: number): boolean {\n if (mo < 1 || mo > 12 || da < 1) return false;\n const leap = (y % 4 === 0 && (y % 100 !== 0 || y % 400 === 0)) ? 29 : 28;\n const daysInMonth = [31, leap, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n return da <= daysInMonth[mo - 1]!;\n}\n\n/**\n * Zod schema for a single `ProvenanceSource` entry (issue #1575). Parsed\n * JSON from frontmatter is external data, so each entry is validated here\n * rather than trusted via a cast (rule: no inline-cast-access on parsed\n * blobs). `safeParse` lets us drop corrupt entries individually instead of\n * failing the whole field.\n */\nconst ProvenanceSourceSchema = z\n .object({\n sessionKey: z.string().min(1),\n observedAt: z\n .string()\n .min(1)\n .refine(isStrictIsoTimestamp, \"must be a valid ISO 8601 timestamp (YYYY-MM-DDTHH:MM:SS[Z|±HH:MM], no calendar overflow)\"),\n quote: z.string().min(1),\n turnId: z.string().min(1).optional(),\n charStart: z.number().finite().nonnegative().int().optional(),\n charEnd: z.number().finite().nonnegative().int().optional(),\n })\n .refine(\n (src) => src.charStart === undefined || src.charEnd === undefined || src.charEnd >= src.charStart,\n { message: \"charEnd must be >= charStart (half-open interval, rule 35)\" },\n );\n\n/**\n * Parse the `sources` array (issue #1575) from its single-line JSON form.\n * Mirrors `parseStructuredAttributes` (JSON.parse) but validates each entry\n * against `ProvenanceSourceSchema` and DROPS corrupt ones rather than\n * poisoning downstream readers — the same \"drop corrupt rather than poison\"\n * contract as `parseMemoryWorthCounterField`. If no entry survives, the\n * whole field is `undefined` (legacy-equivalent).\n */\nexport function parseProvenanceSources(raw: string | undefined): ProvenanceSource[] | undefined {\n if (raw === undefined) return undefined;\n const trimmed = raw.trim();\n if (trimmed.length === 0) return undefined;\n let parsed: unknown;\n try {\n parsed = JSON.parse(trimmed);\n } catch {\n return undefined;\n }\n if (!Array.isArray(parsed)) return undefined;\n const sources: ProvenanceSource[] = [];\n for (const entry of parsed) {\n const result = ProvenanceSourceSchema.safeParse(entry);\n if (result.success) sources.push(result.data);\n }\n return sources.length > 0 ? sources : undefined;\n}\n\n/**\n * Parse the `provenance` config block (issue #1575 PR 1). Validates the\n * shape before applying defaults — a shorthand like `provenance: false` must\n * reject loudly rather than normalize to `{}` and silently enable the feature\n * (rule 51). Booleans coerce via `coerceBool` (rule 36); numeric cap clamps\n * at 1 (rule 28). `REMNIC_PROVENANCE_ENABLED` / `ENGRAM_PROVENANCE_ENABLED`\n * are honored only when the `enabled` key is omitted (explicit config wins).\n *\n * Schema-default note (review rounds 1–3, settled): `provenance.enabled` has\n * NO `\"default\"` in any plugin.json schema. OpenClaw's loader runs\n * `applyDefaults: true` before exposing `api.pluginConfig` (src/index.ts:1345,\n * PR #1593 round 8), so a schema default would be materialized into the\n * merged config and mask the `REMNIC_`/`ENGRAM_` env override. The code-level\n * default-on here (`return true` when `enabled` is omitted) supplies the\n * default-on behavior without that materialization. This matches the\n * emitLegacyTools/namespaceCatalogEnabled precedent, which omits the env\n * override only after a raw-vs-effective split — overkill for a single\n * boolean, so this field uses the simpler omit-the-default approach.\n */\nexport function parseProvenanceConfig(raw: unknown): ProvenanceConfig {\n if (\n raw !== undefined &&\n (raw === null || typeof raw !== \"object\" || Array.isArray(raw))\n ) {\n throw new Error(\n `provenance must be an object (got ${JSON.stringify(raw)}). Use provenance: { enabled: false } to opt out; omit the key to use the default-on behavior (issue #1575).`,\n );\n }\n const rawProvenance =\n raw && typeof raw === \"object\" && !Array.isArray(raw)\n ? (raw as Record<string, unknown>)\n : {};\n return {\n enabled: (() => {\n if (rawProvenance.enabled === undefined) {\n const envEnabled =\n readEnvVar(\"REMNIC_PROVENANCE_ENABLED\") ?? readEnvVar(\"ENGRAM_PROVENANCE_ENABLED\");\n if (envEnabled !== undefined) {\n const coerced = coerceBool(envEnabled);\n if (coerced === undefined) {\n throw new Error(\n `REMNIC_PROVENANCE_ENABLED must be a boolean-like value (true/false/1/0/yes/no/on/off); got ${JSON.stringify(envEnabled)}`,\n );\n }\n return coerced;\n }\n return true;\n }\n const coerced = coerceBool(rawProvenance.enabled);\n if (coerced === undefined) {\n throw new Error(\n `provenance.enabled must be a boolean or one of \"true\"/\"false\"/\"1\"/\"0\"/\"yes\"/\"no\"/\"on\"/\"off\" (got ${JSON.stringify(rawProvenance.enabled)}). Omit the key to use the default-on behavior (issue #1575).`,\n );\n }\n return coerced;\n })(),\n maxQuoteChars: (() => {\n if (rawProvenance.maxQuoteChars === undefined) return 300;\n const rawCap = coerceNumber(rawProvenance.maxQuoteChars);\n // Reject present-but-invalid rather than silently widening the cap\n // (AGENTS.md input-validation rule — a typo should not persist more\n // text than the operator configured).\n if (rawCap === undefined || !Number.isFinite(rawCap) || rawCap < 1 || !Number.isInteger(rawCap)) {\n throw new Error(\n `provenance.maxQuoteChars must be a positive integer >= 1 (got ${JSON.stringify(rawProvenance.maxQuoteChars)}).`,\n );\n }\n return rawCap;\n })(),\n requireSpans: (() => {\n if (rawProvenance.requireSpans === undefined) return false;\n const coerced = coerceBool(rawProvenance.requireSpans);\n if (coerced === undefined) {\n throw new Error(\n `provenance.requireSpans must be a boolean or one of \"true\"/\"false\"/\"1\"/\"0\"/\"yes\"/\"no\"/\"on\"/\"off\" (got ${JSON.stringify(rawProvenance.requireSpans)}).`,\n );\n }\n return coerced;\n })(),\n };\n}\n\n// ---------------------------------------------------------------------------\n// Issue #1575 PR 2 — extraction-side post-parse validator.\n// ---------------------------------------------------------------------------\n//\n// This runs once at write time (inside `ExtractionEngine.extract`, after the\n// LLM output is parsed and sanitized, before the result is returned for\n// persistence). Its job: locate each fact's LLM-provided `quote` in the\n// buffered turn texts and build a `ProvenanceSource[]` with verified\n// offsets. Never throws, never drops a fact (rule 34 spirit — an\n// unverifiable span is a tagged state, not a silent failure).\n//\n// Reuses `collapseWhitespace` from `whitespace.ts` for normalization so there\n// is exactly one normalizer in the codebase (issue #1575 pitfall: \"do not\n// write a second normalizer\").\n// ---------------------------------------------------------------------------\n\n/**\n * A turn in the buffered conversation, reduced to the fields the provenance\n * validator needs. `ExtractionEngine.extract` maps its `BufferTurn[]` to this\n * shape so the validator is pure and testable without the full BufferTurn type.\n */\nexport interface ProvenanceTurnInput {\n content: string;\n sessionKey?: string;\n logicalSessionKey?: string;\n timestamp: string;\n turnId?: string;\n}\n\n/**\n * Result of building provenance for a single extracted fact.\n */\nexport interface ProvenanceBuildResult {\n /** Verified sources (one per matching turn). Absent when no quote survives. */\n sources?: ProvenanceSource[];\n /** Coarse strength tag persisted to frontmatter. */\n provenance: \"verified\" | \"unverified\" | \"none\";\n /**\n * Transient signal (never persisted): `true` when `config.requireSpans`\n * is enabled and the LLM-provided quote could not be located in ANY source\n * turn (the strict case `ProvenanceConfig.requireSpans` documents: \"facts\n * whose quote cannot be located are routed to `pending_review`\"). The\n * extraction consumer carries this onto the in-memory `ExtractedFact` so\n * the persist path can route the fact to the review queue. A quote that\n * WAS located but whose source was dropped (e.g. un-coercible timestamp)\n * does NOT set this flag — the span was found, so requireSpans is\n * satisfied (chatgpt-codex-connector thread 4xB).\n */\n requireSpansPending?: boolean;\n}\n\n/**\n * Cap a quote string at `maxChars`, truncating at the last word boundary that\n * fits and appending an ellipsis marker. Quotes at or under the cap pass\n * through unchanged. Operates on Unicode code points (not UTF-16 units) so\n * emoji and astral-plane characters are not split mid-glyph.\n */\nfunction capQuote(quote: string, maxChars: number): string {\n const glyphs = Array.from(quote);\n if (glyphs.length <= maxChars) return quote;\n // Walk backward from the cap to find a word boundary (space). If the entire\n // span is one long token (no spaces), cut at the cap — a hard cut is better\n // than no quote at all.\n let cut = maxChars;\n while (cut > 0 && !/\\s/.test(glyphs[cut - 1]!)) cut--;\n if (cut === 0) cut = maxChars; // no word boundary found\n return glyphs.slice(0, cut).join(\"\").trimEnd() + \"\\u2026\";\n}\n\n/**\n * Casefold a string for normalized matching. Uses `toLowerCase` (not\n * `toLocaleLowerCase`) for determinism across runtime locales — the existing\n * `normalizeFactKey` helper in extraction.ts follows the same convention.\n */\nfunction casefold(s: string): string {\n return s.toLowerCase();\n}\n\n/**\n * Locate `quote` within `text`, returning whether a match was found and, when\n * recoverable, the half-open `[start, end)` offsets. Tries exact substring\n * first, then whitespace/case-normalized match.\n *\n * For the normalized path, the mapping from the normalized string back to\n * original offsets is recovered by walking both strings in lockstep: we know\n * `collapseWhitespace(text)` is a subsequence of `text` with whitespace runs\n * collapsed, so we can track the original offset as we scan.\n *\n * Returns `{ matched: false }` when neither match succeeds. Returns\n * `{ matched: true, offsets }` when offsets are recoverable. Returns\n * `{ matched: true }` (offsets omitted) when the normalized substring was\n * found but original offsets could not be recovered — callers still treat\n * this as a verified match and record a source without offsets (cursor\n * thread Ocver — \"Normalized match drops verified provenance\").\n */\ntype LocateQuoteResult =\n | { matched: false }\n | { matched: true; offsets?: { charStart: number; charEnd: number } };\n\nfunction locateQuoteOffsets(quote: string, text: string): LocateQuoteResult {\n // 1. Exact substring match (handles unicode, curly quotes, emoji verbatim).\n const exactIdx = text.indexOf(quote);\n if (exactIdx >= 0) {\n return { matched: true, offsets: { charStart: exactIdx, charEnd: exactIdx + quote.length } };\n }\n\n // 2. Whitespace/case-normalized match. Collapse runs of whitespace and\n // casefold both sides, then find the normalized quote in the normalized\n // text. Recover original offsets by scanning forward from the normalized\n // match start through the original text, accumulating non-whitespace\n // glyphs until we've consumed the normalized quote length.\n const normQuote = collapseWhitespace(casefold(quote));\n if (normQuote.length === 0) return { matched: false };\n const normText = collapseWhitespace(casefold(text));\n const normIdx = normText.indexOf(normQuote);\n if (normIdx < 0) return { matched: false };\n\n // Recover original offsets: walk the original text, skipping leading\n // whitespace to align with the collapsed form, then track how many\n // normalized chars we've consumed.\n const normQuoteLen = normQuote.length;\n let origIdx = 0;\n // Skip leading whitespace in original text (collapseWhitespace trims both ends).\n while (origIdx < text.length && /\\s/.test(text[origIdx]!)) origIdx++;\n // Walk through original text, counting normalized chars consumed.\n // Each non-whitespace char in original = 1 normalized char.\n // Whitespace runs in original = 1 space in normalized (but only between non-ws).\n let normPos = 0;\n let origStart = -1;\n let origEnd = -1;\n let prevWasWs = true; // suppress the leading space in collapsed form\n while (origIdx < text.length && origEnd < 0) {\n const ch = text[origIdx]!;\n if (/\\s/.test(ch)) {\n if (!prevWasWs) {\n // This whitespace run collapses to a single space in normalized text.\n if (normPos === normIdx) origStart = origIdx; // normalized space aligns\n normPos++;\n prevWasWs = true;\n }\n origIdx++;\n continue;\n }\n // Non-whitespace char.\n if (normPos === normIdx && origStart < 0) {\n origStart = origIdx;\n }\n normPos++;\n prevWasWs = false;\n origIdx++;\n if (normPos >= normIdx + normQuoteLen) {\n origEnd = origIdx;\n }\n }\n if (origStart >= 0 && origEnd >= 0) {\n return { matched: true, offsets: { charStart: origStart, charEnd: origEnd } };\n }\n // Normalized substring was found, but original offsets are not recoverable\n // (edge case in the normalized mapping). The match still counts as verified\n // — record a source without offsets rather than dropping the turn entirely\n // (cursor thread Ocver). charStart/charEnd are best-effort debugging aids,\n // not a precondition for a verified source.\n return { matched: true };\n}\n\n/**\n * Build provenance sources for a single extracted fact by locating its\n * LLM-provided `quote` in the buffered turns (issue #1575 PR 2).\n *\n * Matching strategy (per issue design):\n * 1. Exact substring match in a turn → `provenance: \"verified\"` with\n * `charStart`/`charEnd` offsets.\n * 2. Whitespace/case-normalized match → `\"verified\"`, offsets recovered\n * when possible, else omitted.\n * 3. No match in any turn → `\"unverified\"` — the quote survives as a\n * source (the LLM vouched for it) but without located offsets.\n * 4. No quote provided by the LLM → `\"none\"` — no evidence to record.\n *\n * A quote appearing in multiple turns produces multiple sources (one per\n * matching turn) so a repeated utterance backs the fact from each occurrence.\n *\n * The quote is capped at `config.maxQuoteChars` (truncated at a word boundary\n * with an ellipsis marker) BEFORE storage. Locating uses the original\n * (untruncated) quote for maximum match fidelity; the capped excerpt is what\n * gets persisted.\n *\n * When `config.enabled === false`, returns `{ provenance: \"none\" }`\n * immediately — byte-identical to pre-feature extraction (rule 39).\n *\n * Never throws. An unexpected error degrades to `{ provenance: \"none\" }` so\n * extraction never crashes on a provenance hiccup (rule 13/18).\n */\n/**\n * Strip a leading extraction-prompt role label from a quote (cursor thread Oc3Z2\n * — \"Quote prompt mismatches validator\"). The extraction prompt renders each\n * buffered turn as `[role] content` (or `[context role] content`), so a\n * faithful LLM may include that prefix in its verbatim quote. buildFactProvenance\n * searches the raw `turn.content` (no prefix), so a quote carrying the label\n * would never match. Stripping the leading label lets the actual utterance\n * verify against the turn text. Only a SINGLE leading label is stripped — a\n * multi-turn quote (with embedded labels) is left untouched and will simply\n * fail to match a single turn, as before.\n *\n * The regex is constrained to the labels the prompt actually emits — `user`,\n * `assistant`, optionally prefixed with `context ` (extraction.ts renders\n * `[user]`, `[assistant]`, `[context user]`, `[context assistant]`). A\n * real utterance that happens to start with other bracketed text (e.g.\n * `[do not] deploy before approval`, `[P1] fix the cache`) is preserved\n * verbatim so the quote can match the turn and the persisted span retains its\n * original meaning (chatgpt-codex-connector thread 4xA — limiting role-prefix\n * stripping to actual prompt labels).\n */\nfunction stripLeadingRolePrefix(quote: string): string {\n return quote.replace(/^\\s*\\[(?:context\\s+)?(?:user|assistant)\\]\\s+/i, \"\");\n}\n\nexport function buildFactProvenance(\n factQuote: string | null | undefined,\n turns: ReadonlyArray<ProvenanceTurnInput>,\n config: ProvenanceConfig,\n): ProvenanceBuildResult {\n if (!config.enabled) return { provenance: \"none\" };\n const rawQuote = typeof factQuote === \"string\" ? factQuote.trim() : \"\";\n // requireSpans (chatgpt-codex-connector thread dEsu + cursor thread dGKJ):\n // every early exit that drops a fact's span (no quote, empty after label\n // strip, or unsafe quote) must flag requireSpansPending when the operator\n // opted into requireSpans, so the persist path routes the fact to\n // pending_review instead of active. Only the disabled-feature exit (above)\n // and the unexpected-error catch (below) omit the flag — those are\n // policy-neutral degradations, not a missing-span decision.\n const noneResult = (): ProvenanceBuildResult =>\n config.requireSpans === true\n ? { provenance: \"none\", requireSpansPending: true }\n : { provenance: \"none\" };\n if (rawQuote.length === 0) return noneResult();\n // Strip a leading prompt role label so a faithful quote verifies against\n // the raw turn content (cursor thread Oc3Z2). Prefer the RAW quote when it\n // matches at least one turn — an utterance that literally begins with\n // [user]/[assistant] must verify as-is, not be truncated to the post-label\n // text (cursor/codex thread dEsw). The strip handles the common case where\n // the LLM includes the prompt label; this preserves the rare case where the\n // utterance itself starts with that text.\n const strippedQuote = stripLeadingRolePrefix(rawQuote);\n const useRawQuote =\n rawQuote === strippedQuote ||\n turns.some(\n (t) =>\n typeof t?.content === \"string\" &&\n t.content.length > 0 &&\n locateQuoteOffsets(rawQuote, t.content).matched,\n );\n const quote = useRawQuote ? rawQuote : strippedQuote;\n if (quote.length === 0) return noneResult();\n // Sanitize the quote before persisting it as a provenance span\n // (chatgpt-codex-connector thread dANZ): the fact body is sanitized via\n // sanitizeMemoryContent, but sources[].quote was persisted verbatim,\n // reintroducing unsafe memory text (e.g. \"ignore previous instructions\")\n // through the provenance field exposed to memory_get/x-ray/faithfulness.\n // An unsafe quote cannot serve as evidence — drop the source entirely\n // (consistent with how the body is sanitized: unsafe text is redacted,\n // and a redacted quote is useless as a verbatim span).\n if (!isSafeMemoryContent(quote)) return noneResult();\n\n try {\n // Search every turn for the quote. Collect verified sources.\n const sources: ProvenanceSource[] = [];\n // Track the first turn where the quote was located even when its\n // timestamp can't be coerced (cursor thread 4Pj — \"Bad timestamp drops\n // matched source\"). Without this, a located-but-unverifiable quote falls\n // through to the unverified branch and is attributed to the *last* turn's\n // session, mislabeling the source's origin session. Also drives the\n // requireSpans signal: only a quote that was NOT located in any turn\n // qualifies for pending_review routing under requireSpans (thread 4xB).\n let locatedTurn: ProvenanceTurnInput | undefined;\n for (const turn of turns) {\n if (!turn || typeof turn.content !== \"string\" || turn.content.length === 0) continue;\n const located = locateQuoteOffsets(quote, turn.content);\n // cursor thread Ocver: a normalized match counts as verified even when\n // original offsets are unrecoverable — record the source without\n // charStart/charEnd instead of skipping the turn.\n if (!located.matched) continue;\n if (!locatedTurn) locatedTurn = turn;\n // cursor thread Ocveu: normalize the turn timestamp to strict ISO so\n // the write-path ProvenanceSourceSchema keeps the source. Skip the turn\n // when the timestamp can't be coerced — pushing it would guarantee a\n // serialization drop (and the tag downgrade) for this source.\n const observedAt = toStrictIsoTimestamp(turn.timestamp);\n if (!observedAt) continue;\n sources.push({\n sessionKey: turn.sessionKey ?? turn.logicalSessionKey ?? \"unknown\",\n ...(turn.turnId ? { turnId: turn.turnId } : {}),\n observedAt,\n quote: capQuote(quote, config.maxQuoteChars),\n ...(located.offsets\n ? { charStart: located.offsets.charStart, charEnd: located.offsets.charEnd }\n : {}),\n });\n }\n\n if (sources.length > 0) {\n return { sources, provenance: \"verified\" };\n }\n\n // Quote provided but could not be turned into a verified source.\n // Determine the session to attribute: prefer the turn where the quote was\n // LOCATED even if its timestamp couldn't be coerced (cursor thread 4Pj — a\n // located quote must not be tied to the *last* turn's session). If the\n // quote was not located in any turn at all, fall back to the last turn's\n // session (the documented unverified behavior: the LLM vouched for the\n // excerpt but we couldn't pin it to a character offset). Normalize the\n // timestamp (thread Ocveu); fall back to epoch when no turn supplies a\n // coercible timestamp so the unverified source still survives the\n // write-path schema.\n const fallbackTurn = locatedTurn ?? turns[turns.length - 1];\n const fallbackSessionKey = fallbackTurn\n ? (fallbackTurn.sessionKey ?? fallbackTurn.logicalSessionKey ?? \"unknown\")\n : \"unknown\";\n const fallbackObservedAt = fallbackTurn\n ? (toStrictIsoTimestamp(fallbackTurn.timestamp) ?? new Date(0).toISOString())\n : new Date(0).toISOString();\n // requireSpans signal (chatgpt-codex-connector thread 4xB): when an\n // operator opts into provenance.requireSpans, a fact whose quote could\n // not be located in ANY turn (locatedTurn undefined) is flagged so the\n // persist path routes it to pending_review instead of active. A quote\n // that WAS located (locatedTurn set) satisfies requireSpans even when\n // its source was dropped for an un-coercible timestamp — the span was\n // found, so the fact has the grounding requireSpans demands.\n const requireSpansPending =\n config.requireSpans === true && locatedTurn === undefined;\n return {\n sources: [\n {\n sessionKey: fallbackSessionKey,\n observedAt: fallbackObservedAt,\n quote: capQuote(quote, config.maxQuoteChars),\n },\n ],\n provenance: \"unverified\",\n ...(requireSpansPending ? { requireSpansPending: true } : {}),\n };\n } catch {\n // Never crash extraction on a provenance error (rule 13/18).\n return { provenance: \"none\" };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAyBA,SAAS,SAAS;AAalB,IAAM,8BAA8B;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAOA,SAAS,0BAA0B,KAAgD;AACjF,QAAM,MAA+B,CAAC;AACtC,aAAW,OAAO,6BAA6B;AAC7C,UAAM,QAAQ,IAAI,GAAG;AACrB,QAAI,UAAU,OAAW,KAAI,GAAG,IAAI;AAAA,EACtC;AACA,SAAO;AACT;AAgBO,SAAS,0BAA0B,IAAuB,OAAuB;AACtF,MAAI,kBAAkB;AACtB,MAAI,GAAG,WAAW,GAAG,QAAQ,SAAS,GAAG;AAIvC,UAAM,YAAuC,CAAC;AAC9C,eAAW,OAAO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
|
import {
|
|
8
8
|
DECISION_SUBCOMMANDS,
|
|
9
9
|
DELTA_SUBCOMMANDS,
|
|
10
10
|
EngramAccessInputError,
|
|
11
11
|
isCodegraphToolName
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GDUOCHCD.js";
|
|
13
13
|
import {
|
|
14
14
|
CorrectionContractError
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VCLGUIFM.js";
|
|
16
16
|
|
|
17
17
|
// src/access-operations.ts
|
|
18
18
|
import { z } from "zod";
|
|
@@ -465,4 +465,4 @@ export {
|
|
|
465
465
|
codegraphIngestTracesOperation,
|
|
466
466
|
REGISTERED_OPERATIONS
|
|
467
467
|
};
|
|
468
|
-
//# sourceMappingURL=chunk-
|
|
468
|
+
//# sourceMappingURL=chunk-N77ELJ2D.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runPostConsolidationMaterialize
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A7TJZLPK.js";
|
|
4
4
|
import {
|
|
5
5
|
discoverMemoryExtensions,
|
|
6
6
|
renderExtensionsBlock,
|
|
@@ -217,4 +217,4 @@ export {
|
|
|
217
217
|
buildExtensionsBlockForConsolidation,
|
|
218
218
|
materializeAfterSemanticConsolidation
|
|
219
219
|
};
|
|
220
|
-
//# sourceMappingURL=chunk-
|
|
220
|
+
//# sourceMappingURL=chunk-NXRUUDUF.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-ZFXCQPNO.js";
|
|
5
5
|
import {
|
|
6
6
|
StorageManager
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EVPNWN7Z.js";
|
|
8
8
|
import {
|
|
9
9
|
MutationSerializer
|
|
10
10
|
} from "./chunk-LTJAMRGI.js";
|
|
@@ -336,4 +336,4 @@ export {
|
|
|
336
336
|
resolveNamespaceStorageRoot,
|
|
337
337
|
NamespaceStorageRouter
|
|
338
338
|
};
|
|
339
|
-
//# sourceMappingURL=chunk-
|
|
339
|
+
//# sourceMappingURL=chunk-OHTOPFRF.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-7FL4CNPV.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveCausalTrajectoryStoreDir
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SQNED75R.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeRecallTokens
|
|
9
9
|
} from "./chunk-ZBJMUXZH.js";
|
|
@@ -339,4 +339,4 @@ export {
|
|
|
339
339
|
scoreStitchCandidate,
|
|
340
340
|
stitchCausalChain
|
|
341
341
|
};
|
|
342
|
-
//# sourceMappingURL=chunk-
|
|
342
|
+
//# sourceMappingURL=chunk-ORAK3LNZ.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
readNamespaceMaintenanceLastRanStatuses,
|
|
4
4
|
readNamespaceMaintenanceStatuses,
|
|
5
5
|
runNamespaceMaintenancePlan
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EXUCUPV2.js";
|
|
7
7
|
|
|
8
8
|
// src/maintenance/namespace-maintenance-fanout.ts
|
|
9
9
|
var NAMESPACE_MAINTENANCE_JOBS = [
|
|
@@ -146,4 +146,4 @@ export {
|
|
|
146
146
|
summarizeNamespaceMaintenanceHealth,
|
|
147
147
|
formatNamespaceMaintenanceHealthText
|
|
148
148
|
};
|
|
149
|
-
//# sourceMappingURL=chunk-
|
|
149
|
+
//# sourceMappingURL=chunk-PD42EYQN.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/connectors/coerce.ts
|
|
2
|
+
function coerceBool(value) {
|
|
3
|
+
if (typeof value === "boolean") return value;
|
|
4
|
+
if (typeof value === "string") {
|
|
5
|
+
const v = value.trim().toLowerCase();
|
|
6
|
+
if (["false", "0", "no", "off"].includes(v)) return false;
|
|
7
|
+
if (["true", "1", "yes", "on"].includes(v)) return true;
|
|
8
|
+
}
|
|
9
|
+
return void 0;
|
|
10
|
+
}
|
|
11
|
+
function coerceInstallExtension(value) {
|
|
12
|
+
return coerceBool(value);
|
|
13
|
+
}
|
|
14
|
+
function coerceNumber(value) {
|
|
15
|
+
if (typeof value === "number") {
|
|
16
|
+
return Number.isFinite(value) ? value : void 0;
|
|
17
|
+
}
|
|
18
|
+
if (typeof value === "string") {
|
|
19
|
+
const trimmed = value.trim();
|
|
20
|
+
if (trimmed.length === 0) return void 0;
|
|
21
|
+
const n = Number(trimmed);
|
|
22
|
+
return Number.isFinite(n) ? n : void 0;
|
|
23
|
+
}
|
|
24
|
+
return void 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
coerceBool,
|
|
29
|
+
coerceInstallExtension,
|
|
30
|
+
coerceNumber
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=chunk-PHK3HARR.js.map
|