@remnic/core 10.0.123 → 10.0.125
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.js +118 -117
- package/dist/access-cli.js +118 -117
- package/dist/access-cli.js.map +1 -1
- package/dist/access-extraction-force-flush.js +118 -117
- package/dist/access-http-admission.js +1 -1
- package/dist/access-http-briefing.js +118 -117
- package/dist/access-http-query.js +118 -117
- package/dist/access-http.js +118 -117
- package/dist/access-identity-continuity-surface.js +118 -117
- package/dist/access-lcm-surface.js +118 -117
- package/dist/access-mcp.js +118 -117
- package/dist/access-observe-write-category.js +8 -8
- package/dist/access-observe-write-surface.js +118 -117
- package/dist/access-offline-manifest.js +5 -5
- package/dist/access-operations-batch.js +118 -117
- package/dist/access-operations.js +118 -117
- package/dist/access-recall-concurrency.js +118 -117
- package/dist/access-recall-diagnostics.js +2 -2
- package/dist/access-recall-response.js +118 -117
- package/dist/access-recall-surface.js +118 -117
- package/dist/access-schema.js +7 -7
- package/dist/access-service.js +118 -117
- package/dist/active-recall.js +18 -18
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/briefing.js +12 -12
- package/dist/buffer-admission.d.ts +9 -0
- package/dist/buffer-admission.d.ts.map +1 -1
- package/dist/buffer-admission.js +3 -1
- package/dist/buffer-session-cap.d.ts +15 -0
- package/dist/buffer-session-cap.d.ts.map +1 -0
- package/dist/buffer-session-cap.js +19 -0
- package/dist/buffer.d.ts +1 -1
- package/dist/buffer.d.ts.map +1 -1
- package/dist/buffer.js +7 -4
- package/dist/calibration.js +2 -2
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.js +15 -15
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.js +3 -3
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-JWFBN2LM.js → chunk-2AVPRUML.js} +2 -2
- package/dist/{chunk-T4Q57NRP.js → chunk-2GSPNTOU.js} +2 -2
- package/dist/{chunk-43AA5FVD.js → chunk-3IZQFNIV.js} +1 -1
- package/dist/chunk-3IZQFNIV.js.map +1 -0
- package/dist/{chunk-NMQF4CAA.js → chunk-42JE2CF4.js} +2 -2
- package/dist/{chunk-R6DTQYSK.js → chunk-47W3ALIS.js} +3 -3
- package/dist/{chunk-PJIJA3MK.js → chunk-4VCASS3Q.js} +3 -3
- package/dist/{chunk-3B7EF4MP.js → chunk-4VWZ4HPL.js} +5 -5
- package/dist/{chunk-UTY3HL57.js → chunk-5DCCVEKT.js} +2 -2
- package/dist/{chunk-JLUOSKCU.js → chunk-5DP4GVKR.js} +2 -2
- package/dist/{chunk-AC6F3ADA.js → chunk-6IRJWKR5.js} +2 -2
- package/dist/{chunk-KU3K2WNM.js → chunk-6VAN7VZR.js} +12 -12
- package/dist/{chunk-TS3ILFYM.js → chunk-7QDB7P3V.js} +3 -3
- package/dist/{chunk-IWULSPDY.js → chunk-7TJMXZPO.js} +3 -3
- package/dist/{chunk-2NGTY22Z.js → chunk-ASINXIKX.js} +4 -4
- package/dist/{chunk-WGYORDDM.js → chunk-AYWW6JEH.js} +168 -168
- package/dist/{chunk-WGYORDDM.js.map → chunk-AYWW6JEH.js.map} +1 -1
- package/dist/{chunk-73TPOGS4.js → chunk-BFBS7OFQ.js} +9 -9
- package/dist/{chunk-QQ4GEUCX.js → chunk-BFDXJHYG.js} +2 -2
- package/dist/{chunk-GSRRD7ZJ.js → chunk-BNRKSJMO.js} +2 -2
- package/dist/{chunk-TVMPYREI.js → chunk-C7BTGSCY.js} +13 -13
- package/dist/{chunk-Z7GJNZTY.js → chunk-CQMH65IP.js} +2 -2
- package/dist/{chunk-R4BBGPI2.js → chunk-CS66BCED.js} +2 -2
- package/dist/{chunk-ZGEBQW2J.js → chunk-CUKYV5O3.js} +4 -4
- package/dist/{chunk-SMCMHPFY.js → chunk-DB4THCGN.js} +6 -6
- package/dist/{chunk-CKUDZMC3.js → chunk-DH2CDGAE.js} +2 -2
- package/dist/{chunk-ZDZJNXL6.js → chunk-DK2VBJ6Q.js} +4 -4
- package/dist/{chunk-B5LNHYSG.js → chunk-DL7K5PMQ.js} +2 -2
- package/dist/{chunk-7DFJ4JX2.js → chunk-DTTDMK7Q.js} +7 -7
- package/dist/{chunk-UJAOI56X.js → chunk-EFHM4VDG.js} +2 -2
- package/dist/{chunk-GFZRBHLH.js → chunk-ELBZT6RU.js} +2 -2
- package/dist/{chunk-3OEZA5TR.js → chunk-ERR7ZFPJ.js} +2 -2
- package/dist/{chunk-WY7QVTBD.js → chunk-FBXU7X27.js} +2 -2
- package/dist/{chunk-3SL52JKD.js → chunk-FZVROZKC.js} +5 -5
- package/dist/{chunk-7P72BY4F.js → chunk-G53I363P.js} +2 -2
- package/dist/{chunk-V2KGDESV.js → chunk-GS2TT2YE.js} +2 -2
- package/dist/{chunk-Y6RTVJJK.js → chunk-GSCIRMPR.js} +2 -2
- package/dist/{chunk-OM5ESBES.js → chunk-HQPFACXO.js} +2 -2
- package/dist/{chunk-EGLJALMG.js → chunk-HRMOKGQM.js} +4 -4
- package/dist/{chunk-VKS2WV2M.js → chunk-HURBXNNB.js} +2 -2
- package/dist/{chunk-SC76A2ZT.js → chunk-IB4TDPCC.js} +18 -18
- package/dist/{chunk-IMULTENA.js → chunk-ID65XTF3.js} +2 -2
- package/dist/{chunk-3COGVB3C.js → chunk-IDCZEKK6.js} +14 -3
- package/dist/chunk-IDCZEKK6.js.map +1 -0
- package/dist/{chunk-KBO44266.js → chunk-J6U6KUMK.js} +4 -4
- package/dist/{chunk-AM5ZNSUK.js → chunk-JTY3NA3I.js} +2 -2
- package/dist/{chunk-TH6OYP6I.js → chunk-K36RMINQ.js} +3 -3
- package/dist/{chunk-7LCGFUMB.js → chunk-KQAFEZQX.js} +4 -4
- package/dist/{chunk-VIWACB5U.js → chunk-KWVGRNKL.js} +6 -2
- package/dist/chunk-KWVGRNKL.js.map +1 -0
- package/dist/{chunk-53VLXNAO.js → chunk-LKGTTX74.js} +2 -2
- package/dist/chunk-LWZNSQN3.js +44 -0
- package/dist/chunk-LWZNSQN3.js.map +1 -0
- package/dist/{chunk-MFKWQJRQ.js → chunk-O62MMJWV.js} +2 -2
- package/dist/{chunk-K3FH3LAQ.js → chunk-OJXK5C6Z.js} +4 -4
- package/dist/{chunk-VYX7W6EB.js → chunk-PAGVXEWG.js} +2 -2
- package/dist/{chunk-WEDE4DXL.js → chunk-PUKLCFCU.js} +4 -4
- package/dist/{chunk-WEDE4DXL.js.map → chunk-PUKLCFCU.js.map} +1 -1
- package/dist/{chunk-GMO3BGOF.js → chunk-QC2MHZDD.js} +1 -1
- package/dist/{chunk-KNAF3A7Y.js → chunk-QF64W4YM.js} +2 -2
- package/dist/{chunk-PH5ZQM35.js → chunk-R6BNDA67.js} +2 -2
- package/dist/{chunk-EOJF66EQ.js → chunk-RRHLI6VU.js} +2 -2
- package/dist/{chunk-NHVAX7MH.js → chunk-RSKZWXQO.js} +3 -3
- package/dist/{chunk-3S7VJJTG.js → chunk-RTIHO7AJ.js} +2 -2
- package/dist/{chunk-I3V3JJS7.js → chunk-SRDWJPET.js} +2 -2
- package/dist/{chunk-I3V3JJS7.js.map → chunk-SRDWJPET.js.map} +1 -1
- package/dist/{chunk-LP326T2D.js → chunk-SU42FIJ7.js} +3 -3
- package/dist/{chunk-UDUJIKFQ.js → chunk-UGCLNASV.js} +3 -3
- package/dist/{chunk-XNRLRNQF.js → chunk-UPYEFL7J.js} +2 -2
- package/dist/{chunk-U2PSE7MB.js → chunk-VPEIWMUT.js} +2 -2
- package/dist/{chunk-RB7NXZ2E.js → chunk-W4Q65VJL.js} +2 -2
- package/dist/{chunk-ZBK3UBMB.js → chunk-WRGW76LI.js} +6 -6
- package/dist/{chunk-XN3F3V5H.js → chunk-WYABF2WA.js} +3 -3
- package/dist/{chunk-ENQCH3SW.js → chunk-XAIRTELU.js} +10 -1
- package/dist/chunk-XAIRTELU.js.map +1 -0
- package/dist/{chunk-X33UXMUS.js → chunk-XLHLZALR.js} +3 -3
- package/dist/{chunk-CHZMU6HA.js → chunk-XN43HAIV.js} +2 -2
- package/dist/{chunk-Y7LKZQ4T.js → chunk-YJEOQ72B.js} +2 -2
- package/dist/{chunk-Q5Q3IHPP.js → chunk-YKUW2EZF.js} +4 -4
- package/dist/{chunk-65HWAQ4F.js → chunk-ZDCSFRIU.js} +2 -2
- package/dist/cli.js +118 -117
- package/dist/coding/export-okf-codegraph.js +11 -11
- package/dist/coding/pre-action-gate.js +2 -2
- package/dist/compounding/engine.js +13 -13
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +18 -18
- package/dist/connectors/codex-materialize-runner.js +12 -12
- package/dist/connectors/index.js +12 -12
- package/dist/convergence-refresh.js +14 -14
- package/dist/corpus-watermark.js +14 -14
- package/dist/deep-recall-http-glue.js +8 -8
- package/dist/embedding-fallback.js +1 -1
- package/dist/entity-retrieval.js +13 -13
- package/dist/event-order-recall.js +3 -3
- package/dist/explicit-capture.js +118 -117
- package/dist/extraction-span-materialize.js +2 -2
- package/dist/extraction.js +21 -21
- package/dist/{first-start-migration-U4K2P7KF.js → first-start-migration-FILJH3RO.js} +4 -4
- package/dist/{graph-edge-decay-BC3IO2J4.js → graph-edge-decay-CXTNJ7IQ.js} +6 -6
- package/dist/graph-edge-decay-CXTNJ7IQ.js.map +1 -0
- package/dist/graph-jsonl.js +4 -4
- package/dist/graph-snapshot.js +4 -4
- package/dist/graph.js +5 -5
- package/dist/harmonic-retrieval.js +12 -12
- package/dist/index.js +183 -182
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.js +4 -4
- package/dist/local-llm.js +2 -2
- package/dist/location/index.js +13 -13
- package/dist/maintenance/memory-governance.js +12 -12
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +12 -12
- package/dist/maintenance/rebuild-memory-projection-runner.js +14 -14
- package/dist/maintenance/rebuild-memory-projection.js +13 -13
- package/dist/namespaces/migrate.js +13 -13
- package/dist/namespaces/search.js +4 -4
- package/dist/namespaces/storage.js +12 -12
- package/dist/offline-sync-changeset-generations.js +3 -3
- package/dist/offline-sync-embedding-generation.js +2 -2
- package/dist/offline-sync-snapshot-stream.js +5 -5
- package/dist/offline-sync.js +4 -4
- package/dist/operator-doctor-corpus.js +15 -15
- package/dist/operator-toolkit.js +29 -29
- package/dist/orchestration/backlog-scheduler.js +119 -118
- package/dist/orchestration/backlog-scheduler.js.map +1 -1
- package/dist/orchestration/buffer-drain-runner.js +119 -118
- package/dist/orchestration/extraction-run.d.ts.map +1 -1
- package/dist/orchestration/maintenance.js +22 -22
- package/dist/orchestrator.js +118 -117
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-navigate-access.js +2 -2
- package/dist/recall-navigate-disclosure.js +2 -2
- package/dist/recall-navigate.js +2 -2
- package/dist/recall-navigation.js +118 -117
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.js +2 -2
- package/dist/resume-bundles.js +21 -21
- package/dist/search/factory.js +3 -3
- package/dist/search/index.js +7 -7
- package/dist/semantic-consolidation.js +13 -13
- package/dist/semantic-rule-promotion.js +12 -12
- package/dist/semantic-rule-verifier.js +12 -12
- package/dist/source-agent-qualifier.js +14 -14
- package/dist/standup/build.js +12 -12
- package/dist/storage.js +11 -11
- package/dist/summarizer.js +3 -3
- package/dist/support-passport/index.js +3 -3
- package/dist/transcript.js +2 -2
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/export-okf.js +12 -12
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/verified-recall.js +12 -12
- package/dist/who-knows-cli.js +13 -13
- package/dist/who-knows.js +12 -12
- package/package.json +2 -2
- package/src/access-http-admission.ts +1 -1
- package/src/access-mcp.ts +1 -1
- package/src/buffer-admission.ts +16 -0
- package/src/buffer-session-cap.ts +49 -0
- package/src/buffer-session.test.ts +75 -1
- package/src/buffer.ts +7 -2
- package/src/config.ts +4 -0
- package/src/orchestration/extraction-run.ts +7 -3
- package/src/orchestrator-flush.test.ts +72 -4
- package/src/types.ts +2 -0
- package/dist/chunk-3COGVB3C.js.map +0 -1
- package/dist/chunk-43AA5FVD.js.map +0 -1
- package/dist/chunk-ENQCH3SW.js.map +0 -1
- package/dist/chunk-VIWACB5U.js.map +0 -1
- /package/dist/{graph-edge-decay-BC3IO2J4.js.map → buffer-session-cap.js.map} +0 -0
- /package/dist/{chunk-JWFBN2LM.js.map → chunk-2AVPRUML.js.map} +0 -0
- /package/dist/{chunk-T4Q57NRP.js.map → chunk-2GSPNTOU.js.map} +0 -0
- /package/dist/{chunk-NMQF4CAA.js.map → chunk-42JE2CF4.js.map} +0 -0
- /package/dist/{chunk-R6DTQYSK.js.map → chunk-47W3ALIS.js.map} +0 -0
- /package/dist/{chunk-PJIJA3MK.js.map → chunk-4VCASS3Q.js.map} +0 -0
- /package/dist/{chunk-3B7EF4MP.js.map → chunk-4VWZ4HPL.js.map} +0 -0
- /package/dist/{chunk-UTY3HL57.js.map → chunk-5DCCVEKT.js.map} +0 -0
- /package/dist/{chunk-JLUOSKCU.js.map → chunk-5DP4GVKR.js.map} +0 -0
- /package/dist/{chunk-AC6F3ADA.js.map → chunk-6IRJWKR5.js.map} +0 -0
- /package/dist/{chunk-KU3K2WNM.js.map → chunk-6VAN7VZR.js.map} +0 -0
- /package/dist/{chunk-TS3ILFYM.js.map → chunk-7QDB7P3V.js.map} +0 -0
- /package/dist/{chunk-IWULSPDY.js.map → chunk-7TJMXZPO.js.map} +0 -0
- /package/dist/{chunk-2NGTY22Z.js.map → chunk-ASINXIKX.js.map} +0 -0
- /package/dist/{chunk-73TPOGS4.js.map → chunk-BFBS7OFQ.js.map} +0 -0
- /package/dist/{chunk-QQ4GEUCX.js.map → chunk-BFDXJHYG.js.map} +0 -0
- /package/dist/{chunk-GSRRD7ZJ.js.map → chunk-BNRKSJMO.js.map} +0 -0
- /package/dist/{chunk-TVMPYREI.js.map → chunk-C7BTGSCY.js.map} +0 -0
- /package/dist/{chunk-Z7GJNZTY.js.map → chunk-CQMH65IP.js.map} +0 -0
- /package/dist/{chunk-R4BBGPI2.js.map → chunk-CS66BCED.js.map} +0 -0
- /package/dist/{chunk-ZGEBQW2J.js.map → chunk-CUKYV5O3.js.map} +0 -0
- /package/dist/{chunk-SMCMHPFY.js.map → chunk-DB4THCGN.js.map} +0 -0
- /package/dist/{chunk-CKUDZMC3.js.map → chunk-DH2CDGAE.js.map} +0 -0
- /package/dist/{chunk-ZDZJNXL6.js.map → chunk-DK2VBJ6Q.js.map} +0 -0
- /package/dist/{chunk-B5LNHYSG.js.map → chunk-DL7K5PMQ.js.map} +0 -0
- /package/dist/{chunk-7DFJ4JX2.js.map → chunk-DTTDMK7Q.js.map} +0 -0
- /package/dist/{chunk-UJAOI56X.js.map → chunk-EFHM4VDG.js.map} +0 -0
- /package/dist/{chunk-GFZRBHLH.js.map → chunk-ELBZT6RU.js.map} +0 -0
- /package/dist/{chunk-3OEZA5TR.js.map → chunk-ERR7ZFPJ.js.map} +0 -0
- /package/dist/{chunk-WY7QVTBD.js.map → chunk-FBXU7X27.js.map} +0 -0
- /package/dist/{chunk-3SL52JKD.js.map → chunk-FZVROZKC.js.map} +0 -0
- /package/dist/{chunk-7P72BY4F.js.map → chunk-G53I363P.js.map} +0 -0
- /package/dist/{chunk-V2KGDESV.js.map → chunk-GS2TT2YE.js.map} +0 -0
- /package/dist/{chunk-Y6RTVJJK.js.map → chunk-GSCIRMPR.js.map} +0 -0
- /package/dist/{chunk-OM5ESBES.js.map → chunk-HQPFACXO.js.map} +0 -0
- /package/dist/{chunk-EGLJALMG.js.map → chunk-HRMOKGQM.js.map} +0 -0
- /package/dist/{chunk-VKS2WV2M.js.map → chunk-HURBXNNB.js.map} +0 -0
- /package/dist/{chunk-SC76A2ZT.js.map → chunk-IB4TDPCC.js.map} +0 -0
- /package/dist/{chunk-IMULTENA.js.map → chunk-ID65XTF3.js.map} +0 -0
- /package/dist/{chunk-KBO44266.js.map → chunk-J6U6KUMK.js.map} +0 -0
- /package/dist/{chunk-AM5ZNSUK.js.map → chunk-JTY3NA3I.js.map} +0 -0
- /package/dist/{chunk-TH6OYP6I.js.map → chunk-K36RMINQ.js.map} +0 -0
- /package/dist/{chunk-7LCGFUMB.js.map → chunk-KQAFEZQX.js.map} +0 -0
- /package/dist/{chunk-53VLXNAO.js.map → chunk-LKGTTX74.js.map} +0 -0
- /package/dist/{chunk-MFKWQJRQ.js.map → chunk-O62MMJWV.js.map} +0 -0
- /package/dist/{chunk-K3FH3LAQ.js.map → chunk-OJXK5C6Z.js.map} +0 -0
- /package/dist/{chunk-VYX7W6EB.js.map → chunk-PAGVXEWG.js.map} +0 -0
- /package/dist/{chunk-GMO3BGOF.js.map → chunk-QC2MHZDD.js.map} +0 -0
- /package/dist/{chunk-KNAF3A7Y.js.map → chunk-QF64W4YM.js.map} +0 -0
- /package/dist/{chunk-PH5ZQM35.js.map → chunk-R6BNDA67.js.map} +0 -0
- /package/dist/{chunk-EOJF66EQ.js.map → chunk-RRHLI6VU.js.map} +0 -0
- /package/dist/{chunk-NHVAX7MH.js.map → chunk-RSKZWXQO.js.map} +0 -0
- /package/dist/{chunk-3S7VJJTG.js.map → chunk-RTIHO7AJ.js.map} +0 -0
- /package/dist/{chunk-LP326T2D.js.map → chunk-SU42FIJ7.js.map} +0 -0
- /package/dist/{chunk-UDUJIKFQ.js.map → chunk-UGCLNASV.js.map} +0 -0
- /package/dist/{chunk-XNRLRNQF.js.map → chunk-UPYEFL7J.js.map} +0 -0
- /package/dist/{chunk-U2PSE7MB.js.map → chunk-VPEIWMUT.js.map} +0 -0
- /package/dist/{chunk-RB7NXZ2E.js.map → chunk-W4Q65VJL.js.map} +0 -0
- /package/dist/{chunk-ZBK3UBMB.js.map → chunk-WRGW76LI.js.map} +0 -0
- /package/dist/{chunk-XN3F3V5H.js.map → chunk-WYABF2WA.js.map} +0 -0
- /package/dist/{chunk-X33UXMUS.js.map → chunk-XLHLZALR.js.map} +0 -0
- /package/dist/{chunk-CHZMU6HA.js.map → chunk-XN43HAIV.js.map} +0 -0
- /package/dist/{chunk-Y7LKZQ4T.js.map → chunk-YJEOQ72B.js.map} +0 -0
- /package/dist/{chunk-Q5Q3IHPP.js.map → chunk-YKUW2EZF.js.map} +0 -0
- /package/dist/{chunk-65HWAQ4F.js.map → chunk-ZDCSFRIU.js.map} +0 -0
- /package/dist/{first-start-migration-U4K2P7KF.js.map → first-start-migration-FILJH3RO.js.map} +0 -0
package/dist/verified-recall.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compareVerifiedEpisodeResults,
|
|
3
3
|
searchVerifiedEpisodes
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5DP4GVKR.js";
|
|
5
5
|
import "./chunk-B7RWBZXW.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-IB4TDPCC.js";
|
|
7
7
|
import "./chunk-QGVCFVX6.js";
|
|
8
|
-
import "./chunk-O3JG4PD3.js";
|
|
9
8
|
import "./chunk-UHVXE24Y.js";
|
|
9
|
+
import "./chunk-O3JG4PD3.js";
|
|
10
10
|
import "./chunk-KNT3BZZH.js";
|
|
11
11
|
import "./chunk-G6OFEGUR.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-BFDXJHYG.js";
|
|
13
|
+
import "./chunk-J6U6KUMK.js";
|
|
14
|
+
import "./chunk-DOJBV6WR.js";
|
|
14
15
|
import "./chunk-PFUXPTBT.js";
|
|
15
16
|
import "./chunk-CYEPCZN5.js";
|
|
16
17
|
import "./chunk-DLZGSZVC.js";
|
|
17
18
|
import "./chunk-OVZIYLBZ.js";
|
|
18
|
-
import "./chunk-EXYT52NR.js";
|
|
19
|
-
import "./chunk-DOJBV6WR.js";
|
|
20
19
|
import "./chunk-WNEVEMJ3.js";
|
|
20
|
+
import "./chunk-EXYT52NR.js";
|
|
21
21
|
import "./chunk-Y5NLBXPV.js";
|
|
22
22
|
import "./chunk-TFA6HPOA.js";
|
|
23
23
|
import "./chunk-F4TWWUMP.js";
|
|
@@ -26,8 +26,8 @@ import "./chunk-A7Q43EUZ.js";
|
|
|
26
26
|
import "./chunk-S2V7RUCL.js";
|
|
27
27
|
import "./chunk-PPUNC7UX.js";
|
|
28
28
|
import "./chunk-X3724WL4.js";
|
|
29
|
-
import "./chunk-MRPOZBJC.js";
|
|
30
29
|
import "./chunk-L76BQSWB.js";
|
|
30
|
+
import "./chunk-MRPOZBJC.js";
|
|
31
31
|
import "./chunk-DM2T26WE.js";
|
|
32
32
|
import "./chunk-LDXUBPMO.js";
|
|
33
33
|
import "./chunk-FF6N7BXC.js";
|
|
@@ -38,14 +38,14 @@ import "./chunk-YXZG5TVN.js";
|
|
|
38
38
|
import "./chunk-3OUGSOJP.js";
|
|
39
39
|
import "./chunk-SCU65EZI.js";
|
|
40
40
|
import "./chunk-3ONXXHQO.js";
|
|
41
|
-
import "./chunk-3WU7XOFN.js";
|
|
42
|
-
import "./chunk-P4GUQSK3.js";
|
|
43
41
|
import "./chunk-4LZ7SVKM.js";
|
|
44
42
|
import "./chunk-YHTG64XV.js";
|
|
43
|
+
import "./chunk-3WU7XOFN.js";
|
|
45
44
|
import "./chunk-KUQLUYIR.js";
|
|
46
45
|
import "./chunk-O3GZPLVY.js";
|
|
47
46
|
import "./chunk-5WITETWU.js";
|
|
48
47
|
import "./chunk-6CIAGZ6X.js";
|
|
48
|
+
import "./chunk-P4GUQSK3.js";
|
|
49
49
|
import "./chunk-G7D6GZ5J.js";
|
|
50
50
|
import "./chunk-7VLBZKNB.js";
|
|
51
51
|
import "./chunk-Y33KJ556.js";
|
|
@@ -56,13 +56,13 @@ import "./chunk-AF2XMJKD.js";
|
|
|
56
56
|
import "./chunk-OR42ZI54.js";
|
|
57
57
|
import "./chunk-IUM3VSHI.js";
|
|
58
58
|
import "./chunk-23G5P7TA.js";
|
|
59
|
+
import "./chunk-UXXK523X.js";
|
|
59
60
|
import "./chunk-MMRTPH3J.js";
|
|
60
61
|
import "./chunk-I55KAVET.js";
|
|
61
62
|
import "./chunk-L2EXJQJP.js";
|
|
62
63
|
import "./chunk-45GF7Y3V.js";
|
|
63
64
|
import "./chunk-QSF5SJAM.js";
|
|
64
65
|
import "./chunk-E2AWJ7KQ.js";
|
|
65
|
-
import "./chunk-UXXK523X.js";
|
|
66
66
|
import "./chunk-YCVB7X56.js";
|
|
67
67
|
import "./chunk-PQVCH2AE.js";
|
|
68
68
|
import "./chunk-PJKTFXE2.js";
|
|
@@ -76,7 +76,7 @@ import "./chunk-7RJUVTVF.js";
|
|
|
76
76
|
import "./chunk-AL3UYZ5N.js";
|
|
77
77
|
import "./chunk-RL6NEVXT.js";
|
|
78
78
|
import "./chunk-YET735EZ.js";
|
|
79
|
-
import "./chunk-
|
|
79
|
+
import "./chunk-3IZQFNIV.js";
|
|
80
80
|
import "./chunk-YBA52OKG.js";
|
|
81
81
|
import "./chunk-NS7U4ZYU.js";
|
|
82
82
|
import "./chunk-AHA5VQGP.js";
|
package/dist/who-knows-cli.js
CHANGED
|
@@ -4,23 +4,23 @@ import {
|
|
|
4
4
|
renderWhoKnows,
|
|
5
5
|
renderWhoKnowsJson,
|
|
6
6
|
renderWhoKnowsText
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-2AVPRUML.js";
|
|
8
|
+
import "./chunk-JTY3NA3I.js";
|
|
9
|
+
import "./chunk-IB4TDPCC.js";
|
|
10
10
|
import "./chunk-QGVCFVX6.js";
|
|
11
|
-
import "./chunk-O3JG4PD3.js";
|
|
12
11
|
import "./chunk-UHVXE24Y.js";
|
|
12
|
+
import "./chunk-O3JG4PD3.js";
|
|
13
13
|
import "./chunk-KNT3BZZH.js";
|
|
14
14
|
import "./chunk-G6OFEGUR.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-BFDXJHYG.js";
|
|
16
|
+
import "./chunk-J6U6KUMK.js";
|
|
17
|
+
import "./chunk-DOJBV6WR.js";
|
|
17
18
|
import "./chunk-PFUXPTBT.js";
|
|
18
19
|
import "./chunk-CYEPCZN5.js";
|
|
19
20
|
import "./chunk-DLZGSZVC.js";
|
|
20
21
|
import "./chunk-OVZIYLBZ.js";
|
|
21
|
-
import "./chunk-EXYT52NR.js";
|
|
22
|
-
import "./chunk-DOJBV6WR.js";
|
|
23
22
|
import "./chunk-WNEVEMJ3.js";
|
|
23
|
+
import "./chunk-EXYT52NR.js";
|
|
24
24
|
import "./chunk-Y5NLBXPV.js";
|
|
25
25
|
import "./chunk-TFA6HPOA.js";
|
|
26
26
|
import "./chunk-F4TWWUMP.js";
|
|
@@ -29,8 +29,8 @@ import "./chunk-A7Q43EUZ.js";
|
|
|
29
29
|
import "./chunk-S2V7RUCL.js";
|
|
30
30
|
import "./chunk-PPUNC7UX.js";
|
|
31
31
|
import "./chunk-X3724WL4.js";
|
|
32
|
-
import "./chunk-MRPOZBJC.js";
|
|
33
32
|
import "./chunk-L76BQSWB.js";
|
|
33
|
+
import "./chunk-MRPOZBJC.js";
|
|
34
34
|
import "./chunk-DM2T26WE.js";
|
|
35
35
|
import "./chunk-LDXUBPMO.js";
|
|
36
36
|
import "./chunk-FF6N7BXC.js";
|
|
@@ -41,14 +41,14 @@ import "./chunk-YXZG5TVN.js";
|
|
|
41
41
|
import "./chunk-3OUGSOJP.js";
|
|
42
42
|
import "./chunk-SCU65EZI.js";
|
|
43
43
|
import "./chunk-3ONXXHQO.js";
|
|
44
|
-
import "./chunk-3WU7XOFN.js";
|
|
45
|
-
import "./chunk-P4GUQSK3.js";
|
|
46
44
|
import "./chunk-4LZ7SVKM.js";
|
|
47
45
|
import "./chunk-YHTG64XV.js";
|
|
46
|
+
import "./chunk-3WU7XOFN.js";
|
|
48
47
|
import "./chunk-KUQLUYIR.js";
|
|
49
48
|
import "./chunk-O3GZPLVY.js";
|
|
50
49
|
import "./chunk-5WITETWU.js";
|
|
51
50
|
import "./chunk-6CIAGZ6X.js";
|
|
51
|
+
import "./chunk-P4GUQSK3.js";
|
|
52
52
|
import "./chunk-G7D6GZ5J.js";
|
|
53
53
|
import "./chunk-7VLBZKNB.js";
|
|
54
54
|
import "./chunk-Y33KJ556.js";
|
|
@@ -59,13 +59,13 @@ import "./chunk-AF2XMJKD.js";
|
|
|
59
59
|
import "./chunk-OR42ZI54.js";
|
|
60
60
|
import "./chunk-IUM3VSHI.js";
|
|
61
61
|
import "./chunk-23G5P7TA.js";
|
|
62
|
+
import "./chunk-UXXK523X.js";
|
|
62
63
|
import "./chunk-MMRTPH3J.js";
|
|
63
64
|
import "./chunk-I55KAVET.js";
|
|
64
65
|
import "./chunk-L2EXJQJP.js";
|
|
65
66
|
import "./chunk-45GF7Y3V.js";
|
|
66
67
|
import "./chunk-QSF5SJAM.js";
|
|
67
68
|
import "./chunk-E2AWJ7KQ.js";
|
|
68
|
-
import "./chunk-UXXK523X.js";
|
|
69
69
|
import "./chunk-YCVB7X56.js";
|
|
70
70
|
import "./chunk-PQVCH2AE.js";
|
|
71
71
|
import "./chunk-PJKTFXE2.js";
|
|
@@ -79,7 +79,7 @@ import "./chunk-7RJUVTVF.js";
|
|
|
79
79
|
import "./chunk-AL3UYZ5N.js";
|
|
80
80
|
import "./chunk-RL6NEVXT.js";
|
|
81
81
|
import "./chunk-YET735EZ.js";
|
|
82
|
-
import "./chunk-
|
|
82
|
+
import "./chunk-3IZQFNIV.js";
|
|
83
83
|
import "./chunk-YBA52OKG.js";
|
|
84
84
|
import "./chunk-NS7U4ZYU.js";
|
|
85
85
|
import "./chunk-AHA5VQGP.js";
|
package/dist/who-knows.js
CHANGED
|
@@ -9,22 +9,22 @@ import {
|
|
|
9
9
|
loadWhoKnowsEntities,
|
|
10
10
|
tokenizeTopic,
|
|
11
11
|
validateWhoKnowsInput
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-JTY3NA3I.js";
|
|
13
|
+
import "./chunk-IB4TDPCC.js";
|
|
14
14
|
import "./chunk-QGVCFVX6.js";
|
|
15
|
-
import "./chunk-O3JG4PD3.js";
|
|
16
15
|
import "./chunk-UHVXE24Y.js";
|
|
16
|
+
import "./chunk-O3JG4PD3.js";
|
|
17
17
|
import "./chunk-KNT3BZZH.js";
|
|
18
18
|
import "./chunk-G6OFEGUR.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-BFDXJHYG.js";
|
|
20
|
+
import "./chunk-J6U6KUMK.js";
|
|
21
|
+
import "./chunk-DOJBV6WR.js";
|
|
21
22
|
import "./chunk-PFUXPTBT.js";
|
|
22
23
|
import "./chunk-CYEPCZN5.js";
|
|
23
24
|
import "./chunk-DLZGSZVC.js";
|
|
24
25
|
import "./chunk-OVZIYLBZ.js";
|
|
25
|
-
import "./chunk-EXYT52NR.js";
|
|
26
|
-
import "./chunk-DOJBV6WR.js";
|
|
27
26
|
import "./chunk-WNEVEMJ3.js";
|
|
27
|
+
import "./chunk-EXYT52NR.js";
|
|
28
28
|
import "./chunk-Y5NLBXPV.js";
|
|
29
29
|
import "./chunk-TFA6HPOA.js";
|
|
30
30
|
import "./chunk-F4TWWUMP.js";
|
|
@@ -33,8 +33,8 @@ import "./chunk-A7Q43EUZ.js";
|
|
|
33
33
|
import "./chunk-S2V7RUCL.js";
|
|
34
34
|
import "./chunk-PPUNC7UX.js";
|
|
35
35
|
import "./chunk-X3724WL4.js";
|
|
36
|
-
import "./chunk-MRPOZBJC.js";
|
|
37
36
|
import "./chunk-L76BQSWB.js";
|
|
37
|
+
import "./chunk-MRPOZBJC.js";
|
|
38
38
|
import "./chunk-DM2T26WE.js";
|
|
39
39
|
import "./chunk-LDXUBPMO.js";
|
|
40
40
|
import "./chunk-FF6N7BXC.js";
|
|
@@ -45,14 +45,14 @@ import "./chunk-YXZG5TVN.js";
|
|
|
45
45
|
import "./chunk-3OUGSOJP.js";
|
|
46
46
|
import "./chunk-SCU65EZI.js";
|
|
47
47
|
import "./chunk-3ONXXHQO.js";
|
|
48
|
-
import "./chunk-3WU7XOFN.js";
|
|
49
|
-
import "./chunk-P4GUQSK3.js";
|
|
50
48
|
import "./chunk-4LZ7SVKM.js";
|
|
51
49
|
import "./chunk-YHTG64XV.js";
|
|
50
|
+
import "./chunk-3WU7XOFN.js";
|
|
52
51
|
import "./chunk-KUQLUYIR.js";
|
|
53
52
|
import "./chunk-O3GZPLVY.js";
|
|
54
53
|
import "./chunk-5WITETWU.js";
|
|
55
54
|
import "./chunk-6CIAGZ6X.js";
|
|
55
|
+
import "./chunk-P4GUQSK3.js";
|
|
56
56
|
import "./chunk-G7D6GZ5J.js";
|
|
57
57
|
import "./chunk-7VLBZKNB.js";
|
|
58
58
|
import "./chunk-Y33KJ556.js";
|
|
@@ -63,13 +63,13 @@ import "./chunk-AF2XMJKD.js";
|
|
|
63
63
|
import "./chunk-OR42ZI54.js";
|
|
64
64
|
import "./chunk-IUM3VSHI.js";
|
|
65
65
|
import "./chunk-23G5P7TA.js";
|
|
66
|
+
import "./chunk-UXXK523X.js";
|
|
66
67
|
import "./chunk-MMRTPH3J.js";
|
|
67
68
|
import "./chunk-I55KAVET.js";
|
|
68
69
|
import "./chunk-L2EXJQJP.js";
|
|
69
70
|
import "./chunk-45GF7Y3V.js";
|
|
70
71
|
import "./chunk-QSF5SJAM.js";
|
|
71
72
|
import "./chunk-E2AWJ7KQ.js";
|
|
72
|
-
import "./chunk-UXXK523X.js";
|
|
73
73
|
import "./chunk-YCVB7X56.js";
|
|
74
74
|
import "./chunk-PQVCH2AE.js";
|
|
75
75
|
import "./chunk-PJKTFXE2.js";
|
|
@@ -83,7 +83,7 @@ import "./chunk-7RJUVTVF.js";
|
|
|
83
83
|
import "./chunk-AL3UYZ5N.js";
|
|
84
84
|
import "./chunk-RL6NEVXT.js";
|
|
85
85
|
import "./chunk-YET735EZ.js";
|
|
86
|
-
import "./chunk-
|
|
86
|
+
import "./chunk-3IZQFNIV.js";
|
|
87
87
|
import "./chunk-YBA52OKG.js";
|
|
88
88
|
import "./chunk-NS7U4ZYU.js";
|
|
89
89
|
import "./chunk-AHA5VQGP.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/core",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.125",
|
|
4
4
|
"description": "Framework-agnostic Remnic memory engine — orchestrator, storage, extraction, search, trust zones",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -3396,7 +3396,7 @@
|
|
|
3396
3396
|
"core"
|
|
3397
3397
|
],
|
|
3398
3398
|
"peerDependencies": {
|
|
3399
|
-
"@remnic/coding-graph": "^10.0.
|
|
3399
|
+
"@remnic/coding-graph": "^10.0.125"
|
|
3400
3400
|
},
|
|
3401
3401
|
"peerDependenciesMeta": {
|
|
3402
3402
|
"@remnic/coding-graph": {
|
|
@@ -23,7 +23,7 @@ export function respondBufferAdmissionError(
|
|
|
23
23
|
respond(400, { error: err.message, code: "storage_target_required" });
|
|
24
24
|
return true;
|
|
25
25
|
}
|
|
26
|
-
if (err.name === "ReplayAdmissionRefusedError") {
|
|
26
|
+
if (err.name === "ReplayAdmissionRefusedError" || err.name === "BufferSessionTurnRefusedError") {
|
|
27
27
|
log.warn(`engram access HTTP buffer admission refused [${correlationId}]: ${err.message}`);
|
|
28
28
|
res.setHeader("retry-after", String(BUFFER_ADMISSION_RETRY_AFTER_SECONDS));
|
|
29
29
|
respond(503, { error: err.message, code: "buffer_admission_refused" });
|
package/src/access-mcp.ts
CHANGED
|
@@ -2435,7 +2435,7 @@ export class EngramMcpServer {
|
|
|
2435
2435
|
const message = mcpToolErrorMessage(err instanceof Error ? err : new Error(String(err)));
|
|
2436
2436
|
const admissionBackpressure =
|
|
2437
2437
|
err instanceof Error &&
|
|
2438
|
-
(err.name === "ReplayAdmissionRefusedError" || err.name === "BufferAdmissionRefusedError");
|
|
2438
|
+
(err.name === "ReplayAdmissionRefusedError" || err.name === "BufferAdmissionRefusedError" || err.name === "BufferSessionTurnRefusedError");
|
|
2439
2439
|
const result: McpToolErrorResult = {
|
|
2440
2440
|
content: [{ type: "text", text: message }],
|
|
2441
2441
|
isError: true,
|
package/src/buffer-admission.ts
CHANGED
|
@@ -18,6 +18,22 @@ export class BufferAdmissionRefusedError extends Error {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Raised when live capture targets an EXISTING session whose retained turns
|
|
23
|
+
* already reach the per-session cap. The turn was never accepted and no
|
|
24
|
+
* buffered turn is dropped; the request is retryable once extraction drains
|
|
25
|
+
* the session. Companion to the session-entry cap above (#3415 bound).
|
|
26
|
+
*/
|
|
27
|
+
export class BufferSessionTurnRefusedError extends Error {
|
|
28
|
+
constructor(bufferKey: string, maxTurnsPerSession: number) {
|
|
29
|
+
super(
|
|
30
|
+
`buffer[${bufferKey}]: live capture refused at the per-session turn cap (${maxTurnsPerSession}); ` +
|
|
31
|
+
"retained backlog is not evicted to admit new turns. Retry after extraction drains the session",
|
|
32
|
+
);
|
|
33
|
+
this.name = "BufferSessionTurnRefusedError";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
21
37
|
/** Durable observe capture refused at the entry cap; the request is retryable. */
|
|
22
38
|
export class ReplayAdmissionRefusedError extends Error {
|
|
23
39
|
constructor(message: string) {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** Per-session retained-turn cap (#3415 bound). Split from buffer.ts (1200-line ratchet). */
|
|
2
|
+
import { log } from "./logger.js";
|
|
3
|
+
import type { BufferEntryState, BufferTurn } from "./types.js";
|
|
4
|
+
|
|
5
|
+
// Far above the extraction trigger (bufferMaxTurns, default 5), so healthy
|
|
6
|
+
// sessions never touch it. Covers direct constructions predating the knob.
|
|
7
|
+
export const FALLBACK_MAX_TURNS_PER_SESSION = 200;
|
|
8
|
+
|
|
9
|
+
export function resolveMaxTurnsPerSession(configured: number | undefined): number {
|
|
10
|
+
return configured ?? FALLBACK_MAX_TURNS_PER_SESSION;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Live turns plus deferred retention copies: one session, one count. */
|
|
14
|
+
export function heldTurnCount(entry: BufferEntryState | null): number {
|
|
15
|
+
return entry === null ? 0 : (entry.retainedTurns?.length ?? 0) + entry.turns.length;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** True when held plus incoming exceeds the cap. New keys hold 0. */
|
|
19
|
+
export function sessionTurnCapReached(entry: BufferEntryState | null, incoming: number, maxTurns: number): boolean {
|
|
20
|
+
return heldTurnCount(entry) + incoming > maxTurns;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function warnTurnCapRefused(bufferKey: string, maxTurns: number): void {
|
|
24
|
+
log.warn(`buffer[${bufferKey}]: durable capture refused at the per-session turn cap (${maxTurns})`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Single-turn paths: true means refuse (live path throws, bounded paths return null). */
|
|
28
|
+
export function refuseOverCapSingle(entry: BufferEntryState | null, maxTurns: number, bufferKey: string): boolean {
|
|
29
|
+
if (!sessionTurnCapReached(entry, 1, maxTurns)) return false;
|
|
30
|
+
warnTurnCapRefused(bufferKey, maxTurns);
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Batch path: sums incoming turns per key across all batches, new keys included. */
|
|
35
|
+
export function refuseOverCapBatch(
|
|
36
|
+
peekEntry: (key: string) => BufferEntryState | null,
|
|
37
|
+
batches: readonly { bufferKey: string; turns: readonly BufferTurn[] }[],
|
|
38
|
+
maxTurns: number,
|
|
39
|
+
): boolean {
|
|
40
|
+
const incomingByKey = new Map<string, number>();
|
|
41
|
+
for (const batch of batches) incomingByKey.set(batch.bufferKey, (incomingByKey.get(batch.bufferKey) ?? 0) + batch.turns.length);
|
|
42
|
+
for (const [bufferKey, incoming] of incomingByKey) {
|
|
43
|
+
if (heldTurnCount(peekEntry(bufferKey)) + incoming > maxTurns) {
|
|
44
|
+
warnTurnCapRefused(bufferKey, maxTurns);
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import test from "node:test";
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
|
-
import { SmartBuffer, BufferAdmissionRefusedError } from "./buffer.js";
|
|
3
|
+
import { SmartBuffer, BufferAdmissionRefusedError, BufferSessionTurnRefusedError } from "./buffer.js";
|
|
4
4
|
import { parseConfig } from "./config.js";
|
|
5
5
|
import type { BufferSurpriseProbe } from "./buffer.js";
|
|
6
6
|
import type { BufferState, BufferTurn } from "./types.js";
|
|
@@ -726,6 +726,80 @@ test("pruneEntries never evicts non-empty backlog; live admission is refused pas
|
|
|
726
726
|
assert.ok(!savedKeys.includes("session-newest"), "the refused turn was never buffered");
|
|
727
727
|
});
|
|
728
728
|
|
|
729
|
+
test("per-session turn cap refuses live admission past the cap without dropping retained turns (#3415 bound)", async () => {
|
|
730
|
+
// A sustained outage with retention on keeps every failed turn. The
|
|
731
|
+
// session-entry cap does not bound turns inside one entry, so a second
|
|
732
|
+
// cap refuses new turns for a full session (retryable backpressure) while
|
|
733
|
+
// a healthy session keeps admitting.
|
|
734
|
+
const at = "2026-04-12T12:00:00.000Z";
|
|
735
|
+
const fullTurns = [0, 1, 2, 3].map((i) => ({ role: "user" as const, content: `retained turn ${i}`, timestamp: at, sessionKey: "session-full" }));
|
|
736
|
+
const storage = new FakeStorage({
|
|
737
|
+
turns: [],
|
|
738
|
+
lastExtractionAt: null,
|
|
739
|
+
extractionCount: 0,
|
|
740
|
+
entries: {
|
|
741
|
+
"session-full": { turns: fullTurns, lastExtractionAt: at, extractionCount: 0 },
|
|
742
|
+
"session-mixed": { turns: [makeTurn("session-mixed", "live one"), makeTurn("session-mixed", "live two")], retainedTurns: [makeTurn("session-mixed", "kept one"), makeTurn("session-mixed", "kept two")], lastExtractionAt: at, extractionCount: 0 },
|
|
743
|
+
"session-healthy": { turns: [makeTurn("session-healthy", "one turn")], lastExtractionAt: at, extractionCount: 0 },
|
|
744
|
+
},
|
|
745
|
+
});
|
|
746
|
+
// SAFETY: FakeStorage implements the load/save surface this test exercises;
|
|
747
|
+
// the cast only satisfies the constructor's StorageManager parameter.
|
|
748
|
+
const buffer = new SmartBuffer(parseConfig({ bufferSaveDebounceMs: 0, bufferMaxTurnsPerSession: 4 }), storage as any);
|
|
749
|
+
await buffer.load();
|
|
750
|
+
await assert.rejects(
|
|
751
|
+
buffer.addTurnWithOutcome("session-full", makeTurn("session-full", "one turn too many")),
|
|
752
|
+
BufferSessionTurnRefusedError,
|
|
753
|
+
"a full session refuses rather than growing without bound",
|
|
754
|
+
);
|
|
755
|
+
assert.equal(buffer.getTurns("session-full").length, 4, "retained turns are kept, not dropped");
|
|
756
|
+
// retainedTurns count toward the cap: 2 live + 2 kept already reach it.
|
|
757
|
+
await assert.rejects(
|
|
758
|
+
buffer.addTurnWithOutcome("session-mixed", makeTurn("session-mixed", "one too many")),
|
|
759
|
+
BufferSessionTurnRefusedError,
|
|
760
|
+
"deferred retention copies count toward the cap",
|
|
761
|
+
);
|
|
762
|
+
assert.equal(buffer.getTurns("session-mixed").length, 4, "nothing recorded on refusal");
|
|
763
|
+
await buffer.addTurnWithOutcome("session-healthy", makeTurn("session-healthy", "second turn"));
|
|
764
|
+
assert.equal(buffer.getTurns("session-healthy").length, 2, "a session under the cap keeps admitting");
|
|
765
|
+
const batch = await buffer.addTurnsBounded([{ bufferKey: "session-full", turns: [makeTurn("session-full", "batched")] }]);
|
|
766
|
+
assert.equal(batch, null, "bounded batch admission refuses atomically, recording nothing");
|
|
767
|
+
assert.equal(buffer.getTurns("session-full").length, 4);
|
|
768
|
+
// A new key is capped too: 0 held + 5 incoming exceeds the cap of 4.
|
|
769
|
+
const over = await buffer.addTurnsBounded([{ bufferKey: "session-brand-new", turns: [0, 1, 2, 3, 4].map((i) => makeTurn("session-brand-new", `turn ${i}`)) }]);
|
|
770
|
+
assert.equal(over, null, "a new key cannot land more than the cap in one batch");
|
|
771
|
+
assert.deepEqual(buffer.getTurns("session-brand-new"), [], "refused batch records nothing");
|
|
772
|
+
// Repeated batches for one key sum within a call: session-healthy holds 2,
|
|
773
|
+
// and 1 + 2 more would reach 5.
|
|
774
|
+
const rep = await buffer.addTurnsBounded([
|
|
775
|
+
{ bufferKey: "session-healthy", turns: [makeTurn("session-healthy", "r1")] },
|
|
776
|
+
{ bufferKey: "session-healthy", turns: [makeTurn("session-healthy", "r2"), makeTurn("session-healthy", "r3")] },
|
|
777
|
+
]);
|
|
778
|
+
assert.equal(rep, null, "repeated batches compare against the running total, not the original count");
|
|
779
|
+
assert.equal(buffer.getTurns("session-healthy").length, 2, "refused batches record nothing");
|
|
780
|
+
// New keys admit a single turn under a normal cap.
|
|
781
|
+
const fresh = await buffer.addTurnBounded("session-fresh", makeTurn("session-fresh", "first turn"));
|
|
782
|
+
assert.notEqual(fresh, null, "a new key under the cap is admitted");
|
|
783
|
+
assert.equal(buffer.getTurns("session-fresh").length, 1);
|
|
784
|
+
});
|
|
785
|
+
|
|
786
|
+
test("addTurnBounded checks the single turn against the per-session cap for new keys too (#3415)", async () => {
|
|
787
|
+
// A hand-built config can carry cap 0 (parseConfig itself rejects it, but
|
|
788
|
+
// direct constructions must still fail closed rather than admit one turn).
|
|
789
|
+
const storage = new FakeStorage({ turns: [], lastExtractionAt: null, extractionCount: 0 });
|
|
790
|
+
const tightConfig = { ...parseConfig({ bufferSaveDebounceMs: 0 }), bufferMaxTurnsPerSession: 0 };
|
|
791
|
+
// SAFETY: FakeStorage implements the load/save surface this test exercises;
|
|
792
|
+
// the cast only satisfies the constructor's StorageManager parameter.
|
|
793
|
+
const tight = new SmartBuffer(tightConfig, storage as any);
|
|
794
|
+
await tight.load();
|
|
795
|
+
assert.equal(await tight.addTurnBounded("brand-new", makeTurn("brand-new", "no room")), null);
|
|
796
|
+
await assert.rejects(
|
|
797
|
+
tight.addTurnWithOutcome("brand-new", makeTurn("brand-new", "no room")),
|
|
798
|
+
BufferSessionTurnRefusedError,
|
|
799
|
+
);
|
|
800
|
+
assert.deepEqual(tight.getTurns("brand-new"), [], "refused turns record nothing");
|
|
801
|
+
});
|
|
802
|
+
|
|
729
803
|
// ---------------------------------------------------------------------------
|
|
730
804
|
// Issue #1909 (Part D) — debounced buffer save
|
|
731
805
|
// ---------------------------------------------------------------------------
|
package/src/buffer.ts
CHANGED
|
@@ -33,8 +33,9 @@ import {
|
|
|
33
33
|
selectRetainedDeferredTurns,
|
|
34
34
|
type BufferEntryCounts,
|
|
35
35
|
} from "./buffer-turn-helpers.js";
|
|
36
|
-
import { BufferAdmissionRefusedError, canAdmitNewEntryUnlocked } from "./buffer-admission.js";
|
|
37
|
-
|
|
36
|
+
import { BufferAdmissionRefusedError, BufferSessionTurnRefusedError, canAdmitNewEntryUnlocked } from "./buffer-admission.js";
|
|
37
|
+
import { refuseOverCapBatch, refuseOverCapSingle, resolveMaxTurnsPerSession, sessionTurnCapReached } from "./buffer-session-cap.js";
|
|
38
|
+
export { BufferAdmissionRefusedError, BufferSessionTurnRefusedError } from "./buffer-admission.js";
|
|
38
39
|
import type { AddTurnMutationResult, AddTurnOutcome, RetainedTurnCleanupOptions, TriggerDecision } from "./buffer-types.js";
|
|
39
40
|
|
|
40
41
|
export type { TriggerDecision, AddTurnOutcome, RetainedTurnCleanupOptions } from "./buffer-types.js";
|
|
@@ -439,6 +440,7 @@ export class SmartBuffer {
|
|
|
439
440
|
async addTurnBounded(bufferKey: string, turn: BufferTurn): Promise<AddTurnOutcome | null> {
|
|
440
441
|
const mutation = await this.enqueueMutation(async () => {
|
|
441
442
|
await this.loadUnlocked();
|
|
443
|
+
if (refuseOverCapSingle(this.peekEntry(bufferKey), resolveMaxTurnsPerSession(this.config.bufferMaxTurnsPerSession), bufferKey)) return null;
|
|
442
444
|
if (this.peekEntry(bufferKey) === null) {
|
|
443
445
|
this.makeRoomForEntryUnlocked();
|
|
444
446
|
if (Object.keys(this.state.entries ?? {}).length >= this.maxSessionEntries) {
|
|
@@ -470,6 +472,7 @@ export class SmartBuffer {
|
|
|
470
472
|
}
|
|
471
473
|
}
|
|
472
474
|
|
|
475
|
+
if (refuseOverCapBatch((key) => this.peekEntry(key), batches, resolveMaxTurnsPerSession(this.config.bufferMaxTurnsPerSession))) return null;
|
|
473
476
|
const entries = this.state.entries ?? {};
|
|
474
477
|
const newKeys = [...new Set(
|
|
475
478
|
additions
|
|
@@ -525,6 +528,8 @@ export class SmartBuffer {
|
|
|
525
528
|
) {
|
|
526
529
|
throw new BufferAdmissionRefusedError(bufferKey, this.maxSessionEntries);
|
|
527
530
|
}
|
|
531
|
+
const maxTurns = resolveMaxTurnsPerSession(this.config.bufferMaxTurnsPerSession);
|
|
532
|
+
if (sessionTurnCapReached(this.peekEntry(bufferKey), 1, maxTurns)) throw new BufferSessionTurnRefusedError(bufferKey, maxTurns);
|
|
528
533
|
return this.recordTurnUnlocked(bufferKey, turn);
|
|
529
534
|
});
|
|
530
535
|
return this.completeAddTurnOutcome(bufferKey, turn, mutation);
|
package/src/config.ts
CHANGED
|
@@ -1593,6 +1593,10 @@ export function parseConfig(
|
|
|
1593
1593
|
bufferMaxTurns:
|
|
1594
1594
|
typeof cfg.bufferMaxTurns === "number" ? cfg.bufferMaxTurns : 5,
|
|
1595
1595
|
bufferMaxSessions: parsePositiveInteger(cfg.bufferMaxSessions, "bufferMaxSessions") ?? 1000,
|
|
1596
|
+
// Per-session retained-turn cap (#3415 bound). Far above the extraction
|
|
1597
|
+
// trigger, so healthy sessions never touch it; a full session refuses live
|
|
1598
|
+
// capture (retryable) instead of growing without bound during an outage.
|
|
1599
|
+
bufferMaxTurnsPerSession: parsePositiveInteger(cfg.bufferMaxTurnsPerSession, "bufferMaxTurnsPerSession") ?? 200,
|
|
1596
1600
|
extractionQueueConcurrency:
|
|
1597
1601
|
parsePositiveInteger(cfg.extractionQueueConcurrency, "extractionQueueConcurrency") ?? 1,
|
|
1598
1602
|
bufferMaxMinutes:
|
|
@@ -1029,15 +1029,19 @@ export class ExtractionRunCoordinator {
|
|
|
1029
1029
|
bufferKey,
|
|
1030
1030
|
isLiveSession: clearBufferAfterExtraction,
|
|
1031
1031
|
});
|
|
1032
|
-
|
|
1033
|
-
|
|
1032
|
+
// Issue #3415: retention follows the actual extraction failure, not the
|
|
1033
|
+
// retry bookkeeping. With retry disabled no backoff state is recorded,
|
|
1034
|
+
// but the failed turns are still kept for the next attempt — clearing
|
|
1035
|
+
// them is silent loss. A successful empty result still clears below.
|
|
1036
|
+
if (extractionFailure) {
|
|
1037
|
+
log.debug("runExtraction: retaining buffer after failed extraction", { extractionFailure });
|
|
1034
1038
|
} else {
|
|
1035
1039
|
await clearBuffer();
|
|
1036
1040
|
}
|
|
1037
1041
|
if (!shouldPersistProcessedFingerprint) {
|
|
1038
1042
|
await commitEmptySuccessExtraction(emptySuccessCommit);
|
|
1039
1043
|
}
|
|
1040
|
-
return emptyExtractionResult(
|
|
1044
|
+
return emptyExtractionResult(Boolean(extractionFailure), result.extractionFailureClass);
|
|
1041
1045
|
}
|
|
1042
1046
|
|
|
1043
1047
|
let threadIdForExtraction: string | null = null;
|
|
@@ -1534,6 +1534,8 @@ test("runExtraction writes buffered turns to active scope profile write layer",
|
|
|
1534
1534
|
...makeTurn("pi-observer:abc123", "remember the team profile target"),
|
|
1535
1535
|
persistProcessedFingerprint: true,
|
|
1536
1536
|
};
|
|
1537
|
+
// SAFETY: runExtraction is driven only through the stub members assigned below;
|
|
1538
|
+
// the prototype harness leaves the rest of Orchestrator unreachable in this test.
|
|
1537
1539
|
const orchestrator = Object.create(Orchestrator.prototype) as any;
|
|
1538
1540
|
orchestrator.config = config;
|
|
1539
1541
|
orchestrator.buffer = { clearAfterExtraction: async () => undefined };
|
|
@@ -1853,13 +1855,16 @@ test("runExtraction does not persist processed fingerprints for failed empty ext
|
|
|
1853
1855
|
assert.deepEqual(meta.processedExtractionFingerprints, []);
|
|
1854
1856
|
});
|
|
1855
1857
|
|
|
1856
|
-
test("runExtraction
|
|
1857
|
-
//
|
|
1858
|
-
//
|
|
1858
|
+
test("runExtraction retains the buffer on a failed extraction when extractionRetryEnabled=false (issue #3415)", async () => {
|
|
1859
|
+
// Retention follows the actual extraction failure, not the retry bookkeeping:
|
|
1860
|
+
// with retry disabled no retry state is recorded, but the turns must still
|
|
1861
|
+
// be kept for the next attempt. Dropped turns are silent loss.
|
|
1859
1862
|
const config = parseConfig({ extractionRetryEnabled: false });
|
|
1860
1863
|
config.extractionMinChars = 0;
|
|
1861
1864
|
config.extractionMinUserTurns = 1;
|
|
1862
1865
|
let clearCalls = 0;
|
|
1866
|
+
// SAFETY: runExtraction is driven only through the stub members assigned below;
|
|
1867
|
+
// the prototype harness leaves the rest of Orchestrator unreachable in this test.
|
|
1863
1868
|
const orchestrator = Object.create(Orchestrator.prototype) as any;
|
|
1864
1869
|
orchestrator.config = config;
|
|
1865
1870
|
orchestrator.buffer = { clearAfterExtraction: async () => { clearCalls += 1; } };
|
|
@@ -1878,7 +1883,68 @@ test("runExtraction clears the buffer on a failed extraction when extractionRetr
|
|
|
1878
1883
|
const result = await orchestrator.runExtraction(turns, { bufferKey: "logical-thread:retry-off" });
|
|
1879
1884
|
assert.equal(result.status, "skipped");
|
|
1880
1885
|
assert.equal(result.reason, "empty_extraction_result");
|
|
1881
|
-
assert.equal(clearCalls,
|
|
1886
|
+
assert.equal(clearCalls, 0, "failed extraction retains the buffer even with retry disabled");
|
|
1887
|
+
assert.equal(result.retainedBuffer, true);
|
|
1888
|
+
assert.equal(result.failureClass, "provider_retryable");
|
|
1889
|
+
});
|
|
1890
|
+
|
|
1891
|
+
test("runExtraction retains the buffer on a parse_empty failure when extractionRetryEnabled=false (issue #3415)", async () => {
|
|
1892
|
+
const config = parseConfig({ extractionRetryEnabled: false });
|
|
1893
|
+
config.extractionMinChars = 0;
|
|
1894
|
+
config.extractionMinUserTurns = 1;
|
|
1895
|
+
let clearCalls = 0;
|
|
1896
|
+
// SAFETY: runExtraction is driven only through the stub members assigned below;
|
|
1897
|
+
// the prototype harness leaves the rest of Orchestrator unreachable in this test.
|
|
1898
|
+
const orchestrator = Object.create(Orchestrator.prototype) as any;
|
|
1899
|
+
orchestrator.config = config;
|
|
1900
|
+
orchestrator.buffer = { clearAfterExtraction: async () => { clearCalls += 1; } };
|
|
1901
|
+
orchestrator.storageRouter = {
|
|
1902
|
+
storageFor: async () => withMetaSeam({
|
|
1903
|
+
listEntityNames: async () => [],
|
|
1904
|
+
loadMeta: async () => ({ extractionCount: 0, lastExtractionAt: null, lastConsolidationAt: null, totalMemories: 0, totalEntities: 0, processedExtractionFingerprints: [] }),
|
|
1905
|
+
saveMeta: async () => {},
|
|
1906
|
+
}),
|
|
1907
|
+
};
|
|
1908
|
+
orchestrator.extraction = {
|
|
1909
|
+
extract: async () => ({ facts: [], entities: [], questions: [], profileUpdates: [], extractionFailure: "local_llm_unusable", extractionFailureClass: "parse_empty" }),
|
|
1910
|
+
};
|
|
1911
|
+
stubPersistExtraction(orchestrator);
|
|
1912
|
+
const turns = [{ ...makeTurn("session-retry-off-empty", "unparseable reply"), logicalSessionKey: "logical-thread:retry-off-empty", turnFingerprint: "fp-retry-off-empty", persistProcessedFingerprint: true }];
|
|
1913
|
+
const result = await orchestrator.runExtraction(turns, { bufferKey: "logical-thread:retry-off-empty" });
|
|
1914
|
+
assert.equal(result.status, "skipped");
|
|
1915
|
+
assert.equal(result.reason, "empty_extraction_result");
|
|
1916
|
+
assert.equal(clearCalls, 0);
|
|
1917
|
+
assert.equal(result.retainedBuffer, true);
|
|
1918
|
+
assert.equal(result.failureClass, "parse_empty");
|
|
1919
|
+
});
|
|
1920
|
+
|
|
1921
|
+
test("runExtraction still clears the buffer on a successful empty extraction when extractionRetryEnabled=false", async () => {
|
|
1922
|
+
const config = parseConfig({ extractionRetryEnabled: false });
|
|
1923
|
+
config.extractionMinChars = 0;
|
|
1924
|
+
config.extractionMinUserTurns = 1;
|
|
1925
|
+
let clearCalls = 0;
|
|
1926
|
+
// SAFETY: runExtraction is driven only through the stub members assigned below;
|
|
1927
|
+
// the prototype harness leaves the rest of Orchestrator unreachable in this test.
|
|
1928
|
+
const orchestrator = Object.create(Orchestrator.prototype) as any;
|
|
1929
|
+
orchestrator.config = config;
|
|
1930
|
+
orchestrator.buffer = { clearAfterExtraction: async () => { clearCalls += 1; } };
|
|
1931
|
+
orchestrator.storageRouter = {
|
|
1932
|
+
storageFor: async () => withMetaSeam({
|
|
1933
|
+
listEntityNames: async () => [],
|
|
1934
|
+
loadMeta: async () => ({ extractionCount: 0, lastExtractionAt: null, lastConsolidationAt: null, totalMemories: 0, totalEntities: 0, processedExtractionFingerprints: [] }),
|
|
1935
|
+
saveMeta: async () => {},
|
|
1936
|
+
}),
|
|
1937
|
+
};
|
|
1938
|
+
orchestrator.extraction = {
|
|
1939
|
+
extract: async () => ({ facts: [], entities: [], questions: [], profileUpdates: [] }),
|
|
1940
|
+
};
|
|
1941
|
+
stubPersistExtraction(orchestrator);
|
|
1942
|
+
const turns = [{ ...makeTurn("session-retry-off-ok", "nothing to remember"), logicalSessionKey: "logical-thread:retry-off-ok", turnFingerprint: "fp-retry-off-ok", persistProcessedFingerprint: true }];
|
|
1943
|
+
const result = await orchestrator.runExtraction(turns, { bufferKey: "logical-thread:retry-off-ok" });
|
|
1944
|
+
assert.equal(result.status, "skipped");
|
|
1945
|
+
assert.equal(result.reason, "empty_extraction_result");
|
|
1946
|
+
assert.equal(clearCalls, 1, "a successful empty extraction still clears the buffer");
|
|
1947
|
+
assert.equal(result.retainedBuffer, undefined);
|
|
1882
1948
|
});
|
|
1883
1949
|
|
|
1884
1950
|
test("runExtraction retains buffers and keeps in-memory backoff when the meta lock is unavailable", async () => {
|
|
@@ -1894,6 +1960,8 @@ test("runExtraction retains buffers and keeps in-memory backoff when the meta lo
|
|
|
1894
1960
|
let updateMetaCalls = 0;
|
|
1895
1961
|
// SAFETY: runExtraction is driven only through the stub members assigned below;
|
|
1896
1962
|
// the prototype harness leaves the rest of Orchestrator unreachable in this test.
|
|
1963
|
+
// SAFETY: runExtraction is driven only through the stub members assigned below;
|
|
1964
|
+
// the prototype harness leaves the rest of Orchestrator unreachable in this test.
|
|
1897
1965
|
const orchestrator = Object.create(Orchestrator.prototype) as any;
|
|
1898
1966
|
orchestrator.config = config;
|
|
1899
1967
|
orchestrator.buffer = { clearAfterExtraction: async () => { clearCalls += 1; } };
|
package/src/types.ts
CHANGED
|
@@ -722,6 +722,8 @@ export interface PluginConfig
|
|
|
722
722
|
bufferMaxTurns: number;
|
|
723
723
|
/** Distinct sessions the extraction buffer admits before backpressure (#3303). */
|
|
724
724
|
bufferMaxSessions: number;
|
|
725
|
+
/** Retained turns admitted per session before live backpressure (#3415 bound). */
|
|
726
|
+
bufferMaxTurnsPerSession: number;
|
|
725
727
|
bufferMaxMinutes: number;
|
|
726
728
|
/** Queue depth cap; default 1 = serial queue, same-buffer tasks never overlap. Applies at daemon start. */
|
|
727
729
|
extractionQueueConcurrency: number;
|