@remnic/core 9.7.14 → 9.8.0
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 -6
- package/dist/access-admin-ops-surface.js +88 -74
- package/dist/access-audit.js +2 -2
- package/dist/access-boundary.d.ts +35 -17
- package/dist/access-boundary.js +89 -77
- package/dist/access-citation.d.ts +28 -0
- package/dist/access-citation.js +9 -0
- package/dist/access-cli.js +197 -181
- package/dist/access-cli.js.map +1 -1
- package/dist/access-errors.d.ts +16 -1
- package/dist/access-errors.js +7 -3
- package/dist/access-http.d.ts +25 -19
- package/dist/access-http.js +103 -90
- package/dist/access-identity-continuity-surface.d.ts +13 -8
- package/dist/access-identity-continuity-surface.js +88 -74
- package/dist/access-lcm-surface.d.ts +16 -9
- package/dist/access-lcm-surface.js +88 -74
- package/dist/access-mcp.d.ts +23 -16
- package/dist/access-mcp.js +99 -87
- package/dist/access-memory-search-fanout.d.ts +93 -0
- package/dist/access-memory-search-fanout.js +18 -0
- package/dist/access-observe-write-surface.d.ts +26 -8
- package/dist/access-observe-write-surface.js +88 -74
- package/dist/access-operations-batch.js +95 -83
- package/dist/access-operations.d.ts +26 -19
- package/dist/access-operations.js +97 -85
- package/dist/access-recall-concurrency.d.ts +250 -0
- package/dist/access-recall-concurrency.js +157 -0
- package/dist/access-recall-response.d.ts +130 -0
- package/dist/access-recall-response.js +147 -0
- package/dist/access-recall-surface.d.ts +15 -7
- package/dist/access-recall-surface.js +88 -74
- package/dist/access-schema.d.ts +34 -34
- package/dist/access-schema.js +8 -6
- package/dist/{access-service-CPhSnLOH.d.ts → access-service-DEL4qCrc.d.ts} +25 -32
- package/dist/access-service.d.ts +13 -6
- package/dist/access-service.js +92 -75
- package/dist/access-surface-catalog.d.ts +23 -16
- package/dist/access-surface-catalog.js +1 -0
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-token-capabilities.d.ts +2 -1
- package/dist/access-token-capabilities.js +4 -2
- package/dist/action-confidence.d.ts +3 -1
- package/dist/active-memory-bridge.d.ts +3 -1
- package/dist/active-memory-bridge.js +4 -4
- package/dist/active-recall.d.ts +4 -1
- package/dist/active-recall.js +23 -13
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/{auto-sync-AAMTVZMK.js → auto-sync-UZG3XQZ5.js} +14 -8
- package/dist/{auto-sync-AAMTVZMK.js.map → auto-sync-UZG3XQZ5.js.map} +1 -1
- package/dist/behavior-learner.d.ts +3 -1
- package/dist/behavior-signals.d.ts +3 -1
- package/dist/bootstrap.d.ts +12 -7
- package/dist/bootstrap.js +2 -2
- package/dist/bounded-jsonl-state.d.ts +54 -0
- package/dist/bounded-jsonl-state.js +10 -0
- package/dist/boxes.js +2 -2
- package/dist/briefing.d.ts +5 -2
- package/dist/briefing.js +37 -27
- package/dist/buffer-surprise-report.d.ts +3 -1
- package/dist/buffer.d.ts +60 -2
- package/dist/buffer.js +3 -3
- package/dist/bulk-import/index.d.ts +5 -3
- package/dist/calibration.d.ts +3 -1
- package/dist/calibration.js +6 -6
- package/dist/capabilities.d.ts +7 -7
- package/dist/capabilities.js +1 -1
- package/dist/{capsule-crypto-CZJSLEFG.js → capsule-crypto-YO5QJ6L3.js} +3 -3
- package/dist/capsule-crypto-YO5QJ6L3.js.map +1 -0
- package/dist/{capsule-merge-Z2HUO6IK.js → capsule-merge-5KKJQBWQ.js} +4 -4
- package/dist/{catalog-uX9sT9ws.d.ts → catalog-BWqHb5HT.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +3 -1
- package/dist/causal-behavior.js +6 -6
- package/dist/causal-chain.js +4 -4
- package/dist/causal-consolidation.d.ts +3 -1
- package/dist/causal-consolidation.js +46 -37
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +6 -6
- package/dist/causal-trajectory-graph.d.ts +3 -1
- package/dist/causal-trajectory-graph.js +1 -1
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-A3GOMRJG.js → chunk-23L3IXFD.js} +2 -2
- package/dist/chunk-2CGLBUW3.js +15 -0
- package/dist/chunk-2CGLBUW3.js.map +1 -0
- package/dist/{chunk-MRHFJV44.js → chunk-2DQ2XREU.js} +2 -2
- package/dist/{chunk-ASKEM4AR.js → chunk-2EJOEICD.js} +1823 -1483
- package/dist/chunk-2EJOEICD.js.map +1 -0
- package/dist/{chunk-L2B3EE7B.js → chunk-2QMKMVHH.js} +2 -2
- package/dist/{chunk-6CALL5VN.js → chunk-2UFO7X4Q.js} +7 -7
- package/dist/{chunk-2MR3MFQB.js → chunk-2VEOKUPP.js} +3 -3
- package/dist/chunk-2Z24E5W2.js +22 -0
- package/dist/chunk-2Z24E5W2.js.map +1 -0
- package/dist/{chunk-RHOZ5LLO.js → chunk-347WD2LE.js} +2 -2
- package/dist/{chunk-5S7Z5SHA.js → chunk-34RC5RT7.js} +2 -2
- package/dist/{chunk-KGWXHWAH.js → chunk-3QAH2S33.js} +3 -3
- package/dist/{chunk-37CTGERM.js → chunk-3WCASNQZ.js} +12 -1
- package/dist/chunk-3WCASNQZ.js.map +1 -0
- package/dist/{chunk-ZIDSD6VC.js → chunk-3Y224NYC.js} +3 -3
- package/dist/{chunk-RBQLJSJ7.js → chunk-44XZ75OQ.js} +46 -10
- package/dist/chunk-44XZ75OQ.js.map +1 -0
- package/dist/{chunk-VFSP73LP.js → chunk-45GF7Y3V.js} +2 -2
- package/dist/{chunk-7ICYQUOL.js → chunk-4BJQODZF.js} +2514 -1526
- package/dist/chunk-4BJQODZF.js.map +1 -0
- package/dist/{chunk-JMBVCAR4.js → chunk-57OWKFUQ.js} +17 -6
- package/dist/chunk-57OWKFUQ.js.map +1 -0
- package/dist/{chunk-OEHCMALU.js → chunk-5I4M26Q7.js} +5 -5
- package/dist/{chunk-2E6G7FCE.js → chunk-5Q7EVV4X.js} +7 -7
- package/dist/{chunk-LC7OODWZ.js → chunk-5SB7SC2G.js} +80 -49
- package/dist/chunk-5SB7SC2G.js.map +1 -0
- package/dist/{chunk-VZ5OJE4X.js → chunk-5VQJBH2G.js} +2 -2
- package/dist/{chunk-PUBTHW5O.js → chunk-6DRPPQEJ.js} +2 -2
- package/dist/{chunk-NWTGD4AN.js → chunk-6KIQT7RG.js} +10 -9
- package/dist/chunk-6KIQT7RG.js.map +1 -0
- package/dist/{chunk-4LEF6XWJ.js → chunk-6O22TZSB.js} +3 -3
- package/dist/{chunk-ZQ7UBUZ6.js → chunk-6QYST5XN.js} +6 -6
- package/dist/{chunk-W4PGTAS2.js → chunk-6WAFYNVT.js} +3 -3
- package/dist/chunk-6ZMAMSHS.js +20 -0
- package/dist/chunk-6ZMAMSHS.js.map +1 -0
- package/dist/{chunk-R5VAVVHP.js → chunk-72A4L5JJ.js} +2 -2
- package/dist/{chunk-X64YLC24.js → chunk-72VAXGEI.js} +5 -13
- package/dist/chunk-72VAXGEI.js.map +1 -0
- package/dist/{chunk-IKQTFQMI.js → chunk-755Q3DGF.js} +22 -3
- package/dist/chunk-755Q3DGF.js.map +1 -0
- package/dist/{chunk-F7AU34FC.js → chunk-76GLCM57.js} +160 -127
- package/dist/chunk-76GLCM57.js.map +1 -0
- package/dist/{chunk-D7FOKIY5.js → chunk-7AMFUATK.js} +12 -9
- package/dist/{chunk-D7FOKIY5.js.map → chunk-7AMFUATK.js.map} +1 -1
- package/dist/{chunk-BFVEEB7W.js → chunk-7ON2JW73.js} +57 -22
- package/dist/chunk-7ON2JW73.js.map +1 -0
- package/dist/chunk-7RNBVZZO.js +270 -0
- package/dist/chunk-7RNBVZZO.js.map +1 -0
- package/dist/{chunk-3FAMU5TX.js → chunk-A6USBZTO.js} +2 -2
- package/dist/{chunk-TXVD7PLT.js → chunk-A72SWTWW.js} +7 -7
- package/dist/{chunk-FC77VUX5.js → chunk-A7Q43EUZ.js} +2 -2
- package/dist/{chunk-UJBESW6X.js → chunk-AE7WMV4V.js} +7 -7
- package/dist/{chunk-J2HSAU72.js → chunk-AIK5W3IW.js} +29 -1
- package/dist/chunk-AIK5W3IW.js.map +1 -0
- package/dist/{chunk-OKUEZOGW.js → chunk-AITCS2RC.js} +2 -2
- package/dist/{chunk-OC35KQIN.js → chunk-AJ7QCSIS.js} +4 -4
- package/dist/{chunk-FNMFJWBY.js → chunk-ANEUPF6O.js} +5 -5
- package/dist/chunk-AREGMX2J.js +50 -0
- package/dist/chunk-AREGMX2J.js.map +1 -0
- package/dist/chunk-AVPXXV6J.js +448 -0
- package/dist/chunk-AVPXXV6J.js.map +1 -0
- package/dist/{chunk-2A3OXAP2.js → chunk-B7RWBZXW.js} +2 -2
- package/dist/{chunk-GWTFLF2P.js → chunk-BJMBJZ2Y.js} +59 -59
- package/dist/chunk-BJMBJZ2Y.js.map +1 -0
- package/dist/{chunk-N3JDIRBW.js → chunk-BLAKS3CP.js} +4 -4
- package/dist/{chunk-M7VGG3ID.js → chunk-BV5WMSIJ.js} +9 -9
- package/dist/{chunk-2BFLDH5F.js → chunk-BXLOS5AJ.js} +2 -2
- package/dist/{chunk-UXKMMNJD.js → chunk-C23BYTJV.js} +6 -6
- package/dist/{chunk-JZHHREBL.js → chunk-C3AKM55W.js} +2 -2
- package/dist/{chunk-RP7YXA67.js → chunk-C5JF6EZ7.js} +2 -2
- package/dist/{chunk-FBNWOMCE.js → chunk-C6XBRYVD.js} +16 -15
- package/dist/chunk-C6XBRYVD.js.map +1 -0
- package/dist/{chunk-FTYDWKO6.js → chunk-CEN6DW6X.js} +12 -2
- package/dist/chunk-CEN6DW6X.js.map +1 -0
- package/dist/chunk-CGASUJVP.js +421 -0
- package/dist/chunk-CGASUJVP.js.map +1 -0
- package/dist/{chunk-DDGV7NAX.js → chunk-CQMEM5CC.js} +2 -2
- package/dist/{chunk-A7B4RMQG.js → chunk-CXZQOVIE.js} +12 -12
- package/dist/chunk-D3V3UMET.js +44 -0
- package/dist/chunk-D3V3UMET.js.map +1 -0
- package/dist/{chunk-7N2RUBAP.js → chunk-DDA47TES.js} +2 -2
- package/dist/{chunk-64SE4X5G.js → chunk-DEBHXHJR.js} +3 -3
- package/dist/{chunk-EHK6KZHK.js → chunk-DNHVPZOD.js} +2 -2
- package/dist/{chunk-437S3G37.js → chunk-DQEMWVMT.js} +2 -2
- package/dist/{chunk-LZZNTPLR.js → chunk-DX3XRGLH.js} +2 -2
- package/dist/chunk-EA2H5LML.js +72 -0
- package/dist/chunk-EA2H5LML.js.map +1 -0
- package/dist/{chunk-IFJ23BHU.js → chunk-EEC7UJPX.js} +112 -106
- package/dist/chunk-EEC7UJPX.js.map +1 -0
- package/dist/{chunk-KSNVDPDF.js → chunk-EKBNDKDY.js} +21 -20
- package/dist/chunk-EKBNDKDY.js.map +1 -0
- package/dist/{chunk-YF6FMLBT.js → chunk-EQWEIIKQ.js} +64 -34
- package/dist/chunk-EQWEIIKQ.js.map +1 -0
- package/dist/{chunk-7MW3CVLD.js → chunk-ES36HTSC.js} +4 -4
- package/dist/{chunk-TN7THW5U.js → chunk-ET356KSB.js} +2 -2
- package/dist/{chunk-YNDLCWXS.js → chunk-EZ25VE3G.js} +4 -4
- package/dist/{chunk-7LFXDGLH.js → chunk-F7GAIWFA.js} +20 -20
- package/dist/{chunk-IKSELOIV.js → chunk-FFPJINJE.js} +7 -7
- package/dist/chunk-FMLKOL2Z.js +636 -0
- package/dist/chunk-FMLKOL2Z.js.map +1 -0
- package/dist/chunk-FQC3DHH2.js +20 -0
- package/dist/chunk-FQC3DHH2.js.map +1 -0
- package/dist/{chunk-V53GJUSL.js → chunk-FUTF72MJ.js} +15 -15
- package/dist/chunk-GCASGYIO.js +71 -0
- package/dist/chunk-GCASGYIO.js.map +1 -0
- package/dist/{chunk-5UNWK7KU.js → chunk-GFPZS3F5.js} +8 -8
- package/dist/{chunk-BCDKBDSY.js → chunk-GNVZQ5JN.js} +99 -41
- package/dist/chunk-GNVZQ5JN.js.map +1 -0
- package/dist/{chunk-G6NKALRN.js → chunk-H4WG3UQZ.js} +2 -2
- package/dist/{chunk-HLTAPHZZ.js → chunk-HNZKVLAN.js} +2 -2
- package/dist/{chunk-5EZXHU36.js → chunk-HYQJQGD3.js} +2 -2
- package/dist/{chunk-ANADNYWK.js → chunk-IDZFBSHN.js} +8 -6
- package/dist/{chunk-ANADNYWK.js.map → chunk-IDZFBSHN.js.map} +1 -1
- package/dist/{chunk-XVLEGMJI.js → chunk-IFH6LWTO.js} +50 -8
- package/dist/chunk-IFH6LWTO.js.map +1 -0
- package/dist/{chunk-RULE4VG5.js → chunk-ILGC6JH6.js} +21 -6
- package/dist/chunk-ILGC6JH6.js.map +1 -0
- package/dist/chunk-IUM3VSHI.js +113 -0
- package/dist/chunk-IUM3VSHI.js.map +1 -0
- package/dist/{chunk-ND5M64JJ.js → chunk-IYNGIMVG.js} +101 -91
- package/dist/chunk-IYNGIMVG.js.map +1 -0
- package/dist/{chunk-TRWPCR6P.js → chunk-JECBQBEX.js} +3 -3
- package/dist/{chunk-HG32URJJ.js → chunk-JYIFGGEM.js} +2 -2
- package/dist/{chunk-VA4WSW54.js → chunk-JYIJNNN3.js} +3 -3
- package/dist/{chunk-L5HJQC36.js → chunk-K2TDK7GG.js} +3 -3
- package/dist/{chunk-MKDRQAA3.js → chunk-KAVBJSBQ.js} +4 -4
- package/dist/{chunk-EEARRVZ2.js → chunk-KF5EUVKQ.js} +16 -6
- package/dist/chunk-KF5EUVKQ.js.map +1 -0
- package/dist/chunk-KFZY2OFH.js +42 -0
- package/dist/chunk-KFZY2OFH.js.map +1 -0
- package/dist/{chunk-4OKLXWDZ.js → chunk-KNB7IBBU.js} +2 -2
- package/dist/{chunk-QLULYKWZ.js → chunk-KSXJOC4F.js} +2 -2
- package/dist/{chunk-OBMR4VIX.js → chunk-L2DPF4DF.js} +186 -15
- package/dist/chunk-L2DPF4DF.js.map +1 -0
- package/dist/{chunk-JI5AVXYO.js → chunk-LEPOP46W.js} +6 -6
- package/dist/{chunk-O7BBFJLP.js → chunk-LTAVSOZW.js} +2 -2
- package/dist/{chunk-E3VODCC3.js → chunk-LUDXM7MD.js} +14 -2
- package/dist/{chunk-E3VODCC3.js.map → chunk-LUDXM7MD.js.map} +1 -1
- package/dist/{chunk-2IZAGAJR.js → chunk-LULR4IUW.js} +3 -3
- package/dist/{chunk-NUWYOKS6.js → chunk-MC5Q3J7S.js} +398 -7
- package/dist/chunk-MC5Q3J7S.js.map +1 -0
- package/dist/{chunk-WMWVO45V.js → chunk-MC6XO7T4.js} +2 -2
- package/dist/chunk-MKQBXQKU.js +107 -0
- package/dist/chunk-MKQBXQKU.js.map +1 -0
- package/dist/{chunk-7PND4PUC.js → chunk-MMGGVZ4Q.js} +29 -9
- package/dist/{chunk-7PND4PUC.js.map → chunk-MMGGVZ4Q.js.map} +1 -1
- package/dist/{chunk-D6RIFG4O.js → chunk-MNB5RMAY.js} +2 -2
- package/dist/{chunk-67ZCJLJY.js → chunk-MYFQ3ED4.js} +8 -8
- package/dist/{chunk-V3UE5I5F.js → chunk-MYVPLJOO.js} +2 -2
- package/dist/chunk-NINSR6LX.js +83 -0
- package/dist/chunk-NINSR6LX.js.map +1 -0
- package/dist/{chunk-MTWKDOVO.js → chunk-NLE6TSLG.js} +2 -2
- package/dist/{chunk-DBRYEIGY.js → chunk-OJP3N7UK.js} +2 -2
- package/dist/{chunk-AD6AMF2N.js → chunk-OQJIB32H.js} +28 -23
- package/dist/chunk-OQJIB32H.js.map +1 -0
- package/dist/{chunk-SMX5267P.js → chunk-OZKOPQCM.js} +2 -2
- package/dist/{chunk-JCK7V6SN.js → chunk-P65YJEEL.js} +2 -2
- package/dist/{chunk-MTR7BZQN.js → chunk-PBGWYM3H.js} +3 -3
- package/dist/chunk-PIG4WJFQ.js +87 -0
- package/dist/chunk-PIG4WJFQ.js.map +1 -0
- package/dist/chunk-PQVCH2AE.js +76 -0
- package/dist/chunk-PQVCH2AE.js.map +1 -0
- package/dist/{chunk-AXTXN4T6.js → chunk-PWFCHOB3.js} +2 -2
- package/dist/{chunk-FDPZVY6D.js → chunk-QFN4U7AG.js} +2 -2
- package/dist/{chunk-K2ZLHESQ.js → chunk-QIEUU4UK.js} +2 -2
- package/dist/{chunk-AHLPZ2SF.js → chunk-QJAQNXWI.js} +44 -6
- package/dist/chunk-QJAQNXWI.js.map +1 -0
- package/dist/{chunk-3D6AFGQR.js → chunk-QVT3E4CE.js} +7 -7
- package/dist/{chunk-VYOFVVNK.js → chunk-R26ZMXR2.js} +24 -24
- package/dist/{chunk-VYOFVVNK.js.map → chunk-R26ZMXR2.js.map} +1 -1
- package/dist/chunk-R3DJVOSM.js +34 -0
- package/dist/chunk-R3DJVOSM.js.map +1 -0
- package/dist/{chunk-SFQ6QNL7.js → chunk-R6YJI3HE.js} +2 -1
- package/dist/{chunk-5CJVLG3H.js → chunk-RFDD3B7W.js} +5 -5
- package/dist/{chunk-JBPKEARU.js → chunk-RKNJBZ55.js} +4 -4
- package/dist/chunk-ROI7BK7H.js +88 -0
- package/dist/chunk-ROI7BK7H.js.map +1 -0
- package/dist/{chunk-UTRJFDP2.js → chunk-S2BBISHU.js} +4 -4
- package/dist/{chunk-IALLX7EE.js → chunk-S2FSBU4H.js} +3 -3
- package/dist/{chunk-BFPETA3S.js → chunk-SCCO46KZ.js} +3 -2
- package/dist/chunk-SCCO46KZ.js.map +1 -0
- package/dist/chunk-SICXL4MK.js +165 -0
- package/dist/chunk-SICXL4MK.js.map +1 -0
- package/dist/chunk-SK7AMF2J.js +168 -0
- package/dist/chunk-SK7AMF2J.js.map +1 -0
- package/dist/{chunk-GMSDQUCR.js → chunk-TDTXKOAJ.js} +6475 -5748
- package/dist/chunk-TDTXKOAJ.js.map +1 -0
- package/dist/{chunk-KSBEEMQF.js → chunk-TG6IHVE2.js} +151 -6
- package/dist/chunk-TG6IHVE2.js.map +1 -0
- package/dist/{chunk-7K5Q6COX.js → chunk-TVVEYCNW.js} +4 -4
- package/dist/{chunk-PK5XBDA6.js → chunk-U3ZAVRP3.js} +2 -2
- package/dist/{chunk-ODPLEWB6.js → chunk-UFGFMWAD.js} +47 -17
- package/dist/chunk-UFGFMWAD.js.map +1 -0
- package/dist/{chunk-4KJLYTLS.js → chunk-V57NLO5P.js} +2 -2
- package/dist/{chunk-FLVL4L3L.js → chunk-VDX2J7OX.js} +2 -2
- package/dist/{chunk-7XGSIUP5.js → chunk-W4FBGYGK.js} +1 -1
- package/dist/{chunk-TXLGHDHS.js → chunk-W4XJFLAL.js} +53 -32
- package/dist/chunk-W4XJFLAL.js.map +1 -0
- package/dist/{chunk-6SXVCD7W.js → chunk-W7IGLX4G.js} +2 -2
- package/dist/{chunk-KQDNAXOM.js → chunk-WG5HSQ4P.js} +19 -6
- package/dist/chunk-WG5HSQ4P.js.map +1 -0
- package/dist/{chunk-LTJAMRGI.js → chunk-WL5EBRDH.js} +17 -3
- package/dist/chunk-WL5EBRDH.js.map +1 -0
- package/dist/{chunk-KAWTOYAW.js → chunk-WLZYGLJ4.js} +2 -2
- package/dist/{chunk-W5NKDU24.js → chunk-WON4APQY.js} +4 -4
- package/dist/{chunk-NKCPUHCI.js → chunk-WZFAPHIK.js} +6 -6
- package/dist/{chunk-KQPJLK3X.js → chunk-XL24QQ63.js} +2 -2
- package/dist/{chunk-X47LWMKA.js → chunk-XMMESCPD.js} +26 -1
- package/dist/chunk-XMMESCPD.js.map +1 -0
- package/dist/{chunk-4B4MUS5D.js → chunk-YROFNEG5.js} +7 -7
- package/dist/{chunk-WU46YPY6.js → chunk-YV32N67O.js} +1 -1
- package/dist/chunk-YV32N67O.js.map +1 -0
- package/dist/{chunk-B3F4CWQR.js → chunk-YVKF3HEW.js} +1 -1
- package/dist/chunk-YVKF3HEW.js.map +1 -0
- package/dist/{chunk-VRAD2FGO.js → chunk-Z54EM5YZ.js} +12 -12
- package/dist/{chunk-2VN4JAX7.js → chunk-ZOKZIR5K.js} +95 -33
- package/dist/chunk-ZOKZIR5K.js.map +1 -0
- package/dist/{cli-_Y2Bmt6A.d.ts → cli-C_pqqTCw.d.ts} +28 -12
- package/dist/cli.d.ts +16 -9
- package/dist/cli.js +145 -130
- package/dist/compounding/engine.d.ts +5 -2
- package/dist/compounding/engine.js +39 -29
- package/dist/compounding/preference-consolidator.d.ts +3 -1
- package/dist/compounding/preference-consolidator.js +1 -1
- package/dist/compression-optimizer.d.ts +3 -1
- package/dist/config-qmd.d.ts +8 -0
- package/dist/config-qmd.js +20 -0
- package/dist/config-qmd.js.map +1 -0
- package/dist/config.d.ts +3 -1
- package/dist/config.js +15 -10
- package/dist/connectors/codex-materialize-runner.d.ts +3 -1
- package/dist/connectors/codex-materialize-runner.js +39 -29
- package/dist/connectors/codex-materialize.d.ts +3 -1
- package/dist/connectors/codex-materialize.js +2 -2
- package/dist/connectors/index.d.ts +3 -1
- package/dist/connectors/index.js +44 -35
- package/dist/consolidation-provenance-check.d.ts +5 -2
- package/dist/consolidation-provenance-check.js +4 -4
- package/dist/consolidation-undo.d.ts +5 -2
- package/dist/consolidation-undo.js +3 -3
- package/dist/contradiction/index.d.ts +5 -2
- package/dist/contradiction/index.js +10 -4
- package/dist/{contradiction-scan-J57T5QV7.js → contradiction-scan-RJBABNRH.js} +4 -4
- package/dist/contradiction-scan-RJBABNRH.js.map +1 -0
- package/dist/conversation-index/backend.d.ts +3 -1
- package/dist/conversation-index/backend.js +5 -5
- package/dist/conversation-index/chunker.d.ts +3 -1
- package/dist/conversation-index/cleanup.js +2 -2
- package/dist/conversation-index/faiss-adapter.d.ts +3 -1
- package/dist/conversation-index/faiss-adapter.js +2 -2
- package/dist/conversation-index/indexer.d.ts +3 -1
- package/dist/conversation-index/indexer.js +2 -2
- package/dist/conversation-index/search.d.ts +3 -1
- package/dist/conversation-index/search.js +2 -2
- package/dist/cross-namespace-budget.d.ts +45 -1
- package/dist/cross-namespace-budget.js +5 -3
- package/dist/dashboard-runtime.js +2 -2
- package/dist/day-summary.d.ts +3 -1
- package/dist/day-summary.js +3 -3
- package/dist/delinearize.d.ts +3 -1
- package/dist/direct-answer-wiring.d.ts +3 -1
- package/dist/direct-answer.d.ts +3 -1
- package/dist/{dreams-ledger-6UODQOX6.js → dreams-ledger-567VKVOU.js} +4 -2
- package/dist/dreams-ledger-567VKVOU.js.map +1 -0
- package/dist/embedding-fallback.d.ts +3 -1
- package/dist/embedding-fallback.js +3 -3
- package/dist/enrichment/index.d.ts +3 -1
- package/dist/entity-retrieval.d.ts +5 -2
- package/dist/entity-retrieval.js +38 -29
- package/dist/entity-schema.d.ts +3 -1
- package/dist/explicit-capture.d.ts +13 -8
- package/dist/explicit-capture.js +7 -3
- package/dist/extraction-faithfulness.d.ts +3 -1
- package/dist/extraction-faithfulness.js +5 -5
- package/dist/extraction-judge-telemetry.d.ts +3 -1
- package/dist/extraction-judge-telemetry.js +2 -2
- package/dist/extraction-judge-training.d.ts +3 -1
- package/dist/extraction-judge-training.js +2 -2
- package/dist/extraction-judge.d.ts +3 -1
- package/dist/extraction-judge.js +5 -5
- package/dist/extraction.d.ts +3 -1
- package/dist/extraction.js +13 -12
- package/dist/faithfulness-config.js +3 -2
- package/dist/fallback-llm.d.ts +3 -1
- package/dist/fallback-llm.js +4 -4
- package/dist/{first-start-migration-TI67YMLG.js → first-start-migration-CSRHCJIQ.js} +2 -2
- package/dist/{forget-CQCLB5LB.js → forget-HRPLVB3W.js} +5 -5
- package/dist/graph-dashboard-diff.d.ts +3 -1
- package/dist/graph-dashboard-key.d.ts +3 -1
- package/dist/graph-dashboard-parser.d.ts +3 -1
- package/dist/{graph-edge-decay-FO7AM4UR.js → graph-edge-decay-Z6ENALU2.js} +3 -3
- package/dist/graph-edge-decay-Z6ENALU2.js.map +1 -0
- package/dist/graph-edge-reinforcement.d.ts +3 -1
- package/dist/graph-snapshot.d.ts +3 -1
- package/dist/graph-snapshot.js +2 -2
- package/dist/graph.d.ts +57 -10
- package/dist/graph.js +1 -1
- package/dist/identity-continuity.d.ts +1 -2
- package/dist/importance.d.ts +3 -1
- package/dist/importers/index.d.ts +3 -1
- package/dist/in-flight-reads.d.ts +3 -1
- package/dist/index.d.ts +101 -92
- package/dist/index.js +290 -242
- package/dist/intent.d.ts +3 -1
- package/dist/lcm/archive.js +2 -2
- package/dist/lcm/engine.d.ts +3 -1
- package/dist/lcm/engine.js +6 -6
- package/dist/lcm/index.d.ts +3 -1
- package/dist/lcm/index.js +13 -13
- package/dist/lcm/schema.js +2 -2
- package/dist/lcm/summarizer.js +3 -3
- package/dist/lcm/tools.d.ts +3 -1
- package/dist/lifecycle.d.ts +3 -1
- package/dist/live-connectors-runner.d.ts +3 -1
- package/dist/local-llm.d.ts +5 -2
- package/dist/local-llm.js +3 -3
- package/dist/local-model-endpoint.d.ts +3 -1
- package/dist/logger.d.ts +3 -1
- package/dist/logger.js +7 -3
- package/dist/maintenance/archive-observations.js +2 -2
- package/dist/maintenance/memory-governance.d.ts +3 -1
- package/dist/maintenance/memory-governance.js +38 -28
- package/dist/maintenance/migrate-observations.js +3 -3
- package/dist/maintenance/observation-ledger-utils.js +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +102 -1
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +40 -28
- package/dist/maintenance/rebuild-memory-projection.js +41 -31
- package/dist/maintenance/rebuild-observations.js +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +22 -15
- package/dist/memory-action-policy.d.ts +3 -1
- package/dist/memory-cache.d.ts +46 -2
- package/dist/memory-cache.js +7 -1
- package/dist/memory-corpus-version.js +2 -2
- package/dist/memory-lifecycle-ledger-utils.d.ts +25 -2
- package/dist/memory-lifecycle-ledger-utils.js +11 -1
- package/dist/memory-projection-store.d.ts +3 -1
- package/dist/memory-projection-store.js +2 -2
- package/dist/memory-provenance.d.ts +3 -1
- package/dist/memory-worth-outcomes.d.ts +5 -2
- package/dist/model-registry.js +2 -2
- package/dist/models-json.d.ts +3 -1
- package/dist/models-json.js +2 -2
- package/dist/namespaces/migrate.d.ts +6 -3
- package/dist/namespaces/migrate.js +54 -45
- package/dist/namespaces/principal.d.ts +27 -2
- package/dist/namespaces/principal.js +6 -2
- package/dist/namespaces/search.d.ts +16 -2
- package/dist/namespaces/search.js +25 -21
- package/dist/namespaces/storage.d.ts +24 -3
- package/dist/namespaces/storage.js +38 -30
- package/dist/native-knowledge.d.ts +3 -1
- package/dist/native-knowledge.js +2 -2
- package/dist/negative.js +2 -2
- package/dist/offline-sync-exclude-globs.d.ts +13 -0
- package/dist/offline-sync-exclude-globs.js +10 -0
- package/dist/offline-sync-exclude-globs.js.map +1 -0
- package/dist/offline-sync-impression-drain.d.ts +78 -0
- package/dist/offline-sync-impression-drain.js +37 -0
- package/dist/offline-sync-impression-drain.js.map +1 -0
- package/dist/offline-sync.js +4 -2
- package/dist/operator-toolkit.d.ts +5 -2
- package/dist/operator-toolkit.js +73 -58
- package/dist/orchestration/compression-guideline-coordinator.d.ts +5 -2
- package/dist/orchestration/compression-guideline-coordinator.js +3 -3
- package/dist/orchestration/maintenance.d.ts +121 -2
- package/dist/orchestration/maintenance.js +47 -34
- package/dist/{orchestrator-BbZ_dQSU.d.ts → orchestrator-CQJ8U7En.d.ts} +85 -79
- package/dist/orchestrator.d.ts +13 -8
- package/dist/orchestrator.js +197 -180
- package/dist/page-versioning.js +3 -3
- package/dist/patterns-cli.d.ts +3 -1
- package/dist/{pipeline-FRMDb1fn.d.ts → pipeline-Cn-kvYeV.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +3 -1
- package/dist/prioritized-embed.d.ts +19 -0
- package/dist/prioritized-embed.js +8 -0
- package/dist/prioritized-embed.js.map +1 -0
- package/dist/proactive-contention.d.ts +28 -0
- package/dist/proactive-contention.js +8 -0
- package/dist/proactive-contention.js.map +1 -0
- package/dist/profiling.js +2 -2
- package/dist/provenance.d.ts +3 -1
- package/dist/provenance.js +3 -2
- package/dist/{purge-NDWV6WYD.js → purge-IRF47ZTX.js} +3 -3
- package/dist/{qmd-xJRrHFbA.d.ts → qmd-oh9VXz1d.d.ts} +11 -1
- package/dist/qmd-preflight.d.ts +5 -2
- package/dist/qmd-recall-cache.d.ts +3 -1
- package/dist/qmd-status.d.ts +57 -0
- package/dist/qmd-status.js +18 -0
- package/dist/qmd-status.js.map +1 -0
- package/dist/qmd.d.ts +5 -2
- package/dist/qmd.js +8 -4
- package/dist/recall-concurrency-config.d.ts +16 -0
- package/dist/recall-concurrency-config.js +10 -0
- package/dist/recall-concurrency-config.js.map +1 -0
- package/dist/recall-disclosure-escalation.d.ts +3 -1
- package/dist/recall-explain-renderer.d.ts +4 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +26 -0
- package/dist/recall-memory-map.js +18 -0
- package/dist/recall-memory-map.js.map +1 -0
- package/dist/recall-planner-llm.d.ts +3 -1
- package/dist/recall-planner-llm.js +4 -4
- package/dist/recall-qos.js +2 -2
- package/dist/recall-state.d.ts +163 -2
- package/dist/recall-state.js +6 -3
- package/dist/recall-tag-filter.d.ts +3 -1
- package/dist/recall-timings.d.ts +11 -2
- package/dist/recall-timings.js +3 -1
- package/dist/recall-xray-cli.d.ts +3 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +3 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +3 -1
- package/dist/recall-xray.js +2 -2
- package/dist/relevance.js +3 -3
- package/dist/replay/normalizers/chatgpt.d.ts +3 -1
- package/dist/replay/normalizers/claude.d.ts +3 -1
- package/dist/replay/normalizers/openclaw.d.ts +3 -1
- package/dist/replay/normalizers/shared.d.ts +3 -1
- package/dist/replay/runner.d.ts +3 -1
- package/dist/replay/types.d.ts +3 -1
- package/dist/rerank.d.ts +8 -1
- package/dist/rerank.js +3 -1
- package/dist/resolution-3K27T4VO.js +18 -0
- package/dist/resolution-3K27T4VO.js.map +1 -0
- package/dist/resolve-auth-token.d.ts +3 -1
- package/dist/resolve-provider-secret.js +2 -2
- package/dist/resume-bundles.js +19 -14
- package/dist/retrieval-agents.d.ts +19 -16
- package/dist/retrieval-agents.js +3 -3
- package/dist/retrieval-tiers.d.ts +3 -1
- package/dist/routing/engine.d.ts +3 -1
- package/dist/routing/store.d.ts +3 -1
- package/dist/routing/store.js +2 -2
- package/dist/salvage-envelope.d.ts +18 -0
- package/dist/salvage-envelope.js +15 -0
- package/dist/salvage-envelope.js.map +1 -0
- package/dist/schemas.d.ts +24 -24
- package/dist/scope-profiles-EpJG7yKP.d.ts +30 -0
- package/dist/search/document-scanner.js +3 -2
- package/dist/search/embed-helper.d.ts +3 -1
- package/dist/search/embed-helper.js +3 -3
- package/dist/search/factory.d.ts +3 -1
- package/dist/search/factory.js +19 -17
- package/dist/search/index.d.ts +3 -1
- package/dist/search/index.js +23 -21
- package/dist/search/lancedb-backend.d.ts +3 -1
- package/dist/search/lancedb-backend.js +6 -5
- package/dist/search/meilisearch-backend.d.ts +3 -1
- package/dist/search/meilisearch-backend.js +6 -5
- package/dist/search/noop-backend.d.ts +3 -1
- package/dist/search/orama-backend.d.ts +3 -1
- package/dist/search/orama-backend.js +6 -5
- package/dist/search/port.d.ts +27 -2
- package/dist/search/port.js +1 -1
- package/dist/search/remote-backend.d.ts +3 -1
- package/dist/search/remote-backend.js +3 -3
- package/dist/secure-store/index.d.ts +12 -1
- package/dist/secure-store/index.js +6 -3
- package/dist/{semantic-consolidation-fvdZRa5Z.d.ts → semantic-consolidation-DILZEQq3.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +4 -2
- package/dist/semantic-consolidation.js +41 -32
- package/dist/semantic-rule-promotion.js +37 -27
- package/dist/semantic-rule-verifier.d.ts +3 -1
- package/dist/semantic-rule-verifier.js +38 -28
- package/dist/session-observer-bands.d.ts +3 -1
- package/dist/session-observer-state.d.ts +3 -1
- package/dist/session-observer-state.js +2 -2
- package/dist/session-transcript-migration.js +2 -2
- package/dist/shared-context/manager.d.ts +3 -1
- package/dist/shared-context/manager.js +3 -3
- package/dist/signal.d.ts +3 -1
- package/dist/{storage-CrvzaM9C.d.ts → storage-NIyKYD8g.d.ts} +505 -110
- package/dist/storage-guards.js +2 -2
- package/dist/storage.d.ts +6 -3
- package/dist/storage.js +41 -29
- package/dist/structured-attributes.d.ts +23 -1
- package/dist/structured-attributes.js +7 -1
- package/dist/summarizer.d.ts +3 -1
- package/dist/summarizer.js +11 -11
- package/dist/summary-snapshot.d.ts +3 -1
- package/dist/summary-snapshot.js +2 -2
- package/dist/temporal-index-batch.d.ts +1 -0
- package/dist/temporal-index-batch.js +10 -0
- package/dist/temporal-index-batch.js.map +1 -0
- package/dist/temporal-index-compat.d.ts +279 -1
- package/dist/temporal-index-compat.js +1 -1
- package/dist/temporal-index.d.ts +1 -225
- package/dist/temporal-index.js +35 -3
- package/dist/temporal-supersession.d.ts +5 -2
- package/dist/temporal-supersession.js +2 -2
- package/dist/temporal-timeline-recall.d.ts +3 -1
- package/dist/temporal-validity.d.ts +3 -1
- package/dist/threading.d.ts +3 -1
- package/dist/threading.js +2 -2
- package/dist/tier-migration.d.ts +5 -2
- package/dist/tier-routing.d.ts +3 -1
- package/dist/{tier-stats-KV7IWCJR.js → tier-stats-QEJSPFV2.js} +2 -2
- package/dist/tokens.js +3 -3
- package/dist/topics.d.ts +3 -1
- package/dist/transcript.d.ts +3 -1
- package/dist/transcript.js +2 -2
- package/dist/transfer/backup.js +3 -3
- package/dist/transfer/capsule-export.js +3 -3
- package/dist/transfer/capsule-import.js +6 -6
- package/dist/transfer/types.d.ts +24 -24
- package/dist/trust-score-stage.d.ts +75 -38
- package/dist/trust-score-stage.js +11 -3
- package/dist/trust-score.d.ts +3 -1
- package/dist/{types-Bl4BWDM8.d.ts → types-D_fG2ix8.d.ts} +49 -63
- package/dist/types-continuity.d.ts +52 -0
- package/dist/types-continuity.js +1 -0
- package/dist/types-continuity.js.map +1 -0
- package/dist/types.d.ts +3 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +3 -1
- package/dist/utils/serialize-mutations.d.ts +31 -2
- package/dist/utils/serialize-mutations.js +1 -1
- package/dist/verified-recall.js +39 -29
- package/dist/write-envelope.d.ts +282 -0
- package/dist/write-envelope.js +35 -0
- package/dist/write-envelope.js.map +1 -0
- package/dist/write-quarantine.d.ts +79 -0
- package/dist/write-quarantine.js +11 -0
- package/dist/write-quarantine.js.map +1 -0
- package/dist/write-rate-limiter.d.ts +45 -0
- package/dist/write-rate-limiter.js +9 -0
- package/dist/write-rate-limiter.js.map +1 -0
- package/package.json +37 -2
- package/src/access-admin-ops-surface.ts +17 -7
- package/src/access-boundary.test.ts +28 -0
- package/src/access-boundary.ts +31 -2
- package/src/access-citation.test.ts +72 -0
- package/src/access-citation.ts +139 -0
- package/src/access-errors.ts +21 -0
- package/src/access-fingerprint-parity.test.ts +211 -0
- package/src/access-http-cancellation.test.ts +59 -21
- package/src/access-http.test.ts +90 -0
- package/src/access-http.ts +79 -79
- package/src/access-mcp-cancellation.test.ts +16 -7
- package/src/access-memory-search-fanout.test.ts +220 -0
- package/src/access-memory-search-fanout.ts +168 -0
- package/src/access-observe-quarantine.test.ts +120 -0
- package/src/access-observe-write-surface.ts +130 -11
- package/src/access-operations-batch.ts +2 -0
- package/src/access-recall-concurrency.ts +773 -0
- package/src/access-recall-response.ts +307 -0
- package/src/access-recall-surface.ts +100 -252
- package/src/access-service-coding-write.test.ts +22 -4
- package/src/access-service-health.test.ts +49 -0
- package/src/access-service-namespace.test.ts +486 -8
- package/src/access-service-observe-scope.test.ts +4 -0
- package/src/access-service-recall-concurrency.test.ts +1990 -0
- package/src/access-service.ts +182 -175
- package/src/access-surface-catalog.ts +1 -0
- package/src/access-token-capabilities.ts +16 -9
- package/src/active-recall.test.ts +35 -0
- package/src/active-recall.ts +7 -0
- package/src/bounded-jsonl-state.ts +93 -0
- package/src/buffer-session.test.ts +422 -5
- package/src/buffer-surprise-trigger.test.ts +41 -0
- package/src/buffer.ts +218 -3
- package/src/capabilities-cluster-b.test.ts +1 -0
- package/src/capabilities.ts +5 -6
- package/src/cli.ts +21 -22
- package/src/coding/architecture-surfaces.test.ts +6 -3
- package/src/coding/architecture-surfaces.ts +36 -25
- package/src/coding/decision-surfaces.ts +42 -34
- package/src/compounding/engine.test.ts +5 -1
- package/src/compounding/engine.ts +7 -7
- package/src/config-qmd.ts +89 -0
- package/src/config.test.ts +136 -0
- package/src/config.ts +122 -118
- package/src/connector-provenance-lifecycle.test.ts +4 -4
- package/src/connectors/coerce.test.ts +131 -0
- package/src/connectors/coerce.ts +80 -7
- package/src/contradiction/contradiction.test.ts +10 -6
- package/src/contradiction/resolution.ts +17 -4
- package/src/correction/correction-access-wiring.ts +62 -18
- package/src/cross-namespace-budget.test.ts +35 -0
- package/src/cross-namespace-budget.ts +86 -19
- package/src/explicit-capture.ts +54 -17
- package/src/extraction.ts +2 -3
- package/src/faithfulness-graph-guard.test.ts +16 -69
- package/src/graph-recall.test.ts +31 -0
- package/src/graph.test.ts +137 -1
- package/src/graph.ts +274 -17
- package/src/index.ts +22 -2
- package/src/local-llm.ts +4 -6
- package/src/logger.ts +16 -0
- package/src/maintenance/dreams-ledger.ts +100 -49
- package/src/maintenance/rebuild-memory-lifecycle-ledger-cli.ts +77 -0
- package/src/maintenance/rebuild-memory-lifecycle-ledger.ts +373 -9
- package/src/memory-cache.ts +70 -0
- package/src/memory-lifecycle-ledger-utils.ts +51 -5
- package/src/namespaces/principal.test.ts +37 -1
- package/src/namespaces/principal.ts +48 -0
- package/src/namespaces/search.test.ts +79 -5
- package/src/namespaces/search.ts +59 -6
- package/src/namespaces/storage.ts +45 -1
- package/src/offline-sync-exclude-globs.ts +58 -0
- package/src/offline-sync-impression-drain.test.ts +316 -0
- package/src/offline-sync-impression-drain.ts +260 -0
- package/src/offline-sync.test.ts +32 -5
- package/src/offline-sync.ts +1 -14
- package/src/operator-toolkit.ts +1 -1
- package/src/orchestration/batch-deindex-flush.test.ts +146 -0
- package/src/orchestration/consolidation-run.ts +96 -85
- package/src/orchestration/extraction-envelope.ts +94 -0
- package/src/orchestration/extraction-persist-promotion.ts +134 -0
- package/src/orchestration/extraction-persist.ts +325 -260
- package/src/orchestration/extraction-run.test.ts +1 -1
- package/src/orchestration/extraction-run.ts +2 -2
- package/src/orchestration/graph-recall-coordinator.ts +18 -7
- package/src/orchestration/lifecycle-policy-coordinator.ts +63 -48
- package/src/orchestration/maintenance.test.ts +2103 -3
- package/src/orchestration/maintenance.ts +581 -2
- package/src/orchestration/namespace-read-fanout.ts +14 -8
- package/src/orchestration/orchestrator-helpers.ts +8 -1
- package/src/orchestration/orchestrator-init.ts +22 -6
- package/src/orchestration/orchestrator-namespace-scope.ts +71 -0
- package/src/orchestration/persistence-index.ts +64 -9
- package/src/orchestration/qmd-result-resolver.ts +27 -0
- package/src/orchestration/recall-entry.ts +34 -19
- package/src/orchestration/recall-internal.ts +207 -79
- package/src/orchestration/recall-rerank-coordinator.ts +229 -82
- package/src/orchestration/recall-result-formatter.ts +76 -20
- package/src/orchestration/recall-search-pipeline.test.ts +70 -0
- package/src/orchestration/recall-search-pipeline.ts +102 -129
- package/src/orchestration/recall-section-coordinator.ts +315 -85
- package/src/orchestration/semantic-consolidation-coordinator.ts +69 -37
- package/src/orchestration/session-context.ts +21 -0
- package/src/orchestration/workspace-ops.test.ts +348 -0
- package/src/orchestration/workspace-ops.ts +172 -34
- package/src/orchestrator-chunked-hash-durability.test.ts +126 -0
- package/src/orchestrator-connector-dedup.test.ts +1061 -40
- package/src/orchestrator-flush.test.ts +155 -39
- package/src/orchestrator-nonchunked-hash-durability.test.ts +121 -0
- package/src/orchestrator-source-attribution.test.ts +9 -9
- package/src/orchestrator.ts +166 -150
- package/src/prioritized-embed.ts +123 -0
- package/src/proactive-contention.test.ts +80 -0
- package/src/proactive-contention.ts +39 -0
- package/src/procedural/procedure-miner.test.ts +19 -14
- package/src/procedural/procedure-miner.ts +44 -13
- package/src/qmd-client.test.ts +111 -1
- package/src/qmd-status.ts +186 -0
- package/src/qmd.test.ts +22 -0
- package/src/qmd.ts +60 -48
- package/src/recall-budget-config.test.ts +30 -0
- package/src/recall-cold-deadline.test.ts +149 -0
- package/src/recall-concurrency-config.ts +28 -0
- package/src/recall-memory-map.ts +74 -0
- package/src/recall-rerank-coordinator.test.ts +508 -0
- package/src/recall-state.test.ts +825 -1
- package/src/recall-state.ts +406 -7
- package/src/recall-timings-access.test.ts +41 -0
- package/src/recall-timings.ts +16 -0
- package/src/relay/mission-access.test.ts +5 -5
- package/src/rerank.ts +22 -0
- package/src/retrieval-agents.test.ts +79 -0
- package/src/retrieval-agents.ts +71 -19
- package/src/salvage-envelope.ts +28 -0
- package/src/scopes/scope-plan.test.ts +42 -0
- package/src/scopes/scope-plan.ts +45 -0
- package/src/search/port.ts +24 -0
- package/src/secure-store/index.ts +1 -0
- package/src/secure-store/secure-fs.ts +48 -0
- package/src/secure-store/secure-store.test.ts +40 -0
- package/src/semantic-rule-promotion.ts +13 -4
- package/src/storage/content-hash-index.ts +655 -0
- package/src/storage/entity-timeline.ts +473 -0
- package/src/storage/memory-lifecycle-ledger-access.ts +603 -0
- package/src/storage/secure-line-reader.test.ts +197 -0
- package/src/storage/secure-line-reader.ts +181 -3
- package/src/storage-append-header-sniff.test.ts +195 -0
- package/src/storage-behavior-signals-cache.test.ts +237 -0
- package/src/storage-contract/cache-coherence.test.ts +96 -1
- package/src/storage-contract/content-hash.test.ts +47 -2
- package/src/storage-fact-hash-index-defer.test.ts +1200 -0
- package/src/storage-memory-lifecycle-ledger.test.ts +1146 -3
- package/src/storage.ts +942 -903
- package/src/structured-attributes.ts +52 -0
- package/src/temporal-index-batch.ts +112 -0
- package/src/temporal-index.test.ts +193 -0
- package/src/temporal-index.ts +49 -53
- package/src/testing/lifecycle-matrix.test.ts +212 -0
- package/src/testing/lifecycle-matrix.ts +271 -0
- package/src/testing/orchestrator-lite.ts +236 -0
- package/src/testing/subjects/dreams-ledger.test.ts +67 -0
- package/src/testing/subjects/extraction-lifecycle.test.ts +442 -0
- package/src/testing/subjects/lifecycle-ledger.test.ts +93 -0
- package/src/testing/subjects/recall-budget.test.ts +461 -0
- package/src/testing/subjects/serialized-write-chain.test.ts +224 -0
- package/src/trust-score-stage.test.ts +154 -0
- package/src/trust-score-stage.ts +216 -53
- package/src/types-continuity.ts +57 -0
- package/src/types.ts +66 -77
- package/src/utils/path-containment.test.ts +75 -0
- package/src/utils/path-containment.ts +76 -0
- package/src/utils/serialize-mutations.test.ts +122 -0
- package/src/utils/serialize-mutations.ts +68 -3
- package/src/wearables/memory-gen.test.ts +31 -9
- package/src/wearables/memory-gen.ts +95 -55
- package/src/wearables/pipeline.test.ts +10 -7
- package/src/wearables/service.test.ts +6 -8
- package/src/wearables/service.ts +2 -2
- package/src/write-envelope.extension.test.ts +111 -0
- package/src/write-envelope.test.ts +683 -0
- package/src/write-envelope.ts +902 -0
- package/src/write-quarantine.test.ts +193 -0
- package/src/write-quarantine.ts +241 -0
- package/src/write-rate-limiter.test.ts +105 -0
- package/src/write-rate-limiter.ts +135 -0
- package/src/write-sealed-parity.test.ts +204 -0
- package/dist/chunk-2VN4JAX7.js.map +0 -1
- package/dist/chunk-37CTGERM.js.map +0 -1
- package/dist/chunk-7ICYQUOL.js.map +0 -1
- package/dist/chunk-AD6AMF2N.js.map +0 -1
- package/dist/chunk-AHLPZ2SF.js.map +0 -1
- package/dist/chunk-ASKEM4AR.js.map +0 -1
- package/dist/chunk-B3F4CWQR.js.map +0 -1
- package/dist/chunk-BCDKBDSY.js.map +0 -1
- package/dist/chunk-BFPETA3S.js.map +0 -1
- package/dist/chunk-BFVEEB7W.js.map +0 -1
- package/dist/chunk-E5BK6CGV.js +0 -335
- package/dist/chunk-E5BK6CGV.js.map +0 -1
- package/dist/chunk-EEARRVZ2.js.map +0 -1
- package/dist/chunk-F7AU34FC.js.map +0 -1
- package/dist/chunk-FBNWOMCE.js.map +0 -1
- package/dist/chunk-FTYDWKO6.js.map +0 -1
- package/dist/chunk-GMSDQUCR.js.map +0 -1
- package/dist/chunk-GWTFLF2P.js.map +0 -1
- package/dist/chunk-IFJ23BHU.js.map +0 -1
- package/dist/chunk-IKQTFQMI.js.map +0 -1
- package/dist/chunk-J2HSAU72.js.map +0 -1
- package/dist/chunk-JMBVCAR4.js.map +0 -1
- package/dist/chunk-KQDNAXOM.js.map +0 -1
- package/dist/chunk-KSBEEMQF.js.map +0 -1
- package/dist/chunk-KSNVDPDF.js.map +0 -1
- package/dist/chunk-LC7OODWZ.js.map +0 -1
- package/dist/chunk-LTJAMRGI.js.map +0 -1
- package/dist/chunk-ND5M64JJ.js.map +0 -1
- package/dist/chunk-NUWYOKS6.js.map +0 -1
- package/dist/chunk-NWTGD4AN.js.map +0 -1
- package/dist/chunk-OBMR4VIX.js.map +0 -1
- package/dist/chunk-ODPLEWB6.js.map +0 -1
- package/dist/chunk-PHK3HARR.js +0 -32
- package/dist/chunk-PHK3HARR.js.map +0 -1
- package/dist/chunk-RANHFI3P.js +0 -8
- package/dist/chunk-RANHFI3P.js.map +0 -1
- package/dist/chunk-RBQLJSJ7.js.map +0 -1
- package/dist/chunk-RULE4VG5.js.map +0 -1
- package/dist/chunk-SVOZFLIQ.js +0 -16
- package/dist/chunk-SVOZFLIQ.js.map +0 -1
- package/dist/chunk-TXLGHDHS.js.map +0 -1
- package/dist/chunk-UN3CH3CO.js +0 -118
- package/dist/chunk-UN3CH3CO.js.map +0 -1
- package/dist/chunk-VSMRDBFT.js +0 -17
- package/dist/chunk-VSMRDBFT.js.map +0 -1
- package/dist/chunk-WU46YPY6.js.map +0 -1
- package/dist/chunk-X47LWMKA.js.map +0 -1
- package/dist/chunk-X64YLC24.js.map +0 -1
- package/dist/chunk-XVLEGMJI.js.map +0 -1
- package/dist/chunk-YF6FMLBT.js.map +0 -1
- package/dist/resolution-VH4NGENZ.js +0 -12
- /package/dist/{capsule-crypto-CZJSLEFG.js.map → access-citation.js.map} +0 -0
- /package/dist/{contradiction-scan-J57T5QV7.js.map → access-memory-search-fanout.js.map} +0 -0
- /package/dist/{dreams-ledger-6UODQOX6.js.map → access-recall-concurrency.js.map} +0 -0
- /package/dist/{graph-edge-decay-FO7AM4UR.js.map → access-recall-response.js.map} +0 -0
- /package/dist/{resolution-VH4NGENZ.js.map → bounded-jsonl-state.js.map} +0 -0
- /package/dist/{capsule-merge-Z2HUO6IK.js.map → capsule-merge-5KKJQBWQ.js.map} +0 -0
- /package/dist/{chunk-A3GOMRJG.js.map → chunk-23L3IXFD.js.map} +0 -0
- /package/dist/{chunk-MRHFJV44.js.map → chunk-2DQ2XREU.js.map} +0 -0
- /package/dist/{chunk-L2B3EE7B.js.map → chunk-2QMKMVHH.js.map} +0 -0
- /package/dist/{chunk-6CALL5VN.js.map → chunk-2UFO7X4Q.js.map} +0 -0
- /package/dist/{chunk-2MR3MFQB.js.map → chunk-2VEOKUPP.js.map} +0 -0
- /package/dist/{chunk-RHOZ5LLO.js.map → chunk-347WD2LE.js.map} +0 -0
- /package/dist/{chunk-5S7Z5SHA.js.map → chunk-34RC5RT7.js.map} +0 -0
- /package/dist/{chunk-KGWXHWAH.js.map → chunk-3QAH2S33.js.map} +0 -0
- /package/dist/{chunk-ZIDSD6VC.js.map → chunk-3Y224NYC.js.map} +0 -0
- /package/dist/{chunk-VFSP73LP.js.map → chunk-45GF7Y3V.js.map} +0 -0
- /package/dist/{chunk-OEHCMALU.js.map → chunk-5I4M26Q7.js.map} +0 -0
- /package/dist/{chunk-2E6G7FCE.js.map → chunk-5Q7EVV4X.js.map} +0 -0
- /package/dist/{chunk-VZ5OJE4X.js.map → chunk-5VQJBH2G.js.map} +0 -0
- /package/dist/{chunk-PUBTHW5O.js.map → chunk-6DRPPQEJ.js.map} +0 -0
- /package/dist/{chunk-4LEF6XWJ.js.map → chunk-6O22TZSB.js.map} +0 -0
- /package/dist/{chunk-ZQ7UBUZ6.js.map → chunk-6QYST5XN.js.map} +0 -0
- /package/dist/{chunk-W4PGTAS2.js.map → chunk-6WAFYNVT.js.map} +0 -0
- /package/dist/{chunk-R5VAVVHP.js.map → chunk-72A4L5JJ.js.map} +0 -0
- /package/dist/{chunk-3FAMU5TX.js.map → chunk-A6USBZTO.js.map} +0 -0
- /package/dist/{chunk-TXVD7PLT.js.map → chunk-A72SWTWW.js.map} +0 -0
- /package/dist/{chunk-FC77VUX5.js.map → chunk-A7Q43EUZ.js.map} +0 -0
- /package/dist/{chunk-UJBESW6X.js.map → chunk-AE7WMV4V.js.map} +0 -0
- /package/dist/{chunk-OKUEZOGW.js.map → chunk-AITCS2RC.js.map} +0 -0
- /package/dist/{chunk-OC35KQIN.js.map → chunk-AJ7QCSIS.js.map} +0 -0
- /package/dist/{chunk-FNMFJWBY.js.map → chunk-ANEUPF6O.js.map} +0 -0
- /package/dist/{chunk-2A3OXAP2.js.map → chunk-B7RWBZXW.js.map} +0 -0
- /package/dist/{chunk-N3JDIRBW.js.map → chunk-BLAKS3CP.js.map} +0 -0
- /package/dist/{chunk-M7VGG3ID.js.map → chunk-BV5WMSIJ.js.map} +0 -0
- /package/dist/{chunk-2BFLDH5F.js.map → chunk-BXLOS5AJ.js.map} +0 -0
- /package/dist/{chunk-UXKMMNJD.js.map → chunk-C23BYTJV.js.map} +0 -0
- /package/dist/{chunk-JZHHREBL.js.map → chunk-C3AKM55W.js.map} +0 -0
- /package/dist/{chunk-RP7YXA67.js.map → chunk-C5JF6EZ7.js.map} +0 -0
- /package/dist/{chunk-DDGV7NAX.js.map → chunk-CQMEM5CC.js.map} +0 -0
- /package/dist/{chunk-A7B4RMQG.js.map → chunk-CXZQOVIE.js.map} +0 -0
- /package/dist/{chunk-7N2RUBAP.js.map → chunk-DDA47TES.js.map} +0 -0
- /package/dist/{chunk-64SE4X5G.js.map → chunk-DEBHXHJR.js.map} +0 -0
- /package/dist/{chunk-EHK6KZHK.js.map → chunk-DNHVPZOD.js.map} +0 -0
- /package/dist/{chunk-437S3G37.js.map → chunk-DQEMWVMT.js.map} +0 -0
- /package/dist/{chunk-LZZNTPLR.js.map → chunk-DX3XRGLH.js.map} +0 -0
- /package/dist/{chunk-7MW3CVLD.js.map → chunk-ES36HTSC.js.map} +0 -0
- /package/dist/{chunk-TN7THW5U.js.map → chunk-ET356KSB.js.map} +0 -0
- /package/dist/{chunk-YNDLCWXS.js.map → chunk-EZ25VE3G.js.map} +0 -0
- /package/dist/{chunk-7LFXDGLH.js.map → chunk-F7GAIWFA.js.map} +0 -0
- /package/dist/{chunk-IKSELOIV.js.map → chunk-FFPJINJE.js.map} +0 -0
- /package/dist/{chunk-V53GJUSL.js.map → chunk-FUTF72MJ.js.map} +0 -0
- /package/dist/{chunk-5UNWK7KU.js.map → chunk-GFPZS3F5.js.map} +0 -0
- /package/dist/{chunk-G6NKALRN.js.map → chunk-H4WG3UQZ.js.map} +0 -0
- /package/dist/{chunk-HLTAPHZZ.js.map → chunk-HNZKVLAN.js.map} +0 -0
- /package/dist/{chunk-5EZXHU36.js.map → chunk-HYQJQGD3.js.map} +0 -0
- /package/dist/{chunk-TRWPCR6P.js.map → chunk-JECBQBEX.js.map} +0 -0
- /package/dist/{chunk-HG32URJJ.js.map → chunk-JYIFGGEM.js.map} +0 -0
- /package/dist/{chunk-VA4WSW54.js.map → chunk-JYIJNNN3.js.map} +0 -0
- /package/dist/{chunk-L5HJQC36.js.map → chunk-K2TDK7GG.js.map} +0 -0
- /package/dist/{chunk-MKDRQAA3.js.map → chunk-KAVBJSBQ.js.map} +0 -0
- /package/dist/{chunk-4OKLXWDZ.js.map → chunk-KNB7IBBU.js.map} +0 -0
- /package/dist/{chunk-QLULYKWZ.js.map → chunk-KSXJOC4F.js.map} +0 -0
- /package/dist/{chunk-JI5AVXYO.js.map → chunk-LEPOP46W.js.map} +0 -0
- /package/dist/{chunk-O7BBFJLP.js.map → chunk-LTAVSOZW.js.map} +0 -0
- /package/dist/{chunk-2IZAGAJR.js.map → chunk-LULR4IUW.js.map} +0 -0
- /package/dist/{chunk-WMWVO45V.js.map → chunk-MC6XO7T4.js.map} +0 -0
- /package/dist/{chunk-D6RIFG4O.js.map → chunk-MNB5RMAY.js.map} +0 -0
- /package/dist/{chunk-67ZCJLJY.js.map → chunk-MYFQ3ED4.js.map} +0 -0
- /package/dist/{chunk-V3UE5I5F.js.map → chunk-MYVPLJOO.js.map} +0 -0
- /package/dist/{chunk-MTWKDOVO.js.map → chunk-NLE6TSLG.js.map} +0 -0
- /package/dist/{chunk-DBRYEIGY.js.map → chunk-OJP3N7UK.js.map} +0 -0
- /package/dist/{chunk-SMX5267P.js.map → chunk-OZKOPQCM.js.map} +0 -0
- /package/dist/{chunk-JCK7V6SN.js.map → chunk-P65YJEEL.js.map} +0 -0
- /package/dist/{chunk-MTR7BZQN.js.map → chunk-PBGWYM3H.js.map} +0 -0
- /package/dist/{chunk-AXTXN4T6.js.map → chunk-PWFCHOB3.js.map} +0 -0
- /package/dist/{chunk-FDPZVY6D.js.map → chunk-QFN4U7AG.js.map} +0 -0
- /package/dist/{chunk-K2ZLHESQ.js.map → chunk-QIEUU4UK.js.map} +0 -0
- /package/dist/{chunk-3D6AFGQR.js.map → chunk-QVT3E4CE.js.map} +0 -0
- /package/dist/{chunk-SFQ6QNL7.js.map → chunk-R6YJI3HE.js.map} +0 -0
- /package/dist/{chunk-5CJVLG3H.js.map → chunk-RFDD3B7W.js.map} +0 -0
- /package/dist/{chunk-JBPKEARU.js.map → chunk-RKNJBZ55.js.map} +0 -0
- /package/dist/{chunk-UTRJFDP2.js.map → chunk-S2BBISHU.js.map} +0 -0
- /package/dist/{chunk-IALLX7EE.js.map → chunk-S2FSBU4H.js.map} +0 -0
- /package/dist/{chunk-7K5Q6COX.js.map → chunk-TVVEYCNW.js.map} +0 -0
- /package/dist/{chunk-PK5XBDA6.js.map → chunk-U3ZAVRP3.js.map} +0 -0
- /package/dist/{chunk-4KJLYTLS.js.map → chunk-V57NLO5P.js.map} +0 -0
- /package/dist/{chunk-FLVL4L3L.js.map → chunk-VDX2J7OX.js.map} +0 -0
- /package/dist/{chunk-7XGSIUP5.js.map → chunk-W4FBGYGK.js.map} +0 -0
- /package/dist/{chunk-6SXVCD7W.js.map → chunk-W7IGLX4G.js.map} +0 -0
- /package/dist/{chunk-KAWTOYAW.js.map → chunk-WLZYGLJ4.js.map} +0 -0
- /package/dist/{chunk-W5NKDU24.js.map → chunk-WON4APQY.js.map} +0 -0
- /package/dist/{chunk-NKCPUHCI.js.map → chunk-WZFAPHIK.js.map} +0 -0
- /package/dist/{chunk-KQPJLK3X.js.map → chunk-XL24QQ63.js.map} +0 -0
- /package/dist/{chunk-4B4MUS5D.js.map → chunk-YROFNEG5.js.map} +0 -0
- /package/dist/{chunk-VRAD2FGO.js.map → chunk-Z54EM5YZ.js.map} +0 -0
- /package/dist/{first-start-migration-TI67YMLG.js.map → first-start-migration-CSRHCJIQ.js.map} +0 -0
- /package/dist/{forget-CQCLB5LB.js.map → forget-HRPLVB3W.js.map} +0 -0
- /package/dist/{purge-NDWV6WYD.js.map → purge-IRF47ZTX.js.map} +0 -0
- /package/dist/{tier-stats-KV7IWCJR.js.map → tier-stats-QEJSPFV2.js.map} +0 -0
package/src/config.ts
CHANGED
|
@@ -35,14 +35,24 @@ import { expandTildePath } from "./utils/path.js";
|
|
|
35
35
|
// boolean-coercion logic that connectors/index.ts already exports. The helper
|
|
36
36
|
// lives in connectors/coerce.ts (a tiny, dependency-free module) so neither
|
|
37
37
|
// config.ts → connectors/index.ts nor the reverse circular import arises.
|
|
38
|
-
import { coerceBool, coerceInstallExtension, coerceNumber } from "./connectors/coerce.js";
|
|
38
|
+
import { coerceBool, coerceBooleanLike, coerceInstallExtension, coerceNumber } from "./connectors/coerce.js";
|
|
39
|
+
import { parseRecallConcurrencyConfig } from "./recall-concurrency-config.js";
|
|
39
40
|
import { hasLegacyConnectorEntries } from "./connectors/paths.js";
|
|
41
|
+
import {
|
|
42
|
+
parseQmdChunkStrategy,
|
|
43
|
+
parseQmdDaemonTimeoutMs,
|
|
44
|
+
parseQmdGpuBackend,
|
|
45
|
+
parseQmdSearchStrategy,
|
|
46
|
+
parseQmdSubprocessStrategy,
|
|
47
|
+
parseQmdSupportedVersion,
|
|
48
|
+
} from "./config-qmd.js";
|
|
40
49
|
import {
|
|
41
50
|
resolveEmitLegacyTools,
|
|
42
51
|
resolveNamespaceCatalogEnabled,
|
|
43
52
|
} from "./emit-legacy-tools.js";
|
|
44
53
|
import { parseWearablesConfig } from "./wearables/config.js";
|
|
45
54
|
import { parseProvenanceConfig } from "./provenance.js";
|
|
55
|
+
import { parseBoundedJsonlStateConfig } from "./bounded-jsonl-state.js";
|
|
46
56
|
import { parseCodingKnowledgeConfig } from "./coding/coding-knowledge-config.js";
|
|
47
57
|
import { parseChatConfig } from "./chat/chat-config.js";
|
|
48
58
|
import { parseCorrectionIntentConfig, parseFaithfulnessGateConfig } from "./faithfulness-config.js";
|
|
@@ -188,92 +198,35 @@ function parseBoundedPositiveInteger(
|
|
|
188
198
|
return Math.max(min, Math.min(max, parsed));
|
|
189
199
|
}
|
|
190
200
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
if (value === undefined
|
|
207
|
-
|
|
208
|
-
if (typeof value !== "string") {
|
|
209
|
-
throw new Error(`qmdGpuBackend must be one of "auto", "metal", "cuda", "vulkan", or false; got ${JSON.stringify(value)}`);
|
|
210
|
-
}
|
|
211
|
-
const normalized = value.trim().toLowerCase();
|
|
201
|
+
/**
|
|
202
|
+
* Validate a closed-range integer config knob, coercing CLI numeric strings
|
|
203
|
+
* first (issue #1909 review round 8). `undefined`/`null` → `fallback`. Anything
|
|
204
|
+
* provided must coerce to a FINITE INTEGER in `[min, max]`; otherwise THROW
|
|
205
|
+
* (AGENTS.md #1/#39: reject invalid user input, never silently floor/clamp).
|
|
206
|
+
*/
|
|
207
|
+
function parseIntegerInClosedRange(
|
|
208
|
+
value: unknown,
|
|
209
|
+
min: number,
|
|
210
|
+
max: number,
|
|
211
|
+
fallback: number,
|
|
212
|
+
keyName: string,
|
|
213
|
+
): number {
|
|
214
|
+
// Only an absent key (undefined) falls back to the default; an explicit `null`
|
|
215
|
+
// is invalid input and proceeds to validation → throw (round 9 finding 1).
|
|
216
|
+
if (value === undefined) return fallback;
|
|
217
|
+
const coerced = coerceNumber(value);
|
|
212
218
|
if (
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
219
|
+
coerced === undefined ||
|
|
220
|
+
!Number.isFinite(coerced) ||
|
|
221
|
+
!Number.isInteger(coerced) ||
|
|
222
|
+
coerced < min ||
|
|
223
|
+
coerced > max
|
|
218
224
|
) {
|
|
219
|
-
return normalized;
|
|
220
|
-
}
|
|
221
|
-
throw new Error(`qmdGpuBackend must be one of "auto", "metal", "cuda", "vulkan", or false; got ${JSON.stringify(value)}`);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
function parseQmdChunkStrategy(value: unknown): "auto" | "regex" {
|
|
225
|
-
if (value === undefined || value === null) return "auto";
|
|
226
|
-
if (typeof value !== "string") {
|
|
227
|
-
throw new Error(`qmdChunkStrategy must be "auto" or "regex"; got ${JSON.stringify(value)}`);
|
|
228
|
-
}
|
|
229
|
-
const normalized = value.trim().toLowerCase();
|
|
230
|
-
if (normalized === "auto" || normalized === "regex") return normalized;
|
|
231
|
-
throw new Error(`qmdChunkStrategy must be "auto" or "regex"; got ${JSON.stringify(value)}`);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// Issue #1335. Default "hybrid" preserves the historical lex+vec+hyde daemon plan.
|
|
235
|
-
function parseQmdSearchStrategy(value: unknown): "hybrid" | "lex-vec" | "lex" {
|
|
236
|
-
if (value === undefined || value === null) return "hybrid";
|
|
237
|
-
if (typeof value !== "string") {
|
|
238
|
-
throw new Error(
|
|
239
|
-
`qmdSearchStrategy must be one of "hybrid", "lex-vec", or "lex"; got ${JSON.stringify(value)}`,
|
|
240
|
-
);
|
|
241
|
-
}
|
|
242
|
-
const normalized = value.trim().toLowerCase();
|
|
243
|
-
if (normalized === "hybrid" || normalized === "lex-vec" || normalized === "lex") {
|
|
244
|
-
return normalized;
|
|
245
|
-
}
|
|
246
|
-
throw new Error(
|
|
247
|
-
`qmdSearchStrategy must be one of "hybrid", "lex-vec", or "lex"; got ${JSON.stringify(value)}`,
|
|
248
|
-
);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// Issue #1335. Reject non-numeric / non-integer timeouts rather than silently
|
|
252
|
-
// coercing them (gotcha #51), then clamp valid integers to the documented bounds.
|
|
253
|
-
function parseQmdDaemonTimeoutMs(value: unknown): number {
|
|
254
|
-
if (value === undefined || value === null) return 8_000;
|
|
255
|
-
const coerced = coerceNumber(value);
|
|
256
|
-
if (coerced === undefined || !Number.isInteger(coerced)) {
|
|
257
225
|
throw new Error(
|
|
258
|
-
|
|
226
|
+
`${keyName} must be an integer in [${min}, ${max}]; got ${JSON.stringify(value)}`,
|
|
259
227
|
);
|
|
260
228
|
}
|
|
261
|
-
return
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
// Issue #1335. Default "query" keeps `qmd query` (LLM expansion + rerank) per gotcha #7.
|
|
265
|
-
function parseQmdSubprocessStrategy(value: unknown): "query" | "search" {
|
|
266
|
-
if (value === undefined || value === null) return "query";
|
|
267
|
-
if (typeof value !== "string") {
|
|
268
|
-
throw new Error(
|
|
269
|
-
`qmdSubprocessStrategy must be one of "query" or "search"; got ${JSON.stringify(value)}`,
|
|
270
|
-
);
|
|
271
|
-
}
|
|
272
|
-
const normalized = value.trim().toLowerCase();
|
|
273
|
-
if (normalized === "query" || normalized === "search") return normalized;
|
|
274
|
-
throw new Error(
|
|
275
|
-
`qmdSubprocessStrategy must be one of "query" or "search"; got ${JSON.stringify(value)}`,
|
|
276
|
-
);
|
|
229
|
+
return coerced;
|
|
277
230
|
}
|
|
278
231
|
|
|
279
232
|
function parseOptionalNonEmptyString(value: unknown): string | undefined {
|
|
@@ -343,30 +296,6 @@ function parsePortNumber(
|
|
|
343
296
|
return coerced;
|
|
344
297
|
}
|
|
345
298
|
|
|
346
|
-
// Coerce common string/number representations of a boolean to a real boolean.
|
|
347
|
-
// Returns `undefined` when the value cannot be interpreted, so callers can
|
|
348
|
-
// fall back to their own default. Guards against the "string `false` is
|
|
349
|
-
// truthy" footgun (CLAUDE.md gotcha #36) when config values arrive from
|
|
350
|
-
// CLI/env/JSON sources where booleans are sometimes string-typed.
|
|
351
|
-
function coerceBooleanLike(value: unknown): boolean | undefined {
|
|
352
|
-
if (typeof value === "boolean") return value;
|
|
353
|
-
if (typeof value === "number") {
|
|
354
|
-
if (value === 1) return true;
|
|
355
|
-
if (value === 0) return false;
|
|
356
|
-
return undefined;
|
|
357
|
-
}
|
|
358
|
-
if (typeof value === "string") {
|
|
359
|
-
const normalized = value.trim().toLowerCase();
|
|
360
|
-
if (normalized === "true" || normalized === "1" || normalized === "yes" || normalized === "on") {
|
|
361
|
-
return true;
|
|
362
|
-
}
|
|
363
|
-
if (normalized === "false" || normalized === "0" || normalized === "no" || normalized === "off") {
|
|
364
|
-
return false;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
return undefined;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
299
|
function readNestedConfig(
|
|
371
300
|
cfg: Record<string, unknown>,
|
|
372
301
|
blockName: string,
|
|
@@ -658,6 +587,7 @@ const DEFAULT_BEHAVIOR_LOOP_PROTECTED_PARAMS = [
|
|
|
658
587
|
"maxMemoryTokens",
|
|
659
588
|
"qmdMaxResults",
|
|
660
589
|
"qmdColdMaxResults",
|
|
590
|
+
"qmdEmbeddingBacklogThreshold",
|
|
661
591
|
"recallPlannerMaxQmdResultsMinimal",
|
|
662
592
|
"verbatimArtifactsMaxRecall",
|
|
663
593
|
];
|
|
@@ -1683,6 +1613,15 @@ export function parseConfig(
|
|
|
1683
1613
|
: "openclaw-engram",
|
|
1684
1614
|
qmdMaxResults:
|
|
1685
1615
|
typeof cfg.qmdMaxResults === "number" ? cfg.qmdMaxResults : 8,
|
|
1616
|
+
qmdEmbeddingBacklogThreshold: (() => {
|
|
1617
|
+
const raw = cfg.qmdEmbeddingBacklogThreshold;
|
|
1618
|
+
const n = typeof raw === "number"
|
|
1619
|
+
? raw
|
|
1620
|
+
: typeof raw === "string" && raw.trim() !== ""
|
|
1621
|
+
? Number(raw)
|
|
1622
|
+
: NaN;
|
|
1623
|
+
return Number.isFinite(n) && Number.isInteger(n) && n >= 0 ? n : 1000;
|
|
1624
|
+
})(),
|
|
1686
1625
|
qmdColdTierEnabled: cfg.qmdColdTierEnabled === true,
|
|
1687
1626
|
qmdColdCollection:
|
|
1688
1627
|
typeof cfg.qmdColdCollection === "string" && cfg.qmdColdCollection.length > 0
|
|
@@ -1780,6 +1719,16 @@ export function parseConfig(
|
|
|
1780
1719
|
typeof cfg.sessionObserverDebounceMs === "number"
|
|
1781
1720
|
? Math.max(0, Math.floor(cfg.sessionObserverDebounceMs))
|
|
1782
1721
|
: 120_000,
|
|
1722
|
+
// Explicit validation (issue #1909 review round 8): reject invalid input
|
|
1723
|
+
// rather than flooring/clamping. Must be an integer in [0, 2^31-1] (Node's
|
|
1724
|
+
// setTimeout ceiling); 0 = save every turn; undefined → 3000.
|
|
1725
|
+
bufferSaveDebounceMs: parseIntegerInClosedRange(
|
|
1726
|
+
cfg.bufferSaveDebounceMs,
|
|
1727
|
+
0,
|
|
1728
|
+
2_147_483_647,
|
|
1729
|
+
3_000,
|
|
1730
|
+
"bufferSaveDebounceMs",
|
|
1731
|
+
),
|
|
1783
1732
|
sessionObserverBands,
|
|
1784
1733
|
injectQuestions: cfg.injectQuestions === true,
|
|
1785
1734
|
commitmentDecayDays: parseIntegerAtLeast(
|
|
@@ -2061,10 +2010,8 @@ export function parseConfig(
|
|
|
2061
2010
|
(v): v is string => typeof v === "string" && v.length > 0,
|
|
2062
2011
|
)
|
|
2063
2012
|
: ["decisions", "principles", "conventions", "runbooks", "entities"],
|
|
2064
|
-
// Cross-namespace query-budget limiter (issue #565 PR 4/5).
|
|
2065
|
-
//
|
|
2066
|
-
// unaffected. When enabled, the read path throttles a principal that
|
|
2067
|
-
// issues a burst of recalls against namespaces other than their own.
|
|
2013
|
+
// Cross-namespace query-budget limiter (issue #565 PR 4/5). Defaults to
|
|
2014
|
+
// false — ships disabled; when enabled, throttles cross-namespace recall bursts.
|
|
2068
2015
|
recallCrossNamespaceBudgetEnabled:
|
|
2069
2016
|
coerceBool(cfg.recallCrossNamespaceBudgetEnabled) ?? false,
|
|
2070
2017
|
recallCrossNamespaceBudgetWindowMs: (() => {
|
|
@@ -2079,6 +2026,7 @@ export function parseConfig(
|
|
|
2079
2026
|
const n = coerceNumber(cfg.recallCrossNamespaceBudgetHardLimit);
|
|
2080
2027
|
return n !== undefined && n > 0 ? Math.floor(n) : 30;
|
|
2081
2028
|
})(),
|
|
2029
|
+
...parseRecallConcurrencyConfig(cfg),
|
|
2082
2030
|
// Recall-audit anomaly detector (issue #565 PR 5/5). Defaults off so
|
|
2083
2031
|
// existing deployments are unaffected; enable explicitly to let the
|
|
2084
2032
|
// access surfaces flag suspicious query patterns derived from the
|
|
@@ -2126,10 +2074,23 @@ export function parseConfig(
|
|
|
2126
2074
|
// opt out with recallMemoryWorthFilterEnabled=false.
|
|
2127
2075
|
recallMemoryWorthFilterEnabled:
|
|
2128
2076
|
coerceBool(cfg.recallMemoryWorthFilterEnabled) ?? true,
|
|
2077
|
+
// Trust/Memory-Worth recall stage corpus-level fallback (issue #1905).
|
|
2078
|
+
// Default true: when a candidate is missing from the frontmatter already
|
|
2079
|
+
// loaded on the hot recall path, the stage may fall back to a per-namespace
|
|
2080
|
+
// corpus counter/signal map (version-keyed, so it hits in steady state).
|
|
2081
|
+
// Set false to disable that O(corpus) fallback entirely — the stage then
|
|
2082
|
+
// uses only the preloaded frontmatter plus a bounded-parallel per-candidate
|
|
2083
|
+
// direct read (fully O(candidates)). coerceBool handles "false"/"0" forms.
|
|
2084
|
+
recallTrustStageCorpusFallbackEnabled:
|
|
2085
|
+
coerceBool(cfg.recallTrustStageCorpusFallbackEnabled) ?? true,
|
|
2129
2086
|
// Hot-memories result cache (issue #1902). Default on: readAllMemories()
|
|
2130
2087
|
// serves from the version-keyed in-process corpus cache. coerceBool
|
|
2131
2088
|
// handles "false"/"0" string forms; set false to force disk scans.
|
|
2132
2089
|
hotMemoriesCacheEnabled: coerceBool(cfg.hotMemoriesCacheEnabled) ?? true,
|
|
2090
|
+
// Scope-aware cache invalidation (issue #1904). Default on: a plain fact
|
|
2091
|
+
// create no longer nukes the QMD/entity caches it can't affect. coerceBool
|
|
2092
|
+
// handles "false"/"0" string forms; set false to restore full-clear-per-write.
|
|
2093
|
+
scopedCacheInvalidationEnabled: coerceBool(cfg.scopedCacheInvalidationEnabled) ?? true,
|
|
2133
2094
|
// External-edit safety net (issue #1902): the version sentinel gives
|
|
2134
2095
|
// immediate coherence for cooperating writers, but direct user/git/editor
|
|
2135
2096
|
// writes to memory files (which the project supports) don't bump it. Bound
|
|
@@ -2270,15 +2231,31 @@ export function parseConfig(
|
|
|
2270
2231
|
? cfg.activeRecallPromptStyle
|
|
2271
2232
|
: "balanced",
|
|
2272
2233
|
activeRecallCustomInstruction: (() => {
|
|
2273
|
-
const
|
|
2234
|
+
const raw =
|
|
2274
2235
|
typeof cfg.activeRecallCustomInstruction === "string"
|
|
2275
2236
|
? cfg.activeRecallCustomInstruction
|
|
2276
2237
|
: typeof cfg[LEGACY_ACTIVE_RECALL_CUSTOM_FIELD] === "string"
|
|
2277
2238
|
? cfg[LEGACY_ACTIVE_RECALL_CUSTOM_FIELD]
|
|
2278
2239
|
: "";
|
|
2279
|
-
return
|
|
2280
|
-
|
|
2281
|
-
|
|
2240
|
+
return raw.trim().length > 0 ? raw.trim() : null;
|
|
2241
|
+
})(),
|
|
2242
|
+
activeRecallPromptReplacement: (() => {
|
|
2243
|
+
const raw = cfg.activeRecallPromptReplacement;
|
|
2244
|
+
if (raw !== undefined && raw !== null && typeof raw !== "string") {
|
|
2245
|
+
throw new Error(
|
|
2246
|
+
`activeRecallPromptReplacement must be a string; got ${JSON.stringify(raw)}`,
|
|
2247
|
+
);
|
|
2248
|
+
}
|
|
2249
|
+
return typeof raw === "string" && raw.trim().length > 0 ? raw.trim() : null;
|
|
2250
|
+
})(),
|
|
2251
|
+
activeRecallPromptOverride: (() => {
|
|
2252
|
+
const raw = cfg.activeRecallPromptOverride;
|
|
2253
|
+
if (raw !== undefined && raw !== null && typeof raw !== "string") {
|
|
2254
|
+
throw new Error(
|
|
2255
|
+
`activeRecallPromptOverride must be a string; got ${JSON.stringify(raw)}`,
|
|
2256
|
+
);
|
|
2257
|
+
}
|
|
2258
|
+
return typeof raw === "string" && raw.trim().length > 0 ? raw.trim() : null;
|
|
2282
2259
|
})(),
|
|
2283
2260
|
activeRecallPromptAppend:
|
|
2284
2261
|
typeof cfg.activeRecallPromptAppend === "string" &&
|
|
@@ -3127,6 +3104,7 @@ export function parseConfig(
|
|
|
3127
3104
|
typeof cfg.entityRetrievalRecentTurns === "number" ? cfg.entityRetrievalRecentTurns : 6,
|
|
3128
3105
|
entitySchemas,
|
|
3129
3106
|
recallBudgetChars: recallPipelineConfig.recallBudgetChars,
|
|
3107
|
+
recallProfileMaxRatio: parseRecallProfileMaxRatio(cfg.recallProfileMaxRatio),
|
|
3130
3108
|
recallOuterTimeoutMs:
|
|
3131
3109
|
typeof cfg.recallOuterTimeoutMs === "number" ? Math.max(0, Math.floor(cfg.recallOuterTimeoutMs)) : 75_000,
|
|
3132
3110
|
recallCoreDeadlineMs:
|
|
@@ -3301,6 +3279,17 @@ export function parseConfig(
|
|
|
3301
3279
|
typeof cfg.proactiveExtractionTimeoutMs === "number"
|
|
3302
3280
|
? Math.max(0, Math.floor(cfg.proactiveExtractionTimeoutMs))
|
|
3303
3281
|
: 2500,
|
|
3282
|
+
proactiveExtractionSkipWhenLocalLlmBusy: ((): boolean => {
|
|
3283
|
+
const raw = cfg.proactiveExtractionSkipWhenLocalLlmBusy;
|
|
3284
|
+
if (raw === undefined || raw === null) return true;
|
|
3285
|
+
const value = coerceBooleanLike(raw, "proactiveExtractionSkipWhenLocalLlmBusy");
|
|
3286
|
+
if (value === undefined) {
|
|
3287
|
+
throw new Error(
|
|
3288
|
+
`proactiveExtractionSkipWhenLocalLlmBusy must be boolean-like (true|false|1|0|yes|no|on|off); got ${JSON.stringify(raw)}`,
|
|
3289
|
+
);
|
|
3290
|
+
}
|
|
3291
|
+
return value;
|
|
3292
|
+
})(),
|
|
3304
3293
|
proactiveExtractionMaxTokens:
|
|
3305
3294
|
typeof cfg.proactiveExtractionMaxTokens === "number"
|
|
3306
3295
|
? Math.max(0, Math.floor(cfg.proactiveExtractionMaxTokens))
|
|
@@ -3531,6 +3520,11 @@ export function parseConfig(
|
|
|
3531
3520
|
memoryReconstructionMaxExpansions:
|
|
3532
3521
|
typeof cfg.memoryReconstructionMaxExpansions === "number" ? Math.max(0, Math.round(cfg.memoryReconstructionMaxExpansions)) : 3,
|
|
3533
3522
|
graphLateralInhibitionEnabled: cfg.graphLateralInhibitionEnabled !== false,
|
|
3523
|
+
// Incremental GraphIndex edge cache (issue #1904). Default on: single-writer
|
|
3524
|
+
// edge appends are pushed into the warm cache in place (size-revalidated for
|
|
3525
|
+
// cross-process coherence) instead of nulling + re-reading the 6 MB edge
|
|
3526
|
+
// file. coerceBool handles string forms; set false to null the cache per write.
|
|
3527
|
+
graphEdgeCacheIncrementalEnabled: coerceBool(cfg.graphEdgeCacheIncrementalEnabled) ?? true,
|
|
3534
3528
|
graphLateralInhibitionBeta:
|
|
3535
3529
|
typeof cfg.graphLateralInhibitionBeta === "number"
|
|
3536
3530
|
? Math.max(0, Math.min(1, cfg.graphLateralInhibitionBeta))
|
|
@@ -3563,10 +3557,9 @@ export function parseConfig(
|
|
|
3563
3557
|
Number.isFinite(cfg.graphEdgeDecayVisibilityThreshold)
|
|
3564
3558
|
? Math.max(0, Math.min(1, cfg.graphEdgeDecayVisibilityThreshold))
|
|
3565
3559
|
: 0.2,
|
|
3566
|
-
|
|
3567
|
-
// Floor clamps to [0,
|
|
3568
|
-
//
|
|
3569
|
-
// documented 0 disables PageRank refinement and BFS scores pass through.
|
|
3560
|
+
...parseBoundedJsonlStateConfig(cfg, parseIntegerAtLeast),
|
|
3561
|
+
// Issue #681 PR 3/3 — confidence-aware traversal. Floor clamps to [0,1]; a
|
|
3562
|
+
// documented 0 iterations disables PageRank refinement (BFS scores pass through).
|
|
3570
3563
|
graphTraversalConfidenceFloor:
|
|
3571
3564
|
typeof cfg.graphTraversalConfidenceFloor === "number" &&
|
|
3572
3565
|
Number.isFinite(cfg.graphTraversalConfidenceFloor)
|
|
@@ -4127,6 +4120,17 @@ function clampNonNegativeNumber(value: unknown): number | undefined {
|
|
|
4127
4120
|
return Math.max(0, Math.floor(value));
|
|
4128
4121
|
}
|
|
4129
4122
|
|
|
4123
|
+
function parseRecallProfileMaxRatio(value: unknown): number {
|
|
4124
|
+
if (value === undefined) return 0.3;
|
|
4125
|
+
const ratio = coerceNumber(value);
|
|
4126
|
+
if (ratio === undefined || ratio < 0 || ratio > 1) {
|
|
4127
|
+
throw new Error(
|
|
4128
|
+
`recallProfileMaxRatio must be a finite number in [0, 1]; got ${JSON.stringify(value)}`,
|
|
4129
|
+
);
|
|
4130
|
+
}
|
|
4131
|
+
return ratio;
|
|
4132
|
+
}
|
|
4133
|
+
|
|
4130
4134
|
/**
|
|
4131
4135
|
* Cursor L on PR #736: numeric config keys must accept BOTH numbers
|
|
4132
4136
|
* and CLI-string forms (`--config peerProfileReasonerMinInteractions=10`
|
|
@@ -295,9 +295,9 @@ test("runExtraction: mixed tagged+untagged turns → persistExtraction receives
|
|
|
295
295
|
validAt?: string;
|
|
296
296
|
sourceConnector?: string;
|
|
297
297
|
}
|
|
298
|
-
): Promise<string[]> => {
|
|
298
|
+
): Promise<{ persistedIds: string[]; memoryPathById: Map<string, string> }> => {
|
|
299
299
|
spy(sourceContext);
|
|
300
|
-
return ["fact-1"];
|
|
300
|
+
return { persistedIds: ["fact-1"], memoryPathById: new Map() };
|
|
301
301
|
},
|
|
302
302
|
maybeCapturePassiveCorrections: async () => {},
|
|
303
303
|
resolveSelfNamespace: () => "default",
|
|
@@ -397,9 +397,9 @@ test("runExtraction: context-only turns without sourceConnector do not affect at
|
|
|
397
397
|
validAt?: string;
|
|
398
398
|
sourceConnector?: string;
|
|
399
399
|
}
|
|
400
|
-
): Promise<string[]> => {
|
|
400
|
+
): Promise<{ persistedIds: string[]; memoryPathById: Map<string, string> }> => {
|
|
401
401
|
capturedConnector = sourceContext?.sourceConnector;
|
|
402
|
-
return ["fact-1"];
|
|
402
|
+
return { persistedIds: ["fact-1"], memoryPathById: new Map() };
|
|
403
403
|
},
|
|
404
404
|
maybeCapturePassiveCorrections: async () => {},
|
|
405
405
|
resolveSelfNamespace: () => "default",
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { strict as assert } from "node:assert";
|
|
2
|
+
import { afterEach, beforeEach, test } from "node:test";
|
|
3
|
+
|
|
4
|
+
import { coerceBool, coerceNumber } from "./coerce.js";
|
|
5
|
+
import { initLogger, resetLogger } from "../logger.js";
|
|
6
|
+
|
|
7
|
+
let warnings: string[];
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
warnings = [];
|
|
11
|
+
initLogger(
|
|
12
|
+
{
|
|
13
|
+
info() {},
|
|
14
|
+
warn(msg: string) {
|
|
15
|
+
warnings.push(msg);
|
|
16
|
+
},
|
|
17
|
+
error() {},
|
|
18
|
+
debug() {},
|
|
19
|
+
},
|
|
20
|
+
false,
|
|
21
|
+
{ timestamps: false },
|
|
22
|
+
);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
afterEach(() => {
|
|
26
|
+
// Restore the no-op backend so later suites do not inherit this capture sink.
|
|
27
|
+
initLogger({ info() {}, warn() {}, error() {}, debug() {} });
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test("coerceBool recognizes canonical true/false spellings without warning", () => {
|
|
31
|
+
for (const t of ["true", "1", "yes", "on", "TRUE", " On "]) {
|
|
32
|
+
assert.equal(coerceBool(t), true, `${t} → true`);
|
|
33
|
+
}
|
|
34
|
+
for (const f of ["false", "0", "no", "off", "FALSE", " Off "]) {
|
|
35
|
+
assert.equal(coerceBool(f), false, `${f} → false`);
|
|
36
|
+
}
|
|
37
|
+
assert.equal(coerceBool(true), true);
|
|
38
|
+
assert.equal(coerceBool(false), false);
|
|
39
|
+
assert.deepEqual(warnings, [], "recognized values must not warn");
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test("coerceBool returns undefined silently for absent values", () => {
|
|
43
|
+
assert.equal(coerceBool(undefined), undefined);
|
|
44
|
+
assert.equal(coerceBool(null), undefined);
|
|
45
|
+
assert.equal(coerceBool(""), undefined);
|
|
46
|
+
assert.equal(coerceBool(" "), undefined);
|
|
47
|
+
assert.deepEqual(warnings, [], "absent/empty must be treated as 'use default', no warning");
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test("coerceBool warns on a present-but-unrecognized string and returns undefined", () => {
|
|
51
|
+
assert.equal(coerceBool("disabled"), undefined);
|
|
52
|
+
assert.equal(warnings.length, 1);
|
|
53
|
+
assert.match(warnings[0], /unrecognized boolean value "disabled"/);
|
|
54
|
+
assert.match(warnings[0], /using default/);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test("coerceBool includes the label in the warning when provided", () => {
|
|
58
|
+
assert.equal(coerceBool("fales", "qmdForceCpu"), undefined);
|
|
59
|
+
assert.equal(warnings.length, 1);
|
|
60
|
+
assert.match(warnings[0], /for qmdForceCpu/);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test("coerceBool does not warn on inherited Object keys (prototype safety)", () => {
|
|
64
|
+
assert.equal(coerceBool("constructor"), undefined);
|
|
65
|
+
assert.equal(coerceBool("toString"), undefined);
|
|
66
|
+
assert.equal(coerceBool("hasOwnProperty"), undefined);
|
|
67
|
+
// These are unrecognized strings, so each warns exactly once — never matched
|
|
68
|
+
// as a truthy/falsy token via the prototype chain.
|
|
69
|
+
assert.equal(warnings.length, 3);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
test("coerceBool returns undefined without warning for non-string, non-boolean inputs", () => {
|
|
73
|
+
assert.equal(coerceBool(2), undefined);
|
|
74
|
+
assert.equal(coerceBool({}), undefined);
|
|
75
|
+
assert.equal(coerceBool([]), undefined);
|
|
76
|
+
assert.deepEqual(warnings, []);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
test("coerceNumber accepts finite numbers and numeric strings without warning", () => {
|
|
80
|
+
assert.equal(coerceNumber(5), 5);
|
|
81
|
+
assert.equal(coerceNumber(0), 0);
|
|
82
|
+
assert.equal(coerceNumber(-3.5), -3.5);
|
|
83
|
+
assert.equal(coerceNumber("42"), 42);
|
|
84
|
+
assert.equal(coerceNumber(" 7 "), 7);
|
|
85
|
+
assert.deepEqual(warnings, []);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
test("coerceNumber returns undefined silently for absent inputs", () => {
|
|
89
|
+
assert.equal(coerceNumber(undefined), undefined);
|
|
90
|
+
assert.equal(coerceNumber(null), undefined);
|
|
91
|
+
assert.equal(coerceNumber(""), undefined);
|
|
92
|
+
assert.equal(coerceNumber(" "), undefined);
|
|
93
|
+
assert.deepEqual(warnings, [], "absent numeric inputs do not warn");
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
test("coerceNumber warns on present non-finite number inputs and returns undefined", () => {
|
|
97
|
+
assert.equal(coerceNumber(Number.NaN), undefined);
|
|
98
|
+
assert.equal(coerceNumber(Number.POSITIVE_INFINITY), undefined);
|
|
99
|
+
assert.equal(coerceNumber(Number.NEGATIVE_INFINITY, "ttlMs"), undefined);
|
|
100
|
+
assert.equal(warnings.length, 3);
|
|
101
|
+
assert.match(warnings[0], /non-finite numeric value/);
|
|
102
|
+
assert.match(warnings[2], /for ttlMs/);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
test("coerceNumber warns on a present-but-unparseable string and returns undefined", () => {
|
|
106
|
+
assert.equal(coerceNumber("abc"), undefined);
|
|
107
|
+
assert.equal(coerceNumber("NaN"), undefined);
|
|
108
|
+
assert.equal(coerceNumber("Infinity"), undefined);
|
|
109
|
+
assert.equal(coerceNumber("12px", "maxResults"), undefined);
|
|
110
|
+
assert.equal(warnings.length, 4);
|
|
111
|
+
assert.match(warnings[0], /unrecognized numeric value "abc"/);
|
|
112
|
+
assert.match(warnings[3], /for maxResults/);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
test("warns via console when no logger backend is installed (standalone-core path)", () => {
|
|
116
|
+
resetLogger();
|
|
117
|
+
const originalWarn = console.warn;
|
|
118
|
+
const captured: string[] = [];
|
|
119
|
+
console.warn = (msg?: unknown) => {
|
|
120
|
+
captured.push(String(msg));
|
|
121
|
+
};
|
|
122
|
+
try {
|
|
123
|
+
assert.equal(coerceBool("disabled"), undefined);
|
|
124
|
+
assert.equal(coerceNumber("abc"), undefined);
|
|
125
|
+
} finally {
|
|
126
|
+
console.warn = originalWarn;
|
|
127
|
+
}
|
|
128
|
+
assert.equal(captured.length, 2);
|
|
129
|
+
assert.match(captured[0], /^remnic: ignoring unrecognized boolean value "disabled"/);
|
|
130
|
+
assert.match(captured[1], /^remnic: ignoring unrecognized numeric value "abc"/);
|
|
131
|
+
});
|
package/src/connectors/coerce.ts
CHANGED
|
@@ -5,6 +5,28 @@
|
|
|
5
5
|
* connectors/index.ts can import them without creating a circular dependency.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { isLoggerInitialized, log } from "../logger.js";
|
|
9
|
+
|
|
10
|
+
const BOOL_TOKENS: Record<string, boolean> = {
|
|
11
|
+
true: true, "1": true, yes: true, on: true,
|
|
12
|
+
false: false, "0": false, no: false, off: false,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Surface a "present but unrecognized config value" diagnostic. Routes through
|
|
17
|
+
* the installed logger when a host has called `initLogger`, and otherwise falls
|
|
18
|
+
* back to `console.warn` so the standalone `@remnic/core` path (documented to
|
|
19
|
+
* call `parseConfig()` without a logger) does not silently discard the warning
|
|
20
|
+
* and re-introduce the fail-open default this whole change exists to prevent.
|
|
21
|
+
*/
|
|
22
|
+
export function warnUnrecognizedConfig(message: string): void {
|
|
23
|
+
if (isLoggerInitialized()) {
|
|
24
|
+
log.warn(message);
|
|
25
|
+
} else {
|
|
26
|
+
console.warn(`remnic: ${message}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
8
30
|
/**
|
|
9
31
|
* Generic boolean coercion: converts string representations of booleans
|
|
10
32
|
* (e.g. from CLI `--config someFlag=false`) to proper boolean values.
|
|
@@ -13,15 +35,28 @@
|
|
|
13
35
|
* Returns `undefined` when the value is neither a boolean nor a recognised
|
|
14
36
|
* string, so callers can fall back to a default.
|
|
15
37
|
*
|
|
38
|
+
* A value that is PRESENT but unrecognised (a non-empty string like `"disabled"`
|
|
39
|
+
* or a typo like `"fales"`) is logged at warn level before returning `undefined`,
|
|
40
|
+
* so an operator typo does not silently take the caller's default — which is
|
|
41
|
+
* frequently a fail-open `?? true`. Absent values (`undefined`/`null`/empty
|
|
42
|
+
* string) fall through silently: absence legitimately means "use the default".
|
|
43
|
+
* Pass `label` (the config key) to make the warning actionable.
|
|
44
|
+
*
|
|
16
45
|
* CLAUDE.md gotcha #36: String "false" is truthy in JavaScript.
|
|
17
46
|
* CLAUDE.md gotcha #28: Coerce CLI values to expected types at input boundaries.
|
|
47
|
+
* CLAUDE.md gotcha #51: Reject/flag present-but-unrecognized values; don't
|
|
48
|
+
* silently default them.
|
|
18
49
|
*/
|
|
19
|
-
export function coerceBool(value: unknown): boolean | undefined {
|
|
50
|
+
export function coerceBool(value: unknown, label?: string): boolean | undefined {
|
|
20
51
|
if (typeof value === "boolean") return value;
|
|
21
52
|
if (typeof value === "string") {
|
|
22
53
|
const v = value.trim().toLowerCase();
|
|
23
|
-
if (
|
|
24
|
-
if (
|
|
54
|
+
if (v === "") return undefined;
|
|
55
|
+
if (Object.hasOwn(BOOL_TOKENS, v)) return BOOL_TOKENS[v];
|
|
56
|
+
warnUnrecognizedConfig(
|
|
57
|
+
`ignoring unrecognized boolean value ${JSON.stringify(value)}${label ? ` for ${label}` : ""}; ` +
|
|
58
|
+
`expected true|false|1|0|yes|no|on|off — using default`,
|
|
59
|
+
);
|
|
25
60
|
}
|
|
26
61
|
return undefined;
|
|
27
62
|
}
|
|
@@ -33,7 +68,7 @@ export function coerceBool(value: unknown): boolean | undefined {
|
|
|
33
68
|
* Delegates to the generic `coerceBool` helper. Kept for backward compatibility.
|
|
34
69
|
*/
|
|
35
70
|
export function coerceInstallExtension(value: unknown): boolean | undefined {
|
|
36
|
-
return coerceBool(value);
|
|
71
|
+
return coerceBool(value, "installExtension");
|
|
37
72
|
}
|
|
38
73
|
|
|
39
74
|
/**
|
|
@@ -46,17 +81,55 @@ export function coerceInstallExtension(value: unknown): boolean | undefined {
|
|
|
46
81
|
* - string: trimmed, parsed with `Number()`. Returns `undefined` on
|
|
47
82
|
* empty, NaN, or Infinity.
|
|
48
83
|
*
|
|
84
|
+
* A PRESENT but unparseable string (a non-empty value that is not a finite
|
|
85
|
+
* number) is logged at warn level before returning `undefined`, for the same
|
|
86
|
+
* reason as `coerceBool`: a typo must not silently take the caller's default.
|
|
87
|
+
* Absent values (`undefined`/`null`/empty string) fall through silently.
|
|
88
|
+
* Pass `label` (the config key) to make the warning actionable.
|
|
89
|
+
*
|
|
49
90
|
* CLAUDE.md gotcha #28: Coerce CLI values to expected types at input boundaries.
|
|
91
|
+
* CLAUDE.md gotcha #51: Flag present-but-unrecognized values.
|
|
50
92
|
*/
|
|
51
|
-
export function coerceNumber(value: unknown): number | undefined {
|
|
93
|
+
export function coerceNumber(value: unknown, label?: string): number | undefined {
|
|
52
94
|
if (typeof value === "number") {
|
|
53
|
-
|
|
95
|
+
if (Number.isFinite(value)) return value;
|
|
96
|
+
warnUnrecognizedConfig(
|
|
97
|
+
`ignoring non-finite numeric value ${JSON.stringify(value)}${label ? ` for ${label}` : ""}; ` +
|
|
98
|
+
`expected a finite number — using default`,
|
|
99
|
+
);
|
|
100
|
+
return undefined;
|
|
54
101
|
}
|
|
55
102
|
if (typeof value === "string") {
|
|
56
103
|
const trimmed = value.trim();
|
|
57
104
|
if (trimmed.length === 0) return undefined;
|
|
58
105
|
const n = Number(trimmed);
|
|
59
|
-
|
|
106
|
+
if (Number.isFinite(n)) return n;
|
|
107
|
+
warnUnrecognizedConfig(
|
|
108
|
+
`ignoring unrecognized numeric value ${JSON.stringify(value)}${label ? ` for ${label}` : ""}; ` +
|
|
109
|
+
`expected a finite number — using default`,
|
|
110
|
+
);
|
|
60
111
|
}
|
|
61
112
|
return undefined;
|
|
62
113
|
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Config-layer boolean coercion. Adds numeric 1/0 handling on top of the
|
|
117
|
+
* canonical `coerceBool` because config values can arrive as JSON numbers,
|
|
118
|
+
* which `coerceBool` intentionally does not accept. Any other present-but-
|
|
119
|
+
* unrecognized value (string typo or out-of-range number) warns and returns
|
|
120
|
+
* `undefined` so a caller's fail-open `?? true` default is not taken silently.
|
|
121
|
+
*
|
|
122
|
+
* CLAUDE.md gotcha #36: string "false" is truthy in JavaScript.
|
|
123
|
+
*/
|
|
124
|
+
export function coerceBooleanLike(value: unknown, label?: string): boolean | undefined {
|
|
125
|
+
if (typeof value === "number") {
|
|
126
|
+
if (value === 1) return true;
|
|
127
|
+
if (value === 0) return false;
|
|
128
|
+
warnUnrecognizedConfig(
|
|
129
|
+
`ignoring unrecognized boolean value ${JSON.stringify(value)}${label ? ` for ${label}` : ""}; ` +
|
|
130
|
+
`expected true|false|1|0|yes|no|on|off — using default`,
|
|
131
|
+
);
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
return coerceBool(value, label);
|
|
135
|
+
}
|