@remnic/core 9.7.15 → 9.9.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 +85 -71
- package/dist/access-audit.js +2 -2
- package/dist/access-boundary.d.ts +35 -17
- package/dist/access-boundary.js +86 -74
- package/dist/access-citation.d.ts +28 -0
- package/dist/access-citation.js +9 -0
- package/dist/access-cli.js +194 -178
- 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 +100 -87
- package/dist/access-identity-continuity-surface.d.ts +13 -8
- package/dist/access-identity-continuity-surface.js +85 -71
- package/dist/access-lcm-surface.d.ts +16 -9
- package/dist/access-lcm-surface.js +85 -71
- package/dist/access-mcp.d.ts +23 -16
- package/dist/access-mcp.js +96 -84
- 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 +85 -71
- package/dist/access-operations-batch.js +92 -80
- package/dist/access-operations.d.ts +29 -22
- package/dist/access-operations.js +94 -82
- 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 +85 -71
- package/dist/access-schema.d.ts +98 -98
- package/dist/access-schema.js +8 -6
- package/dist/{access-service-DpcYZ9Nl.d.ts → access-service-DbZ1G3zV.d.ts} +29 -36
- package/dist/access-service.d.ts +13 -6
- package/dist/access-service.js +89 -72
- 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 +34 -24
- 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/{catalog-C9444P10.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 +43 -34
- 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-L2B3EE7B.js → chunk-2QMKMVHH.js} +2 -2
- package/dist/{chunk-VJVNLNDQ.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-HDTQVNWD.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-LRNMRXJO.js → chunk-3Y224NYC.js} +3 -3
- package/dist/{chunk-3IY64MV6.js → chunk-44XZ75OQ.js} +44 -10
- package/dist/chunk-44XZ75OQ.js.map +1 -0
- package/dist/{chunk-VFSP73LP.js → chunk-45GF7Y3V.js} +2 -2
- package/dist/{chunk-K7LOWSLU.js → chunk-4BJQODZF.js} +2479 -1520
- package/dist/chunk-4BJQODZF.js.map +1 -0
- package/dist/{chunk-JREB6UFH.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-2AZXIZEN.js → chunk-5Q7EVV4X.js} +6 -6
- package/dist/{chunk-LC7OODWZ.js → chunk-5SB7SC2G.js} +80 -49
- package/dist/chunk-5SB7SC2G.js.map +1 -0
- 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-FDCTQWLW.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-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-ZHIVCODT.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-A5UXZRRM.js → chunk-AJ7QCSIS.js} +2 -2
- 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-QKQYXZVS.js → chunk-BI2OJF6J.js} +1819 -1481
- package/dist/chunk-BI2OJF6J.js.map +1 -0
- package/dist/{chunk-GWTFLF2P.js → chunk-BJMBJZ2Y.js} +59 -59
- package/dist/chunk-BJMBJZ2Y.js.map +1 -0
- package/dist/{chunk-74F5STS4.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-T7Y5KPLN.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-EHCONI6E.js → chunk-CQMEM5CC.js} +2 -2
- package/dist/{chunk-PBNZVPFS.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-INELTPRG.js → chunk-EEC7UJPX.js} +103 -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-DZKHSDOM.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-DMSDUGDM.js → chunk-F7GAIWFA.js} +20 -20
- package/dist/{chunk-G6XXLKC5.js → chunk-FFPJINJE.js} +6 -6
- 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-G4CN3ZXL.js → chunk-FUTF72MJ.js} +15 -15
- package/dist/chunk-GCASGYIO.js +71 -0
- package/dist/chunk-GCASGYIO.js.map +1 -0
- package/dist/{chunk-HF77M34J.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-UDQUSU27.js → chunk-HNZKVLAN.js} +2 -2
- package/dist/{chunk-5EZXHU36.js → chunk-HYQJQGD3.js} +2 -2
- package/dist/{chunk-PLQE6MJA.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-TRWPCR6P.js → chunk-JECBQBEX.js} +3 -3
- package/dist/{chunk-E6CBU7XP.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-KDXVOFYY.js → chunk-KAVBJSBQ.js} +4 -4
- package/dist/{chunk-BS4SGLWV.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-2S6QHZGJ.js → chunk-L2DPF4DF.js} +1 -1
- 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-QQGPUKMT.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-Q5WG43OP.js → chunk-MYFQ3ED4.js} +7 -7
- 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-OAZVR2BV.js → chunk-OGCAYLNA.js} +8 -6
- package/dist/{chunk-OAZVR2BV.js.map → chunk-OGCAYLNA.js.map} +1 -1
- package/dist/{chunk-DBRYEIGY.js → chunk-OJP3N7UK.js} +2 -2
- package/dist/{chunk-VDW4VU7B.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-PJSK6OJM.js +201 -0
- package/dist/chunk-PJSK6OJM.js.map +1 -0
- package/dist/{chunk-OVJ2HIPE.js → chunk-PMUD7ERF.js} +158 -125
- package/dist/chunk-PMUD7ERF.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-DYP3YYJJ.js → chunk-QJAQNXWI.js} +39 -5
- package/dist/chunk-QJAQNXWI.js.map +1 -0
- package/dist/{chunk-3D6AFGQR.js → chunk-QVT3E4CE.js} +7 -7
- package/dist/{chunk-FIJUY7GG.js → chunk-R26ZMXR2.js} +23 -23
- package/dist/{chunk-FIJUY7GG.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-FNZQGN76.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-SK7AMF2J.js +168 -0
- package/dist/chunk-SK7AMF2J.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-DPAENM7O.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-AJLLIIML.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-RO4LQGT3.js → chunk-WON4APQY.js} +4 -4
- package/dist/{chunk-PQVK2S3J.js → chunk-WZFAPHIK.js} +6 -6
- package/dist/{chunk-KQPJLK3X.js → chunk-XL24QQ63.js} +2 -2
- package/dist/{chunk-LZOV7MX7.js → chunk-XQDRKZ7V.js} +6476 -5747
- package/dist/chunk-XQDRKZ7V.js.map +1 -0
- package/dist/{chunk-RVZRYUQH.js → chunk-YROFNEG5.js} +7 -7
- package/dist/{chunk-RAR2BSEM.js → chunk-YV32N67O.js} +1 -1
- package/dist/chunk-YV32N67O.js.map +1 -0
- package/dist/{chunk-PBSAPHHA.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/{chunk-DCFV7A7H.js → chunk-ZVAYK7GU.js} +101 -91
- package/dist/chunk-ZVAYK7GU.js.map +1 -0
- package/dist/{cli-Cd5fMmhq.d.ts → cli-5tNLVTvJ.d.ts} +28 -12
- package/dist/cli.d.ts +16 -9
- package/dist/cli.js +142 -127
- package/dist/compounding/engine.d.ts +5 -2
- package/dist/compounding/engine.js +36 -26
- 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 +36 -26
- 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 +41 -32
- package/dist/consolidation-provenance-check.d.ts +5 -2
- package/dist/consolidation-undo.d.ts +5 -2
- 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 +35 -26
- 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-IOGBBAGC.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 +3 -1
- 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 +473 -464
- package/dist/index.js +287 -239
- 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 +35 -25
- 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 +37 -25
- package/dist/maintenance/rebuild-memory-projection.js +38 -28
- 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 +3 -1
- 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 +51 -42
- 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 +24 -20
- package/dist/namespaces/storage.d.ts +24 -3
- package/dist/namespaces/storage.js +35 -27
- 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 +69 -54
- 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 +44 -31
- package/dist/{orchestrator-Bp_jeBHK.d.ts → orchestrator-CQJ8U7En.d.ts} +85 -79
- package/dist/orchestrator.d.ts +13 -8
- package/dist/orchestrator.js +194 -177
- package/dist/patterns-cli.d.ts +3 -1
- package/dist/{pipeline-BAj5bx7g.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-_MDSlj1m.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 +7 -3
- 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 +98 -98
- 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 +18 -16
- package/dist/search/index.d.ts +3 -1
- package/dist/search/index.js +22 -20
- 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 +16 -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-C2m5eHHE.d.ts → semantic-consolidation-DILZEQq3.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +4 -2
- package/dist/semantic-consolidation.js +38 -29
- package/dist/semantic-rule-promotion.js +34 -24
- package/dist/semantic-rule-verifier.d.ts +3 -1
- package/dist/semantic-rule-verifier.js +35 -25
- 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 +11 -9
- package/dist/shared-context/manager.js +3 -3
- package/dist/signal.d.ts +3 -1
- package/dist/{storage-hr_Y2z5R.d.ts → storage-NIyKYD8g.d.ts} +489 -110
- package/dist/storage-guards.js +2 -2
- package/dist/storage.d.ts +6 -3
- package/dist/storage.js +38 -26
- 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 +3 -3
- package/dist/transfer/types.d.ts +90 -90
- 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-Cg8q7W7_.d.ts → types-D_fG2ix8.d.ts} +39 -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 +36 -26
- 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 +94 -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 +172 -0
- package/src/access-observe-write-surface.ts +137 -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 +186 -179
- 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 +113 -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/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-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 +43 -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 +574 -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 +168 -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 +160 -149
- 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.ts +47 -47
- 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 +13 -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 +882 -890
- 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 +51 -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 +245 -0
- package/src/write-quarantine.ts +290 -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-3IY64MV6.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-BS4SGLWV.js.map +0 -1
- package/dist/chunk-DCFV7A7H.js.map +0 -1
- package/dist/chunk-DYP3YYJJ.js.map +0 -1
- package/dist/chunk-E5BK6CGV.js +0 -335
- package/dist/chunk-E5BK6CGV.js.map +0 -1
- package/dist/chunk-FTYDWKO6.js.map +0 -1
- package/dist/chunk-GWTFLF2P.js.map +0 -1
- package/dist/chunk-IKQTFQMI.js.map +0 -1
- package/dist/chunk-INELTPRG.js.map +0 -1
- package/dist/chunk-J2HSAU72.js.map +0 -1
- package/dist/chunk-JREB6UFH.js.map +0 -1
- package/dist/chunk-K7LOWSLU.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-LZOV7MX7.js.map +0 -1
- package/dist/chunk-NWTGD4AN.js.map +0 -1
- package/dist/chunk-ODPLEWB6.js.map +0 -1
- package/dist/chunk-OVJ2HIPE.js.map +0 -1
- package/dist/chunk-PBSAPHHA.js.map +0 -1
- package/dist/chunk-PHK3HARR.js +0 -32
- package/dist/chunk-PHK3HARR.js.map +0 -1
- package/dist/chunk-PLQE6MJA.js.map +0 -1
- package/dist/chunk-QKQYXZVS.js.map +0 -1
- package/dist/chunk-QQGPUKMT.js.map +0 -1
- package/dist/chunk-RANHFI3P.js +0 -8
- package/dist/chunk-RANHFI3P.js.map +0 -1
- package/dist/chunk-RAR2BSEM.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-T7Y5KPLN.js.map +0 -1
- package/dist/chunk-TXLGHDHS.js.map +0 -1
- package/dist/chunk-VDW4VU7B.js.map +0 -1
- package/dist/chunk-VSMRDBFT.js +0 -17
- package/dist/chunk-VSMRDBFT.js.map +0 -1
- package/dist/chunk-X64YLC24.js.map +0 -1
- package/dist/chunk-XDSXEKYK.js +0 -118
- package/dist/chunk-XDSXEKYK.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-IOGBBAGC.js.map → access-recall-response.js.map} +0 -0
- /package/dist/{resolution-VH4NGENZ.js.map → bounded-jsonl-state.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-VJVNLNDQ.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-HDTQVNWD.js.map → chunk-3QAH2S33.js.map} +0 -0
- /package/dist/{chunk-LRNMRXJO.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-2AZXIZEN.js.map → chunk-5Q7EVV4X.js.map} +0 -0
- /package/dist/{chunk-PUBTHW5O.js.map → chunk-6DRPPQEJ.js.map} +0 -0
- /package/dist/{chunk-FDCTQWLW.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-ZHIVCODT.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-A5UXZRRM.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-74F5STS4.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-EHCONI6E.js.map → chunk-CQMEM5CC.js.map} +0 -0
- /package/dist/{chunk-PBNZVPFS.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-DZKHSDOM.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-DMSDUGDM.js.map → chunk-F7GAIWFA.js.map} +0 -0
- /package/dist/{chunk-G6XXLKC5.js.map → chunk-FFPJINJE.js.map} +0 -0
- /package/dist/{chunk-G4CN3ZXL.js.map → chunk-FUTF72MJ.js.map} +0 -0
- /package/dist/{chunk-HF77M34J.js.map → chunk-GFPZS3F5.js.map} +0 -0
- /package/dist/{chunk-G6NKALRN.js.map → chunk-H4WG3UQZ.js.map} +0 -0
- /package/dist/{chunk-UDQUSU27.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-E6CBU7XP.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-KDXVOFYY.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-2S6QHZGJ.js.map → chunk-L2DPF4DF.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-Q5WG43OP.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-FNZQGN76.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-DPAENM7O.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-AJLLIIML.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-RO4LQGT3.js.map → chunk-WON4APQY.js.map} +0 -0
- /package/dist/{chunk-PQVK2S3J.js.map → chunk-WZFAPHIK.js.map} +0 -0
- /package/dist/{chunk-KQPJLK3X.js.map → chunk-XL24QQ63.js.map} +0 -0
- /package/dist/{chunk-RVZRYUQH.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
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import { M as MemoryFile, P as PluginConfig,
|
|
1
|
+
import { au as EntityTimelineEntry, ag as EntityStructuredSection, E as EntityFile, M as MemoryFile, P as PluginConfig, x as MemoryStatus, w as MemoryCategory, ah as ImportanceScore, av as MemoryLink, o as MemoryFrontmatter, F as FaithfulnessFrontmatter, U as ProvenanceSource, aw as BufferState, ax as MetaState, ab as MemoryActionEvent, z as MemoryLifecycleEvent, a0 as BufferSurpriseEvent, $ as BehaviorSignalEvent, ac as CompressionGuidelineOptimizerState, ay as FileHygieneConfig, az as EntityRelationship, aA as EntityActivityEntry, aB as AccessTrackingEntry, y as MemoryProjectionCurrentState, aC as MemorySummary, as as TopicScore } from './types-D_fG2ix8.js';
|
|
2
2
|
import { VersioningConfig } from './page-versioning.js';
|
|
3
3
|
import { ConsolidationOperator } from './consolidation-operator.js';
|
|
4
4
|
import { ProjectedMemoryBrowseOptions, ProjectedMemoryBrowsePage, readProjectedGovernanceRecord } from './memory-projection-store.js';
|
|
5
|
+
import { SealedMemoryEnvelope } from './write-envelope.js';
|
|
5
6
|
import './structured-attributes.js';
|
|
7
|
+
import { ContinuityIncidentOpenInput, ContinuityIncidentRecord, ContinuityIncidentCloseInput, ContinuityImprovementLoop, ContinuityLoopUpsertInput, ContinuityLoopReviewInput } from './types-continuity.js';
|
|
8
|
+
|
|
9
|
+
/** Result of a pre-snapshot lifecycle drain (#2033): `folded` is true when spill
|
|
10
|
+
* rows were committed to the active ledger; `pendingDeferred` is true when
|
|
11
|
+
* durable spill rows STILL remain in the offline-sync-EXCLUDED pending queue
|
|
12
|
+
* after the attempt (the ledger lock was held by a peer, or a spill could not
|
|
13
|
+
* be claimed). A caller MUST NOT report a clean snapshot while `pendingDeferred`
|
|
14
|
+
* is true — those append-only rows would be silently omitted. */
|
|
15
|
+
interface DrainPendingLifecycleForSyncResult {
|
|
16
|
+
folded: boolean;
|
|
17
|
+
pendingDeferred: boolean;
|
|
18
|
+
}
|
|
6
19
|
|
|
7
20
|
/**
|
|
8
21
|
* Wearable cross-source fusion — shared types (issue #1810).
|
|
@@ -623,38 +636,32 @@ interface RetiredMemoryRecord {
|
|
|
623
636
|
contentHash?: string;
|
|
624
637
|
}
|
|
625
638
|
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
+
/**
|
|
640
|
+
* Tuning for {@link ContentHashIndex} cross-process lock waits and the
|
|
641
|
+
* deferred reconcile-save durable retry (issue #1909 / PR #2016). All optional;
|
|
642
|
+
* production uses the module defaults. Tests inject small values so the
|
|
643
|
+
* lock-timeout + retry path is exercised deterministically without real
|
|
644
|
+
* multi-second waits.
|
|
645
|
+
*/
|
|
646
|
+
interface ContentHashIndexLockOptions {
|
|
647
|
+
/** Bounded wait to acquire the per-file advisory lock; passed to `withHeldFileLock` (default 5000ms). */
|
|
648
|
+
readonly maxWaitMs?: number;
|
|
649
|
+
/** Poll interval while waiting for a busy lock (default 50ms). */
|
|
650
|
+
readonly pollMs?: number;
|
|
651
|
+
/** Base backoff before the first deferred-save retry (default 500ms). */
|
|
652
|
+
readonly retryBaseMs?: number;
|
|
653
|
+
/** Max deferred-save retries before falling back to the corpus-rebuild safety net (default 5). */
|
|
654
|
+
readonly retryMaxAttempts?: number;
|
|
639
655
|
}
|
|
640
|
-
declare function parseFrontmatterStringValue(rawValue: string | undefined): string | undefined;
|
|
641
|
-
declare function parseFrontmatter(raw: string): {
|
|
642
|
-
frontmatter: MemoryFrontmatter;
|
|
643
|
-
content: string;
|
|
644
|
-
} | null;
|
|
645
|
-
declare function normalizeFrontmatterForPath(frontmatter: MemoryFrontmatter, pathRel: string, content?: string): MemoryFrontmatter;
|
|
646
656
|
/**
|
|
647
|
-
*
|
|
648
|
-
*
|
|
649
|
-
*
|
|
650
|
-
*
|
|
651
|
-
* Checks caller-provided user aliases first, then built-in aliases. Alias
|
|
652
|
-
* tables are instance state on StorageManager (issue #1534) — use
|
|
653
|
-
* `storageManager.normalizeEntityName(raw, type)` when normalizing within a
|
|
654
|
-
* store, or pass `storageManager.entityAliases` explicitly. Without an
|
|
655
|
-
* aliases argument only the built-in structural aliases apply.
|
|
657
|
+
* Thrown when the fact-hash index cannot be made authoritative — the
|
|
658
|
+
* cross-process rebuild lock could not be acquired within the bounded retry
|
|
659
|
+
* budget (PR #2016). Callers that require an authoritative dedup answer surface
|
|
660
|
+
* this instead of silently trusting a stale loaded snapshot.
|
|
656
661
|
*/
|
|
657
|
-
declare
|
|
662
|
+
declare class FactHashIndexNotAuthoritativeError extends Error {
|
|
663
|
+
constructor(stateDir: string);
|
|
664
|
+
}
|
|
658
665
|
/**
|
|
659
666
|
* Content-hash dedup index for facts.
|
|
660
667
|
* Normalizes content (lowercase, strip punctuation, collapse whitespace),
|
|
@@ -664,13 +671,66 @@ declare function normalizeEntityName(raw: string, type: string, aliases?: Readon
|
|
|
664
671
|
declare class ContentHashIndex {
|
|
665
672
|
private hashes;
|
|
666
673
|
private dirty;
|
|
674
|
+
/**
|
|
675
|
+
* Hashes explicitly removed since the last successful save (issue #1909 review
|
|
676
|
+
* round 8 thread 3). Tracked separately so `saveMergingWithDisk` can be
|
|
677
|
+
* removal-AWARE: under the file lock it reads the latest on-disk set, DROPS
|
|
678
|
+
* these, then unions our additions — so a removal batch cannot resurrect a
|
|
679
|
+
* hash (union alone would) and cannot clobber a concurrent extraction's
|
|
680
|
+
* appended hash (blind overwrite would). Consumed + cleared by every save.
|
|
681
|
+
*/
|
|
682
|
+
private removed;
|
|
683
|
+
/**
|
|
684
|
+
* Hashes added by THIS instance since the last successful save (issue #1909
|
|
685
|
+
* review round 9 finding 3). Tracked separately from the loaded snapshot so a
|
|
686
|
+
* reconciling save publishes `(on-disk \ removed) ∪ added` — it re-applies only
|
|
687
|
+
* OUR additions, never the stale loaded entries. Without this, seeding the
|
|
688
|
+
* merge from `this.hashes` (loaded ∪ added) would resurrect a hash a peer
|
|
689
|
+
* removed on disk while this instance held a stale snapshot.
|
|
690
|
+
*/
|
|
691
|
+
private added;
|
|
667
692
|
private readonly filePath;
|
|
668
693
|
private readonly secureStoreKeyProvider;
|
|
669
694
|
private readonly secureStoreWriteKeyProvider;
|
|
670
695
|
private readonly memoryDir;
|
|
671
|
-
|
|
696
|
+
private readonly lockOptions;
|
|
697
|
+
/**
|
|
698
|
+
* Deferred reconcile-save durable-retry state (issue #1909 / PR #2016). At
|
|
699
|
+
* most ONE retry is ever armed (`reconcileRetryTimer` is the reentrancy guard)
|
|
700
|
+
* so successive timed-out saves cannot stack duplicate/parallel retries.
|
|
701
|
+
* `reconcileRetryBarrier` resolves when the chain settles (published or gave
|
|
702
|
+
* up) — awaited by tests and any caller wanting the eventual result.
|
|
703
|
+
*/
|
|
704
|
+
private reconcileRetryTimer;
|
|
705
|
+
private reconcileRetryAttempts;
|
|
706
|
+
private reconcileRetryBarrier;
|
|
707
|
+
private reconcileRetryResolve;
|
|
708
|
+
/**
|
|
709
|
+
* On-disk fingerprint (mtime + byte size) of `fact-hashes.txt` captured at the
|
|
710
|
+
* last point THIS instance's in-memory set matched disk — after `load()`,
|
|
711
|
+
* `save()`, or a reconcile publish (PR #2016 review). A peer process that
|
|
712
|
+
* advances the durable index changes this fingerprint;
|
|
713
|
+
* {@link isDiskFingerprintCurrent} compares a single cheap `stat` against it so
|
|
714
|
+
* a stale-but-"authoritative" snapshot is detected without an O(file-size)
|
|
715
|
+
* re-read on the hot path.
|
|
716
|
+
*/
|
|
717
|
+
private lastSyncedFingerprint;
|
|
718
|
+
constructor(stateDir: string, secureStoreKeyProvider?: () => Buffer | null, secureStoreWriteKeyProvider?: () => Buffer | null, memoryDir?: string, lockOptions?: ContentHashIndexLockOptions);
|
|
672
719
|
/** Load existing hashes from disk. Safe to call multiple times. */
|
|
673
720
|
load(): Promise<void>;
|
|
721
|
+
/** Cheap `stat` of the durable index file; null when it does not exist yet. */
|
|
722
|
+
private statIndexFile;
|
|
723
|
+
/** Record the current on-disk fingerprint as this instance's synced baseline. */
|
|
724
|
+
private captureSyncedFingerprint;
|
|
725
|
+
/**
|
|
726
|
+
* True when the durable index file is unchanged since this instance last
|
|
727
|
+
* synced it (load / save / reconcile). False when a peer advanced it, when the
|
|
728
|
+
* file appeared or vanished, or when freshness cannot be established (stat
|
|
729
|
+
* error) — the caller then treats the in-memory snapshot as non-authoritative
|
|
730
|
+
* and confirms a dedup miss against the durable corpus (PR #2016 review). One
|
|
731
|
+
* `stat`, never an O(file-size) read, so the hot path stays cheap.
|
|
732
|
+
*/
|
|
733
|
+
isDiskFingerprintCurrent(): Promise<boolean>;
|
|
674
734
|
/** Check if content already exists in the index. */
|
|
675
735
|
has(content: string): boolean;
|
|
676
736
|
/** Add content hash to the index. */
|
|
@@ -678,8 +738,99 @@ declare class ContentHashIndex {
|
|
|
678
738
|
get size(): number;
|
|
679
739
|
/** Clear all loaded hashes so the next save rewrites the index from scratch. */
|
|
680
740
|
clear(): void;
|
|
681
|
-
/** Persist index to disk if changed. */
|
|
741
|
+
/** Persist index to disk if changed (plain whole-file overwrite). */
|
|
682
742
|
save(): Promise<void>;
|
|
743
|
+
/**
|
|
744
|
+
* Persist the index by RECONCILING with the latest on-disk state under a
|
|
745
|
+
* cross-process lock (issue #1909). Used by the extraction-persist batch save
|
|
746
|
+
* for BOTH append and removal batches, so appends and removals to the same
|
|
747
|
+
* index serialize against each other:
|
|
748
|
+
* final = (on-disk \ this.removed) ∪ this.added
|
|
749
|
+
* Note it re-applies only OUR local additions (`added`), NOT the loaded
|
|
750
|
+
* snapshot (review round 9 finding 3): seeding from `this.hashes` would
|
|
751
|
+
* resurrect a hash a peer removed on disk while we held a stale snapshot. This
|
|
752
|
+
* preserves a concurrent writer's appended hashes (a blind overwrite would
|
|
753
|
+
* drop them), never resurrects a removed hash, and never loses our additions.
|
|
754
|
+
*
|
|
755
|
+
* Hardening:
|
|
756
|
+
* - Dirty short-circuit (round 7 finding 3): when this instance neither added
|
|
757
|
+
* nor removed anything this run, skip the O(file) read+rewrite entirely.
|
|
758
|
+
* - Cross-process lock (round 7 finding 2): serialize the read→reconcile→write
|
|
759
|
+
* window on a per-file advisory lock. If the lock is NOT acquired (timeout),
|
|
760
|
+
* do NOT publish (round 9 finding 2): keep `dirty` set AND schedule a bounded
|
|
761
|
+
* durable background retry (PR #2016) that keeps re-attempting the locked
|
|
762
|
+
* publish until the deferred additions land — never an unlocked write that
|
|
763
|
+
* could clobber a peer, and never a silent "batch save complete" that leaves
|
|
764
|
+
* the addition in this process's memory only.
|
|
765
|
+
*/
|
|
766
|
+
saveMergingWithDisk(): Promise<void>;
|
|
767
|
+
/**
|
|
768
|
+
* Rebuild-and-publish the index from an authoritative source (the durable
|
|
769
|
+
* corpus) under the SAME per-file cross-process lock the reconciling
|
|
770
|
+
* append/removal saves (`saveMergingWithDisk`) use (issue #1909 / PR #2016).
|
|
771
|
+
* The `populate` callback runs WHILE the lock is held and MUST repopulate this
|
|
772
|
+
* index from the corpus (`clear()` then `addByHash(...)` for every corpus
|
|
773
|
+
* hash); the rebuilt set is then published with a plain overwrite that is now
|
|
774
|
+
* serialized against every locked writer.
|
|
775
|
+
*
|
|
776
|
+
* This closes the finding where the previous unlocked clear→scan→save() could
|
|
777
|
+
* overwrite a peer's newer lock-merged or deferred additions: a locked writer
|
|
778
|
+
* that committed BEFORE the rebuild acquired the lock has its memory `.md` on
|
|
779
|
+
* disk and is re-scanned; one that commits AFTER the rebuild releases
|
|
780
|
+
* reconciles its additions on top of the freshly-published set. No union with
|
|
781
|
+
* the raw on-disk file is performed, so the rebuild keeps its
|
|
782
|
+
* garbage-collection property (orphaned hashes for deleted memories drop).
|
|
783
|
+
*
|
|
784
|
+
* Lock-acquisition failure is explicit and non-destructive: `populate` is NOT
|
|
785
|
+
* run and nothing is written (never an unlocked overwrite). Returns true when
|
|
786
|
+
* the rebuild was published under the lock, false when the lock timed out —
|
|
787
|
+
* the caller keeps the index non-authoritative and retries on next use. Uses
|
|
788
|
+
* the same non-reentrant file lock as the reconcile path, so it can never
|
|
789
|
+
* deadlock with the deferred reconcile-retry: a concurrent locked writer (or a
|
|
790
|
+
* fired retry) simply yields `acquired=false` after the bounded wait.
|
|
791
|
+
*/
|
|
792
|
+
rebuildUnderLock(populate: () => Promise<void>): Promise<boolean>;
|
|
793
|
+
/**
|
|
794
|
+
* True while a background durable reconcile-save retry is armed (PR #2016).
|
|
795
|
+
* Test/introspection hook.
|
|
796
|
+
*/
|
|
797
|
+
get hasPendingReconcileRetry(): boolean;
|
|
798
|
+
/**
|
|
799
|
+
* Resolve once any armed background reconcile-save retry chain has settled —
|
|
800
|
+
* either it published the deferred additions, or it exhausted its bounded
|
|
801
|
+
* attempts and fell back to the corpus-rebuild safety net. Resolves
|
|
802
|
+
* immediately when nothing is armed. Lets a caller (or a test) await the
|
|
803
|
+
* eventual durability outcome of a lock-timed-out save.
|
|
804
|
+
*/
|
|
805
|
+
whenReconcileRetrySettled(): Promise<void>;
|
|
806
|
+
/**
|
|
807
|
+
* Drive any deferred lock-timeout reconcile save to completion INLINE at a
|
|
808
|
+
* lifecycle boundary (PR #2016 finding 3). The background retry timer is
|
|
809
|
+
* `unref`'d so it never keeps a long-lived daemon alive — but a short-lived
|
|
810
|
+
* writer (a one-shot CLI) can exit before it fires, leaving a durable fact
|
|
811
|
+
* `.md` whose hash never reached `fact-hashes.txt` for peers that already
|
|
812
|
+
* built their in-memory index. `orchestrator.destroy()` calls this so the
|
|
813
|
+
* addition publishes before the process exits; long-lived hosts only reach it
|
|
814
|
+
* at their own shutdown, so their in-flight retries keep running in the
|
|
815
|
+
* background until then. Bounded by the same attempt ceiling as the background
|
|
816
|
+
* retry; a permanently contended lock falls back to the corpus-rebuild-on-
|
|
817
|
+
* restart safety net (the fact `.md` is already durable). No deadlock: each
|
|
818
|
+
* attempt is the same non-reentrant, bounded-wait file lock.
|
|
819
|
+
*/
|
|
820
|
+
flushReconcileRetry(): Promise<void>;
|
|
821
|
+
/**
|
|
822
|
+
* Schedule ONE bounded, exponentially-backed-off background retry of the
|
|
823
|
+
* deferred reconcile save (PR #2016). Reentrant-safe: an already-armed timer
|
|
824
|
+
* short-circuits, so successive timed-out saves never stack duplicate retries.
|
|
825
|
+
* When attempts are exhausted the chain settles without publishing — the
|
|
826
|
+
* durable fact `.md` is on disk and a process restart rebuilds the index from
|
|
827
|
+
* the corpus, so this degrades to that safety net, never a fatal failure.
|
|
828
|
+
*/
|
|
829
|
+
private scheduleReconcileRetry;
|
|
830
|
+
/** Cancel any armed reconcile-save retry and settle the barrier (a publish landed). */
|
|
831
|
+
private cancelReconcileRetry;
|
|
832
|
+
/** Resolve and clear the retry barrier if one is outstanding. */
|
|
833
|
+
private settleReconcileRetry;
|
|
683
834
|
/** Remove a hash from the index (used when archiving/deleting). */
|
|
684
835
|
remove(content: string): void;
|
|
685
836
|
/**
|
|
@@ -706,13 +857,46 @@ declare class ContentHashIndex {
|
|
|
706
857
|
static computeHash(content: string): string;
|
|
707
858
|
}
|
|
708
859
|
|
|
709
|
-
declare function normalizeAttributePairs(pairs: Record<string, string>): string;
|
|
710
860
|
declare function normalizeStructuredSectionFacts(facts: string[]): string[];
|
|
711
861
|
declare function compileEntityFacts(timeline: EntityTimelineEntry[], structuredSections: EntityStructuredSection[]): string[];
|
|
712
862
|
declare function compareEntityTimestamps(left?: string, right?: string): number;
|
|
713
863
|
declare function countEntityStructuredFacts(entity: EntityFile): number;
|
|
714
864
|
declare function fingerprintEntityStructuredFacts(entity: Pick<EntityFile, "structuredSections">): string | undefined;
|
|
715
865
|
declare function isEntitySynthesisStale(entity: EntityFile): boolean;
|
|
866
|
+
|
|
867
|
+
interface ReextractJobRequest {
|
|
868
|
+
memoryId: string;
|
|
869
|
+
model: string;
|
|
870
|
+
requestedAt: string;
|
|
871
|
+
source: "cli-migrate";
|
|
872
|
+
}
|
|
873
|
+
interface MemoryLifecycleEventWriteOptions {
|
|
874
|
+
at?: Date;
|
|
875
|
+
actor?: string;
|
|
876
|
+
reasonCode?: string;
|
|
877
|
+
ruleVersion?: string;
|
|
878
|
+
relatedMemoryIds?: string[];
|
|
879
|
+
correlationId?: string;
|
|
880
|
+
}
|
|
881
|
+
declare function parseFrontmatterStringValue(rawValue: string | undefined): string | undefined;
|
|
882
|
+
declare function parseFrontmatter(raw: string): {
|
|
883
|
+
frontmatter: MemoryFrontmatter;
|
|
884
|
+
content: string;
|
|
885
|
+
} | null;
|
|
886
|
+
declare function normalizeFrontmatterForPath(frontmatter: MemoryFrontmatter, pathRel: string, content?: string): MemoryFrontmatter;
|
|
887
|
+
/**
|
|
888
|
+
* Normalize an entity name to a canonical form.
|
|
889
|
+
* Strips non-alphanumeric chars, collapses hyphens, removes type prefix duplication.
|
|
890
|
+
* e.g. "My Project" → "my-project"
|
|
891
|
+
*
|
|
892
|
+
* Checks caller-provided user aliases first, then built-in aliases. Alias
|
|
893
|
+
* tables are instance state on StorageManager (issue #1534) — use
|
|
894
|
+
* `storageManager.normalizeEntityName(raw, type)` when normalizing within a
|
|
895
|
+
* store, or pass `storageManager.entityAliases` explicitly. Without an
|
|
896
|
+
* aliases argument only the built-in structural aliases apply.
|
|
897
|
+
*/
|
|
898
|
+
declare function normalizeEntityName(raw: string, type: string, aliases?: Readonly<Record<string, string>>): string;
|
|
899
|
+
|
|
716
900
|
/**
|
|
717
901
|
* Parse an entity markdown file into a structured EntityFile.
|
|
718
902
|
* Backward compatible: old files without new sections get empty arrays.
|
|
@@ -751,6 +935,89 @@ interface MemoryWriteResult {
|
|
|
751
935
|
/** The tombstone id that blocked the write, when `tombstoneBlocked`. */
|
|
752
936
|
blockedBy?: string;
|
|
753
937
|
}
|
|
938
|
+
/**
|
|
939
|
+
* Options accepted by `StorageManager.writeMemory` (extracted verbatim in
|
|
940
|
+
* issue #1989 PR2 so `SealedWriteExtras` can be derived from it — the
|
|
941
|
+
* sealed-envelope path takes envelope-owned fields from the envelope and
|
|
942
|
+
* everything else from these extras).
|
|
943
|
+
*/
|
|
944
|
+
interface WriteMemoryOptions {
|
|
945
|
+
actor?: string;
|
|
946
|
+
confidence?: number;
|
|
947
|
+
tags?: string[];
|
|
948
|
+
entityRef?: string;
|
|
949
|
+
source?: string;
|
|
950
|
+
supersedes?: string;
|
|
951
|
+
lineage?: string[];
|
|
952
|
+
importance?: ImportanceScore;
|
|
953
|
+
links?: MemoryLink[];
|
|
954
|
+
intentGoal?: string;
|
|
955
|
+
intentActionType?: string;
|
|
956
|
+
intentEntityTypes?: string[];
|
|
957
|
+
artifactType?: MemoryFrontmatter["artifactType"];
|
|
958
|
+
sourceMemoryId?: string;
|
|
959
|
+
sourceTurnId?: string;
|
|
960
|
+
memoryKind?: MemoryFrontmatter["memoryKind"];
|
|
961
|
+
expiresAt?: string;
|
|
962
|
+
validAt?: string;
|
|
963
|
+
observedAt?: string;
|
|
964
|
+
eventTimeSource?: "extracted" | "assumed";
|
|
965
|
+
invalidAt?: string;
|
|
966
|
+
structuredAttributes?: Record<string, string>;
|
|
967
|
+
/**
|
|
968
|
+
* When provided, this string is used as the source for the fact-content
|
|
969
|
+
* dedup hash index instead of the persisted body (`content`).
|
|
970
|
+
*
|
|
971
|
+
* Use this when the persisted body differs from the canonical fact text
|
|
972
|
+
* — for example when `content` is a citation-annotated variant of a raw
|
|
973
|
+
* fact. Passing the raw fact as `contentHashSource` ensures that
|
|
974
|
+
* `hasFactContentHash(rawFact)` returns `true` after the write, so
|
|
975
|
+
* subsequent extractions of the same logical fact are correctly deduped
|
|
976
|
+
* even when their citation timestamp differs.
|
|
977
|
+
*/
|
|
978
|
+
contentHashSource?: string;
|
|
979
|
+
/**
|
|
980
|
+
* When true, writeMemory marks the fact-hash index dirty via `.add(...)`
|
|
981
|
+
* but does NOT flush it to disk — the caller is responsible for a
|
|
982
|
+
* subsequent batch save (issue #1909). The extraction persist path sets
|
|
983
|
+
* this and relies on the orchestrator's authoritative
|
|
984
|
+
* `saveContentHashIndexes()` batch save plus a per-storage union flush,
|
|
985
|
+
* avoiding a whole-index (which grows with corpus size) rewrite per fact.
|
|
986
|
+
* Default false: every
|
|
987
|
+
* other (single-write) caller keeps the immediate, crash-safe save.
|
|
988
|
+
*/
|
|
989
|
+
deferHashIndexSave?: boolean;
|
|
990
|
+
status?: MemoryStatus;
|
|
991
|
+
/**
|
|
992
|
+
* Consolidation provenance (issue #561 PR 2). When the caller is a
|
|
993
|
+
* consolidation / supersession / dedup-merge path, these fields wire
|
|
994
|
+
* the page-version snapshots the new memory was derived from and the
|
|
995
|
+
* operator that produced it. Persisted onto frontmatter as
|
|
996
|
+
* `derived_from` + `derived_via`; validated at serialize time.
|
|
997
|
+
*/
|
|
998
|
+
derivedFrom?: string[];
|
|
999
|
+
derivedVia?: ConsolidationOperator;
|
|
1000
|
+
/**
|
|
1001
|
+
* Faithfulness gate verdict (issue #1576). When provided, persisted to
|
|
1002
|
+
* frontmatter so downstream readers (TrustScore #1577, review queue)
|
|
1003
|
+
* can consume it. Absent = gate was off or fact predates #1576.
|
|
1004
|
+
*/
|
|
1005
|
+
faithfulness?: FaithfulnessFrontmatter;
|
|
1006
|
+
/**
|
|
1007
|
+
* Claim-level provenance spans (issue #1575 PR 2). When provided,
|
|
1008
|
+
* persisted to frontmatter so downstream readers (memory_get, x-ray,
|
|
1009
|
+
* faithfulness gate #1576) can consume them. Absent = fact predates
|
|
1010
|
+
* #1575 or provenance was disabled.
|
|
1011
|
+
*/
|
|
1012
|
+
sources?: ProvenanceSource[];
|
|
1013
|
+
provenance?: "verified" | "unverified" | "none";
|
|
1014
|
+
sourceConnector?: string;
|
|
1015
|
+
}
|
|
1016
|
+
/**
|
|
1017
|
+
* `WriteMemoryOptions` minus the fields a `SealedMemoryEnvelope` owns.
|
|
1018
|
+
* Passing an envelope-owned field twice is a compile error by construction.
|
|
1019
|
+
*/
|
|
1020
|
+
type SealedWriteExtras = Omit<WriteMemoryOptions, "confidence" | "tags" | "entityRef" | "source" | "expiresAt" | "validAt" | "structuredAttributes" | "sourceConnector">;
|
|
754
1021
|
declare class StorageManager {
|
|
755
1022
|
private readonly baseDir;
|
|
756
1023
|
private readonly entitySchemas?;
|
|
@@ -850,7 +1117,35 @@ declare class StorageManager {
|
|
|
850
1117
|
private factHashIndexLoadPromise;
|
|
851
1118
|
private factHashIndexAuthoritative;
|
|
852
1119
|
private factHashIndexAuthoritativePromise;
|
|
1120
|
+
/**
|
|
1121
|
+
* Fact-ONLY hash membership (PR #2016). The shared `factHashIndex` above is
|
|
1122
|
+
* category-agnostic (the round-15 corpus rebuild + addContentHashDedup index
|
|
1123
|
+
* every category), so it cannot answer a fact-only question. This set carries
|
|
1124
|
+
* only `category === "fact"` hashes and is the sole source for
|
|
1125
|
+
* `hasFactContentHash`, so an over-included non-fact body can never suppress a
|
|
1126
|
+
* real fact candidate. Kept in lockstep with the shared index on EVERY path:
|
|
1127
|
+
* the authoritative corpus rebuild (repopulated in place), the write path
|
|
1128
|
+
* (`writeMemory` / `addActiveFactContentHash`), the storage-owned removal
|
|
1129
|
+
* (`removeFactContentHashesForMemories`), AND the orchestrator's archival /
|
|
1130
|
+
* consolidation removal (`removeContentHashForMemory` ->
|
|
1131
|
+
* `removeFactOnlyHashForMemory`). In-memory only; never persisted.
|
|
1132
|
+
*/
|
|
1133
|
+
private factOnlyHashes;
|
|
1134
|
+
/** Optional lock/retry tuning for the fact-hash index cross-process lock (PR #2016; tests inject tight budgets). */
|
|
1135
|
+
factHashIndexLockOptions: ContentHashIndexLockOptions;
|
|
853
1136
|
private readonly secureAppendChains;
|
|
1137
|
+
/**
|
|
1138
|
+
* Cache of "is this file encrypted?" keyed by absolute path, VALIDATED by file
|
|
1139
|
+
* identity (size + mtimeMs) — issue #1909 review round 10 finding 1. A prior
|
|
1140
|
+
* design cached only a boolean and relied on this instance's own writes to
|
|
1141
|
+
* invalidate it; a PEER process encrypting the file would not invalidate,
|
|
1142
|
+
* leaving a stale `false` that made the append path write RAW bytes into an
|
|
1143
|
+
* encrypted file (corruption). Now each entry records the (size, mtime) the
|
|
1144
|
+
* classification was read at; `isEncryptedFileHeader` re-sniffs (header-only)
|
|
1145
|
+
* whenever the on-disk identity no longer matches, so a foreign rewrite is
|
|
1146
|
+
* detected. The whole-file read is still never performed.
|
|
1147
|
+
*/
|
|
1148
|
+
private readonly secureFileEncryptionSniffCache;
|
|
854
1149
|
private offlineSyncDigestCache;
|
|
855
1150
|
private offlineSyncDigestCacheLoadPromise;
|
|
856
1151
|
private offlineSyncDigestCacheWriteChain;
|
|
@@ -859,6 +1154,9 @@ declare class StorageManager {
|
|
|
859
1154
|
citationTemplate: string;
|
|
860
1155
|
/** Post-write catalog hook (#1522). Installed by the namespace router; fire-and-forget. */
|
|
861
1156
|
onCatalogWrite?: () => void;
|
|
1157
|
+
/** Post-write embedding hook (#2019). Installed by the orchestrator; fire-and-forget. */
|
|
1158
|
+
onMemoryWrite?: (filePath: string) => void;
|
|
1159
|
+
private notifyMemoryWrite;
|
|
862
1160
|
private notifyCatalogWrite;
|
|
863
1161
|
/**
|
|
864
1162
|
* Whether pure state-file writes touch the namespace catalog (issue #1903).
|
|
@@ -956,17 +1254,22 @@ declare class StorageManager {
|
|
|
956
1254
|
setSecureStoreRequired(required: boolean): void;
|
|
957
1255
|
/** Return true iff the secure-store key is currently set (store is unlocked). */
|
|
958
1256
|
isSecureStoreUnlocked(): boolean;
|
|
959
|
-
/**
|
|
960
|
-
*
|
|
1257
|
+
/** Whether a state-file write encrypts at rest (encrypt-on-write on AND key
|
|
1258
|
+
* set) — the write mode lifecycle compaction reserves the envelope for (#2033). */
|
|
1259
|
+
willEncryptStateWrites(): boolean;
|
|
1260
|
+
/**
|
|
1261
|
+
* Resolve the effective write key: null when encrypt-on-write is off or the
|
|
1262
|
+
* store is unlocked-optional; the key when set; else throws
|
|
1263
|
+
* SecureStoreLockedError under a required-but-locked store (PR #767) instead
|
|
1264
|
+
* of silently writing plaintext.
|
|
961
1265
|
*
|
|
962
|
-
*
|
|
963
|
-
*
|
|
964
|
-
*
|
|
965
|
-
*
|
|
966
|
-
*
|
|
967
|
-
*
|
|
968
|
-
*
|
|
969
|
-
* `_secureStoreRequired` is false: returns null (unencrypted store).
|
|
1266
|
+
* `forceEncrypt` overrides the encrypt-on-write policy flag ONLY (issue
|
|
1267
|
+
* #2033): a lifecycle-ledger compaction of an already-encrypted ledger/backup
|
|
1268
|
+
* must preserve encryption at rest even when `secureStoreEncryptOnWrite` is
|
|
1269
|
+
* paused, or it would silently downgrade encrypted state to plaintext. It
|
|
1270
|
+
* never bypasses the LOCK: when the store has no key it still returns null
|
|
1271
|
+
* (optional) or throws (required), so a keyless caller can never fabricate an
|
|
1272
|
+
* encrypted write.
|
|
970
1273
|
*/
|
|
971
1274
|
private resolveWriteKey;
|
|
972
1275
|
/**
|
|
@@ -1135,11 +1438,21 @@ declare class StorageManager {
|
|
|
1135
1438
|
private invalidateAfterOfflineSyncMutation;
|
|
1136
1439
|
createContentHashIndex(): ContentHashIndex;
|
|
1137
1440
|
private appendStorageSecureFile;
|
|
1441
|
+
/**
|
|
1442
|
+
* Classify a file as encrypted by reading ONLY the fixed-size magic header
|
|
1443
|
+
* (issue #1909), never the whole file. The result is cached per-path but
|
|
1444
|
+
* VALIDATED against the file's (size, mtime) identity (review round 10 finding
|
|
1445
|
+
* 1): a `stat` on each call is O(1), and the 12-byte header read happens only
|
|
1446
|
+
* on a cache miss or when the on-disk identity changed — so a PEER process
|
|
1447
|
+
* rewriting/encrypting the file is detected and we never append raw bytes into
|
|
1448
|
+
* an encrypted body. ENOENT and short/empty files classify as not-encrypted
|
|
1449
|
+
* (fall through to a plain `appendFile`).
|
|
1450
|
+
*/
|
|
1451
|
+
private isEncryptedFileHeader;
|
|
1138
1452
|
private appendStorageSecureFileUnlocked;
|
|
1139
1453
|
private get stateDir();
|
|
1140
1454
|
private get offlineSyncDigestCachePath();
|
|
1141
1455
|
private get entitySynthesisQueuePath();
|
|
1142
|
-
private get factHashIndexReadyPath();
|
|
1143
1456
|
/**
|
|
1144
1457
|
* The on-disk tombstone log path. Lives under `<stateDir>/tombstones.jsonl`
|
|
1145
1458
|
* so it is co-located with the fact-hash index and encrypted at rest when
|
|
@@ -1208,7 +1521,54 @@ declare class StorageManager {
|
|
|
1208
1521
|
*/
|
|
1209
1522
|
rebuildTombstonesFromFiles(): Promise<number>;
|
|
1210
1523
|
private getFactHashIndex;
|
|
1524
|
+
/**
|
|
1525
|
+
* Return the fact-hash index after ensuring it is authoritative — i.e. rebuilt
|
|
1526
|
+
* from the durable fact corpus (issue #1909 review round 12). This is the ONE
|
|
1527
|
+
* coherent dedup source: the orchestrator's dedup layer
|
|
1528
|
+
* (contentHashIndexForStorage) shares THIS instance instead of loading a raw,
|
|
1529
|
+
* possibly-stale fact-hashes.txt, so after a crash+restart the orchestrator's
|
|
1530
|
+
* hasContentHashDedup sees the same corpus-rebuilt hashes StorageManager does
|
|
1531
|
+
* and never re-creates a fact whose per-write flush was deferred and lost.
|
|
1532
|
+
*/
|
|
1533
|
+
getAuthoritativeFactHashIndex(): Promise<ContentHashIndex>;
|
|
1534
|
+
/**
|
|
1535
|
+
* Return the shared fact-hash index instance, corpus-rebuilt under the lock
|
|
1536
|
+
* when the lock is free. Unlike {@link getAuthoritativeFactHashIndex} this
|
|
1537
|
+
* NEVER throws on lock contention — it returns the shared instance (the loaded
|
|
1538
|
+
* snapshot when a locked rebuild could not run) so registration writes still
|
|
1539
|
+
* land in the one shared index and reconcile to disk. Callers that trust a
|
|
1540
|
+
* dedup MISS MUST also consult {@link isFactContentHashAuthoritative} and
|
|
1541
|
+
* confirm against the corpus when it is false (PR #2016).
|
|
1542
|
+
*/
|
|
1543
|
+
getSharedFactHashIndex(): Promise<ContentHashIndex>;
|
|
1211
1544
|
private ensureFactHashIndexAuthoritative;
|
|
1545
|
+
/**
|
|
1546
|
+
* Repopulate `factHashIndex` in memory from the durable HOT+COLD corpus. Runs
|
|
1547
|
+
* WHILE the per-index cross-process lock is held (see
|
|
1548
|
+
* ContentHashIndex.rebuildUnderLock, which publishes the rebuilt set); this
|
|
1549
|
+
* method itself never writes to disk.
|
|
1550
|
+
*/
|
|
1551
|
+
private rebuildFactHashIndexFromCorpus;
|
|
1552
|
+
/**
|
|
1553
|
+
* The content-hash the corpus rebuild registers for `memory`, or null when the
|
|
1554
|
+
* body carries a citation from an unknown/custom template that cannot be
|
|
1555
|
+
* safely stripped. Shared by the authoritative rebuild and the fact-only
|
|
1556
|
+
* corpus confirmation (`hasFactContentHash`) so both derive the identical
|
|
1557
|
+
* hash for a given stored body.
|
|
1558
|
+
*
|
|
1559
|
+
* Preference order:
|
|
1560
|
+
* 1. frontmatter.contentHash — the raw pre-citation hash writeMemory records
|
|
1561
|
+
* for facts (issue #369 round 8); matches hasFactContentHash(rawFact).
|
|
1562
|
+
* 2. Reconstruct from the stored body: strip the "[Attributes: …]" suffix
|
|
1563
|
+
* writeMemory appends for structuredAttributes (registration hashed the
|
|
1564
|
+
* raw canonical content WITHOUT it — a no-op when absent), then strip a
|
|
1565
|
+
* recognised citation and hash the bare body, or hash a citation-free
|
|
1566
|
+
* body as-is.
|
|
1567
|
+
* 3. A body with a citation from an unknown/custom template → null: a
|
|
1568
|
+
* false-negative miss beats a wrong hash that would permanently suppress
|
|
1569
|
+
* legitimate duplicate writes.
|
|
1570
|
+
*/
|
|
1571
|
+
private corpusRegisteredHash;
|
|
1212
1572
|
private get questionsDir();
|
|
1213
1573
|
private get artifactsDir();
|
|
1214
1574
|
private get identityDir();
|
|
@@ -1226,6 +1586,25 @@ declare class StorageManager {
|
|
|
1226
1586
|
private get compressionGuidelineStatePath();
|
|
1227
1587
|
private get compressionGuidelineDraftStatePath();
|
|
1228
1588
|
private get behaviorSignalsPath();
|
|
1589
|
+
/**
|
|
1590
|
+
* In-memory dedup key set for behavior-signals appends (issue #1909),
|
|
1591
|
+
* validated by (size, mtime) file identity like the catalog `compactedCache`.
|
|
1592
|
+
* Avoids re-reading + JSON.parsing the whole `behavior-signals.jsonl` on
|
|
1593
|
+
* every append. A foreign write changes size/mtime, forcing a reload; this
|
|
1594
|
+
* process's own appends refresh the identity in place. null => reload.
|
|
1595
|
+
*/
|
|
1596
|
+
private behaviorSignalsKeyCache;
|
|
1597
|
+
/**
|
|
1598
|
+
* Per-instance serializer for `appendBehaviorSignals` (issue #1909 review
|
|
1599
|
+
* round 3). The read→dedup→append→cache-commit transaction must run to
|
|
1600
|
+
* completion before the next append starts; otherwise two concurrent callers
|
|
1601
|
+
* each snapshot their own `existingKeys`, and the later one commits an
|
|
1602
|
+
* INCOMPLETE set under the final file identity, so a subsequent call
|
|
1603
|
+
* cache-hits a set missing the earlier batch and writes duplicate signals.
|
|
1604
|
+
* The `.catch` links keep the chain alive after a rejected append
|
|
1605
|
+
* (AGENTS.md #28).
|
|
1606
|
+
*/
|
|
1607
|
+
private behaviorSignalsAppendChain;
|
|
1229
1608
|
/**
|
|
1230
1609
|
* Buffer surprise telemetry ledger (issue #563 PR 3).
|
|
1231
1610
|
*
|
|
@@ -1274,68 +1653,29 @@ declare class StorageManager {
|
|
|
1274
1653
|
* (RECALL_FALLBACK_DIRS; QMD scans baseDir recursively), so writes stay found.
|
|
1275
1654
|
*/
|
|
1276
1655
|
private resolveCategoryWritePath;
|
|
1277
|
-
writeMemory(category: MemoryCategory, content: string, options?:
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
invalidAt?: string;
|
|
1299
|
-
structuredAttributes?: Record<string, string>;
|
|
1300
|
-
/**
|
|
1301
|
-
* When provided, this string is used as the source for the fact-content
|
|
1302
|
-
* dedup hash index instead of the persisted body (`content`).
|
|
1303
|
-
*
|
|
1304
|
-
* Use this when the persisted body differs from the canonical fact text
|
|
1305
|
-
* — for example when `content` is a citation-annotated variant of a raw
|
|
1306
|
-
* fact. Passing the raw fact as `contentHashSource` ensures that
|
|
1307
|
-
* `hasFactContentHash(rawFact)` returns `true` after the write, so
|
|
1308
|
-
* subsequent extractions of the same logical fact are correctly deduped
|
|
1309
|
-
* even when their citation timestamp differs.
|
|
1310
|
-
*/
|
|
1311
|
-
contentHashSource?: string;
|
|
1312
|
-
status?: MemoryStatus;
|
|
1313
|
-
/**
|
|
1314
|
-
* Consolidation provenance (issue #561 PR 2). When the caller is a
|
|
1315
|
-
* consolidation / supersession / dedup-merge path, these fields wire
|
|
1316
|
-
* the page-version snapshots the new memory was derived from and the
|
|
1317
|
-
* operator that produced it. Persisted onto frontmatter as
|
|
1318
|
-
* `derived_from` + `derived_via`; validated at serialize time.
|
|
1319
|
-
*/
|
|
1320
|
-
derivedFrom?: string[];
|
|
1321
|
-
derivedVia?: ConsolidationOperator;
|
|
1322
|
-
/**
|
|
1323
|
-
* Faithfulness gate verdict (issue #1576). When provided, persisted to
|
|
1324
|
-
* frontmatter so downstream readers (TrustScore #1577, review queue)
|
|
1325
|
-
* can consume it. Absent = gate was off or fact predates #1576.
|
|
1326
|
-
*/
|
|
1327
|
-
faithfulness?: FaithfulnessFrontmatter;
|
|
1328
|
-
/**
|
|
1329
|
-
* Claim-level provenance spans (issue #1575 PR 2). When provided,
|
|
1330
|
-
* persisted to frontmatter so downstream readers (memory_get, x-ray,
|
|
1331
|
-
* faithfulness gate #1576) can consume them. Absent = fact predates
|
|
1332
|
-
* #1575 or provenance was disabled.
|
|
1333
|
-
*/
|
|
1334
|
-
sources?: ProvenanceSource[];
|
|
1335
|
-
provenance?: "verified" | "unverified" | "none";
|
|
1336
|
-
sourceConnector?: string;
|
|
1337
|
-
}): Promise<MemoryWriteResult>;
|
|
1656
|
+
writeMemory(category: MemoryCategory, content: string, options?: WriteMemoryOptions): Promise<MemoryWriteResult>;
|
|
1657
|
+
/**
|
|
1658
|
+
* Sealed-envelope write entry point (issue #1989 PR2).
|
|
1659
|
+
*
|
|
1660
|
+
* Byte-identity with `writeMemory` is BY DELEGATION: the envelope-owned
|
|
1661
|
+
* fields are unpacked into the exact `writeMemory` arguments a legacy
|
|
1662
|
+
* caller would have passed, so the persisted output is produced by the
|
|
1663
|
+
* same code path. The composer's `persistedBody` was assembled with the
|
|
1664
|
+
* same `assemblePersistedBody` helper `writeMemory` uses, so fingerprints
|
|
1665
|
+
* derived from the envelope match the stored body (§13).
|
|
1666
|
+
*
|
|
1667
|
+
* Differences from a raw `writeMemory` call are REJECTIONS, not silent
|
|
1668
|
+
* changes: the composer enforces tag/attribute caps, strict validAt, and
|
|
1669
|
+
* plain-object attributes that the legacy path never validated.
|
|
1670
|
+
*
|
|
1671
|
+
* `envelope.ttl` maps to `expiresAt` verbatim; converting duration
|
|
1672
|
+
* expressions (`"90d"`) to instants remains the access layer's job (PR3).
|
|
1673
|
+
* `envelope.sourceReason` is access-layer metadata with no frontmatter
|
|
1674
|
+
* field and is deliberately not persisted here.
|
|
1675
|
+
*/
|
|
1676
|
+
writeSealedMemory(envelope: SealedMemoryEnvelope, extras?: SealedWriteExtras): Promise<MemoryWriteResult>;
|
|
1338
1677
|
hasFactContentHash(content: string): Promise<boolean>;
|
|
1678
|
+
private factContentHashPresentInCorpus;
|
|
1339
1679
|
private factContentHashForRemoval;
|
|
1340
1680
|
private addActiveFactContentHash;
|
|
1341
1681
|
/**
|
|
@@ -1351,6 +1691,19 @@ declare class StorageManager {
|
|
|
1351
1691
|
restoreFactHashAfterApproval(memoryId: string): Promise<void>;
|
|
1352
1692
|
private syncFactHashIndexAfterRewrite;
|
|
1353
1693
|
removeFactContentHashesForMemories(memories: MemoryFile[]): Promise<void>;
|
|
1694
|
+
/**
|
|
1695
|
+
* Remove a memory's fact-ONLY hash membership in lockstep with the shared,
|
|
1696
|
+
* category-agnostic index removal the orchestrator's
|
|
1697
|
+
* `removeContentHashForMemory` performs on archival / semantic consolidation
|
|
1698
|
+
* (PR #2016 threads SDzOP / SDzOR). Without this, `factOnlyHashes` kept a
|
|
1699
|
+
* removed/superseded fact's hash and `hasFactContentHash` returned a stale
|
|
1700
|
+
* `true` until the next corpus rebuild, so wearable / explicit-capture /
|
|
1701
|
+
* promotion callers skipped a valid write. In-memory only — `factOnlyHashes`
|
|
1702
|
+
* is never persisted; it is rebuilt from the corpus. No-op for non-facts.
|
|
1703
|
+
* Matches the shared index's unconditional per-hash removal so the two stay
|
|
1704
|
+
* coherent.
|
|
1705
|
+
*/
|
|
1706
|
+
removeFactOnlyHashForMemory(memory: MemoryFile): void;
|
|
1354
1707
|
isFactContentHashAuthoritative(): Promise<boolean>;
|
|
1355
1708
|
writeArtifact(quote: string, options?: {
|
|
1356
1709
|
actor?: string;
|
|
@@ -1527,11 +1880,31 @@ declare class StorageManager {
|
|
|
1527
1880
|
saveMeta(state: MetaState): Promise<void>;
|
|
1528
1881
|
appendMemoryActionEvents(events: MemoryActionEvent[]): Promise<number>;
|
|
1529
1882
|
appendMemoryLifecycleEvents(events: MemoryLifecycleEvent[]): Promise<number>;
|
|
1883
|
+
/** Drain the durable pending lifecycle-append spill into the ledger (#2033);
|
|
1884
|
+
* fast no-op when nothing is pending. Returns true when rows were drained. */
|
|
1885
|
+
drainPendingMemoryLifecycleEvents(): Promise<boolean>;
|
|
1886
|
+
/** Offline-sync pre-snapshot drain (#2033): fold pending lifecycle spills into
|
|
1887
|
+
* the active ledger and report whether durable rows STILL remain in the
|
|
1888
|
+
* offline-sync-EXCLUDED pending queue. The caller aborts the snapshot when
|
|
1889
|
+
* `pendingDeferred` is true so append-only rows are never silently omitted. */
|
|
1890
|
+
drainPendingMemoryLifecycleEventsForSync(): Promise<DrainPendingLifecycleForSyncResult>;
|
|
1891
|
+
/** Drain pending lifecycle spills for any ledger inside this storage root.
|
|
1892
|
+
* The offline CLI uses this path-aware variant for per-namespace ledgers so
|
|
1893
|
+
* secure-store encryption and path-bound authentication remain consistent. */
|
|
1894
|
+
drainPendingMemoryLifecycleEventsForSyncAt(ledgerPath: string): Promise<DrainPendingLifecycleForSyncResult>;
|
|
1895
|
+
/** Rewrite the ledger through the secure writer (#1910); re-encrypts when unlocked, throws when locked.
|
|
1896
|
+
* `targetPath` re-encrypts under a decryptable backup path's own AAD;
|
|
1897
|
+
* Buffer content passes through verbatim (#2033). `forceEncrypt` preserves
|
|
1898
|
+
* encryption at rest for an already-encrypted ledger/backup even when the
|
|
1899
|
+
* `secureStoreEncryptOnWrite` policy is paused, so a compaction never
|
|
1900
|
+
* downgrades encrypted state to plaintext (#2033); it never bypasses the lock. */
|
|
1901
|
+
writeMemoryLifecycleLedgerContent(content: string | Buffer, targetPath?: string, forceEncrypt?: boolean): Promise<void>;
|
|
1530
1902
|
appendBufferSurpriseEvents(events: BufferSurpriseEvent[]): Promise<number>;
|
|
1531
1903
|
readBufferSurpriseEvents(options?: {
|
|
1532
1904
|
limit?: number;
|
|
1533
1905
|
}): Promise<BufferSurpriseEvent[]>;
|
|
1534
1906
|
appendBehaviorSignals(events: BehaviorSignalEvent[]): Promise<number>;
|
|
1907
|
+
private appendBehaviorSignalsUnlocked;
|
|
1535
1908
|
appendReextractJobs(events: ReextractJobRequest[]): Promise<number>;
|
|
1536
1909
|
readReextractJobs(limit?: number): Promise<ReextractJobRequest[]>;
|
|
1537
1910
|
readBehaviorSignals(limit?: number): Promise<BehaviorSignalEvent[]>;
|
|
@@ -1541,6 +1914,10 @@ declare class StorageManager {
|
|
|
1541
1914
|
event: MemoryActionEvent;
|
|
1542
1915
|
}>>;
|
|
1543
1916
|
readAllMemoryLifecycleEvents(): Promise<MemoryLifecycleEvent[]>;
|
|
1917
|
+
/** Raw decrypted ledger bytes as a Buffer, never a string, so an oversized
|
|
1918
|
+
* ledger cannot throw on decode before recovery (#2033). */
|
|
1919
|
+
readMemoryLifecycleLedgerRawBufferForCompaction(): Promise<Buffer>;
|
|
1920
|
+
readAllMemoryLifecycleEventsForCompaction(): Promise<MemoryLifecycleEvent[]>;
|
|
1544
1921
|
readMemoryLifecycleEvents(limit?: number): Promise<MemoryLifecycleEvent[]>;
|
|
1545
1922
|
writeCompressionGuidelines(content: string): Promise<void>;
|
|
1546
1923
|
readCompressionGuidelines(): Promise<string | null>;
|
|
@@ -1662,13 +2039,15 @@ declare class StorageManager {
|
|
|
1662
2039
|
*/
|
|
1663
2040
|
getMemoryById(id: string): Promise<MemoryFile | null>;
|
|
1664
2041
|
/**
|
|
1665
|
-
*
|
|
2042
|
+
* Resolve existing active memory IDs to their on-disk paths.
|
|
1666
2043
|
*
|
|
1667
2044
|
* Uses a lightweight directory scan (collectActiveMemoryPaths) that reads
|
|
1668
2045
|
* file names without parsing frontmatter — much cheaper than readAllMemories()
|
|
1669
|
-
* for
|
|
1670
|
-
|
|
1671
|
-
|
|
2046
|
+
* for citation usage tracking and other existence checks.
|
|
2047
|
+
*/
|
|
2048
|
+
findExistingMemoryPaths(ids: string[], preferredPaths?: Map<string, string[]>): Promise<Map<string, string[]>>;
|
|
2049
|
+
/**
|
|
2050
|
+
* Check which of the given memory IDs actually exist on disk.
|
|
1672
2051
|
*/
|
|
1673
2052
|
filterExistingMemoryIds(ids: string[]): Promise<Set<string>>;
|
|
1674
2053
|
getProjectedMemoryState(id: string): Promise<MemoryProjectionCurrentState | null>;
|
|
@@ -1755,4 +2134,4 @@ declare class StorageManager {
|
|
|
1755
2134
|
private appendGeneratedMemoryLifecycleEventFailOpen;
|
|
1756
2135
|
}
|
|
1757
2136
|
|
|
1758
|
-
export {
|
|
2137
|
+
export { compareEntityTimestamps as A, compileEntityFacts as B, ContentHashIndex as C, type DisagreementKind as D, countEntityStructuredFacts as E, FusionArtifactStore as F, fingerprintEntityStructuredFacts as G, isEntitySynthesisStale as H, isValidBufferSurpriseEvent as I, normalizeEntityName as J, normalizeFrontmatterForPath as K, normalizeStructuredSectionFacts as L, type MemoryWriteResult as M, parseFrontmatter as N, parseFrontmatterStringValue as O, type ReextractJobRequest as R, StorageManager as S, type WriteMemoryOptions as W, type FusedWearableConversation as a, type FusionConversationInput as b, type FusedSpeaker as c, type FusedSegment as d, type FusedDisagreement as e, type FusionOptions as f, type FusionDayResult as g, FUSION_KIND as h, type FusedContribution as i, type FusedConversationProvenance as j, type FusedDayFile as k, type FusedDayMeta as l, type FusedSegmentProvenance as m, type FusionSegmentInput as n, type SegmentPickReason as o, composeFusionDayMeta as p, hashFusionBody as q, parseEntityFile as r, parseFusionDay as s, serializeEntityFile as t, serializeFusionDay as u, type ContentHashIndexLockOptions as v, FactHashIndexNotAuthoritativeError as w, type MemoryLifecycleEventWriteOptions as x, type SealedWriteExtras as y, buildEntitySchemaCacheKey as z };
|