@remnic/core 9.69.40 → 9.69.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access-admin-ops-surface.d.ts +13 -13
- package/dist/access-admin-ops-surface.js +69 -68
- package/dist/access-audit.js +2 -2
- package/dist/access-authorization-probe.d.ts +13 -13
- package/dist/access-authorization-probe.js +70 -69
- package/dist/access-boundary.d.ts +13 -13
- package/dist/access-boundary.js +69 -68
- package/dist/access-cli.js +157 -155
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +1 -1
- package/dist/access-extraction-force-flush.d.ts +13 -13
- package/dist/access-extraction-force-flush.js +69 -68
- package/dist/access-health-types.d.ts +1 -1
- package/dist/access-http-briefing.d.ts +13 -13
- package/dist/access-http-briefing.js +70 -69
- package/dist/access-http-lcm-compaction.d.ts +13 -13
- package/dist/access-http-lifecycle-flush.d.ts +13 -13
- package/dist/access-http-offline-stream.d.ts +13 -13
- package/dist/access-http-query.d.ts +2 -2
- package/dist/access-http-query.js +71 -70
- package/dist/access-http.d.ts +14 -14
- package/dist/access-http.js +90 -87
- package/dist/access-identity-continuity-surface.d.ts +11 -11
- package/dist/access-identity-continuity-surface.js +69 -68
- package/dist/access-lcm-surface.d.ts +13 -13
- package/dist/access-lcm-surface.js +69 -68
- package/dist/access-mcp-shared-context-tools.d.ts +156 -0
- package/dist/access-mcp-shared-context-tools.js +8 -0
- package/dist/access-mcp.d.ts +13 -13
- package/dist/access-mcp.js +81 -78
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-CKBumJ8W.d.ts → access-namespace-preflight-DWsMc9Dh.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +69 -68
- package/dist/access-observe-transcript.d.ts +11 -11
- package/dist/access-observe-write-category.d.ts +1 -1
- package/dist/access-observe-write-category.js +4 -4
- package/dist/access-observe-write-surface.d.ts +13 -13
- package/dist/access-observe-write-surface.js +69 -68
- package/dist/access-offline-manifest.d.ts +11 -11
- package/dist/access-offline-manifest.js +9 -9
- package/dist/access-operations-batch.js +74 -72
- package/dist/access-operations.d.ts +13 -13
- package/dist/access-operations.js +79 -77
- package/dist/access-recall-concurrency.d.ts +13 -13
- package/dist/access-recall-concurrency.js +69 -68
- package/dist/access-recall-response.d.ts +13 -13
- package/dist/access-recall-response.js +69 -68
- package/dist/access-recall-surface.d.ts +13 -13
- package/dist/access-recall-surface.js +69 -68
- package/dist/access-schema.d.ts +1 -1
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-DJ3qogNt.d.ts → access-service-Cisy5YDq.d.ts} +14 -9
- package/dist/access-service-helpers.d.ts +13 -13
- package/dist/access-service.d.ts +13 -13
- package/dist/access-service.js +69 -68
- package/dist/access-surface-catalog.d.ts +13 -13
- package/dist/access-surface-catalog.js +71 -70
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-wearables-meetings-surface.d.ts +4 -4
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-memory-bridge.js +3 -3
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +6 -6
- package/dist/activity/digest.d.ts +1 -1
- package/dist/ambient-provenance.d.ts +1 -1
- package/dist/artifact-search.d.ts +1 -1
- package/dist/{auto-sync-D6BAPIJV.js → auto-sync-7PGUFY7U.js} +7 -7
- package/dist/background-generation.d.ts +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +11 -11
- package/dist/briefing-window.d.ts +2 -2
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +17 -17
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer-turn-helpers.d.ts +1 -1
- package/dist/buffer.d.ts +2 -2
- package/dist/buffer.js +5 -5
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +1 -1
- package/dist/calibration.js +2 -2
- package/dist/capabilities.d.ts +1 -1
- package/dist/{capsule-crypto-7FJQINUR.js → capsule-crypto-YO5QJ6L3.js} +2 -2
- package/dist/{capsule-merge-IPG4IOFP.js → capsule-merge-3MNURAQ3.js} +2 -2
- package/dist/{catalog-BHXkBVhg.d.ts → catalog-wcX1QhtQ.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 +20 -20
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-M6RORUO5.js → chunk-2EYZ32LH.js} +24 -2
- package/dist/{chunk-M6RORUO5.js.map → chunk-2EYZ32LH.js.map} +1 -1
- package/dist/{chunk-VHKXRYQN.js → chunk-2HQPE2NM.js} +2 -2
- package/dist/{chunk-RDLPFM7I.js → chunk-2ZG2LLZT.js} +2 -2
- package/dist/{chunk-IMBQFHRV.js → chunk-3BLHPQHT.js} +5 -5
- package/dist/{chunk-6L2II3KS.js → chunk-3D75XIYO.js} +2 -2
- package/dist/{chunk-J272ODKJ.js → chunk-42DJ235G.js} +2 -2
- package/dist/{chunk-RJQAP333.js → chunk-46RII65S.js} +2 -2
- package/dist/{chunk-JUDT33RX.js → chunk-4AX5OYKC.js} +2 -2
- package/dist/{chunk-GSSDHAYH.js → chunk-4IGOLIWM.js} +2 -2
- package/dist/{chunk-4CMXI55L.js → chunk-54QPOE45.js} +2 -2
- package/dist/{chunk-LKFVVN7R.js → chunk-563X6JJX.js} +2 -2
- package/dist/{chunk-VQWBUPSJ.js → chunk-5EQT62HH.js} +2 -2
- package/dist/{chunk-BYQX4IOG.js → chunk-6MQMYXSQ.js} +2 -2
- package/dist/{chunk-TVVEYCNW.js → chunk-7K5Q6COX.js} +4 -4
- package/dist/{chunk-K75A5XWU.js → chunk-7ZLC4DTZ.js} +4 -4
- package/dist/{chunk-7Z54NXVS.js → chunk-A4OIJYCV.js} +2 -2
- package/dist/{chunk-QS5Q5RBV.js → chunk-AFJHNHAM.js} +8 -8
- package/dist/{chunk-TZ44E732.js → chunk-AIVRD66I.js} +2 -2
- package/dist/{chunk-OEDW4ER7.js → chunk-AJBWVDRV.js} +2 -1
- package/dist/chunk-AJBWVDRV.js.map +1 -0
- package/dist/{chunk-IOPIGX7Y.js → chunk-AKABVXFS.js} +2 -2
- package/dist/{chunk-KOTG3RXE.js → chunk-AUSRUOMQ.js} +2 -2
- package/dist/{chunk-K4A6UVPB.js → chunk-BTPCP535.js} +8 -8
- package/dist/{chunk-2NLLXCJG.js → chunk-BXLOS5AJ.js} +2 -2
- package/dist/{chunk-TEMKBSV6.js → chunk-C3G6MW4W.js} +3 -3
- package/dist/{chunk-3QEVOQF5.js → chunk-D6PY63OM.js} +2 -2
- package/dist/{chunk-DFVSJFHK.js → chunk-DBB5JPSL.js} +2 -2
- package/dist/{chunk-HJUP3K6L.js → chunk-DIXZQTGY.js} +2 -2
- package/dist/{chunk-ZX3AYNNV.js → chunk-DM5CU5J7.js} +2 -2
- package/dist/{chunk-X7Y7WX73.js → chunk-DQEMWVMT.js} +1 -1
- package/dist/{chunk-BGRTZOJB.js → chunk-E3I3NDUP.js} +4 -4
- package/dist/{chunk-ZAEPD4C2.js → chunk-E4LMQTST.js} +2 -2
- package/dist/{chunk-NETQXOPY.js → chunk-EH3HNCAM.js} +12 -7
- package/dist/{chunk-NETQXOPY.js.map → chunk-EH3HNCAM.js.map} +1 -1
- package/dist/{chunk-7D6SER6A.js → chunk-EMSYMYXO.js} +14 -14
- package/dist/{chunk-YNDLCWXS.js → chunk-EZ25VE3G.js} +4 -4
- package/dist/{chunk-V2ZA4YWE.js → chunk-F5H6YG5P.js} +2 -2
- package/dist/{chunk-YTK5MVNF.js → chunk-FGFC2EFR.js} +14 -13
- package/dist/chunk-FGFC2EFR.js.map +1 -0
- package/dist/{chunk-ZMWSYUUL.js → chunk-GCBIXUPT.js} +2 -2
- package/dist/{chunk-IS2IDFJP.js → chunk-GMH5QPUU.js} +22 -22
- package/dist/chunk-GMH5QPUU.js.map +1 -0
- package/dist/{chunk-LFVZD5EC.js → chunk-GWNSKQDA.js} +3 -3
- package/dist/{chunk-JDX2OA4R.js → chunk-HNHIHXSD.js} +2 -2
- package/dist/{chunk-2SNCQHJZ.js → chunk-I33QYUAF.js} +6 -6
- package/dist/{chunk-UZ6JYPJ6.js → chunk-I46BYY7U.js} +193 -150
- package/dist/chunk-I46BYY7U.js.map +1 -0
- package/dist/{chunk-MVG3KXON.js → chunk-ICN37XHG.js} +15 -15
- package/dist/chunk-IFBSZGW3.js +42 -0
- package/dist/chunk-IFBSZGW3.js.map +1 -0
- package/dist/{chunk-ICNJ6J46.js → chunk-IYIPXAIJ.js} +2 -2
- package/dist/{chunk-AEOOGXMQ.js → chunk-J2MGTGKC.js} +4 -4
- package/dist/chunk-JATHBCAV.js +94 -0
- package/dist/chunk-JATHBCAV.js.map +1 -0
- package/dist/{chunk-5U7K4W6K.js → chunk-JDOBQPJY.js} +3 -3
- package/dist/{chunk-TG3FAM2S.js → chunk-JL4TQYM5.js} +48 -1
- package/dist/{chunk-TG3FAM2S.js.map → chunk-JL4TQYM5.js.map} +1 -1
- package/dist/{chunk-NVVZPBKI.js → chunk-JMWUPUE6.js} +2 -2
- package/dist/{chunk-QPVNK2VE.js → chunk-JSD7Q7LD.js} +2 -2
- package/dist/{chunk-RLU2Y5GV.js → chunk-K5D2XVNN.js} +4 -4
- package/dist/{chunk-YTZN2UZO.js → chunk-KJLLPG26.js} +2 -2
- package/dist/{chunk-2SKMZUOW.js → chunk-KLUC2GSG.js} +6 -6
- package/dist/{chunk-YRIFXXMI.js → chunk-KZJM7R4F.js} +3 -3
- package/dist/{chunk-46Z3VGWF.js → chunk-LE2KZ72G.js} +3 -3
- package/dist/{chunk-HIP6DKJJ.js → chunk-LQVXSRAJ.js} +2 -2
- package/dist/{chunk-A7GQBJP5.js → chunk-LVFI5LG7.js} +7 -7
- package/dist/{chunk-5LYSEZOF.js → chunk-MCMS4VUK.js} +9 -8
- package/dist/chunk-MCMS4VUK.js.map +1 -0
- package/dist/{chunk-ROEFLU37.js → chunk-N6XTC56E.js} +13 -81
- package/dist/chunk-N6XTC56E.js.map +1 -0
- package/dist/{chunk-PKUJNICO.js → chunk-ND7MAIJC.js} +2 -2
- package/dist/{chunk-DAZANIYU.js → chunk-NYWCFC3K.js} +76 -77
- package/dist/{chunk-DAZANIYU.js.map → chunk-NYWCFC3K.js.map} +1 -1
- package/dist/{chunk-W23JARAQ.js → chunk-P66QH6R6.js} +2 -2
- package/dist/{chunk-62D2PAAM.js → chunk-PAAJWQH5.js} +4 -4
- package/dist/{chunk-XM46Y66S.js → chunk-PFKIOYJH.js} +2 -2
- package/dist/{chunk-C5R73BON.js → chunk-PGGPRF6J.js} +2 -2
- package/dist/{chunk-V6EGNVUT.js → chunk-PIWFNPQT.js} +4 -4
- package/dist/{chunk-JOP7W24J.js → chunk-PLJ2MQFT.js} +4 -4
- package/dist/{chunk-MJC7UKH7.js → chunk-PQ42DJNG.js} +2 -2
- package/dist/{chunk-37CAEC7E.js → chunk-PWPIERBM.js} +4 -4
- package/dist/{chunk-BXIJSPCL.js → chunk-Q62GA5U2.js} +2 -2
- package/dist/{chunk-CC37E3QM.js → chunk-QKCXRS5A.js} +16 -1
- package/dist/chunk-QKCXRS5A.js.map +1 -0
- package/dist/{chunk-VKWFNPBH.js → chunk-RQQO3ORQ.js} +2 -2
- package/dist/{chunk-SFHLQPBF.js → chunk-S4MJTIPG.js} +85 -81
- package/dist/chunk-S4MJTIPG.js.map +1 -0
- package/dist/{chunk-THTF2W7M.js → chunk-TRTLWUDD.js} +19 -18
- package/dist/chunk-TRTLWUDD.js.map +1 -0
- package/dist/{chunk-KTOXQMW3.js → chunk-UHSOPTNB.js} +14 -4
- package/dist/chunk-UHSOPTNB.js.map +1 -0
- package/dist/{chunk-ES5BUPYB.js → chunk-UZGHKD3T.js} +2 -2
- package/dist/{chunk-62HFZNCJ.js → chunk-V2EXYQEQ.js} +11 -10
- package/dist/{chunk-62HFZNCJ.js.map → chunk-V2EXYQEQ.js.map} +1 -1
- package/dist/{chunk-QE6YVNP5.js → chunk-V2TOGJPM.js} +49 -16
- package/dist/chunk-V2TOGJPM.js.map +1 -0
- package/dist/{chunk-J4WGTN2N.js → chunk-V62YYBBY.js} +4 -4
- package/dist/{chunk-KQAFEZQX.js → chunk-VDX2J7OX.js} +2 -2
- package/dist/{chunk-Z4GUX2M6.js → chunk-VSN2DMQK.js} +2 -2
- package/dist/{chunk-ZHXSOMYH.js → chunk-VVX5PZFS.js} +2 -2
- package/dist/{chunk-KY236SP5.js → chunk-W7UV2ZCA.js} +3 -3
- package/dist/{chunk-TO36VPZI.js → chunk-WBQ4ONQJ.js} +2 -2
- package/dist/{chunk-WZYHPAG5.js → chunk-WFMQN7JE.js} +3 -3
- package/dist/{chunk-G2XZFGYN.js → chunk-WGZHSQDV.js} +4 -4
- package/dist/{chunk-MDIEES23.js → chunk-WN2OXGGH.js} +1 -1
- package/dist/chunk-WN2OXGGH.js.map +1 -0
- package/dist/{chunk-SUEOG2S4.js → chunk-WPGA4RYI.js} +2 -2
- package/dist/{chunk-SV4Z2S67.js → chunk-WUUGE7QC.js} +54 -21
- package/dist/chunk-WUUGE7QC.js.map +1 -0
- package/dist/{chunk-J7FVMLBR.js → chunk-WZIO3TW6.js} +2 -2
- package/dist/{chunk-ZZUVBZL2.js → chunk-X2QPKLPL.js} +2 -2
- package/dist/{chunk-JAJIMTFB.js → chunk-XRS65T4O.js} +9 -9
- package/dist/{chunk-GO5LOHCD.js → chunk-YFXAWGMR.js} +2 -2
- package/dist/{chunk-ZRMMXWYI.js → chunk-YR5QT4SR.js} +32 -9
- package/dist/chunk-YR5QT4SR.js.map +1 -0
- package/dist/{chunk-CARRTDKC.js → chunk-Z22M4JCY.js} +4 -3
- package/dist/chunk-Z22M4JCY.js.map +1 -0
- package/dist/{chunk-K4JKAXMO.js → chunk-Z535ADTC.js} +3 -3
- package/dist/{chunk-23HFXQ5J.js → chunk-Z7NBT6AK.js} +3 -3
- package/dist/{chunk-VQYWKCDR.js → chunk-ZX6NNFSY.js} +3 -3
- package/dist/{chunk-3XPN7AVY.js → chunk-ZYSOT6HD.js} +2 -2
- package/dist/{chunk-ZZCR2QYL.js → chunk-ZZEIL3MI.js} +2 -2
- package/dist/{cli-BWri5-am.d.ts → cli-CUlMlS2N.d.ts} +5 -5
- package/dist/cli.d.ts +15 -15
- package/dist/cli.js +116 -114
- package/dist/coding/export-okf-codegraph.d.ts +1 -1
- package/dist/coding/export-okf-codegraph.js +16 -16
- package/dist/coding/pre-action-gate.d.ts +1 -1
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +19 -19
- 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 +6 -6
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +19 -19
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/codex-materialize.js +2 -2
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +19 -19
- package/dist/consolidation-provenance-check.d.ts +2 -2
- package/dist/consolidation-undo.d.ts +2 -2
- package/dist/contradiction/index.d.ts +4 -4
- package/dist/contradiction/index.js +4 -4
- package/dist/{contradiction-scan-BSGKZHYJ.js → contradiction-scan-GVD4JJ7B.js} +4 -4
- package/dist/converge-config.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +2 -2
- package/dist/convergence-refresh.js +20 -20
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/corpus-watermark.d.ts +1 -1
- package/dist/corpus-watermark.js +19 -19
- package/dist/cross-lingual-recall.d.ts +1 -1
- package/dist/dashboard-runtime.js +2 -2
- package/dist/day-summary.d.ts +1 -1
- package/dist/deep-recall-config.d.ts +12 -1
- package/dist/deep-recall-config.js +5 -3
- package/dist/deep-recall-http-glue.d.ts +16 -14
- package/dist/deep-recall-http-glue.js +7 -4
- package/dist/deep-recall-mcp-tools.d.ts +13 -13
- package/dist/deep-recall-policy-llm.d.ts +12 -2
- package/dist/deep-recall-policy-llm.js +3 -3
- package/dist/deep-recall-seeds.d.ts +4 -1
- package/dist/deep-recall-seeds.js +1 -1
- package/dist/deep-recall.d.ts +12 -1
- package/dist/deep-recall.js +3 -2
- package/dist/delinearize.d.ts +1 -1
- package/dist/dependency-propagation-config.d.ts +1 -1
- package/dist/{dependency-propagation-delivery-ueZlKTQB.d.ts → dependency-propagation-delivery-BDDjImQn.d.ts} +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-origin-fields.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +2 -2
- package/dist/entity-retrieval.js +18 -18
- package/dist/entity-schema.d.ts +1 -1
- package/dist/episodic-context.d.ts +1 -1
- package/dist/eval-trajectory-contracts.d.ts +1 -1
- package/dist/eval-trajectory-store.d.ts +1 -1
- package/dist/eval-trajectory.d.ts +1 -1
- package/dist/explicit-capture.d.ts +11 -11
- package/dist/explicit-capture.js +3 -3
- package/dist/external-wiki-access.d.ts +13 -13
- package/dist/external-wiki-access.js +70 -69
- package/dist/external-wiki-collection-registration.d.ts +1 -1
- package/dist/external-wiki-collection.d.ts +1 -1
- package/dist/external-wiki-mcp-tools.d.ts +13 -13
- package/dist/extraction-error-classification.d.ts +1 -1
- package/dist/extraction-faithfulness.d.ts +2 -2
- package/dist/extraction-faithfulness.js +3 -3
- package/dist/extraction-judge-telemetry.d.ts +2 -2
- package/dist/extraction-judge-training.d.ts +2 -2
- package/dist/extraction-judge.d.ts +2 -2
- package/dist/extraction-judge.js +3 -3
- package/dist/extraction-liveness.d.ts +1 -1
- package/dist/extraction-normalization.d.ts +1 -1
- package/dist/extraction-prompt.d.ts +1 -1
- package/dist/extraction-source-grounding-rules.d.ts +1 -1
- package/dist/extraction-source-grounding.d.ts +1 -1
- package/dist/extraction-span-config.d.ts +1 -1
- package/dist/extraction-span-materialize.d.ts +1 -1
- package/dist/extraction.d.ts +2 -2
- package/dist/extraction.js +30 -30
- package/dist/fallback-llm-codex-subscription.d.ts +15 -5
- package/dist/fallback-llm-codex-subscription.js +3 -1
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/fallback-llm.js +2 -2
- package/dist/{first-start-migration-ZWMV5CX4.js → first-start-migration-L3UFX5CU.js} +4 -4
- package/dist/{generic-recall-paths-CpyVmA88.d.ts → generic-recall-paths-CpDzNO_I.d.ts} +1 -1
- package/dist/graph-append-error.d.ts +1 -1
- package/dist/graph-dashboard-diff.d.ts +1 -1
- package/dist/graph-dashboard-key.d.ts +1 -1
- package/dist/graph-dashboard-parser.d.ts +1 -1
- package/dist/graph-edge-reinforcement.d.ts +1 -1
- package/dist/graph-jsonl.d.ts +1 -1
- package/dist/graph-path-reconstruction.d.ts +1 -1
- package/dist/graph-path-scoring.d.ts +1 -1
- package/dist/graph-snapshot.d.ts +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/harmonic-retrieval.js +3 -3
- package/dist/importance.d.ts +1 -1
- package/dist/importers/index.d.ts +1 -1
- package/dist/importers/test-utils.d.ts +1 -1
- package/dist/in-flight-reads.d.ts +1 -1
- package/dist/{index-BvUA4S7M.d.ts → index-CtmmCJoo.d.ts} +3 -3
- package/dist/index.d.ts +26 -26
- package/dist/index.js +279 -275
- 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 +8 -8
- 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-BsJGulur.d.ts → local-llm-DpXIvm6F.d.ts} +1 -1
- package/dist/local-llm-helpers.d.ts +2 -2
- package/dist/local-llm.d.ts +2 -2
- package/dist/local-llm.js +2 -2
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/location/index.d.ts +3 -3
- package/dist/location/index.js +19 -19
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +18 -18
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +17 -17
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +19 -19
- package/dist/{maintenance-CYubtIRr.d.ts → maintenance-CNgoLsoM.d.ts} +7 -6
- package/dist/mcp-memory-inspector-app.d.ts +13 -13
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-controller.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-snapshot.d.ts +1 -1
- package/dist/memory-subject-cli.d.ts +13 -13
- package/dist/memory-subject.d.ts +13 -13
- package/dist/memory-worth-outcomes.d.ts +2 -2
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +3 -3
- package/dist/namespaces/migrate.js +18 -18
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +3 -3
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +17 -17
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/offline-sync-impression-drain.d.ts +1 -1
- package/dist/operator-doctor-corpus.d.ts +1 -1
- package/dist/operator-doctor-corpus.js +20 -20
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +35 -35
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +29 -29
- package/dist/{orchestrator-BWDRJ_0d.d.ts → orchestrator-DT7ybIFz.d.ts} +18 -10
- package/dist/orchestrator.d.ts +11 -11
- package/dist/orchestrator.js +157 -155
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-7JMn2yMH.d.ts → pipeline-CgBEmHcz.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/proactive-contention.d.ts +2 -2
- package/dist/provenance.d.ts +1 -1
- package/dist/{public-http-CJWs3mo9.d.ts → public-http-C8P8fyiO.d.ts} +1 -1
- package/dist/{qmd-CxCH9G9m.d.ts → qmd-BkY8KpCh.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +2 -2
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +2 -2
- package/dist/recall-concurrency-config.d.ts +1 -1
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +1 -1
- package/dist/recall-navigate-access.d.ts +1 -1
- package/dist/recall-navigate-access.js +2 -2
- package/dist/recall-navigate-disclosure.d.ts +1 -1
- package/dist/recall-navigate-disclosure.js +1 -1
- package/dist/recall-navigate.d.ts +1 -1
- package/dist/recall-navigate.js +2 -2
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-planner-llm.js +2 -2
- package/dist/recall-state-view-admission.d.ts +2 -2
- package/dist/recall-state-view-admission.js +7 -7
- package/dist/recall-state-view-anchors.d.ts +1 -1
- package/dist/recall-state-view-anchors.js +2 -2
- package/dist/recall-state-view-inject.js +2 -2
- package/dist/recall-state-view-render.js +2 -2
- package/dist/recall-state-view-widen.js +2 -2
- package/dist/recall-state-view-wire.js +3 -3
- package/dist/recall-state-view.d.ts +9 -1
- package/dist/recall-state-view.js +5 -3
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.d.ts +1 -1
- package/dist/recall-timings.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +1 -1
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/cursor.d.ts +1 -1
- package/dist/reconcile/cursor.js +2 -2
- package/dist/reconcile/manifest.d.ts +1 -1
- package/dist/reconcile/manifest.js +4 -4
- package/dist/reconcile/plan.d.ts +1 -1
- package/dist/reconcile/plan.js +2 -2
- package/dist/replay/normalizers/chatgpt.d.ts +1 -1
- package/dist/replay/normalizers/claude.d.ts +1 -1
- package/dist/replay/normalizers/openclaw.d.ts +1 -1
- package/dist/replay/normalizers/shared.d.ts +1 -1
- package/dist/replay/runner.d.ts +1 -1
- package/dist/replay/types.d.ts +1 -1
- package/dist/replica-divergence.d.ts +1 -1
- package/dist/replica-peers-config.d.ts +1 -1
- package/dist/{resolution-4GG3QZRJ.js → resolution-LXFQQ4AE.js} +5 -5
- package/dist/resolution-LXFQQ4AE.js.map +1 -0
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/resume-bundles.js +8 -8
- package/dist/retrieval-agents.d.ts +2 -2
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +1 -1
- package/dist/routing/store.d.ts +1 -1
- package/dist/salvage-envelope.d.ts +1 -1
- package/dist/{scope-profiles-BGAUqhBR.d.ts → scope-profiles-BBPjZ9jb.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 +2 -2
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +4 -4
- 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-CCeRD9pV.d.ts → semantic-consolidation-BPFFVO84.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +20 -20
- package/dist/semantic-rule-promotion.js +17 -17
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +17 -17
- package/dist/{service-BwpzRduk.d.ts → service-jKcr6Jvr.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +1 -1
- package/dist/shared-context/manager.js +2 -2
- package/dist/shared-context/write-output-controls.d.ts +34 -0
- package/dist/shared-context/write-output-controls.js +10 -0
- package/dist/shared-context/write-output-controls.js.map +1 -0
- package/dist/signal.d.ts +1 -1
- package/dist/source-agent-qualifier.d.ts +1 -1
- package/dist/source-agent-qualifier.js +25 -25
- package/dist/source-attribution.d.ts +23 -1
- package/dist/source-attribution.js +13 -3
- package/dist/standup/build.js +17 -17
- package/dist/{storage-BprAGBG0.d.ts → storage-C-0Ah5OY.d.ts} +1 -1
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +16 -16
- package/dist/subject-config.d.ts +1 -1
- package/dist/summarizer.d.ts +1 -1
- package/dist/summarizer.js +6 -6
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/support-passport/index.d.ts +16 -16
- package/dist/support-passport/index.js +72 -71
- package/dist/temporal-supersession.d.ts +2 -2
- package/dist/temporal-timeline-recall.d.ts +1 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +1 -1
- package/dist/tier-migration.d.ts +2 -2
- package/dist/tier-routing.d.ts +1 -1
- package/dist/tier-routing.js +3 -3
- package/dist/{tier-stats-LUSUUNU6.js → tier-stats-VK5PCO2L.js} +4 -4
- 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 +3 -3
- package/dist/transfer/export-okf.d.ts +1 -1
- package/dist/transfer/export-okf.js +17 -17
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-nJV23pa3.d.ts → types-cK5LydjL.d.ts} +5 -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 +17 -17
- package/dist/who-knows-cli.d.ts +13 -13
- package/dist/who-knows-cli.js +18 -18
- package/dist/who-knows.d.ts +13 -13
- package/dist/who-knows.js +17 -17
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +12 -2
- package/src/access-http.ts +1 -1
- package/src/access-mcp-shared-context-tools.ts +103 -0
- package/src/access-mcp.ts +4 -74
- package/src/access-operations-batch.ts +45 -2
- package/src/access-service.ts +14 -7
- package/src/activity/timeline/regenerate.test.ts +48 -0
- package/src/activity/timeline/regenerate.ts +7 -5
- package/src/cli/deep-recall-commands.ts +22 -10
- package/src/config.ts +5 -0
- package/src/dedup/merge.test.ts +283 -0
- package/src/deep-recall-boundary.test.ts +66 -0
- package/src/deep-recall-cli.test.ts +82 -0
- package/src/deep-recall-config.test.ts +56 -0
- package/src/deep-recall-config.ts +32 -0
- package/src/deep-recall-http-glue.ts +10 -10
- package/src/deep-recall-policy-llm.test.ts +242 -0
- package/src/deep-recall-policy-llm.ts +37 -7
- package/src/deep-recall-seeds.test.ts +53 -0
- package/src/deep-recall-seeds.ts +7 -1
- package/src/deep-recall-surface.test.ts +93 -0
- package/src/deep-recall.test.ts +121 -0
- package/src/deep-recall.ts +88 -28
- package/src/fallback-llm-codex-subscription.ts +27 -5
- package/src/fallback-llm.test.ts +120 -0
- package/src/fallback-llm.ts +17 -16
- package/src/meetings/config.test.ts +58 -0
- package/src/orchestration/extraction-persist.ts +1 -1
- package/src/orchestration/recall-entry.ts +15 -1
- package/src/orchestration/recall-internal.ts +1 -0
- package/src/orchestration/recall-section-coordinator.ts +65 -28
- package/src/orchestration/recall-state-view-pipeline.test.ts +8 -2
- package/src/orchestration/semantic-merge-commit-effects.ts +45 -16
- package/src/orchestration/semantic-merge-persist.ts +23 -36
- package/src/providers/codex-subscription.test.ts +127 -0
- package/src/providers/codex-subscription.ts +1 -1
- package/src/recall-state-view-budget.test.ts +424 -0
- package/src/recall-state-view.ts +30 -16
- package/src/shared-context/envelope-io.ts +25 -0
- package/src/shared-context/envelope-wiring.test.ts +4 -2
- package/src/shared-context/manager.ts +1 -0
- package/src/shared-context/write-output-controls.test.ts +192 -0
- package/src/shared-context/write-output-controls.ts +72 -0
- package/src/source-attribution.test.ts +39 -0
- package/src/source-attribution.ts +72 -0
- package/src/types.ts +5 -0
- package/dist/chunk-5LYSEZOF.js.map +0 -1
- package/dist/chunk-CARRTDKC.js.map +0 -1
- package/dist/chunk-CC37E3QM.js.map +0 -1
- package/dist/chunk-IS2IDFJP.js.map +0 -1
- package/dist/chunk-KTOXQMW3.js.map +0 -1
- package/dist/chunk-MDIEES23.js.map +0 -1
- package/dist/chunk-OEDW4ER7.js.map +0 -1
- package/dist/chunk-QE6YVNP5.js.map +0 -1
- package/dist/chunk-ROEFLU37.js.map +0 -1
- package/dist/chunk-SFHLQPBF.js.map +0 -1
- package/dist/chunk-SV4Z2S67.js.map +0 -1
- package/dist/chunk-THTF2W7M.js.map +0 -1
- package/dist/chunk-UZ6JYPJ6.js.map +0 -1
- package/dist/chunk-YTK5MVNF.js.map +0 -1
- package/dist/chunk-ZRMMXWYI.js.map +0 -1
- /package/dist/{capsule-crypto-7FJQINUR.js.map → access-mcp-shared-context-tools.js.map} +0 -0
- /package/dist/{auto-sync-D6BAPIJV.js.map → auto-sync-7PGUFY7U.js.map} +0 -0
- /package/dist/{contradiction-scan-BSGKZHYJ.js.map → capsule-crypto-YO5QJ6L3.js.map} +0 -0
- /package/dist/{capsule-merge-IPG4IOFP.js.map → capsule-merge-3MNURAQ3.js.map} +0 -0
- /package/dist/{chunk-VHKXRYQN.js.map → chunk-2HQPE2NM.js.map} +0 -0
- /package/dist/{chunk-RDLPFM7I.js.map → chunk-2ZG2LLZT.js.map} +0 -0
- /package/dist/{chunk-IMBQFHRV.js.map → chunk-3BLHPQHT.js.map} +0 -0
- /package/dist/{chunk-6L2II3KS.js.map → chunk-3D75XIYO.js.map} +0 -0
- /package/dist/{chunk-J272ODKJ.js.map → chunk-42DJ235G.js.map} +0 -0
- /package/dist/{chunk-RJQAP333.js.map → chunk-46RII65S.js.map} +0 -0
- /package/dist/{chunk-JUDT33RX.js.map → chunk-4AX5OYKC.js.map} +0 -0
- /package/dist/{chunk-GSSDHAYH.js.map → chunk-4IGOLIWM.js.map} +0 -0
- /package/dist/{chunk-4CMXI55L.js.map → chunk-54QPOE45.js.map} +0 -0
- /package/dist/{chunk-LKFVVN7R.js.map → chunk-563X6JJX.js.map} +0 -0
- /package/dist/{chunk-VQWBUPSJ.js.map → chunk-5EQT62HH.js.map} +0 -0
- /package/dist/{chunk-BYQX4IOG.js.map → chunk-6MQMYXSQ.js.map} +0 -0
- /package/dist/{chunk-TVVEYCNW.js.map → chunk-7K5Q6COX.js.map} +0 -0
- /package/dist/{chunk-K75A5XWU.js.map → chunk-7ZLC4DTZ.js.map} +0 -0
- /package/dist/{chunk-7Z54NXVS.js.map → chunk-A4OIJYCV.js.map} +0 -0
- /package/dist/{chunk-QS5Q5RBV.js.map → chunk-AFJHNHAM.js.map} +0 -0
- /package/dist/{chunk-TZ44E732.js.map → chunk-AIVRD66I.js.map} +0 -0
- /package/dist/{chunk-IOPIGX7Y.js.map → chunk-AKABVXFS.js.map} +0 -0
- /package/dist/{chunk-KOTG3RXE.js.map → chunk-AUSRUOMQ.js.map} +0 -0
- /package/dist/{chunk-K4A6UVPB.js.map → chunk-BTPCP535.js.map} +0 -0
- /package/dist/{chunk-2NLLXCJG.js.map → chunk-BXLOS5AJ.js.map} +0 -0
- /package/dist/{chunk-TEMKBSV6.js.map → chunk-C3G6MW4W.js.map} +0 -0
- /package/dist/{chunk-3QEVOQF5.js.map → chunk-D6PY63OM.js.map} +0 -0
- /package/dist/{chunk-DFVSJFHK.js.map → chunk-DBB5JPSL.js.map} +0 -0
- /package/dist/{chunk-HJUP3K6L.js.map → chunk-DIXZQTGY.js.map} +0 -0
- /package/dist/{chunk-ZX3AYNNV.js.map → chunk-DM5CU5J7.js.map} +0 -0
- /package/dist/{chunk-X7Y7WX73.js.map → chunk-DQEMWVMT.js.map} +0 -0
- /package/dist/{chunk-BGRTZOJB.js.map → chunk-E3I3NDUP.js.map} +0 -0
- /package/dist/{chunk-ZAEPD4C2.js.map → chunk-E4LMQTST.js.map} +0 -0
- /package/dist/{chunk-7D6SER6A.js.map → chunk-EMSYMYXO.js.map} +0 -0
- /package/dist/{chunk-YNDLCWXS.js.map → chunk-EZ25VE3G.js.map} +0 -0
- /package/dist/{chunk-V2ZA4YWE.js.map → chunk-F5H6YG5P.js.map} +0 -0
- /package/dist/{chunk-ZMWSYUUL.js.map → chunk-GCBIXUPT.js.map} +0 -0
- /package/dist/{chunk-LFVZD5EC.js.map → chunk-GWNSKQDA.js.map} +0 -0
- /package/dist/{chunk-JDX2OA4R.js.map → chunk-HNHIHXSD.js.map} +0 -0
- /package/dist/{chunk-2SNCQHJZ.js.map → chunk-I33QYUAF.js.map} +0 -0
- /package/dist/{chunk-MVG3KXON.js.map → chunk-ICN37XHG.js.map} +0 -0
- /package/dist/{chunk-ICNJ6J46.js.map → chunk-IYIPXAIJ.js.map} +0 -0
- /package/dist/{chunk-AEOOGXMQ.js.map → chunk-J2MGTGKC.js.map} +0 -0
- /package/dist/{chunk-5U7K4W6K.js.map → chunk-JDOBQPJY.js.map} +0 -0
- /package/dist/{chunk-NVVZPBKI.js.map → chunk-JMWUPUE6.js.map} +0 -0
- /package/dist/{chunk-QPVNK2VE.js.map → chunk-JSD7Q7LD.js.map} +0 -0
- /package/dist/{chunk-RLU2Y5GV.js.map → chunk-K5D2XVNN.js.map} +0 -0
- /package/dist/{chunk-YTZN2UZO.js.map → chunk-KJLLPG26.js.map} +0 -0
- /package/dist/{chunk-2SKMZUOW.js.map → chunk-KLUC2GSG.js.map} +0 -0
- /package/dist/{chunk-YRIFXXMI.js.map → chunk-KZJM7R4F.js.map} +0 -0
- /package/dist/{chunk-46Z3VGWF.js.map → chunk-LE2KZ72G.js.map} +0 -0
- /package/dist/{chunk-HIP6DKJJ.js.map → chunk-LQVXSRAJ.js.map} +0 -0
- /package/dist/{chunk-A7GQBJP5.js.map → chunk-LVFI5LG7.js.map} +0 -0
- /package/dist/{chunk-PKUJNICO.js.map → chunk-ND7MAIJC.js.map} +0 -0
- /package/dist/{chunk-W23JARAQ.js.map → chunk-P66QH6R6.js.map} +0 -0
- /package/dist/{chunk-62D2PAAM.js.map → chunk-PAAJWQH5.js.map} +0 -0
- /package/dist/{chunk-XM46Y66S.js.map → chunk-PFKIOYJH.js.map} +0 -0
- /package/dist/{chunk-C5R73BON.js.map → chunk-PGGPRF6J.js.map} +0 -0
- /package/dist/{chunk-V6EGNVUT.js.map → chunk-PIWFNPQT.js.map} +0 -0
- /package/dist/{chunk-JOP7W24J.js.map → chunk-PLJ2MQFT.js.map} +0 -0
- /package/dist/{chunk-MJC7UKH7.js.map → chunk-PQ42DJNG.js.map} +0 -0
- /package/dist/{chunk-37CAEC7E.js.map → chunk-PWPIERBM.js.map} +0 -0
- /package/dist/{chunk-BXIJSPCL.js.map → chunk-Q62GA5U2.js.map} +0 -0
- /package/dist/{chunk-VKWFNPBH.js.map → chunk-RQQO3ORQ.js.map} +0 -0
- /package/dist/{chunk-ES5BUPYB.js.map → chunk-UZGHKD3T.js.map} +0 -0
- /package/dist/{chunk-J4WGTN2N.js.map → chunk-V62YYBBY.js.map} +0 -0
- /package/dist/{chunk-KQAFEZQX.js.map → chunk-VDX2J7OX.js.map} +0 -0
- /package/dist/{chunk-Z4GUX2M6.js.map → chunk-VSN2DMQK.js.map} +0 -0
- /package/dist/{chunk-ZHXSOMYH.js.map → chunk-VVX5PZFS.js.map} +0 -0
- /package/dist/{chunk-KY236SP5.js.map → chunk-W7UV2ZCA.js.map} +0 -0
- /package/dist/{chunk-TO36VPZI.js.map → chunk-WBQ4ONQJ.js.map} +0 -0
- /package/dist/{chunk-WZYHPAG5.js.map → chunk-WFMQN7JE.js.map} +0 -0
- /package/dist/{chunk-G2XZFGYN.js.map → chunk-WGZHSQDV.js.map} +0 -0
- /package/dist/{chunk-SUEOG2S4.js.map → chunk-WPGA4RYI.js.map} +0 -0
- /package/dist/{chunk-J7FVMLBR.js.map → chunk-WZIO3TW6.js.map} +0 -0
- /package/dist/{chunk-ZZUVBZL2.js.map → chunk-X2QPKLPL.js.map} +0 -0
- /package/dist/{chunk-JAJIMTFB.js.map → chunk-XRS65T4O.js.map} +0 -0
- /package/dist/{chunk-GO5LOHCD.js.map → chunk-YFXAWGMR.js.map} +0 -0
- /package/dist/{chunk-K4JKAXMO.js.map → chunk-Z535ADTC.js.map} +0 -0
- /package/dist/{chunk-23HFXQ5J.js.map → chunk-Z7NBT6AK.js.map} +0 -0
- /package/dist/{chunk-VQYWKCDR.js.map → chunk-ZX6NNFSY.js.map} +0 -0
- /package/dist/{chunk-3XPN7AVY.js.map → chunk-ZYSOT6HD.js.map} +0 -0
- /package/dist/{chunk-ZZCR2QYL.js.map → chunk-ZZEIL3MI.js.map} +0 -0
- /package/dist/{resolution-4GG3QZRJ.js.map → contradiction-scan-GVD4JJ7B.js.map} +0 -0
- /package/dist/{first-start-migration-ZWMV5CX4.js.map → first-start-migration-L3UFX5CU.js.map} +0 -0
- /package/dist/{tier-stats-LUSUUNU6.js.map → tier-stats-VK5PCO2L.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/deep-recall-seeds.ts"],"sourcesContent":["/**\n * Deep-recall seed retrieval (issue #2332 review).\n *\n * Seeds route through the SAME namespace search router the rest of the read\n * path uses, so a non-default caller searches its own suffixed collection\n * instead of the base (default-namespace) collection — read and write resolve\n * through one resolver, never two (§30).\n *\n * Each hit is resolved to a real memory id through the shared QMD result\n * resolver (`QmdResultResolver.readQmdResultMemory`), per hit and bounded by\n * the requested limit, instead of pre-scanning the whole namespace corpus to\n * build a path index. With namespaces disabled the fanout queries the QMD\n * backend directly, so hits keep the indexer's raw path forms; the resolver\n * decodes `qmd://<collection>/` URIs and `<collection>/`-prefixed relatives,\n * and the two forms it cannot decode (`qmd:///`, a leading `/`) are stripped\n * for one retry. A hit with no path is dropped: its namespace membership\n * cannot be verified, and a bare docid from a foreign collection must never\n * enter the working set as a resolved memory.\n *\n * An unavailable namespace backend (or a missing collection) contributes an\n * empty result set and reports itself only through `execution.onDegradation`,\n * so the observer is REQUIRED here: without it a dead index is indistinguishable\n * from a healthy empty one and deep recall would answer `ok: true` with zero\n * entries instead of the advertised `backend_unavailable` failure.\n */\n\nimport type { DeepRecallSeedHit } from \"./deep-recall.js\";\nimport type { SearchDegradation } from \"./search/port.js\";\n\n/** Namespace-scoped search entrypoint (satisfied by `Orchestrator.searchAcrossNamespaces`). */\nexport interface DeepRecallSeedRouter {\n searchAcrossNamespaces(options: {\n query: string;\n namespaces: string[];\n maxResults?: number;\n execution?: {\n signal?: AbortSignal;\n onDegradation?: (degradation: SearchDegradation) => void;\n };\n }): Promise<ReadonlyArray<{ path?: string; docid?: string; score?: number }>>;\n}\n\n/** Namespace-scoped storage read (satisfied by `StorageManager`). */\nexport interface DeepRecallSeedStorage {\n readonly dir: string;\n readMemoryByPath(filePath: string): Promise<{ frontmatter: { id?: string } } | null>;\n}\n\n/** Full QMD hit -> memory resolver (satisfied by `QmdResultResolver#readQmdResultMemory`). */\nexport interface DeepRecallSeedResultResolver {\n readQmdResultMemory(\n resultPath: string,\n fallbackStorage: DeepRecallSeedStorage,\n recallNamespaces?: readonly string[],\n preferredNamespace?: string,\n ): Promise<{ frontmatter: { id?: string } } | null>;\n}\n\n/**\n * Strip the collection-qualified forms the indexer can emit but\n * `readQmdResultMemory` cannot decode: the empty-hostname `qmd:///` URI and\n * the root-relative `/` path both reach its fallback probe still prefixed and\n * miss. Returns `null` when the path carries no such prefix — including a\n * decodable `qmd://<collection>/` or `<collection>/` form, which the resolver\n * owns, and a foreign collection prefix, which must stay a miss.\n */\nfunction collectionPrefixStrippedPath(resultPath: string): string | null {\n const trimmed = resultPath.trim();\n if (trimmed.startsWith(\"qmd:///\")) {\n const relative = trimmed.slice(\"qmd:///\".length).replace(/^\\/+/, \"\");\n return relative.length > 0 ? relative : null;\n }\n if (trimmed.startsWith(\"/\")) {\n const relative = trimmed.replace(/^\\/+/, \"\");\n return relative.length > 0 ? relative : null;\n }\n return null;\n}\n\nasync function resolveSeedMemoryId(\n resolver: DeepRecallSeedResultResolver,\n storage: DeepRecallSeedStorage,\n namespace: string,\n resultPath: string | undefined,\n): Promise<string | null> {\n if (typeof resultPath !== \"string\" || resultPath.length === 0) return null;\n const attempts = [resultPath];\n const stripped = collectionPrefixStrippedPath(resultPath);\n if (stripped !== null) attempts.push(stripped);\n for (const attempt of attempts) {\n const memory = await resolver.readQmdResultMemory(attempt, storage, [namespace]);\n const id = memory?.frontmatter?.id;\n if (typeof id === \"string\" && id.length > 0) return id;\n }\n return null;\n}\n\nexport function createDeepRecallSeedSearch(deps: {\n namespace: string;\n storage: DeepRecallSeedStorage;\n router: DeepRecallSeedRouter;\n resolver: DeepRecallSeedResultResolver;\n /** Transport cancellation (issue #2915); forwarded to the search router. */\n signal?: AbortSignal;\n}): (query: string, limit: number) => Promise<DeepRecallSeedHit[]> {\n return async (query, limit) => {\n if (limit <= 0) return [];\n const unavailable: SearchDegradation[] = [];\n const hits = await deps.router.searchAcrossNamespaces({\n query,\n namespaces: [deps.namespace],\n maxResults: limit,\n execution: {\n ...(deps.signal ? { signal: deps.signal } : {}),\n onDegradation: (degradation) => {\n if (degradation.code === \"backend_unavailable\") unavailable.push(degradation);\n },\n },\n });\n // The requested namespace has no usable index: a seed-search failure, which\n // is the one condition deep recall reports as `backend_unavailable`.\n if (unavailable.length > 0) {\n throw new Error(\n `deep recall seed search unavailable: ${unavailable.map((d) => d.detail ?? d.code).join(\"; \")}`,\n );\n }\n const seeds: DeepRecallSeedHit[] = [];\n for (const hit of hits) {\n if (typeof hit.path !== \"string\" || hit.path.length === 0) continue;\n const memoryId =\n (await resolveSeedMemoryId(deps.resolver, deps.storage, deps.namespace, hit.path)) ?? hit.docid;\n if (typeof memoryId !== \"string\" || memoryId.length === 0) continue;\n seeds.push({\n memoryId,\n score: typeof hit.score === \"number\" && Number.isFinite(hit.score) ? hit.score : 0,\n });\n }\n return seeds;\n };\n}\n"],"mappings":";AAkEA,SAAS,6BAA6B,YAAmC;AACvE,QAAM,UAAU,WAAW,KAAK;AAChC,MAAI,QAAQ,WAAW,SAAS,GAAG;AACjC,UAAM,WAAW,QAAQ,MAAM,UAAU,MAAM,EAAE,QAAQ,QAAQ,EAAE;AACnE,WAAO,SAAS,SAAS,IAAI,WAAW;AAAA,EAC1C;AACA,MAAI,QAAQ,WAAW,GAAG,GAAG;AAC3B,UAAM,WAAW,QAAQ,QAAQ,QAAQ,EAAE;AAC3C,WAAO,SAAS,SAAS,IAAI,WAAW;AAAA,EAC1C;AACA,SAAO;AACT;AAEA,eAAe,oBACb,UACA,SACA,WACA,YACwB;AACxB,MAAI,OAAO,eAAe,YAAY,WAAW,WAAW,EAAG,QAAO;AACtE,QAAM,WAAW,CAAC,UAAU;AAC5B,QAAM,WAAW,6BAA6B,UAAU;AACxD,MAAI,aAAa,KAAM,UAAS,KAAK,QAAQ;AAC7C,aAAW,WAAW,UAAU;AAC9B,UAAM,SAAS,MAAM,SAAS,oBAAoB,SAAS,SAAS,CAAC,SAAS,CAAC;AAC/E,UAAM,KAAK,QAAQ,aAAa;AAChC,QAAI,OAAO,OAAO,YAAY,GAAG,SAAS,EAAG,QAA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";
|
|
15
15
|
import {
|
|
16
16
|
inferMemoryStatus,
|
|
17
17
|
toMemoryPathRel
|
|
@@ -318,4 +318,4 @@ export {
|
|
|
318
318
|
readProjectedHarmonicGraph,
|
|
319
319
|
searchHarmonicRetrieval
|
|
320
320
|
};
|
|
321
|
-
//# sourceMappingURL=chunk-
|
|
321
|
+
//# sourceMappingURL=chunk-AKABVXFS.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-SOBJ6NEY.js";
|
|
4
4
|
import {
|
|
5
5
|
summarizeDisclosureTokens
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Q62GA5U2.js";
|
|
7
7
|
import {
|
|
8
8
|
summarizeRetrievedMemoryProvenance
|
|
9
9
|
} from "./chunk-I4WBNM3M.js";
|
|
@@ -610,4 +610,4 @@ export {
|
|
|
610
610
|
renderRecallExplain,
|
|
611
611
|
parseRecallExplainFormat
|
|
612
612
|
};
|
|
613
|
-
//# sourceMappingURL=chunk-
|
|
613
|
+
//# sourceMappingURL=chunk-AUSRUOMQ.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
headerConnector,
|
|
4
4
|
renderExtractionConversation,
|
|
5
5
|
resolveSourceConnector
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YFXAWGMR.js";
|
|
7
7
|
import {
|
|
8
8
|
ConsolidationResultSchema,
|
|
9
9
|
DaySummaryResultSchema,
|
|
@@ -62,13 +62,13 @@ import {
|
|
|
62
62
|
extractionResponseShape,
|
|
63
63
|
spanModePromptSection
|
|
64
64
|
} from "./chunk-BOADKFN4.js";
|
|
65
|
+
import {
|
|
66
|
+
looksLikeMechanicalTelemetryTranscript
|
|
67
|
+
} from "./chunk-4RA3C3EV.js";
|
|
65
68
|
import {
|
|
66
69
|
AMBIENT_CAPTURE_PROMPT_SECTION_COMPACT,
|
|
67
70
|
clampAmbientCaptureConfidence
|
|
68
71
|
} from "./chunk-QW27DOHG.js";
|
|
69
|
-
import {
|
|
70
|
-
looksLikeMechanicalTelemetryTranscript
|
|
71
|
-
} from "./chunk-4RA3C3EV.js";
|
|
72
72
|
import {
|
|
73
73
|
applyWorkExtractionBoundary
|
|
74
74
|
} from "./chunk-EI6V5UXY.js";
|
|
@@ -80,21 +80,21 @@ import {
|
|
|
80
80
|
} from "./chunk-WLZYGLJ4.js";
|
|
81
81
|
import {
|
|
82
82
|
LocalLlmClient
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-WGZHSQDV.js";
|
|
84
84
|
import {
|
|
85
85
|
isMemoryCategory
|
|
86
86
|
} from "./chunk-GDYU6VF4.js";
|
|
87
87
|
import {
|
|
88
88
|
FallbackLlmClient,
|
|
89
89
|
gatewayTaskChainOptions
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-TRTLWUDD.js";
|
|
91
91
|
import {
|
|
92
92
|
buildChatCompletionTokenLimit,
|
|
93
93
|
shouldAssumeOpenAiChatCompletions
|
|
94
94
|
} from "./chunk-L2EXJQJP.js";
|
|
95
95
|
import {
|
|
96
96
|
fallbackLlmRuntimeContextFromConfig
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-UHSOPTNB.js";
|
|
98
98
|
import {
|
|
99
99
|
normalizeProcedureSteps
|
|
100
100
|
} from "./chunk-QDW3E4RD.js";
|
|
@@ -2443,4 +2443,4 @@ export {
|
|
|
2443
2443
|
shouldEnableLocalExtractionThinking,
|
|
2444
2444
|
ExtractionEngine
|
|
2445
2445
|
};
|
|
2446
|
-
//# sourceMappingURL=chunk-
|
|
2446
|
+
//# sourceMappingURL=chunk-BTPCP535.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-765K3SAT.js";
|
|
4
4
|
import {
|
|
5
5
|
encryptCapsuleFile
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DQEMWVMT.js";
|
|
7
7
|
import {
|
|
8
8
|
computeTransferOutputRel,
|
|
9
9
|
isTransferPathExcluded
|
|
@@ -109,4 +109,4 @@ async function enforceRetention(outDirAbs, retentionDays) {
|
|
|
109
109
|
export {
|
|
110
110
|
backupMemoryDir
|
|
111
111
|
};
|
|
112
|
-
//# sourceMappingURL=chunk-
|
|
112
|
+
//# sourceMappingURL=chunk-BXLOS5AJ.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SUPPORT_PASSPORT_DRAFT_MAX_CONTENT_CHARACTERS,
|
|
3
3
|
SUPPORT_PASSPORT_DRAFT_MAX_MEMORIES
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-S4MJTIPG.js";
|
|
5
5
|
import {
|
|
6
6
|
SUPPORT_PASSPORT_SOURCE_MEMORY_ID_MAX_LENGTH
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PWPIERBM.js";
|
|
8
8
|
|
|
9
9
|
// src/support-passport/model-bridge.ts
|
|
10
10
|
import { randomUUID } from "crypto";
|
|
@@ -343,4 +343,4 @@ export {
|
|
|
343
343
|
parseSupportPassportModelJob,
|
|
344
344
|
SupportPassportModelBridge
|
|
345
345
|
};
|
|
346
|
-
//# sourceMappingURL=chunk-
|
|
346
|
+
//# sourceMappingURL=chunk-C3G6MW4W.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isNamespaceKind
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-P66QH6R6.js";
|
|
4
4
|
import {
|
|
5
5
|
EngramAccessInputError
|
|
6
6
|
} from "./chunk-2Z24E5W2.js";
|
|
@@ -40,4 +40,4 @@ export {
|
|
|
40
40
|
positiveIntQueryParam,
|
|
41
41
|
optionalNamespaceKindQueryParam
|
|
42
42
|
};
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-D6PY63OM.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
widenRecallStateViews
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3D75XIYO.js";
|
|
4
4
|
|
|
5
5
|
// src/recall-state-view-wire.ts
|
|
6
6
|
function applyRecallStateViews(results, query, config, stateViewActive, asOfMs) {
|
|
@@ -10,4 +10,4 @@ function applyRecallStateViews(results, query, config, stateViewActive, asOfMs)
|
|
|
10
10
|
export {
|
|
11
11
|
applyRecallStateViews
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-DBB5JPSL.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseFrontmatter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ICN37XHG.js";
|
|
4
4
|
import {
|
|
5
5
|
activityDigestPath,
|
|
6
6
|
isValidActivityDate
|
|
@@ -199,4 +199,4 @@ export {
|
|
|
199
199
|
buildStandup,
|
|
200
200
|
standupHelp
|
|
201
201
|
};
|
|
202
|
-
//# sourceMappingURL=chunk-
|
|
202
|
+
//# sourceMappingURL=chunk-DIXZQTGY.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isValidCapsuleSince
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VDX2J7OX.js";
|
|
4
4
|
import {
|
|
5
5
|
CAPSULE_ID_PATTERN
|
|
6
6
|
} from "./chunk-WEHSQBFR.js";
|
|
@@ -558,4 +558,4 @@ export {
|
|
|
558
558
|
actionConfidenceRequestSchema,
|
|
559
559
|
validateRequest
|
|
560
560
|
};
|
|
561
|
-
//# sourceMappingURL=chunk-
|
|
561
|
+
//# sourceMappingURL=chunk-DM5CU5J7.js.map
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
listMemoryGovernanceRuns,
|
|
9
9
|
readMemoryGovernanceRunArtifact
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KLUC2GSG.js";
|
|
11
11
|
import {
|
|
12
12
|
StorageManager
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ICN37XHG.js";
|
|
14
14
|
import {
|
|
15
15
|
normalizeProjectionPreview,
|
|
16
16
|
normalizeProjectionTags
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
} from "./chunk-RL6NEVXT.js";
|
|
40
40
|
import {
|
|
41
41
|
isSupportPassportPrivateMemory
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-PWPIERBM.js";
|
|
43
43
|
import {
|
|
44
44
|
MEMORY_LIFECYCLE_EVENT_SORT_ORDER,
|
|
45
45
|
buildLifecycleEventsForMemory,
|
|
@@ -1005,4 +1005,4 @@ export {
|
|
|
1005
1005
|
verifyMemoryProjection,
|
|
1006
1006
|
repairMemoryProjection
|
|
1007
1007
|
};
|
|
1008
|
-
//# sourceMappingURL=chunk-
|
|
1008
|
+
//# sourceMappingURL=chunk-E3I3NDUP.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageManager
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ICN37XHG.js";
|
|
4
4
|
import {
|
|
5
5
|
getCachedRuleMemories,
|
|
6
6
|
setCachedRuleMemories
|
|
@@ -119,4 +119,4 @@ export {
|
|
|
119
119
|
compareVerifiedSemanticRuleResults,
|
|
120
120
|
searchVerifiedSemanticRules
|
|
121
121
|
};
|
|
122
|
-
//# sourceMappingURL=chunk-
|
|
122
|
+
//# sourceMappingURL=chunk-E4LMQTST.js.map
|
|
@@ -157,10 +157,7 @@ function reconcileStateViewPairs(results) {
|
|
|
157
157
|
}
|
|
158
158
|
return kept;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
const safeLimit = typeof limit === "number" && Number.isFinite(limit) ? Math.max(0, Math.floor(limit)) : 0;
|
|
162
|
-
if (safeLimit === 0) return [];
|
|
163
|
-
if (ordered.length === 0) return [];
|
|
160
|
+
function stateViewPacketKeys(ordered) {
|
|
164
161
|
const byPred = buildSuccessorMap(ordered, []);
|
|
165
162
|
const parent = /* @__PURE__ */ new Map();
|
|
166
163
|
const root = (key) => {
|
|
@@ -194,13 +191,20 @@ function capStateViewPackets(ordered, limit) {
|
|
|
194
191
|
const succIdx = keyToIndex.get(succKey);
|
|
195
192
|
if (predIdx !== void 0 && succIdx !== void 0) union(keys[predIdx], keys[succIdx]);
|
|
196
193
|
}
|
|
194
|
+
return keys.map((key) => root(key));
|
|
195
|
+
}
|
|
196
|
+
function capStateViewPackets(ordered, limit) {
|
|
197
|
+
const safeLimit = typeof limit === "number" && Number.isFinite(limit) ? Math.max(0, Math.floor(limit)) : 0;
|
|
198
|
+
if (safeLimit === 0) return [];
|
|
199
|
+
if (ordered.length === 0) return [];
|
|
200
|
+
const keys = stateViewPacketKeys(ordered);
|
|
197
201
|
const selectedRoots = /* @__PURE__ */ new Set();
|
|
198
202
|
for (let i = 0; i < ordered.length && selectedRoots.size < safeLimit; i += 1) {
|
|
199
|
-
selectedRoots.add(
|
|
203
|
+
selectedRoots.add(keys[i]);
|
|
200
204
|
}
|
|
201
205
|
const selected = [];
|
|
202
206
|
for (let i = 0; i < ordered.length; i += 1) {
|
|
203
|
-
if (selectedRoots.has(
|
|
207
|
+
if (selectedRoots.has(keys[i])) selected.push(ordered[i]);
|
|
204
208
|
}
|
|
205
209
|
return selected;
|
|
206
210
|
}
|
|
@@ -216,6 +220,7 @@ export {
|
|
|
216
220
|
resultStateViewKey,
|
|
217
221
|
annotateStateView,
|
|
218
222
|
reconcileStateViewPairs,
|
|
223
|
+
stateViewPacketKeys,
|
|
219
224
|
capStateViewPackets
|
|
220
225
|
};
|
|
221
|
-
//# sourceMappingURL=chunk-
|
|
226
|
+
//# sourceMappingURL=chunk-EH3HNCAM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/recall-state-view.ts"],"sourcesContent":["/**\n * Recall state views (issue #1952).\n *\n * Config key: `recallStateViews` (default false). When false, annotateStateView\n * is identity: same array reference, no `stateLabel`. config.ts is at its\n * fileSizeGrandfather ceiling, so parseConfig wiring waits for a later PR.\n * Call `parseRecallStateViews` at the recall seam when that lands.\n *\n * Change-intent morphology lives here (do not grow intent.ts). A superseded\n * memory is admitted only when its successor is also in the candidate set.\n *\n * #2859 — chain identities are namespace-qualified (`namespace\\0id`): the\n * same id in two namespaces never cross-anchors. The reverse chain derives\n * from the successor's `supersedes` back-pointer when a predecessor lacks\n * `supersededBy`, and asOf snapshot labels use the temporal validity\n * boundary (predecessor `invalidAt` / successor `validAt`), not the\n * `supersededAt` write time.\n */\nimport { coerceBooleanLike } from \"./connectors/coerce.js\";\n\nexport type StateLabel = \"current\" | \"historical\" | \"transition\";\n\nexport interface StateViewChain {\n predecessorId: string;\n successorId: string;\n supersededAt?: string;\n /** #2859 — namespace scope; a chain link never crosses namespaces. */\n namespace?: string;\n}\n\nexport interface StateViewResult {\n id?: string;\n docid?: string;\n status?: string;\n /** #2859 — namespace that owns this row; qualifies every chain identity. */\n namespace?: string;\n /** #2859 — back-pointer: id of the row this one replaced. */\n supersedes?: string;\n supersededBy?: string;\n supersededAt?: string;\n /** #2859 — fact validity start (frontmatter `valid_at`). */\n validAt?: string;\n /** #2859 — fact validity end (frontmatter `invalid_at`). */\n invalidAt?: string;\n stateLabel?: StateLabel;\n}\n\nexport const DEFAULT_RECALL_STATE_VIEWS = false;\n\nconst CHANGE_WORDS = [\"switch\", \"switches\", \"switched\", \"switching\", \"change\", \"changes\", \"changed\", \"changing\"];\n\n// Phrase matches are token-bounded: \"when Didi\" must not fire the\n// \"when did\" phrase, and \"confused to\" must not fire \"used to\".\nconst CHANGE_PHRASE_RE = /\\bwhen\\s+did\\b|\\bused\\s+to\\b/;\nconst CHANGE_WORD_RE = new RegExp(`\\\\b(?:${CHANGE_WORDS.join(\"|\")})\\\\b`);\n// Bare \"before\"/\"after\" are ordinary sequencing (\"before lunch\",\n// \"after install\"). They carry change intent only when they point at a\n// specific event through a determiner (\"before the move\", \"after the\n// cutover\").\nconst EVENT_POINTER_RE = /\\b(?:before|after)\\s+(?:the|a|an|this|that|these|those)\\b/;\n\nexport function parseRecallStateViews(raw: unknown): boolean {\n return coerceBooleanLike(raw, \"recallStateViews\") === true;\n}\n\nexport function isChangeOrientedQuery(query: string): boolean {\n const lower = query.toLowerCase();\n return CHANGE_PHRASE_RE.test(lower) || CHANGE_WORD_RE.test(lower) || EVENT_POINTER_RE.test(lower);\n}\n\nexport function shouldWidenSuperseded(\n successorId: string | undefined,\n candidateIds: ReadonlySet<string>,\n): boolean {\n return typeof successorId === \"string\" && successorId.length > 0 && candidateIds.has(successorId);\n}\n\nexport function formatSupersededPrefix(date: string, successorId: string): string {\n return `[superseded ${date} by ${successorId}]`;\n}\n\nexport function resultStateViewId(result: StateViewResult): string {\n return result.id ?? result.docid ?? \"\";\n}\n\n/**\n * #2859 — namespace-qualified chain identity. Namespace fanout can surface\n * the same id from two namespaces; every successor/admission match runs on\n * `namespace\\0id` keys so a row in one namespace can never anchor (or be\n * anchored by) an identically-named row in another.\n */\nexport function stateViewKey(namespace: string | undefined, id: string): string {\n return `${typeof namespace === \"string\" ? namespace : \"\"}\\u0000${id}`;\n}\n\nexport function resultStateViewKey(result: StateViewResult): string {\n const id = resultStateViewId(result);\n return id ? stateViewKey(result.namespace, id) : \"\";\n}\n\n/** Inverse of {@link stateViewKey}: the id after the namespace separator. */\nfunction stateViewIdFromKey(key: string): string {\n const sep = key.indexOf(\"\\u0000\");\n return sep === -1 ? key : key.slice(sep + 1);\n}\n\n/**\n * predecessorKey → successorKey, namespace-qualified. Precedence: explicit\n * chains, then successor rows' `supersedes` back-pointers (#2859 — derives\n * the reverse chain when the predecessor lacks `supersededBy`), then the\n * predecessor's own `supersededBy` (authoritative when present).\n */\nfunction buildSuccessorMap(\n results: readonly StateViewResult[],\n chains: readonly StateViewChain[],\n): Map<string, string> {\n const byPred = new Map<string, string>();\n const link = (predKey: string, succKey: string, overwrite: boolean): void => {\n if (!predKey || !succKey) return;\n if (overwrite || !byPred.has(predKey)) byPred.set(predKey, succKey);\n };\n for (const chain of chains) {\n if (chain.predecessorId && chain.successorId) {\n link(\n stateViewKey(chain.namespace, chain.predecessorId),\n stateViewKey(chain.namespace, chain.successorId),\n false,\n );\n }\n }\n for (const result of results) {\n const key = resultStateViewKey(result);\n if (key && result.supersedes) {\n link(stateViewKey(result.namespace, result.supersedes), key, false);\n }\n }\n for (const result of results) {\n const key = resultStateViewKey(result);\n if (key && result.supersededBy) {\n link(key, stateViewKey(result.namespace, result.supersededBy), true);\n }\n }\n return byPred;\n}\n\nfunction successorLinkOf(\n result: StateViewResult,\n byPred: ReadonlyMap<string, string>,\n): { superseded: boolean; successorKey: string | undefined } {\n const key = resultStateViewKey(result);\n return {\n superseded:\n result.status === \"superseded\" ||\n Boolean(result.supersededBy) ||\n byPred.has(key),\n successorKey: result.supersededBy\n ? stateViewKey(result.namespace, result.supersededBy)\n : byPred.get(key),\n };\n}\n\nfunction labelFor(\n key: string,\n result: StateViewResult,\n byPred: Map<string, string>,\n admittedIds: ReadonlySet<string>,\n asOfMs: number | null,\n): StateLabel {\n const { successorKey } = successorLinkOf(result, byPred);\n const isPred = shouldWidenSuperseded(successorKey, admittedIds);\n let isSucc = false;\n for (const [predId, succId] of byPred) {\n if (succId === key && admittedIds.has(predId)) {\n isSucc = true;\n break;\n }\n }\n if (isPred && isSucc) return \"transition\";\n if (isPred) return \"historical\";\n if (isSucc) return \"current\";\n if (result.status === \"superseded\") {\n // #1952 asOf mode: the successor is legitimately absent under the\n // historical pin (a linked successor takes the pair branches above).\n // The row was the live fact at the snapshot when the temporal\n // validity boundary postdates the pin (\"current\" relative to the\n // snapshot); already replaced at the pin is \"historical\". #2859: the\n // boundary is the fact's validity flip — `invalidAt` (the supersession\n // pipeline sets it to the successor's valid_at) — not the\n // `supersededAt` write time; legacy rows without a window fall back\n // to supersededAt.\n return asOfMs === null ? \"historical\" : snapshotStateLabel(result, asOfMs);\n }\n return \"current\";\n}\n\nfunction snapshotStateLabel(result: StateViewResult, asOfMs: number): StateLabel {\n const invalidAtMs = Date.parse(result.invalidAt ?? \"\");\n const boundaryMs = Number.isFinite(invalidAtMs)\n ? invalidAtMs\n : Date.parse(result.supersededAt ?? \"\");\n return Number.isFinite(boundaryMs) && boundaryMs <= asOfMs ? \"historical\" : \"current\";\n}\n\nexport function annotateStateView<T extends StateViewResult>(\n results: T[],\n query: string,\n chains: readonly StateViewChain[],\n options: { enabled?: boolean; asOfMs?: number; changeIntent?: boolean } = {},\n): T[] {\n const enabled = options.enabled === true;\n // #2893 — changeIntent:true marks intent as already classified from the\n // ORIGINAL prompt; `query` may be cron-normalized (intent signal\n // truncated or stop-worded away) and must not be re-checked then.\n if (!enabled || (options.changeIntent !== true && !isChangeOrientedQuery(query))) return results;\n // #1952 asOf mode: under a historical pin the pipeline's isValidAsOf\n // gate already decided validity at the pinned instant, so a predecessor\n // must not be discarded merely because its successor is absent under\n // the same filter. A valid asOf result is never emptied here.\n const asOfMs =\n typeof options.asOfMs === \"number\" && Number.isFinite(options.asOfMs)\n ? options.asOfMs\n : null;\n\n const byPred = buildSuccessorMap(results, chains);\n const candidateIds = new Set<string>();\n for (const result of results) {\n const key = resultStateViewKey(result);\n if (key) candidateIds.add(key);\n }\n let admitted: T[];\n if (asOfMs !== null) {\n admitted = results.slice();\n } else {\n admitted = [];\n for (const result of results) {\n const { superseded, successorKey } = successorLinkOf(result, byPred);\n if (!superseded || shouldWidenSuperseded(successorKey, candidateIds)) {\n admitted.push(result);\n }\n }\n\n // #1952 contract: superseded never appears without its successor. A\n // successor can itself be dropped (filtered elsewhere, or transitively\n // orphaned), so reconcile to a fixpoint instead of trusting the first pass.\n let admittedIds = new Set(admitted.map(resultStateViewKey).filter(Boolean));\n for (let changed = true; changed; ) {\n changed = false;\n for (let i = admitted.length - 1; i >= 0; i -= 1) {\n const row = admitted[i]!;\n const { superseded, successorKey } = successorLinkOf(row, byPred);\n if (superseded && !shouldWidenSuperseded(successorKey, admittedIds)) {\n admitted.splice(i, 1);\n changed = true;\n }\n }\n if (changed) admittedIds = new Set(admitted.map(resultStateViewKey).filter(Boolean));\n }\n }\n\n const admittedIds = new Set(admitted.map(resultStateViewKey).filter(Boolean));\n return admitted.map((result) => {\n const key = resultStateViewKey(result);\n const { successorKey } = successorLinkOf(result, byPred);\n const stateLabel = labelFor(key, result, byPred, admittedIds, asOfMs);\n if (result.supersededBy || !successorKey) return { ...result, stateLabel };\n return { ...result, stateLabel, supersededBy: stateViewIdFromKey(successorKey) };\n });\n}\n\n/**\n * #2859 — drop superseded rows whose successor is not in the pool BEFORE\n * the user cap/MMR runs, so post-cap orphan removal can never underfill\n * the result set. Reconciles to a fixpoint (a dropped successor orphans\n * its own predecessors). Rows with no successor links pass through in\n * order. ponytail: repeated full-pool passes are O(n²) on one long chain;\n * recall pools stay small, memoize per-key if pools ever grow.\n */\nexport function reconcileStateViewPairs<T extends StateViewResult>(results: readonly T[]): T[] {\n const byPred = buildSuccessorMap(results, []);\n let kept = results.slice();\n for (let changed = true; changed; ) {\n changed = false;\n const keptKeys = new Set(kept.map(resultStateViewKey).filter(Boolean));\n const next: T[] = [];\n for (const row of kept) {\n const { superseded, successorKey } = successorLinkOf(row, byPred);\n if (superseded && !shouldWidenSuperseded(successorKey, keptKeys)) {\n changed = true;\n continue;\n }\n next.push(row);\n }\n if (changed) kept = next;\n }\n return kept;\n}\n\n/**\n * #2859 — packet-counting cap. A predecessor/successor chain admitted\n * together is ONE complete evidence packet: it consumes a single slot of\n * the user cap, and the slice never splits a packet at the boundary (no\n * underfill from post-cap orphan removal). Rows keep their incoming\n * (MMR) order; packets are ordered by first appearance. Call\n * reconcileStateViewPairs first so orphans never consume a slot.\n */\nexport function capStateViewPackets<T extends StateViewResult>(\n ordered: readonly T[],\n limit: number,\n): T[] {\n const safeLimit =\n typeof limit === \"number\" && Number.isFinite(limit) ? Math.max(0, Math.floor(limit)) : 0;\n if (safeLimit === 0) return [];\n if (ordered.length === 0) return [];\n\n const byPred = buildSuccessorMap(ordered, []);\n // Union-find over row keys; blank-key rows become per-index singletons.\n const parent = new Map<string, string>();\n const root = (key: string): string => {\n let current = key;\n for (;;) {\n const up = parent.get(current);\n if (up === undefined || up === current) {\n parent.set(current, current);\n return current;\n }\n current = up;\n }\n };\n const union = (a: string, b: string): void => {\n const ra = root(a);\n const rb = root(b);\n if (ra !== rb) parent.set(ra, rb);\n };\n const keys: string[] = [];\n const keyToIndex = new Map<string, number>();\n for (let i = 0; i < ordered.length; i += 1) {\n // ponytail: blank-key rows must stay distinct singletons; index-keyed.\n const key = resultStateViewKey(ordered[i]!) || `#idx${i}`;\n keys.push(key);\n if (!parent.has(key)) parent.set(key, key);\n const first = keyToIndex.get(key);\n if (first !== undefined) union(keys[first]!, key);\n else keyToIndex.set(key, i);\n }\n for (const [predKey, succKey] of byPred) {\n const predIdx = keyToIndex.get(predKey);\n const succIdx = keyToIndex.get(succKey);\n if (predIdx !== undefined && succIdx !== undefined) union(keys[predIdx]!, keys[succIdx]!);\n }\n // Packets ordered by first appearance; admit whole packets until the cap.\n const selectedRoots = new Set<string>();\n for (let i = 0; i < ordered.length && selectedRoots.size < safeLimit; i += 1) {\n selectedRoots.add(root(keys[i]!));\n }\n const selected: T[] = [];\n for (let i = 0; i < ordered.length; i += 1) {\n if (selectedRoots.has(root(keys[i]!))) selected.push(ordered[i]!);\n }\n return selected;\n}\n"],"mappings":";;;;;AA+CO,IAAM,6BAA6B;AAE1C,IAAM,eAAe,CAAC,UAAU,YAAY,YAAY,aAAa,UAAU,WAAW,WAAW,UAAU;AAI/G,IAAM,mBAAmB;AACzB,IAAM,iBAAiB,IAAI,OAAO,SAAS,aAAa,KAAK,GAAG,CAAC,MAAM;AAKvE,IAAM,mBAAmB;AAElB,SAAS,sBAAsB,KAAuB;AAC3D,SAAO,kBAAkB,KAAK,kBAAkB,MAAM;AACxD;AAEO,S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C,CAAE,CAAC,EAAG,UAAS,KAAK,QAAQ,CAAC,CAAE;AAAA,EAClE;AACA,SAAO;AACT;","names":["admittedIds"]}
|
|
1
|
+
{"version":3,"sources":["../src/recall-state-view.ts"],"sourcesContent":["/**\n * Recall state views (issue #1952).\n *\n * Config key: `recallStateViews` (default false). When false, annotateStateView\n * is identity: same array reference, no `stateLabel`. config.ts is at its\n * fileSizeGrandfather ceiling, so parseConfig wiring waits for a later PR.\n * Call `parseRecallStateViews` at the recall seam when that lands.\n *\n * Change-intent morphology lives here (do not grow intent.ts). A superseded\n * memory is admitted only when its successor is also in the candidate set.\n *\n * #2859 — chain identities are namespace-qualified (`namespace\\0id`): the\n * same id in two namespaces never cross-anchors. The reverse chain derives\n * from the successor's `supersedes` back-pointer when a predecessor lacks\n * `supersededBy`, and asOf snapshot labels use the temporal validity\n * boundary (predecessor `invalidAt` / successor `validAt`), not the\n * `supersededAt` write time.\n */\nimport { coerceBooleanLike } from \"./connectors/coerce.js\";\n\nexport type StateLabel = \"current\" | \"historical\" | \"transition\";\n\nexport interface StateViewChain {\n predecessorId: string;\n successorId: string;\n supersededAt?: string;\n /** #2859 — namespace scope; a chain link never crosses namespaces. */\n namespace?: string;\n}\n\nexport interface StateViewResult {\n id?: string;\n docid?: string;\n status?: string;\n /** #2859 — namespace that owns this row; qualifies every chain identity. */\n namespace?: string;\n /** #2859 — back-pointer: id of the row this one replaced. */\n supersedes?: string;\n supersededBy?: string;\n supersededAt?: string;\n /** #2859 — fact validity start (frontmatter `valid_at`). */\n validAt?: string;\n /** #2859 — fact validity end (frontmatter `invalid_at`). */\n invalidAt?: string;\n stateLabel?: StateLabel;\n}\n\nexport const DEFAULT_RECALL_STATE_VIEWS = false;\n\nconst CHANGE_WORDS = [\"switch\", \"switches\", \"switched\", \"switching\", \"change\", \"changes\", \"changed\", \"changing\"];\n\n// Phrase matches are token-bounded: \"when Didi\" must not fire the\n// \"when did\" phrase, and \"confused to\" must not fire \"used to\".\nconst CHANGE_PHRASE_RE = /\\bwhen\\s+did\\b|\\bused\\s+to\\b/;\nconst CHANGE_WORD_RE = new RegExp(`\\\\b(?:${CHANGE_WORDS.join(\"|\")})\\\\b`);\n// Bare \"before\"/\"after\" are ordinary sequencing (\"before lunch\",\n// \"after install\"). They carry change intent only when they point at a\n// specific event through a determiner (\"before the move\", \"after the\n// cutover\").\nconst EVENT_POINTER_RE = /\\b(?:before|after)\\s+(?:the|a|an|this|that|these|those)\\b/;\n\nexport function parseRecallStateViews(raw: unknown): boolean {\n return coerceBooleanLike(raw, \"recallStateViews\") === true;\n}\n\nexport function isChangeOrientedQuery(query: string): boolean {\n const lower = query.toLowerCase();\n return CHANGE_PHRASE_RE.test(lower) || CHANGE_WORD_RE.test(lower) || EVENT_POINTER_RE.test(lower);\n}\n\nexport function shouldWidenSuperseded(\n successorId: string | undefined,\n candidateIds: ReadonlySet<string>,\n): boolean {\n return typeof successorId === \"string\" && successorId.length > 0 && candidateIds.has(successorId);\n}\n\nexport function formatSupersededPrefix(date: string, successorId: string): string {\n return `[superseded ${date} by ${successorId}]`;\n}\n\nexport function resultStateViewId(result: StateViewResult): string {\n return result.id ?? result.docid ?? \"\";\n}\n\n/**\n * #2859 — namespace-qualified chain identity. Namespace fanout can surface\n * the same id from two namespaces; every successor/admission match runs on\n * `namespace\\0id` keys so a row in one namespace can never anchor (or be\n * anchored by) an identically-named row in another.\n */\nexport function stateViewKey(namespace: string | undefined, id: string): string {\n return `${typeof namespace === \"string\" ? namespace : \"\"}\\u0000${id}`;\n}\n\nexport function resultStateViewKey(result: StateViewResult): string {\n const id = resultStateViewId(result);\n return id ? stateViewKey(result.namespace, id) : \"\";\n}\n\n/** Inverse of {@link stateViewKey}: the id after the namespace separator. */\nfunction stateViewIdFromKey(key: string): string {\n const sep = key.indexOf(\"\\u0000\");\n return sep === -1 ? key : key.slice(sep + 1);\n}\n\n/**\n * predecessorKey → successorKey, namespace-qualified. Precedence: explicit\n * chains, then successor rows' `supersedes` back-pointers (#2859 — derives\n * the reverse chain when the predecessor lacks `supersededBy`), then the\n * predecessor's own `supersededBy` (authoritative when present).\n */\nfunction buildSuccessorMap(\n results: readonly StateViewResult[],\n chains: readonly StateViewChain[],\n): Map<string, string> {\n const byPred = new Map<string, string>();\n const link = (predKey: string, succKey: string, overwrite: boolean): void => {\n if (!predKey || !succKey) return;\n if (overwrite || !byPred.has(predKey)) byPred.set(predKey, succKey);\n };\n for (const chain of chains) {\n if (chain.predecessorId && chain.successorId) {\n link(\n stateViewKey(chain.namespace, chain.predecessorId),\n stateViewKey(chain.namespace, chain.successorId),\n false,\n );\n }\n }\n for (const result of results) {\n const key = resultStateViewKey(result);\n if (key && result.supersedes) {\n link(stateViewKey(result.namespace, result.supersedes), key, false);\n }\n }\n for (const result of results) {\n const key = resultStateViewKey(result);\n if (key && result.supersededBy) {\n link(key, stateViewKey(result.namespace, result.supersededBy), true);\n }\n }\n return byPred;\n}\n\nfunction successorLinkOf(\n result: StateViewResult,\n byPred: ReadonlyMap<string, string>,\n): { superseded: boolean; successorKey: string | undefined } {\n const key = resultStateViewKey(result);\n return {\n superseded:\n result.status === \"superseded\" ||\n Boolean(result.supersededBy) ||\n byPred.has(key),\n successorKey: result.supersededBy\n ? stateViewKey(result.namespace, result.supersededBy)\n : byPred.get(key),\n };\n}\n\nfunction labelFor(\n key: string,\n result: StateViewResult,\n byPred: Map<string, string>,\n admittedIds: ReadonlySet<string>,\n asOfMs: number | null,\n): StateLabel {\n const { successorKey } = successorLinkOf(result, byPred);\n const isPred = shouldWidenSuperseded(successorKey, admittedIds);\n let isSucc = false;\n for (const [predId, succId] of byPred) {\n if (succId === key && admittedIds.has(predId)) {\n isSucc = true;\n break;\n }\n }\n if (isPred && isSucc) return \"transition\";\n if (isPred) return \"historical\";\n if (isSucc) return \"current\";\n if (result.status === \"superseded\") {\n // #1952 asOf mode: the successor is legitimately absent under the\n // historical pin (a linked successor takes the pair branches above).\n // The row was the live fact at the snapshot when the temporal\n // validity boundary postdates the pin (\"current\" relative to the\n // snapshot); already replaced at the pin is \"historical\". #2859: the\n // boundary is the fact's validity flip — `invalidAt` (the supersession\n // pipeline sets it to the successor's valid_at) — not the\n // `supersededAt` write time; legacy rows without a window fall back\n // to supersededAt.\n return asOfMs === null ? \"historical\" : snapshotStateLabel(result, asOfMs);\n }\n return \"current\";\n}\n\nfunction snapshotStateLabel(result: StateViewResult, asOfMs: number): StateLabel {\n const invalidAtMs = Date.parse(result.invalidAt ?? \"\");\n const boundaryMs = Number.isFinite(invalidAtMs)\n ? invalidAtMs\n : Date.parse(result.supersededAt ?? \"\");\n return Number.isFinite(boundaryMs) && boundaryMs <= asOfMs ? \"historical\" : \"current\";\n}\n\nexport function annotateStateView<T extends StateViewResult>(\n results: T[],\n query: string,\n chains: readonly StateViewChain[],\n options: { enabled?: boolean; asOfMs?: number; changeIntent?: boolean } = {},\n): T[] {\n const enabled = options.enabled === true;\n // #2893 — changeIntent:true marks intent as already classified from the\n // ORIGINAL prompt; `query` may be cron-normalized (intent signal\n // truncated or stop-worded away) and must not be re-checked then.\n if (!enabled || (options.changeIntent !== true && !isChangeOrientedQuery(query))) return results;\n // #1952 asOf mode: under a historical pin the pipeline's isValidAsOf\n // gate already decided validity at the pinned instant, so a predecessor\n // must not be discarded merely because its successor is absent under\n // the same filter. A valid asOf result is never emptied here.\n const asOfMs =\n typeof options.asOfMs === \"number\" && Number.isFinite(options.asOfMs)\n ? options.asOfMs\n : null;\n\n const byPred = buildSuccessorMap(results, chains);\n const candidateIds = new Set<string>();\n for (const result of results) {\n const key = resultStateViewKey(result);\n if (key) candidateIds.add(key);\n }\n let admitted: T[];\n if (asOfMs !== null) {\n admitted = results.slice();\n } else {\n admitted = [];\n for (const result of results) {\n const { superseded, successorKey } = successorLinkOf(result, byPred);\n if (!superseded || shouldWidenSuperseded(successorKey, candidateIds)) {\n admitted.push(result);\n }\n }\n\n // #1952 contract: superseded never appears without its successor. A\n // successor can itself be dropped (filtered elsewhere, or transitively\n // orphaned), so reconcile to a fixpoint instead of trusting the first pass.\n let admittedIds = new Set(admitted.map(resultStateViewKey).filter(Boolean));\n for (let changed = true; changed; ) {\n changed = false;\n for (let i = admitted.length - 1; i >= 0; i -= 1) {\n const row = admitted[i]!;\n const { superseded, successorKey } = successorLinkOf(row, byPred);\n if (superseded && !shouldWidenSuperseded(successorKey, admittedIds)) {\n admitted.splice(i, 1);\n changed = true;\n }\n }\n if (changed) admittedIds = new Set(admitted.map(resultStateViewKey).filter(Boolean));\n }\n }\n\n const admittedIds = new Set(admitted.map(resultStateViewKey).filter(Boolean));\n return admitted.map((result) => {\n const key = resultStateViewKey(result);\n const { successorKey } = successorLinkOf(result, byPred);\n const stateLabel = labelFor(key, result, byPred, admittedIds, asOfMs);\n if (result.supersededBy || !successorKey) return { ...result, stateLabel };\n return { ...result, stateLabel, supersededBy: stateViewIdFromKey(successorKey) };\n });\n}\n\n/**\n * #2859 — drop superseded rows whose successor is not in the pool BEFORE\n * the user cap/MMR runs, so post-cap orphan removal can never underfill\n * the result set. Reconciles to a fixpoint (a dropped successor orphans\n * its own predecessors). Rows with no successor links pass through in\n * order. ponytail: repeated full-pool passes are O(n²) on one long chain;\n * recall pools stay small, memoize per-key if pools ever grow.\n */\nexport function reconcileStateViewPairs<T extends StateViewResult>(results: readonly T[]): T[] {\n const byPred = buildSuccessorMap(results, []);\n let kept = results.slice();\n for (let changed = true; changed; ) {\n changed = false;\n const keptKeys = new Set(kept.map(resultStateViewKey).filter(Boolean));\n const next: T[] = [];\n for (const row of kept) {\n const { superseded, successorKey } = successorLinkOf(row, byPred);\n if (superseded && !shouldWidenSuperseded(successorKey, keptKeys)) {\n changed = true;\n continue;\n }\n next.push(row);\n }\n if (changed) kept = next;\n }\n return kept;\n}\n\n/**\n * #2928 — per-row packet root keys for the final output budget. Runs the\n * same namespace-qualified union-find as {@link capStateViewPackets}:\n * every row of one evidence packet shares the root key, so a downstream\n * budget that admits one row of the packet can admit them all or none.\n * Blank-key rows get unique per-index roots (distinct singletons).\n */\nexport function stateViewPacketKeys<T extends StateViewResult>(\n ordered: readonly T[],\n): string[] {\n const byPred = buildSuccessorMap(ordered, []);\n // Union-find over row keys; blank-key rows become per-index singletons.\n const parent = new Map<string, string>();\n const root = (key: string): string => {\n let current = key;\n for (;;) {\n const up = parent.get(current);\n if (up === undefined || up === current) {\n parent.set(current, current);\n return current;\n }\n current = up;\n }\n };\n const union = (a: string, b: string): void => {\n const ra = root(a);\n const rb = root(b);\n if (ra !== rb) parent.set(ra, rb);\n };\n const keys: string[] = [];\n const keyToIndex = new Map<string, number>();\n for (let i = 0; i < ordered.length; i += 1) {\n // ponytail: blank-key rows must stay distinct singletons; index-keyed.\n const key = resultStateViewKey(ordered[i]!) || `#idx${i}`;\n keys.push(key);\n if (!parent.has(key)) parent.set(key, key);\n const first = keyToIndex.get(key);\n if (first !== undefined) union(keys[first]!, key);\n else keyToIndex.set(key, i);\n }\n for (const [predKey, succKey] of byPred) {\n const predIdx = keyToIndex.get(predKey);\n const succIdx = keyToIndex.get(succKey);\n if (predIdx !== undefined && succIdx !== undefined) union(keys[predIdx]!, keys[succIdx]!);\n }\n return keys.map((key) => root(key));\n}\n\n/**\n * #2859 — packet-counting cap. A predecessor/successor chain admitted\n * together is ONE complete evidence packet: it consumes a single slot of\n * the user cap, and the slice never splits a packet at the boundary (no\n * underfill from post-cap orphan removal). Rows keep their incoming\n * (MMR) order; packets are ordered by first appearance. Call\n * reconcileStateViewPairs first so orphans never consume a slot.\n */\nexport function capStateViewPackets<T extends StateViewResult>(\n ordered: readonly T[],\n limit: number,\n): T[] {\n const safeLimit =\n typeof limit === \"number\" && Number.isFinite(limit) ? Math.max(0, Math.floor(limit)) : 0;\n if (safeLimit === 0) return [];\n if (ordered.length === 0) return [];\n\n const keys = stateViewPacketKeys(ordered);\n // Packets ordered by first appearance; admit whole packets until the cap.\n const selectedRoots = new Set<string>();\n for (let i = 0; i < ordered.length && selectedRoots.size < safeLimit; i += 1) {\n selectedRoots.add(keys[i]!);\n }\n const selected: T[] = [];\n for (let i = 0; i < ordered.length; i += 1) {\n if (selectedRoots.has(keys[i]!)) selected.push(ordered[i]!);\n }\n return selected;\n}\n"],"mappings":";;;;;AA+CO,IAAM,6BAA6B;AAE1C,IAAM,eAAe,CAAC,UAAU,YAAY,YAAY,aAAa,UAAU,WAAW,WAAW,UAAU;AAI/G,IAAM,mBAAmB;AACzB,IAAM,iBAAiB,IAAI,OAAO,SAAS,aAAa,KAAK,GAAG,CAAC,MAAM;AAKvE,IAAM,mBAAmB;AAElB,SAAS,sBAAsB,KAAuB;AAC3D,SAAO,kBAAkB,KAAK,kBAAkB,MAAM;AACxD;AAEO,SAAS,sBAAsB,OAAwB;AAC5D,QAAM,QAAQ,MAAM,YAAY;AAChC,SAAO,iBAAiB,KAAK,KAAK,KAAK,eAAe,KAAK,KAAK,KAAK,iBAAiB,KAAK,KAAK;AAClG;AAEO,SAAS,sBACd,aACA,cACS;AACT,SAAO,OAAO,gBAAgB,YAAY,YAAY,SAAS,KAAK,aAAa,IAAI,WAAW;AAClG;AAEO,SAAS,uBAAuB,MAAc,aAA6B;AAChF,SAAO,eAAe,IAAI,OAAO,WAAW;AAC9C;AAEO,SAAS,kBAAkB,QAAiC;AACjE,SAAO,OAAO,MAAM,OAAO,SAAS;AACtC;AAQO,SAAS,aAAa,WAA+B,IAAoB;AAC9E,SAAO,GAAG,OAAO,cAAc,WAAW,YAAY,EAAE,KAAS,EAAE;AACrE;AAEO,SAAS,mBAAmB,QAAiC;AAClE,QAAM,KAAK,kBAAkB,MAAM;AACnC,SAAO,KAAK,aAAa,OAAO,WAAW,EAAE,IAAI;AACnD;AAGA,SAAS,mBAAmB,KAAqB;AAC/C,QAAM,MAAM,IAAI,QAAQ,IAAQ;AAChC,SAAO,QAAQ,KAAK,MAAM,IAAI,MAAM,MAAM,CAAC;AAC7C;AAQA,SAAS,kBACP,SACA,QACqB;AACrB,QAAM,SAAS,oBAAI,IAAoB;AACvC,QAAM,OAAO,CAAC,SAAi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SACA,OACK;AACL,QAAM,YACJ,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,IAAI,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,CAAC,IAAI;AACzF,MAAI,cAAc,EAAG,QAAO,CAAC;AAC7B,MAAI,QAAQ,WAAW,EAAG,QAAO,CAAC;AAElC,QAAM,OAAO,oBAAoB,OAAO;AAExC,QAAM,gBAAgB,oBAAI,IAAY;AACtC,WAAS,IAAI,GAAG,IAAI,QAAQ,UAAU,cAAc,OAAO,WAAW,KAAK,GAAG;AAC5E,kBAAc,IAAI,KAAK,CAAC,CAAE;AAAA,EAC5B;AACA,QAAM,WAAgB,CAAC;AACvB,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK,GAAG;AAC1C,QAAI,cAAc,IAAI,KAAK,CAAC,CAAE,EAAG,UAAS,KAAK,QAAQ,CAAC,CAAE;AAAA,EAC5D;AACA,SAAO;AACT;","names":["admittedIds"]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
readNamespaceMaintenanceLastRanStatuses,
|
|
4
4
|
readNamespaceMaintenanceStatuses,
|
|
5
5
|
runNamespaceMaintenancePlan
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WFMQN7JE.js";
|
|
7
7
|
import {
|
|
8
8
|
analyzeSessionIntegrity,
|
|
9
9
|
applySessionRepair,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-CMTINOFS.js";
|
|
15
15
|
import {
|
|
16
16
|
summarizeCorpusAndReplica
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-6MQMYXSQ.js";
|
|
18
18
|
import {
|
|
19
19
|
readJudgeVerdictStats
|
|
20
20
|
} from "./chunk-OZKOPQCM.js";
|
|
@@ -25,36 +25,36 @@ import {
|
|
|
25
25
|
runEvalBenchmarkCiGate,
|
|
26
26
|
validateEvalBenchmarkPack
|
|
27
27
|
} from "./chunk-4IHBN6WU.js";
|
|
28
|
-
import {
|
|
29
|
-
runConsolidationProvenanceCheck
|
|
30
|
-
} from "./chunk-2SGLMP2E.js";
|
|
31
28
|
import {
|
|
32
29
|
resolveCuratedIncludeFilesStatePath,
|
|
33
30
|
resolveNativeKnowledgeStatePath,
|
|
34
31
|
resolveOpenClawWorkspaceStatePath
|
|
35
32
|
} from "./chunk-2DQ2XREU.js";
|
|
33
|
+
import {
|
|
34
|
+
runConsolidationProvenanceCheck
|
|
35
|
+
} from "./chunk-2SGLMP2E.js";
|
|
36
36
|
import {
|
|
37
37
|
reportBufferSurpriseDistribution
|
|
38
38
|
} from "./chunk-YBPYIAA5.js";
|
|
39
39
|
import {
|
|
40
40
|
parseConfig
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-MCMS4VUK.js";
|
|
42
42
|
import {
|
|
43
43
|
readAggregateExtractionWatermark
|
|
44
|
-
} from "./chunk-
|
|
45
|
-
import {
|
|
46
|
-
listNamespaces
|
|
47
|
-
} from "./chunk-KY236SP5.js";
|
|
44
|
+
} from "./chunk-563X6JJX.js";
|
|
48
45
|
import {
|
|
49
46
|
listMemoryGovernanceRuns,
|
|
50
47
|
readMemoryGovernanceRunArtifact
|
|
51
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-KLUC2GSG.js";
|
|
49
|
+
import {
|
|
50
|
+
listNamespaces
|
|
51
|
+
} from "./chunk-W7UV2ZCA.js";
|
|
52
52
|
import {
|
|
53
53
|
analyzeGraphHealth
|
|
54
54
|
} from "./chunk-5FAGCOZD.js";
|
|
55
55
|
import {
|
|
56
56
|
StorageManager
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-ICN37XHG.js";
|
|
58
58
|
import {
|
|
59
59
|
lintWorkspaceFiles
|
|
60
60
|
} from "./chunk-DM2T26WE.js";
|
|
@@ -1109,7 +1109,7 @@ async function summarizeGraphEdgeDecayStatus(config) {
|
|
|
1109
1109
|
}
|
|
1110
1110
|
async function summarizeTierDistribution(storage) {
|
|
1111
1111
|
try {
|
|
1112
|
-
const { summarizeTiers } = await import("./tier-stats-
|
|
1112
|
+
const { summarizeTiers } = await import("./tier-stats-VK5PCO2L.js");
|
|
1113
1113
|
const summary = await summarizeTiers(storage);
|
|
1114
1114
|
const storageDir = storage.dir ?? "";
|
|
1115
1115
|
const journalPath = storageDir.length > 0 ? path.join(storageDir, "state", "tier-migration-journal.jsonl") : null;
|
|
@@ -1683,4 +1683,4 @@ export {
|
|
|
1683
1683
|
runBenchmarkRecall,
|
|
1684
1684
|
runOperatorRepair
|
|
1685
1685
|
};
|
|
1686
|
-
//# sourceMappingURL=chunk-
|
|
1686
|
+
//# sourceMappingURL=chunk-EMSYMYXO.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
diffGraphSnapshots
|
|
3
|
-
} from "./chunk-AUDJPF4N.js";
|
|
4
1
|
import {
|
|
5
2
|
graphSnapshotFromMemoryDir
|
|
6
3
|
} from "./chunk-44442YCH.js";
|
|
4
|
+
import {
|
|
5
|
+
diffGraphSnapshots
|
|
6
|
+
} from "./chunk-AUDJPF4N.js";
|
|
7
7
|
|
|
8
8
|
// src/dashboard-runtime.ts
|
|
9
9
|
import { createHash, timingSafeEqual } from "crypto";
|
|
@@ -370,4 +370,4 @@ var GraphDashboardServer = class {
|
|
|
370
370
|
export {
|
|
371
371
|
GraphDashboardServer
|
|
372
372
|
};
|
|
373
|
-
//# sourceMappingURL=chunk-
|
|
373
|
+
//# sourceMappingURL=chunk-EZ25VE3G.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
formatSupersededPrefix
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EH3HNCAM.js";
|
|
4
4
|
|
|
5
5
|
// src/recall-state-view-render.ts
|
|
6
6
|
function renderStateViewLine(result, options = {}) {
|
|
@@ -17,4 +17,4 @@ function renderStateViewLine(result, options = {}) {
|
|
|
17
17
|
export {
|
|
18
18
|
renderStateViewLine
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-F5H6YG5P.js.map
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseDeepRecallMaxSteps
|
|
3
|
+
} from "./chunk-2EYZ32LH.js";
|
|
1
4
|
import {
|
|
2
5
|
deepRecallRequestSchema
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DM5CU5J7.js";
|
|
4
7
|
import {
|
|
5
8
|
EngramAccessInputError
|
|
6
9
|
} from "./chunk-2Z24E5W2.js";
|
|
7
10
|
|
|
8
11
|
// src/deep-recall-http-glue.ts
|
|
9
|
-
function
|
|
10
|
-
if (raw === void 0 || raw === null) return void 0;
|
|
11
|
-
const value = typeof raw === "string" ? Number(raw) : raw;
|
|
12
|
-
if (typeof value !== "number" || !Number.isFinite(value) || !Number.isInteger(value) || value < 0) {
|
|
13
|
-
throw new EngramAccessInputError("maxSteps must be a non-negative integer");
|
|
14
|
-
}
|
|
15
|
-
return value;
|
|
16
|
-
}
|
|
17
|
-
async function respondDeepRecall(req, res, respondJson, readJsonBody, service, scopeFor) {
|
|
12
|
+
async function respondDeepRecall(req, res, respondJson, readJsonBody, service, scopeFor, abortSignal) {
|
|
18
13
|
const parsed = deepRecallRequestSchema.safeParse(await readJsonBody(req));
|
|
19
14
|
if (!parsed.success) {
|
|
20
15
|
respondJson(
|
|
@@ -24,14 +19,20 @@ async function respondDeepRecall(req, res, respondJson, readJsonBody, service, s
|
|
|
24
19
|
);
|
|
25
20
|
return;
|
|
26
21
|
}
|
|
27
|
-
|
|
22
|
+
let maxSteps;
|
|
23
|
+
try {
|
|
24
|
+
maxSteps = parseDeepRecallMaxSteps(parsed.data.maxSteps);
|
|
25
|
+
} catch (err) {
|
|
26
|
+
throw new EngramAccessInputError(err instanceof Error ? err.message : String(err));
|
|
27
|
+
}
|
|
28
28
|
const scope = scopeFor(parsed.data.namespace, parsed.data.sessionKey);
|
|
29
29
|
const result = await service.deepRecall({
|
|
30
30
|
query: parsed.data.query,
|
|
31
31
|
...maxSteps !== void 0 ? { maxSteps } : {},
|
|
32
32
|
namespace: scope.namespace,
|
|
33
33
|
sessionKey: scope.sessionKey,
|
|
34
|
-
authenticatedPrincipal: scope.authenticatedPrincipal
|
|
34
|
+
authenticatedPrincipal: scope.authenticatedPrincipal,
|
|
35
|
+
...abortSignal ? { abortSignal } : {}
|
|
35
36
|
});
|
|
36
37
|
respondJson(res, 200, result);
|
|
37
38
|
}
|
|
@@ -39,4 +40,4 @@ async function respondDeepRecall(req, res, respondJson, readJsonBody, service, s
|
|
|
39
40
|
export {
|
|
40
41
|
respondDeepRecall
|
|
41
42
|
};
|
|
42
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-FGFC2EFR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/deep-recall-http-glue.ts"],"sourcesContent":["/**\n * Deep-recall HTTP glue (issue #2332) — route body lives here so\n * access-http.ts stays at its structural ceiling (same seam as\n * meetings/http-glue.ts and location/http-glue.ts).\n *\n * Input errors map to 400; everything else rethrows so backend faults keep\n * flowing to the global 500 handler. `deepRecall.enabled` gating lives in\n * EngramAccessService — this module only translates transport shape.\n */\n\nimport type { IncomingMessage, ServerResponse } from \"node:http\";\nimport { deepRecallRequestSchema } from \"./access-schema.js\";\nimport { EngramAccessInputError } from \"./access-errors.js\";\nimport type { EngramAccessService } from \"./access-service.js\";\nimport { parseDeepRecallMaxSteps } from \"./deep-recall-config.js\";\n\ntype RespondJson = (res: ServerResponse, status: number, payload: unknown) => void;\ntype ReadJsonBody = (req: IncomingMessage) => Promise<unknown>;\n\nexport async function respondDeepRecall(\n req: IncomingMessage,\n res: ServerResponse,\n respondJson: RespondJson,\n readJsonBody: ReadJsonBody,\n service: EngramAccessService,\n /**\n * Resolve the caller scope for a body-supplied namespace/sessionKey. The\n * body `namespace` is user-controlled, so it MUST flow through the SAME\n * effective-namespace allow-list gate as the query-string value (issue\n * #1850 finding 2 / #2332 review): a scoped bearer that passes an allowed\n * `?namespace=` while setting a different `namespace` in the body would\n * otherwise read another tenant. access-http supplies the gate and applies\n * the query-string fallback, so this module never selects a namespace of\n * its own. Throws 403 when the effective namespace is not permitted.\n *\n * `authenticatedPrincipal` is the identity the transport authenticated, and\n * it MUST reach the service: authorization and the audit trail derive from\n * the presenting principal, never from the client-supplied `sessionKey`.\n * Dropping it let a crafted key matching another principal rule read that\n * principal's namespaces, and made a legitimate namespace-enabled request\n * with no session key fail as unauthenticated.\n */\n scopeFor: (\n bodyNamespace?: string,\n bodySessionKey?: string,\n ) => { namespace?: string; sessionKey?: string; authenticatedPrincipal?: string },\n /** Transport cancellation (issue #2915): aborts seed search, graph reads, policy calls. */\n abortSignal?: AbortSignal,\n): Promise<void> {\n const parsed = deepRecallRequestSchema.safeParse(await readJsonBody(req));\n if (!parsed.success) {\n respondJson(\n res,\n 400,\n { error: \"invalid_request\", detail: parsed.error.issues.map((i) => `${i.path.join(\".\")}: ${i.message}`).join(\"; \") },\n );\n return;\n }\n let maxSteps: number | undefined;\n try {\n maxSteps = parseDeepRecallMaxSteps(parsed.data.maxSteps);\n } catch (err) {\n throw new EngramAccessInputError(err instanceof Error ? err.message : String(err));\n }\n const scope = scopeFor(parsed.data.namespace, parsed.data.sessionKey);\n const result = await service.deepRecall({\n query: parsed.data.query,\n ...(maxSteps !== undefined ? { maxSteps } : {}),\n namespace: scope.namespace,\n sessionKey: scope.sessionKey,\n authenticatedPrincipal: scope.authenticatedPrincipal,\n ...(abortSignal ? { abortSignal } : {}),\n });\n respondJson(res, 200, result);\n}\n"],"mappings":";;;;;;;;;;;AAmBA,eAAsB,kBACpB,KACA,KACA,aACA,cACA,SAkBA,UAKA,aACe;AACf,QAAM,SAAS,wBAAwB,UAAU,MAAM,aAAa,GAAG,CAAC;AACxE,MAAI,CAAC,OAAO,SAAS;AACnB;AAAA,MACE;AAAA,MACA;AAAA,MACA,EAAE,OAAO,mBAAmB,QAAQ,OAAO,MAAM,OAAO,IAAI,CAAC,MAAM,GAAG,EAAE,KAAK,KAAK,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,IAAI,EAAE;AAAA,IACrH;AACA;AAAA,EACF;AACA,MAAI;AACJ,MAAI;AACF,eAAW,wBAAwB,OAAO,KAAK,QAAQ;AAAA,EACzD,SAAS,KAAK;AACZ,UAAM,IAAI,uBAAuB,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAAA,EACnF;AACA,QAAM,QAAQ,SAAS,OAAO,KAAK,WAAW,OAAO,KAAK,UAAU;AACpE,QAAM,SAAS,MAAM,QAAQ,WAAW;AAAA,IACtC,OAAO,OAAO,KAAK;AAAA,IACnB,GAAI,aAAa,SAAY,EAAE,SAAS,IAAI,CAAC;AAAA,IAC7C,WAAW,MAAM;AAAA,IACjB,YAAY,MAAM;AAAA,IAClB,wBAAwB,MAAM;AAAA,IAC9B,GAAI,cAAc,EAAE,YAAY,IAAI,CAAC;AAAA,EACvC,CAAC;AACD,cAAY,KAAK,KAAK,MAAM;AAC9B;","names":[]}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-TBBDFYXW.js";
|
|
6
6
|
import {
|
|
7
7
|
hasLiveSupportPassportCard
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PWPIERBM.js";
|
|
9
9
|
|
|
10
10
|
// src/tier-routing.ts
|
|
11
11
|
function requiresHotTier(memory) {
|
|
@@ -80,4 +80,4 @@ export {
|
|
|
80
80
|
computeTierValueScore,
|
|
81
81
|
decideTierTransition
|
|
82
82
|
};
|
|
83
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-GCBIXUPT.js.map
|