@remnic/core 10.0.37 → 10.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access-admin-ops-surface.js +76 -76
- package/dist/access-audit.js +2 -2
- package/dist/access-authorization-probe.js +77 -77
- package/dist/access-boundary.js +76 -76
- package/dist/access-citation-namespace.js +2 -2
- package/dist/access-cli.js +165 -164
- package/dist/access-cli.js.map +1 -1
- package/dist/access-extraction-force-flush.js +76 -76
- package/dist/access-http-briefing.js +77 -77
- package/dist/access-http-query.js +78 -78
- package/dist/access-http.js +101 -101
- package/dist/access-identity-continuity-surface.js +76 -76
- package/dist/access-lcm-surface.js +76 -76
- package/dist/access-mcp.js +90 -90
- package/dist/access-namespace-preflight.js +76 -76
- package/dist/access-observe-write-category.js +15 -15
- package/dist/access-observe-write-surface.js +76 -76
- package/dist/access-offline-manifest.js +12 -12
- package/dist/access-operations-batch.js +80 -80
- package/dist/access-operations.js +87 -87
- package/dist/access-recall-concurrency.js +76 -76
- package/dist/access-recall-diagnostics.js +2 -2
- package/dist/access-recall-response.js +76 -76
- package/dist/access-recall-surface.js +76 -76
- package/dist/access-schema.js +10 -10
- package/dist/access-service.js +76 -76
- package/dist/access-surface-catalog.js +78 -78
- package/dist/active-recall.js +31 -31
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/{auto-sync-R3XGJL5I.js → auto-sync-BNCBMU6H.js} +9 -9
- package/dist/briefing.js +21 -21
- package/dist/buffer-types.d.ts +59 -0
- package/dist/buffer-types.d.ts.map +1 -0
- package/dist/buffer-types.js +1 -0
- package/dist/buffer.d.ts +14 -22
- package/dist/buffer.d.ts.map +1 -1
- package/dist/buffer.js +11 -11
- package/dist/calibration.js +3 -3
- package/dist/{capsule-crypto-7FJQINUR.js → capsule-crypto-GWVG7LGC.js} +2 -2
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.js +24 -24
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.js +2 -2
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-MH3LC7KB.js → chunk-22YJQTPN.js} +2 -2
- package/dist/{chunk-MKE5DP3S.js → chunk-23ZMQONL.js} +2 -2
- package/dist/{chunk-MGXFJOUR.js → chunk-2AV2U2SZ.js} +4 -4
- package/dist/{chunk-HJ3UTGIW.js → chunk-2JNBPOZ2.js} +3 -3
- package/dist/{chunk-EEOYF3IB.js → chunk-3RJDYZJE.js} +2 -2
- package/dist/{chunk-FBAHBFT5.js → chunk-4HJ2QK32.js} +2 -2
- package/dist/{chunk-UXXVOA4D.js → chunk-4LLV2N3R.js} +3 -3
- package/dist/{chunk-P5CUEB2Q.js → chunk-4QLKVZH6.js} +8 -8
- package/dist/{chunk-2RJO7VS4.js → chunk-4UT2NUAC.js} +2 -2
- package/dist/{chunk-R6TCM47S.js → chunk-5KZNWERU.js} +156 -143
- package/dist/chunk-5KZNWERU.js.map +1 -0
- package/dist/{chunk-MNDHKZZQ.js → chunk-5Q6CR65T.js} +2 -2
- package/dist/{chunk-XTBEXZFN.js → chunk-5SF7JOJB.js} +4 -4
- package/dist/{chunk-BQ6DGL6A.js → chunk-64WHWIPL.js} +2 -2
- package/dist/{chunk-TVIGN3XZ.js → chunk-6FRFVIKC.js} +10 -10
- package/dist/{chunk-A23DPFFI.js → chunk-6ITNEPJO.js} +2 -2
- package/dist/{chunk-UFBIOF7C.js → chunk-6X3J4NLZ.js} +10 -5
- package/dist/chunk-6X3J4NLZ.js.map +1 -0
- package/dist/{chunk-G6PPA4TH.js → chunk-6Z2ZWBOV.js} +6 -6
- package/dist/{chunk-QEGE5QCL.js → chunk-7IANFJ24.js} +58 -58
- package/dist/{chunk-PSQ2P2T3.js → chunk-7XZ7TOLQ.js} +3 -3
- package/dist/{chunk-Z5AQZRHF.js → chunk-AER3HD3B.js} +2 -2
- package/dist/{chunk-BPBUUGAO.js → chunk-ANV373S5.js} +2 -2
- package/dist/{chunk-GMMZ45C4.js → chunk-AVVCPA7U.js} +6 -8
- package/dist/chunk-AVVCPA7U.js.map +1 -0
- package/dist/{chunk-LSSCMZQ2.js → chunk-B3I2QQU7.js} +3 -3
- package/dist/{chunk-NSQSOLCE.js → chunk-B7VKRCAG.js} +2 -2
- package/dist/{chunk-HXFIILGF.js → chunk-BFPF5N3H.js} +4 -4
- package/dist/{chunk-KQAFEZQX.js → chunk-BUKK5SWA.js} +2 -2
- package/dist/{chunk-RBC4GIZU.js → chunk-BUKZ7MTN.js} +2 -2
- package/dist/{chunk-FO5AFCRI.js → chunk-CR72WZ3M.js} +9 -9
- package/dist/{chunk-YC2C67F7.js → chunk-CRXGQRNA.js} +3 -3
- package/dist/{chunk-WRDFYSUC.js → chunk-CZVNOTLR.js} +2 -2
- package/dist/{chunk-VPO53QMG.js → chunk-D6DOLQYK.js} +2 -2
- package/dist/{chunk-HRT2SJPC.js → chunk-E3NBMTTX.js} +2 -2
- package/dist/{chunk-HIMXDRSQ.js → chunk-E5IEI2MR.js} +2 -2
- package/dist/{chunk-Z2T5BPOZ.js → chunk-EIYJK7OD.js} +2 -2
- package/dist/{chunk-FRAL3EU4.js → chunk-EKPRLTAE.js} +2 -2
- package/dist/{chunk-EVVCE7S2.js → chunk-EKR6OO4P.js} +2 -2
- package/dist/{chunk-TYGLV6ZG.js → chunk-EYGOM6AI.js} +2 -2
- package/dist/{chunk-TYGLV6ZG.js.map → chunk-EYGOM6AI.js.map} +1 -1
- package/dist/{chunk-6R6CU3MR.js → chunk-F2IU6A2L.js} +57 -57
- package/dist/{chunk-FL6SLVAJ.js → chunk-FAKRTS3Y.js} +3 -3
- package/dist/{chunk-64IO6ZEE.js → chunk-FC3ZFEXF.js} +2 -2
- package/dist/{chunk-YGYT7S3G.js → chunk-FJ264QBP.js} +31 -9
- package/dist/chunk-FJ264QBP.js.map +1 -0
- package/dist/{chunk-DGBWPSM6.js → chunk-FLDXEJFX.js} +2 -2
- package/dist/{chunk-JH4FCVWJ.js → chunk-G6OFEGUR.js} +2 -2
- package/dist/{chunk-Z5QWUR3Y.js → chunk-GCW7UT5I.js} +2 -2
- package/dist/{chunk-ULUX6Q7R.js → chunk-GE5ZNDLE.js} +4 -4
- package/dist/{chunk-U4JXQCJ3.js → chunk-GLB6VV3J.js} +2 -2
- package/dist/{chunk-RWWYBE7E.js → chunk-GPVGAHXL.js} +3 -3
- package/dist/{chunk-3BPMYMPX.js → chunk-GSBSGT43.js} +2 -2
- package/dist/{chunk-645WOU5I.js → chunk-H7BZBSP6.js} +4 -4
- package/dist/{chunk-GFYFKXWZ.js → chunk-HUDPXTXW.js} +2 -2
- package/dist/{chunk-L2JQSG5M.js → chunk-I7TR2OCU.js} +2 -2
- package/dist/{chunk-HKEK27M4.js → chunk-IAOW2L6K.js} +2 -2
- package/dist/{chunk-STM4T335.js → chunk-IJH6METJ.js} +2 -2
- package/dist/{chunk-WADPRAZE.js → chunk-IZRNMXZC.js} +2 -2
- package/dist/{chunk-JWTUJVIF.js → chunk-JGS55BAS.js} +53 -2
- package/dist/chunk-JGS55BAS.js.map +1 -0
- package/dist/{chunk-LAQS5HYU.js → chunk-JM6U3SAE.js} +2 -2
- package/dist/{chunk-74AY3S7U.js → chunk-JNLYHJG7.js} +4 -4
- package/dist/{chunk-7ZBANI3M.js → chunk-JOOGPZJE.js} +2 -2
- package/dist/{chunk-V5RJCXLG.js → chunk-JORSMFL6.js} +6 -6
- package/dist/{chunk-VKTP3TZB.js → chunk-JQCP5QW3.js} +4 -4
- package/dist/{chunk-LRJKHXU4.js → chunk-JRTKYFFY.js} +2 -2
- package/dist/{chunk-UMFBHYPW.js → chunk-JT3IXJIL.js} +13 -13
- package/dist/{chunk-S53WZWGL.js → chunk-JZFJZLJY.js} +2 -2
- package/dist/{chunk-6QOL4G76.js → chunk-KQXRVELF.js} +2 -2
- package/dist/{chunk-USOXPN5H.js → chunk-L74NWAD4.js} +2 -2
- package/dist/{chunk-Y6Y3TRBN.js → chunk-LJXBFVI2.js} +4 -4
- package/dist/{chunk-3L5WH6CV.js → chunk-LPD6I2U6.js} +2 -2
- package/dist/{chunk-LDXS746V.js → chunk-LR7RW4T6.js} +3 -3
- package/dist/{chunk-FZVZYU5C.js → chunk-LXN737FX.js} +2 -2
- package/dist/{chunk-5U3NUHMA.js → chunk-MD3W2H3G.js} +301 -98
- package/dist/chunk-MD3W2H3G.js.map +1 -0
- package/dist/{chunk-ARFT6ZBE.js → chunk-MGYZENUY.js} +2 -2
- package/dist/{chunk-YQ6SLFNZ.js → chunk-MPJDQC4G.js} +3 -3
- package/dist/{chunk-5UWP5X3T.js → chunk-NJ2DZYEK.js} +2 -2
- package/dist/{chunk-MBMT5FUQ.js → chunk-O2O4FDAH.js} +2 -2
- package/dist/{chunk-GCVUBVEN.js → chunk-ODJ2HRFW.js} +10 -10
- package/dist/{chunk-2NLLXCJG.js → chunk-OWHERGF2.js} +2 -2
- package/dist/{chunk-I73ZSORJ.js → chunk-OXSTKCYK.js} +4 -4
- package/dist/{chunk-CNQQNYJ2.js → chunk-P3YUEPSQ.js} +2 -2
- package/dist/{chunk-A6PKEU7T.js → chunk-PARM6OYL.js} +1 -1
- package/dist/chunk-PARM6OYL.js.map +1 -0
- package/dist/{chunk-TPKB7T6Z.js → chunk-Q6UZREJK.js} +2 -2
- package/dist/{chunk-UJDTXWMT.js → chunk-QIMGULGN.js} +2 -2
- package/dist/{chunk-E24RUQEN.js → chunk-QNIYL5SK.js} +2 -2
- package/dist/{chunk-KOY25HUB.js → chunk-QYAXMXOB.js} +2 -2
- package/dist/{chunk-CU7WDDPV.js → chunk-RIAKNXZB.js} +4 -4
- package/dist/{chunk-UQWA5QDT.js → chunk-RO2NNWR5.js} +3 -3
- package/dist/{chunk-AYXRK264.js → chunk-RROFIAYI.js} +9 -9
- package/dist/{chunk-L46Y5FPE.js → chunk-RUAIO5UA.js} +2 -2
- package/dist/{chunk-QIC7YZ3D.js → chunk-RWW5KPIY.js} +18 -18
- package/dist/{chunk-E5PVMB3I.js → chunk-SDXBR5QO.js} +2 -2
- package/dist/{chunk-WSLNC5AL.js → chunk-SJHFU52W.js} +8 -8
- package/dist/{chunk-7PG7QBWD.js → chunk-SRPGA6WN.js} +2 -2
- package/dist/{chunk-CUWOSRCS.js → chunk-SUKPM6DV.js} +2 -2
- package/dist/{chunk-BBDASWNT.js → chunk-TJ5YGCPV.js} +81 -76
- package/dist/chunk-TJ5YGCPV.js.map +1 -0
- package/dist/{chunk-G2SRB62M.js → chunk-TTQYX7VU.js} +2 -2
- package/dist/{chunk-TDCR6PQL.js → chunk-TWRPWJJT.js} +2 -2
- package/dist/{chunk-KC5SVCUJ.js → chunk-U66CTIF5.js} +2 -2
- package/dist/{chunk-D2AKUKAQ.js → chunk-UIK3U36O.js} +2 -2
- package/dist/{chunk-XLEP7SS3.js → chunk-UMSH4I3E.js} +2 -2
- package/dist/{chunk-X7Y7WX73.js → chunk-UVYI6VIX.js} +1 -1
- package/dist/{chunk-LHBOFROT.js → chunk-V2XMG7GM.js} +2 -2
- package/dist/chunk-VA3GNAWQ.js +58 -0
- package/dist/chunk-VA3GNAWQ.js.map +1 -0
- package/dist/{chunk-NQOM6PHO.js → chunk-VCOCOBUS.js} +6 -6
- package/dist/{chunk-4P4VLPGB.js → chunk-VECRSYQG.js} +1 -1
- package/dist/{chunk-ID2PLENW.js → chunk-VHBGJAYC.js} +2 -2
- package/dist/{chunk-RVYXSS3Q.js → chunk-VIS23B6O.js} +8 -8
- package/dist/{chunk-NMKETOAX.js → chunk-VSHWPOUB.js} +2 -2
- package/dist/{chunk-UBN5AOLT.js → chunk-W5EO4USJ.js} +2 -2
- package/dist/{chunk-Y7427SL7.js → chunk-WCGJK4NQ.js} +4 -4
- package/dist/{chunk-CCYXCT4B.js → chunk-WQYS47G4.js} +2 -2
- package/dist/{chunk-JH2ALMPR.js → chunk-WR5POHQ3.js} +2 -2
- package/dist/{chunk-DK5VMJL3.js → chunk-WT2VVYBM.js} +2 -2
- package/dist/{chunk-EHIKY2IA.js → chunk-WU5WTCH5.js} +2 -2
- package/dist/{chunk-QKXPOLQD.js → chunk-WUBGMV3G.js} +6 -6
- package/dist/{chunk-O6YJI5VX.js → chunk-WUL6LDJ4.js} +2 -2
- package/dist/{chunk-5EILJ6W2.js → chunk-WXPBDEMW.js} +2 -2
- package/dist/{chunk-U7HJBODU.js → chunk-XKTHJHSQ.js} +5 -5
- package/dist/{chunk-JFI3ATK4.js → chunk-XMYWYJM2.js} +2 -2
- package/dist/{chunk-64S6X4IU.js → chunk-XTN54NML.js} +4 -4
- package/dist/{chunk-VGFNTY3Y.js → chunk-YFXRLRKP.js} +2 -2
- package/dist/{chunk-DAOMWGO2.js → chunk-ZX5N5D6M.js} +4 -4
- package/dist/{chunk-PTRPOJ7U.js → chunk-ZXFKG7VZ.js} +2 -2
- package/dist/cli.js +124 -124
- package/dist/coding/export-okf-codegraph.js +22 -22
- package/dist/coding/pre-action-gate.js +2 -2
- package/dist/compounding/engine.js +23 -23
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +31 -31
- package/dist/connectors/codex-materialize-runner.js +21 -21
- package/dist/connectors/index.js +21 -21
- package/dist/contradiction/index.js +5 -5
- package/dist/convergence-refresh.js +23 -23
- package/dist/corpus-watermark.js +23 -23
- package/dist/deep-recall-http-glue.js +11 -11
- package/dist/deep-recall-policy-llm.js +2 -2
- package/dist/deep-recall.js +2 -2
- package/dist/entity-retrieval.js +22 -22
- package/dist/event-order-recall.js +2 -2
- package/dist/explicit-capture.js +6 -6
- package/dist/external-wiki-access.js +77 -77
- package/dist/extraction-faithfulness.js +2 -2
- package/dist/extraction-judge.d.ts +42 -2
- package/dist/extraction-judge.d.ts.map +1 -1
- package/dist/extraction-judge.js +12 -2
- package/dist/extraction-window-drain.d.ts +48 -0
- package/dist/extraction-window-drain.d.ts.map +1 -0
- package/dist/extraction-window-drain.js +14 -0
- package/dist/extraction.js +29 -29
- package/dist/fallback-llm.d.ts +1 -0
- package/dist/fallback-llm.d.ts.map +1 -1
- package/dist/fallback-llm.js +1 -1
- package/dist/{graph-edge-decay-2BZTY2IM.js → graph-edge-decay-3HVLMT6U.js} +5 -5
- package/dist/graph-edge-decay-3HVLMT6U.js.map +1 -0
- package/dist/graph-jsonl.js +3 -3
- package/dist/graph-snapshot.js +3 -3
- package/dist/graph.js +4 -4
- package/dist/harmonic-retrieval.js +22 -22
- package/dist/harmonic-source-lookup.js +2 -2
- package/dist/index.js +212 -211
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.js +7 -7
- package/dist/local-llm.js +2 -2
- package/dist/location/index.js +24 -24
- package/dist/maintenance/memory-governance.js +21 -21
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +21 -21
- package/dist/maintenance/rebuild-memory-projection-runner.js +23 -23
- package/dist/maintenance/rebuild-memory-projection.js +22 -22
- package/dist/memory-browse-operations.js +77 -77
- package/dist/memory-browse.js +6 -6
- package/dist/memory-subject.js +3 -3
- package/dist/namespaces/migrate.js +22 -22
- package/dist/namespaces/search.js +7 -7
- package/dist/namespaces/storage.js +21 -21
- package/dist/offline-sync-changeset-generations.js +3 -3
- package/dist/offline-sync-embedding-generation.js +2 -2
- package/dist/offline-sync-file-io.js +2 -2
- package/dist/offline-sync-impression-drain.js +3 -3
- package/dist/offline-sync-snapshot-stream.js +8 -8
- package/dist/offline-sync-upload-staging.js +3 -3
- package/dist/offline-sync.js +9 -9
- package/dist/operator-doctor-corpus.js +24 -24
- package/dist/operator-toolkit.js +42 -42
- package/dist/orchestration/extraction-drain.d.ts +90 -0
- package/dist/orchestration/extraction-drain.d.ts.map +1 -0
- package/dist/orchestration/extraction-run-helpers.d.ts +3 -0
- package/dist/orchestration/extraction-run-helpers.d.ts.map +1 -1
- package/dist/orchestration/extraction-run.d.ts +4 -1
- package/dist/orchestration/extraction-run.d.ts.map +1 -1
- package/dist/orchestration/maintenance.js +35 -35
- package/dist/orchestration/turn-ingestion.d.ts +3 -0
- package/dist/orchestration/turn-ingestion.d.ts.map +1 -1
- package/dist/orchestrator.d.ts +8 -0
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +165 -164
- package/dist/qmd.js +5 -5
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-navigate-access.js +2 -2
- package/dist/recall-navigate-disclosure.js +2 -2
- package/dist/recall-navigate.js +2 -2
- package/dist/recall-navigation-operations.js +77 -77
- package/dist/recall-navigation.js +76 -76
- package/dist/recall-planner-llm.js +1 -1
- package/dist/recall-state-view-admission.js +6 -6
- package/dist/recall-why-service.js +6 -6
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/manifest.js +3 -3
- package/dist/{resolution-4ZEQPXUZ.js → resolution-NNYG37YB.js} +6 -6
- package/dist/resolution-NNYG37YB.js.map +1 -0
- package/dist/resume-bundles.js +32 -32
- package/dist/retrieval-agents.js +2 -2
- package/dist/salvage-envelope.js +5 -5
- package/dist/search/factory.js +6 -6
- package/dist/search/index.js +10 -10
- package/dist/secure-store/index.js +2 -2
- package/dist/semantic-consolidation.js +22 -22
- package/dist/semantic-rule-promotion.js +21 -21
- package/dist/semantic-rule-verifier.js +21 -21
- package/dist/source-agent-qualifier.js +25 -25
- package/dist/standup/build.js +21 -21
- package/dist/storage/dropped-extraction-chunk.d.ts +8 -0
- package/dist/storage/dropped-extraction-chunk.d.ts.map +1 -0
- package/dist/storage.d.ts +1 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +20 -20
- package/dist/subject-config.js +4 -4
- package/dist/summarizer.js +4 -4
- package/dist/support-passport/index.js +79 -79
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/export-okf.js +22 -22
- package/dist/types.d.ts +19 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/verified-recall.js +21 -21
- package/dist/who-knows-cli.js +22 -22
- package/dist/who-knows.js +21 -21
- package/dist/write-envelope.js +4 -4
- package/package.json +2 -2
- package/src/buffer-drop-extraction-chunk.test.ts +196 -0
- package/src/buffer-types.ts +65 -0
- package/src/buffer.ts +60 -62
- package/src/config.test.ts +16 -0
- package/src/config.ts +22 -0
- package/src/extraction-judge-chain.test.ts +298 -2
- package/src/extraction-judge.ts +147 -82
- package/src/extraction-window-drain.test.ts +123 -0
- package/src/extraction-window-drain.ts +110 -0
- package/src/fallback-llm.test.ts +94 -0
- package/src/fallback-llm.ts +7 -7
- package/src/orchestration/extraction-drain.ts +261 -0
- package/src/orchestration/extraction-run-helpers.ts +8 -0
- package/src/orchestration/extraction-run.ts +5 -4
- package/src/orchestration/turn-ingestion.ts +9 -5
- package/src/orchestrator.ts +21 -0
- package/src/secure-store/secure-fs.ts +3 -1
- package/src/storage/dropped-extraction-chunk.ts +27 -0
- package/src/storage-dropped-chunk-filenames.test.ts +30 -0
- package/src/storage.ts +6 -7
- package/src/types.ts +19 -0
- package/dist/chunk-5U3NUHMA.js.map +0 -1
- package/dist/chunk-A6PKEU7T.js.map +0 -1
- package/dist/chunk-BBDASWNT.js.map +0 -1
- package/dist/chunk-GMMZ45C4.js.map +0 -1
- package/dist/chunk-JWTUJVIF.js.map +0 -1
- package/dist/chunk-R6TCM47S.js.map +0 -1
- package/dist/chunk-UFBIOF7C.js.map +0 -1
- package/dist/chunk-YGYT7S3G.js.map +0 -1
- /package/dist/{auto-sync-R3XGJL5I.js.map → auto-sync-BNCBMU6H.js.map} +0 -0
- /package/dist/{capsule-crypto-7FJQINUR.js.map → buffer-types.js.map} +0 -0
- /package/dist/{graph-edge-decay-2BZTY2IM.js.map → capsule-crypto-GWVG7LGC.js.map} +0 -0
- /package/dist/{chunk-MH3LC7KB.js.map → chunk-22YJQTPN.js.map} +0 -0
- /package/dist/{chunk-MKE5DP3S.js.map → chunk-23ZMQONL.js.map} +0 -0
- /package/dist/{chunk-MGXFJOUR.js.map → chunk-2AV2U2SZ.js.map} +0 -0
- /package/dist/{chunk-HJ3UTGIW.js.map → chunk-2JNBPOZ2.js.map} +0 -0
- /package/dist/{chunk-EEOYF3IB.js.map → chunk-3RJDYZJE.js.map} +0 -0
- /package/dist/{chunk-FBAHBFT5.js.map → chunk-4HJ2QK32.js.map} +0 -0
- /package/dist/{chunk-UXXVOA4D.js.map → chunk-4LLV2N3R.js.map} +0 -0
- /package/dist/{chunk-P5CUEB2Q.js.map → chunk-4QLKVZH6.js.map} +0 -0
- /package/dist/{chunk-2RJO7VS4.js.map → chunk-4UT2NUAC.js.map} +0 -0
- /package/dist/{chunk-MNDHKZZQ.js.map → chunk-5Q6CR65T.js.map} +0 -0
- /package/dist/{chunk-XTBEXZFN.js.map → chunk-5SF7JOJB.js.map} +0 -0
- /package/dist/{chunk-BQ6DGL6A.js.map → chunk-64WHWIPL.js.map} +0 -0
- /package/dist/{chunk-TVIGN3XZ.js.map → chunk-6FRFVIKC.js.map} +0 -0
- /package/dist/{chunk-A23DPFFI.js.map → chunk-6ITNEPJO.js.map} +0 -0
- /package/dist/{chunk-G6PPA4TH.js.map → chunk-6Z2ZWBOV.js.map} +0 -0
- /package/dist/{chunk-QEGE5QCL.js.map → chunk-7IANFJ24.js.map} +0 -0
- /package/dist/{chunk-PSQ2P2T3.js.map → chunk-7XZ7TOLQ.js.map} +0 -0
- /package/dist/{chunk-Z5AQZRHF.js.map → chunk-AER3HD3B.js.map} +0 -0
- /package/dist/{chunk-BPBUUGAO.js.map → chunk-ANV373S5.js.map} +0 -0
- /package/dist/{chunk-LSSCMZQ2.js.map → chunk-B3I2QQU7.js.map} +0 -0
- /package/dist/{chunk-NSQSOLCE.js.map → chunk-B7VKRCAG.js.map} +0 -0
- /package/dist/{chunk-HXFIILGF.js.map → chunk-BFPF5N3H.js.map} +0 -0
- /package/dist/{chunk-KQAFEZQX.js.map → chunk-BUKK5SWA.js.map} +0 -0
- /package/dist/{chunk-RBC4GIZU.js.map → chunk-BUKZ7MTN.js.map} +0 -0
- /package/dist/{chunk-FO5AFCRI.js.map → chunk-CR72WZ3M.js.map} +0 -0
- /package/dist/{chunk-YC2C67F7.js.map → chunk-CRXGQRNA.js.map} +0 -0
- /package/dist/{chunk-WRDFYSUC.js.map → chunk-CZVNOTLR.js.map} +0 -0
- /package/dist/{chunk-VPO53QMG.js.map → chunk-D6DOLQYK.js.map} +0 -0
- /package/dist/{chunk-HRT2SJPC.js.map → chunk-E3NBMTTX.js.map} +0 -0
- /package/dist/{chunk-HIMXDRSQ.js.map → chunk-E5IEI2MR.js.map} +0 -0
- /package/dist/{chunk-Z2T5BPOZ.js.map → chunk-EIYJK7OD.js.map} +0 -0
- /package/dist/{chunk-FRAL3EU4.js.map → chunk-EKPRLTAE.js.map} +0 -0
- /package/dist/{chunk-EVVCE7S2.js.map → chunk-EKR6OO4P.js.map} +0 -0
- /package/dist/{chunk-6R6CU3MR.js.map → chunk-F2IU6A2L.js.map} +0 -0
- /package/dist/{chunk-FL6SLVAJ.js.map → chunk-FAKRTS3Y.js.map} +0 -0
- /package/dist/{chunk-64IO6ZEE.js.map → chunk-FC3ZFEXF.js.map} +0 -0
- /package/dist/{chunk-DGBWPSM6.js.map → chunk-FLDXEJFX.js.map} +0 -0
- /package/dist/{chunk-JH4FCVWJ.js.map → chunk-G6OFEGUR.js.map} +0 -0
- /package/dist/{chunk-Z5QWUR3Y.js.map → chunk-GCW7UT5I.js.map} +0 -0
- /package/dist/{chunk-ULUX6Q7R.js.map → chunk-GE5ZNDLE.js.map} +0 -0
- /package/dist/{chunk-U4JXQCJ3.js.map → chunk-GLB6VV3J.js.map} +0 -0
- /package/dist/{chunk-RWWYBE7E.js.map → chunk-GPVGAHXL.js.map} +0 -0
- /package/dist/{chunk-3BPMYMPX.js.map → chunk-GSBSGT43.js.map} +0 -0
- /package/dist/{chunk-645WOU5I.js.map → chunk-H7BZBSP6.js.map} +0 -0
- /package/dist/{chunk-GFYFKXWZ.js.map → chunk-HUDPXTXW.js.map} +0 -0
- /package/dist/{chunk-L2JQSG5M.js.map → chunk-I7TR2OCU.js.map} +0 -0
- /package/dist/{chunk-HKEK27M4.js.map → chunk-IAOW2L6K.js.map} +0 -0
- /package/dist/{chunk-STM4T335.js.map → chunk-IJH6METJ.js.map} +0 -0
- /package/dist/{chunk-WADPRAZE.js.map → chunk-IZRNMXZC.js.map} +0 -0
- /package/dist/{chunk-LAQS5HYU.js.map → chunk-JM6U3SAE.js.map} +0 -0
- /package/dist/{chunk-74AY3S7U.js.map → chunk-JNLYHJG7.js.map} +0 -0
- /package/dist/{chunk-7ZBANI3M.js.map → chunk-JOOGPZJE.js.map} +0 -0
- /package/dist/{chunk-V5RJCXLG.js.map → chunk-JORSMFL6.js.map} +0 -0
- /package/dist/{chunk-VKTP3TZB.js.map → chunk-JQCP5QW3.js.map} +0 -0
- /package/dist/{chunk-LRJKHXU4.js.map → chunk-JRTKYFFY.js.map} +0 -0
- /package/dist/{chunk-UMFBHYPW.js.map → chunk-JT3IXJIL.js.map} +0 -0
- /package/dist/{chunk-S53WZWGL.js.map → chunk-JZFJZLJY.js.map} +0 -0
- /package/dist/{chunk-6QOL4G76.js.map → chunk-KQXRVELF.js.map} +0 -0
- /package/dist/{chunk-USOXPN5H.js.map → chunk-L74NWAD4.js.map} +0 -0
- /package/dist/{chunk-Y6Y3TRBN.js.map → chunk-LJXBFVI2.js.map} +0 -0
- /package/dist/{chunk-3L5WH6CV.js.map → chunk-LPD6I2U6.js.map} +0 -0
- /package/dist/{chunk-LDXS746V.js.map → chunk-LR7RW4T6.js.map} +0 -0
- /package/dist/{chunk-FZVZYU5C.js.map → chunk-LXN737FX.js.map} +0 -0
- /package/dist/{chunk-ARFT6ZBE.js.map → chunk-MGYZENUY.js.map} +0 -0
- /package/dist/{chunk-YQ6SLFNZ.js.map → chunk-MPJDQC4G.js.map} +0 -0
- /package/dist/{chunk-5UWP5X3T.js.map → chunk-NJ2DZYEK.js.map} +0 -0
- /package/dist/{chunk-MBMT5FUQ.js.map → chunk-O2O4FDAH.js.map} +0 -0
- /package/dist/{chunk-GCVUBVEN.js.map → chunk-ODJ2HRFW.js.map} +0 -0
- /package/dist/{chunk-2NLLXCJG.js.map → chunk-OWHERGF2.js.map} +0 -0
- /package/dist/{chunk-I73ZSORJ.js.map → chunk-OXSTKCYK.js.map} +0 -0
- /package/dist/{chunk-CNQQNYJ2.js.map → chunk-P3YUEPSQ.js.map} +0 -0
- /package/dist/{chunk-TPKB7T6Z.js.map → chunk-Q6UZREJK.js.map} +0 -0
- /package/dist/{chunk-UJDTXWMT.js.map → chunk-QIMGULGN.js.map} +0 -0
- /package/dist/{chunk-E24RUQEN.js.map → chunk-QNIYL5SK.js.map} +0 -0
- /package/dist/{chunk-KOY25HUB.js.map → chunk-QYAXMXOB.js.map} +0 -0
- /package/dist/{chunk-CU7WDDPV.js.map → chunk-RIAKNXZB.js.map} +0 -0
- /package/dist/{chunk-UQWA5QDT.js.map → chunk-RO2NNWR5.js.map} +0 -0
- /package/dist/{chunk-AYXRK264.js.map → chunk-RROFIAYI.js.map} +0 -0
- /package/dist/{chunk-L46Y5FPE.js.map → chunk-RUAIO5UA.js.map} +0 -0
- /package/dist/{chunk-QIC7YZ3D.js.map → chunk-RWW5KPIY.js.map} +0 -0
- /package/dist/{chunk-E5PVMB3I.js.map → chunk-SDXBR5QO.js.map} +0 -0
- /package/dist/{chunk-WSLNC5AL.js.map → chunk-SJHFU52W.js.map} +0 -0
- /package/dist/{chunk-7PG7QBWD.js.map → chunk-SRPGA6WN.js.map} +0 -0
- /package/dist/{chunk-CUWOSRCS.js.map → chunk-SUKPM6DV.js.map} +0 -0
- /package/dist/{chunk-G2SRB62M.js.map → chunk-TTQYX7VU.js.map} +0 -0
- /package/dist/{chunk-TDCR6PQL.js.map → chunk-TWRPWJJT.js.map} +0 -0
- /package/dist/{chunk-KC5SVCUJ.js.map → chunk-U66CTIF5.js.map} +0 -0
- /package/dist/{chunk-D2AKUKAQ.js.map → chunk-UIK3U36O.js.map} +0 -0
- /package/dist/{chunk-XLEP7SS3.js.map → chunk-UMSH4I3E.js.map} +0 -0
- /package/dist/{chunk-X7Y7WX73.js.map → chunk-UVYI6VIX.js.map} +0 -0
- /package/dist/{chunk-LHBOFROT.js.map → chunk-V2XMG7GM.js.map} +0 -0
- /package/dist/{chunk-NQOM6PHO.js.map → chunk-VCOCOBUS.js.map} +0 -0
- /package/dist/{chunk-4P4VLPGB.js.map → chunk-VECRSYQG.js.map} +0 -0
- /package/dist/{chunk-ID2PLENW.js.map → chunk-VHBGJAYC.js.map} +0 -0
- /package/dist/{chunk-RVYXSS3Q.js.map → chunk-VIS23B6O.js.map} +0 -0
- /package/dist/{chunk-NMKETOAX.js.map → chunk-VSHWPOUB.js.map} +0 -0
- /package/dist/{chunk-UBN5AOLT.js.map → chunk-W5EO4USJ.js.map} +0 -0
- /package/dist/{chunk-Y7427SL7.js.map → chunk-WCGJK4NQ.js.map} +0 -0
- /package/dist/{chunk-CCYXCT4B.js.map → chunk-WQYS47G4.js.map} +0 -0
- /package/dist/{chunk-JH2ALMPR.js.map → chunk-WR5POHQ3.js.map} +0 -0
- /package/dist/{chunk-DK5VMJL3.js.map → chunk-WT2VVYBM.js.map} +0 -0
- /package/dist/{chunk-EHIKY2IA.js.map → chunk-WU5WTCH5.js.map} +0 -0
- /package/dist/{chunk-QKXPOLQD.js.map → chunk-WUBGMV3G.js.map} +0 -0
- /package/dist/{chunk-O6YJI5VX.js.map → chunk-WUL6LDJ4.js.map} +0 -0
- /package/dist/{chunk-5EILJ6W2.js.map → chunk-WXPBDEMW.js.map} +0 -0
- /package/dist/{chunk-U7HJBODU.js.map → chunk-XKTHJHSQ.js.map} +0 -0
- /package/dist/{chunk-JFI3ATK4.js.map → chunk-XMYWYJM2.js.map} +0 -0
- /package/dist/{chunk-64S6X4IU.js.map → chunk-XTN54NML.js.map} +0 -0
- /package/dist/{chunk-VGFNTY3Y.js.map → chunk-YFXRLRKP.js.map} +0 -0
- /package/dist/{chunk-DAOMWGO2.js.map → chunk-ZX5N5D6M.js.map} +0 -0
- /package/dist/{chunk-PTRPOJ7U.js.map → chunk-ZXFKG7VZ.js.map} +0 -0
- /package/dist/{resolution-4ZEQPXUZ.js.map → extraction-window-drain.js.map} +0 -0
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./chunk-VY6BD5KB.js";
|
|
23
23
|
import {
|
|
24
24
|
normalizeQmdResultPath
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-V2XMG7GM.js";
|
|
26
26
|
import {
|
|
27
27
|
withholdToolScopedFromSharedNamespace
|
|
28
28
|
} from "./chunk-S2V7RUCL.js";
|
|
@@ -40,9 +40,6 @@ import {
|
|
|
40
40
|
import {
|
|
41
41
|
createMemorySnapshot
|
|
42
42
|
} from "./chunk-S2HLHAZ4.js";
|
|
43
|
-
import {
|
|
44
|
-
rotateMarkdownFileToArchive
|
|
45
|
-
} from "./chunk-DM2T26WE.js";
|
|
46
43
|
import {
|
|
47
44
|
closeContinuityIncidentRecord,
|
|
48
45
|
createContinuityIncidentRecord,
|
|
@@ -52,6 +49,9 @@ import {
|
|
|
52
49
|
serializeContinuityIncident,
|
|
53
50
|
upsertContinuityLoopInMarkdown
|
|
54
51
|
} from "./chunk-LDXUBPMO.js";
|
|
52
|
+
import {
|
|
53
|
+
rotateMarkdownFileToArchive
|
|
54
|
+
} from "./chunk-DM2T26WE.js";
|
|
55
55
|
import {
|
|
56
56
|
parseProvenanceSources,
|
|
57
57
|
parseProvenanceTag,
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
import {
|
|
62
62
|
parseFaithfulnessField,
|
|
63
63
|
serializeFaithfulnessFields
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-WXPBDEMW.js";
|
|
65
65
|
import {
|
|
66
66
|
CasRevisionHost,
|
|
67
67
|
DeletionRevisionStore,
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
invalidationCommitFingerprint,
|
|
70
70
|
parseTombstoneBlockedOfflineSyncMemory,
|
|
71
71
|
withCasCommitReceipt
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-MPJDQC4G.js";
|
|
73
73
|
import {
|
|
74
74
|
matchEntitySchemaSection,
|
|
75
75
|
normalizeEntityStructuredSection,
|
|
@@ -163,12 +163,12 @@ import {
|
|
|
163
163
|
import {
|
|
164
164
|
SPECULATIVE_TTL_DAYS,
|
|
165
165
|
confidenceTier
|
|
166
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-PARM6OYL.js";
|
|
167
167
|
import {
|
|
168
168
|
composeMemoryEnvelope,
|
|
169
169
|
isSealedMemoryEnvelope,
|
|
170
170
|
sealedWriteToLegacyArgs
|
|
171
|
-
} from "./chunk-
|
|
171
|
+
} from "./chunk-TWRPWJJT.js";
|
|
172
172
|
import {
|
|
173
173
|
DEFAULT_CITATION_FORMAT,
|
|
174
174
|
hasCitationForTemplate,
|
|
@@ -189,7 +189,7 @@ import {
|
|
|
189
189
|
readMemoryActionEventRowsFromLines,
|
|
190
190
|
readProjectionRebuiltAt,
|
|
191
191
|
serializeLifecycleAppendPayload
|
|
192
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-QIMGULGN.js";
|
|
193
193
|
import {
|
|
194
194
|
assertMemoryFrontmatterId,
|
|
195
195
|
warnProjectionFallback
|
|
@@ -214,7 +214,7 @@ import {
|
|
|
214
214
|
CONTENT_HASH_INDEX_RETRY_MAX_DELAY_MS,
|
|
215
215
|
ContentHashIndex,
|
|
216
216
|
FactHashIndexNotAuthoritativeError
|
|
217
|
-
} from "./chunk-
|
|
217
|
+
} from "./chunk-W5EO4USJ.js";
|
|
218
218
|
import {
|
|
219
219
|
computeLegacyContentHash
|
|
220
220
|
} from "./chunk-5FVVY2EB.js";
|
|
@@ -257,7 +257,7 @@ import {
|
|
|
257
257
|
readMaybeEncryptedFile,
|
|
258
258
|
readMaybeEncryptedFileBuffer,
|
|
259
259
|
writeMaybeEncryptedFile
|
|
260
|
-
} from "./chunk-
|
|
260
|
+
} from "./chunk-EYGOM6AI.js";
|
|
261
261
|
import {
|
|
262
262
|
assertPathInsideRoot,
|
|
263
263
|
pathIsInside
|
|
@@ -283,7 +283,7 @@ import {
|
|
|
283
283
|
realpath as realpath3,
|
|
284
284
|
stat as stat3,
|
|
285
285
|
writeFile,
|
|
286
|
-
mkdir,
|
|
286
|
+
mkdir as mkdir2,
|
|
287
287
|
unlink as unlink4,
|
|
288
288
|
appendFile,
|
|
289
289
|
open
|
|
@@ -313,7 +313,7 @@ function parseDriftProvenance(fm) {
|
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
// src/storage.ts
|
|
316
|
-
import
|
|
316
|
+
import path14 from "path";
|
|
317
317
|
|
|
318
318
|
// src/storage/tombstone-migration-sources.ts
|
|
319
319
|
import { statSync } from "fs";
|
|
@@ -5118,6 +5118,20 @@ Reason: ${reason}`;
|
|
|
5118
5118
|
}
|
|
5119
5119
|
}
|
|
5120
5120
|
|
|
5121
|
+
// src/storage/dropped-extraction-chunk.ts
|
|
5122
|
+
import { randomUUID } from "crypto";
|
|
5123
|
+
import { mkdir } from "fs/promises";
|
|
5124
|
+
import path13 from "path";
|
|
5125
|
+
async function saveDroppedExtractionChunk(stateDir, writeSecureFile, bufferKey, reason, turns) {
|
|
5126
|
+
const droppedDir = path13.join(stateDir, "dropped");
|
|
5127
|
+
await mkdir(droppedDir, { recursive: true });
|
|
5128
|
+
const safeKey = bufferKey.replace(/[^a-zA-Z0-9._-]/g, "-").slice(0, 80) || "default";
|
|
5129
|
+
const filePath = path13.join(droppedDir, `${Date.now()}-${randomUUID().slice(0, 8)}-${safeKey}.json`);
|
|
5130
|
+
const payload = { bufferKey, reason, droppedAt: (/* @__PURE__ */ new Date()).toISOString(), turns };
|
|
5131
|
+
await writeSecureFile(filePath, JSON.stringify(payload, null, 2));
|
|
5132
|
+
return filePath;
|
|
5133
|
+
}
|
|
5134
|
+
|
|
5121
5135
|
// src/storage/entity-timeline.ts
|
|
5122
5136
|
import { createHash as createHash5 } from "crypto";
|
|
5123
5137
|
var ENTITY_TIMELINE_METADATA_MARKER = "remnic-meta-v1";
|
|
@@ -6118,17 +6132,17 @@ function inferEntityTypeFromContent(content) {
|
|
|
6118
6132
|
}
|
|
6119
6133
|
var KNOWN_ENTITY_FILENAME_PREFIXES = /* @__PURE__ */ new Set(["company", "other", "person", "place", "project", "tool", "topic"]);
|
|
6120
6134
|
function inferEntityTypeFromFilename(pathRel) {
|
|
6121
|
-
const basename =
|
|
6135
|
+
const basename = path14.basename(pathRel, ".md").toLowerCase();
|
|
6122
6136
|
const separator = basename.indexOf("-");
|
|
6123
6137
|
if (separator <= 0) return void 0;
|
|
6124
6138
|
const candidate = basename.slice(0, separator);
|
|
6125
6139
|
return KNOWN_ENTITY_FILENAME_PREFIXES.has(candidate) ? candidate : void 0;
|
|
6126
6140
|
}
|
|
6127
6141
|
function normalizeFrontmatterForPath(frontmatter, pathRel, content = "") {
|
|
6128
|
-
const normalizedPath = pathRel.split(
|
|
6142
|
+
const normalizedPath = pathRel.split(path14.sep).join("/");
|
|
6129
6143
|
let normalizedFrontmatter = frontmatter;
|
|
6130
6144
|
if (normalizedPath === "entities" || normalizedPath.startsWith("entities/") || normalizedPath.includes("/entities/")) {
|
|
6131
|
-
const basename =
|
|
6145
|
+
const basename = path14.basename(pathRel, ".md");
|
|
6132
6146
|
const inferredType = inferEntityTypeFromContent(content) || inferEntityTypeFromFilename(pathRel) || "entity";
|
|
6133
6147
|
const existingTags = Array.isArray(frontmatter.tags) ? frontmatter.tags : [];
|
|
6134
6148
|
normalizedFrontmatter = {
|
|
@@ -6601,9 +6615,9 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
6601
6615
|
this.entitySchemas = entitySchemas;
|
|
6602
6616
|
this.deletionRevisionStore = new DeletionRevisionStore({
|
|
6603
6617
|
baseDir,
|
|
6604
|
-
deletionRevisionMetadataPath:
|
|
6605
|
-
invalidationCommitMetadataPath:
|
|
6606
|
-
deletionRevisionLockPath:
|
|
6618
|
+
deletionRevisionMetadataPath: path14.join(baseDir, ".offline-sync", "deletion-revisions.v1.json"),
|
|
6619
|
+
invalidationCommitMetadataPath: path14.join(baseDir, ".offline-sync", "invalidation-commits.v1.json"),
|
|
6620
|
+
deletionRevisionLockPath: path14.join(baseDir, ".offline-sync", "deletion-revisions.v1.json.lock"),
|
|
6607
6621
|
assertManagedStoragePath: (filePath, method) => this.assertManagedStoragePath(filePath, method)
|
|
6608
6622
|
});
|
|
6609
6623
|
this.casRevisions = new CasRevisionHost(baseDir);
|
|
@@ -6789,8 +6803,8 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
6789
6803
|
}
|
|
6790
6804
|
/** Whether `filePath` resolves to `stateDir` itself or a path contained in it. */
|
|
6791
6805
|
isStateFilePath(filePath) {
|
|
6792
|
-
const rel =
|
|
6793
|
-
return rel === "" || !rel.startsWith("..") && !
|
|
6806
|
+
const rel = path14.relative(this.stateDir, path14.resolve(filePath));
|
|
6807
|
+
return rel === "" || !rel.startsWith("..") && !path14.isAbsolute(rel);
|
|
6794
6808
|
}
|
|
6795
6809
|
// ── Tombstone store (issue #1579) ───────────────────────────────────────
|
|
6796
6810
|
// Instance-scoped (rule 11) + namespace-scoped (rule 42) tombstone index.
|
|
@@ -6905,8 +6919,8 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
6905
6919
|
* /srv/cold/remnic), skipping the patch and stranding a stale hot entry.
|
|
6906
6920
|
*/
|
|
6907
6921
|
isColdOrArchiveTierPath(p) {
|
|
6908
|
-
const rel =
|
|
6909
|
-
return rel === "cold" || rel === "archive" || rel.startsWith(`cold${
|
|
6922
|
+
const rel = path14.relative(this.baseDir, p);
|
|
6923
|
+
return rel === "cold" || rel === "archive" || rel.startsWith(`cold${path14.sep}`) || rel.startsWith(`archive${path14.sep}`);
|
|
6910
6924
|
}
|
|
6911
6925
|
/**
|
|
6912
6926
|
* Mark the secure-store as required for this storage instance.
|
|
@@ -6993,7 +7007,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
6993
7007
|
void 0,
|
|
6994
7008
|
this.baseDir
|
|
6995
7009
|
);
|
|
6996
|
-
const rel =
|
|
7010
|
+
const rel = path14.relative(this.baseDir, filePath).split(path14.sep).join("/");
|
|
6997
7011
|
return `${rel}:${version.versionId}`;
|
|
6998
7012
|
} catch (err) {
|
|
6999
7013
|
log.warn(
|
|
@@ -7038,10 +7052,10 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
7038
7052
|
_StorageManager.okfConformanceByDir.set(memoryDir, enabled !== false);
|
|
7039
7053
|
}
|
|
7040
7054
|
okfConformanceEnabled() {
|
|
7041
|
-
for (let dir = this.baseDir; ; dir =
|
|
7055
|
+
for (let dir = this.baseDir; ; dir = path14.dirname(dir)) {
|
|
7042
7056
|
const registered = _StorageManager.okfConformanceByDir.get(dir);
|
|
7043
7057
|
if (registered !== void 0) return registered;
|
|
7044
|
-
if (dir ===
|
|
7058
|
+
if (dir === path14.dirname(dir)) return true;
|
|
7045
7059
|
}
|
|
7046
7060
|
}
|
|
7047
7061
|
/**
|
|
@@ -7085,12 +7099,12 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
7085
7099
|
}
|
|
7086
7100
|
identityFilePath(workspaceDir, namespace) {
|
|
7087
7101
|
const rawNamespace = typeof namespace === "string" ? namespace.trim() : "";
|
|
7088
|
-
if (!rawNamespace) return
|
|
7102
|
+
if (!rawNamespace) return path14.join(workspaceDir, "IDENTITY.md");
|
|
7089
7103
|
const safeNamespace = rawNamespace.replace(/[^a-zA-Z0-9._-]/g, "-");
|
|
7090
|
-
return
|
|
7104
|
+
return path14.join(workspaceDir, `IDENTITY.${safeNamespace}.md`);
|
|
7091
7105
|
}
|
|
7092
7106
|
versionFilePath(kind) {
|
|
7093
|
-
return
|
|
7107
|
+
return path14.join(this.stateDir, `.${kind}-version.log`);
|
|
7094
7108
|
}
|
|
7095
7109
|
bumpSharedVersion(kind, fallbackMap) {
|
|
7096
7110
|
const filePath = this.versionFilePath(kind);
|
|
@@ -7197,7 +7211,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
7197
7211
|
// memories.
|
|
7198
7212
|
// -------------------------------------------------------------------------
|
|
7199
7213
|
get wearablesDir() {
|
|
7200
|
-
return
|
|
7214
|
+
return path14.join(this.baseDir, WEARABLES_DIR_NAME);
|
|
7201
7215
|
}
|
|
7202
7216
|
/**
|
|
7203
7217
|
* Resolve the on-disk path for a source/day transcript. Throws on
|
|
@@ -7213,7 +7227,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
7213
7227
|
if (!isValidTranscriptDate(date)) {
|
|
7214
7228
|
throw new Error(`invalid wearable transcript date '${String(date)}' \u2014 expected YYYY-MM-DD`);
|
|
7215
7229
|
}
|
|
7216
|
-
return
|
|
7230
|
+
return path14.join(this.wearablesDir, sourceId, `${date}.md`);
|
|
7217
7231
|
}
|
|
7218
7232
|
async writeWearableDayTranscript(sourceId, date, serialized) {
|
|
7219
7233
|
const targetPath = this.wearableTranscriptPath(sourceId, date);
|
|
@@ -7327,25 +7341,25 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
7327
7341
|
});
|
|
7328
7342
|
}
|
|
7329
7343
|
get factsDir() {
|
|
7330
|
-
return
|
|
7344
|
+
return path14.join(this.baseDir, "facts");
|
|
7331
7345
|
}
|
|
7332
7346
|
get correctionsDir() {
|
|
7333
|
-
return
|
|
7347
|
+
return path14.join(this.baseDir, "corrections");
|
|
7334
7348
|
}
|
|
7335
7349
|
get proceduresDir() {
|
|
7336
|
-
return
|
|
7350
|
+
return path14.join(this.baseDir, "procedures");
|
|
7337
7351
|
}
|
|
7338
7352
|
get reasoningTracesDir() {
|
|
7339
|
-
return
|
|
7353
|
+
return path14.join(this.baseDir, "reasoning-traces");
|
|
7340
7354
|
}
|
|
7341
7355
|
get entitiesDir() {
|
|
7342
|
-
return
|
|
7356
|
+
return path14.join(this.baseDir, "entities");
|
|
7343
7357
|
}
|
|
7344
7358
|
resolveEntityFilePath(name) {
|
|
7345
7359
|
if (typeof name !== "string") return null;
|
|
7346
|
-
const filePath =
|
|
7347
|
-
const relative2 =
|
|
7348
|
-
if (relative2 === "" || relative2.startsWith("..") ||
|
|
7360
|
+
const filePath = path14.resolve(this.entitiesDir, `${name}.md`);
|
|
7361
|
+
const relative2 = path14.relative(this.entitiesDir, filePath);
|
|
7362
|
+
if (relative2 === "" || relative2.startsWith("..") || path14.isAbsolute(relative2)) {
|
|
7349
7363
|
return null;
|
|
7350
7364
|
}
|
|
7351
7365
|
return filePath;
|
|
@@ -7356,7 +7370,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
7356
7370
|
async readDependencyPropagationQueueFile(filePath) {
|
|
7357
7371
|
const target = await resolveSafeStoragePath(
|
|
7358
7372
|
this.baseDir,
|
|
7359
|
-
|
|
7373
|
+
path14.relative(
|
|
7360
7374
|
this.baseDir,
|
|
7361
7375
|
this.assertManagedStoragePath(filePath, "storage.readDependencyPropagationQueueFile")
|
|
7362
7376
|
)
|
|
@@ -7366,7 +7380,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
7366
7380
|
async writeDependencyPropagationQueueFile(filePath, content) {
|
|
7367
7381
|
const target = await resolveSafeStoragePath(
|
|
7368
7382
|
this.baseDir,
|
|
7369
|
-
|
|
7383
|
+
path14.relative(
|
|
7370
7384
|
this.baseDir,
|
|
7371
7385
|
this.assertManagedStoragePath(filePath, "storage.writeDependencyPropagationQueueFile")
|
|
7372
7386
|
)
|
|
@@ -7381,10 +7395,10 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
7381
7395
|
});
|
|
7382
7396
|
}
|
|
7383
7397
|
assertManagedStoragePath(filePath, method) {
|
|
7384
|
-
const resolved =
|
|
7385
|
-
const base =
|
|
7386
|
-
const rel =
|
|
7387
|
-
if (rel === "" || rel === ".." || rel.startsWith(`..${
|
|
7398
|
+
const resolved = path14.resolve(filePath);
|
|
7399
|
+
const base = path14.resolve(this.baseDir);
|
|
7400
|
+
const rel = path14.relative(base, resolved);
|
|
7401
|
+
if (rel === "" || rel === ".." || rel.startsWith(`..${path14.sep}`) || path14.isAbsolute(rel)) {
|
|
7388
7402
|
throw new Error(`${method}: file path escapes memory dir`);
|
|
7389
7403
|
}
|
|
7390
7404
|
return resolved;
|
|
@@ -7421,7 +7435,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
7421
7435
|
async digestOfflineSyncFile(filePath) {
|
|
7422
7436
|
const target = this.assertManagedStoragePath(filePath, "storage.digestOfflineSyncFile");
|
|
7423
7437
|
const st = await stat3(target);
|
|
7424
|
-
const relPath =
|
|
7438
|
+
const relPath = path14.relative(this.baseDir, target).split(path14.sep).join("/");
|
|
7425
7439
|
const cache = await this.loadOfflineSyncDigestCache();
|
|
7426
7440
|
const cached = cache.get(relPath);
|
|
7427
7441
|
if (cached && cached.statBytes === st.size && cached.mtimeMs === st.mtimeMs && cached.ctimeMs === st.ctimeMs && !cached.encrypted) {
|
|
@@ -7506,7 +7520,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
7506
7520
|
const cache = this.offlineSyncDigestCache;
|
|
7507
7521
|
if (!cache) return;
|
|
7508
7522
|
const entries = [...cache.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([entryPath, entry]) => ({ path: entryPath, ...entry }));
|
|
7509
|
-
await
|
|
7523
|
+
await mkdir2(path14.dirname(this.offlineSyncDigestCachePath), { recursive: true });
|
|
7510
7524
|
await writeFile(this.offlineSyncDigestCachePath, `${JSON.stringify({ version: 1, entries })}
|
|
7511
7525
|
`, "utf-8");
|
|
7512
7526
|
}).catch((err) => {
|
|
@@ -7607,7 +7621,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
7607
7621
|
}
|
|
7608
7622
|
async appendStorageSecureFileUnlocked(filePath, content) {
|
|
7609
7623
|
const writeKey = this.resolveWriteKey();
|
|
7610
|
-
await
|
|
7624
|
+
await mkdir2(path14.dirname(filePath), { recursive: true });
|
|
7611
7625
|
if (writeKey === null) {
|
|
7612
7626
|
try {
|
|
7613
7627
|
if (await this.isEncryptedFileHeader(filePath)) {
|
|
@@ -7633,13 +7647,13 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
7633
7647
|
this.notifyCatalogWriteForPath(filePath);
|
|
7634
7648
|
}
|
|
7635
7649
|
get stateDir() {
|
|
7636
|
-
return
|
|
7650
|
+
return path14.join(this.baseDir, "state");
|
|
7637
7651
|
}
|
|
7638
7652
|
get offlineSyncDigestCachePath() {
|
|
7639
|
-
return
|
|
7653
|
+
return path14.join(this.baseDir, ".offline-sync", "digest-cache.v1.json");
|
|
7640
7654
|
}
|
|
7641
7655
|
get entitySynthesisQueuePath() {
|
|
7642
|
-
return
|
|
7656
|
+
return path14.join(this.stateDir, "entity-synthesis-queue.json");
|
|
7643
7657
|
}
|
|
7644
7658
|
// ── Tombstone store access (issue #1579) ─────────────────────────────────
|
|
7645
7659
|
/**
|
|
@@ -7649,7 +7663,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
7649
7663
|
* helpers are injected into the store).
|
|
7650
7664
|
*/
|
|
7651
7665
|
get tombstonesPath() {
|
|
7652
|
-
return
|
|
7666
|
+
return path14.join(this.stateDir, "tombstones.jsonl");
|
|
7653
7667
|
}
|
|
7654
7668
|
/**
|
|
7655
7669
|
* Configure the tombstone invariant for this storage instance. Installed
|
|
@@ -7962,55 +7976,55 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
7962
7976
|
return legacyMatches.length > 0 ? [...new Set(legacyMatches.map((content) => ContentHashIndex.computeHash(content)))] : [persistedHash];
|
|
7963
7977
|
}
|
|
7964
7978
|
get questionsDir() {
|
|
7965
|
-
return
|
|
7979
|
+
return path14.join(this.baseDir, "questions");
|
|
7966
7980
|
}
|
|
7967
7981
|
get artifactsDir() {
|
|
7968
|
-
return
|
|
7982
|
+
return path14.join(this.baseDir, "artifacts");
|
|
7969
7983
|
}
|
|
7970
7984
|
get identityDir() {
|
|
7971
|
-
return
|
|
7985
|
+
return path14.join(this.baseDir, "identity");
|
|
7972
7986
|
}
|
|
7973
7987
|
get identityAnchorPath() {
|
|
7974
|
-
return
|
|
7988
|
+
return path14.join(this.identityDir, "identity-anchor.md");
|
|
7975
7989
|
}
|
|
7976
7990
|
get identityIncidentsDir() {
|
|
7977
|
-
return
|
|
7991
|
+
return path14.join(this.identityDir, "incidents");
|
|
7978
7992
|
}
|
|
7979
7993
|
get identityAuditsWeeklyDir() {
|
|
7980
|
-
return
|
|
7994
|
+
return path14.join(this.identityDir, "audits", "weekly");
|
|
7981
7995
|
}
|
|
7982
7996
|
get identityAuditsMonthlyDir() {
|
|
7983
|
-
return
|
|
7997
|
+
return path14.join(this.identityDir, "audits", "monthly");
|
|
7984
7998
|
}
|
|
7985
7999
|
get identityImprovementLoopsPath() {
|
|
7986
|
-
return
|
|
8000
|
+
return path14.join(this.identityDir, "improvement-loops.md");
|
|
7987
8001
|
}
|
|
7988
8002
|
get identityReflectionsPath() {
|
|
7989
|
-
return
|
|
8003
|
+
return path14.join(this.identityDir, "reflections.md");
|
|
7990
8004
|
}
|
|
7991
8005
|
get profilePath() {
|
|
7992
|
-
return
|
|
8006
|
+
return path14.join(this.baseDir, "profile.md");
|
|
7993
8007
|
}
|
|
7994
8008
|
get memoryActionsPath() {
|
|
7995
|
-
return
|
|
8009
|
+
return path14.join(this.stateDir, "memory-actions.jsonl");
|
|
7996
8010
|
}
|
|
7997
8011
|
get memoryLifecycleLedgerPath() {
|
|
7998
|
-
return
|
|
8012
|
+
return path14.join(this.stateDir, "memory-lifecycle-ledger.jsonl");
|
|
7999
8013
|
}
|
|
8000
8014
|
get compressionGuidelinesPath() {
|
|
8001
|
-
return
|
|
8015
|
+
return path14.join(this.stateDir, "compression-guidelines.md");
|
|
8002
8016
|
}
|
|
8003
8017
|
get compressionGuidelineDraftPath() {
|
|
8004
|
-
return
|
|
8018
|
+
return path14.join(this.stateDir, "compression-guidelines.draft.md");
|
|
8005
8019
|
}
|
|
8006
8020
|
get compressionGuidelineStatePath() {
|
|
8007
|
-
return
|
|
8021
|
+
return path14.join(this.stateDir, "compression-guideline-state.json");
|
|
8008
8022
|
}
|
|
8009
8023
|
get compressionGuidelineDraftStatePath() {
|
|
8010
|
-
return
|
|
8024
|
+
return path14.join(this.stateDir, "compression-guideline-draft-state.json");
|
|
8011
8025
|
}
|
|
8012
8026
|
get behaviorSignalsPath() {
|
|
8013
|
-
return
|
|
8027
|
+
return path14.join(this.stateDir, "behavior-signals.jsonl");
|
|
8014
8028
|
}
|
|
8015
8029
|
/**
|
|
8016
8030
|
* In-memory dedup key set for behavior-signals appends (issue #1909),
|
|
@@ -8042,7 +8056,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
8042
8056
|
* governance sweeps can treat it uniformly.
|
|
8043
8057
|
*/
|
|
8044
8058
|
get bufferSurpriseLedgerPath() {
|
|
8045
|
-
return
|
|
8059
|
+
return path14.join(this.stateDir, "buffer-surprise-ledger.jsonl");
|
|
8046
8060
|
}
|
|
8047
8061
|
/**
|
|
8048
8062
|
* Entity alias table loaded from THIS store's config/aliases.json.
|
|
@@ -8105,7 +8119,7 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
8105
8119
|
this.loadAliasesSync();
|
|
8106
8120
|
}
|
|
8107
8121
|
loadAliasesSync() {
|
|
8108
|
-
const aliasPath =
|
|
8122
|
+
const aliasPath = path14.join(this.baseDir, "config", "aliases.json");
|
|
8109
8123
|
this.userAliases = {};
|
|
8110
8124
|
const raw = readEntityAliasConfigSync(this.baseDir);
|
|
8111
8125
|
if (raw === void 0) return;
|
|
@@ -8140,22 +8154,22 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
8140
8154
|
return completionFingerprint;
|
|
8141
8155
|
}
|
|
8142
8156
|
async ensureDirectories(options = {}) {
|
|
8143
|
-
await
|
|
8157
|
+
await mkdir2(this.baseDir, { recursive: true });
|
|
8144
8158
|
await validateRoots(this.baseDir, this.entitiesDir, this.stateDir, this.archiveDir);
|
|
8145
8159
|
const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
8146
|
-
await
|
|
8147
|
-
await
|
|
8148
|
-
await
|
|
8149
|
-
await
|
|
8150
|
-
await
|
|
8151
|
-
await
|
|
8152
|
-
await
|
|
8153
|
-
await
|
|
8154
|
-
await
|
|
8155
|
-
await
|
|
8156
|
-
await
|
|
8157
|
-
await
|
|
8158
|
-
await
|
|
8160
|
+
await mkdir2(path14.join(this.factsDir, today), { recursive: true });
|
|
8161
|
+
await mkdir2(path14.join(this.proceduresDir, today), { recursive: true });
|
|
8162
|
+
await mkdir2(path14.join(this.reasoningTracesDir, today), { recursive: true });
|
|
8163
|
+
await mkdir2(this.correctionsDir, { recursive: true });
|
|
8164
|
+
await mkdir2(this.entitiesDir, { recursive: true });
|
|
8165
|
+
await mkdir2(this.stateDir, { recursive: true });
|
|
8166
|
+
await mkdir2(this.questionsDir, { recursive: true });
|
|
8167
|
+
await mkdir2(this.artifactsDir, { recursive: true });
|
|
8168
|
+
await mkdir2(this.identityDir, { recursive: true });
|
|
8169
|
+
await mkdir2(this.identityIncidentsDir, { recursive: true });
|
|
8170
|
+
await mkdir2(this.identityAuditsWeeklyDir, { recursive: true });
|
|
8171
|
+
await mkdir2(this.identityAuditsMonthlyDir, { recursive: true });
|
|
8172
|
+
await mkdir2(path14.join(this.baseDir, "config"), { recursive: true });
|
|
8159
8173
|
await this.entityCanonicalIdMigration.begin(options.waitForEntityMigration !== false, this.entitiesDir);
|
|
8160
8174
|
if (this.hotMemoriesCacheEnabled && this.getMemoryCorpusVersion() === 0) {
|
|
8161
8175
|
this.bumpMemoryCorpusVersion();
|
|
@@ -8177,12 +8191,12 @@ var StorageManager3 = class _StorageManager extends TombstoneBlockedCaptureIndex
|
|
|
8177
8191
|
*/
|
|
8178
8192
|
async resolveCategoryWritePath(category, id, today) {
|
|
8179
8193
|
if (category === "correction") {
|
|
8180
|
-
await
|
|
8181
|
-
return
|
|
8194
|
+
await mkdir2(this.correctionsDir, { recursive: true });
|
|
8195
|
+
return path14.join(this.correctionsDir, `${id}.md`);
|
|
8182
8196
|
}
|
|
8183
|
-
const datedDir =
|
|
8184
|
-
await
|
|
8185
|
-
return
|
|
8197
|
+
const datedDir = path14.join(getCategoryDir(this.baseDir, category), today);
|
|
8198
|
+
await mkdir2(datedDir, { recursive: true });
|
|
8199
|
+
return path14.join(datedDir, `${id}.md`);
|
|
8186
8200
|
}
|
|
8187
8201
|
async findExistingTombstoneBlockedMemory(content, category, sourceConnector) {
|
|
8188
8202
|
const identity = buildExplicitCaptureDedupKey(content, category, sourceConnector);
|
|
@@ -8561,8 +8575,8 @@ ${sanitized.text}
|
|
|
8561
8575
|
await this.ensureDirectories();
|
|
8562
8576
|
const now = /* @__PURE__ */ new Date();
|
|
8563
8577
|
const day = now.toISOString().slice(0, 10);
|
|
8564
|
-
const dir =
|
|
8565
|
-
await
|
|
8578
|
+
const dir = path14.join(this.artifactsDir, day);
|
|
8579
|
+
await mkdir2(dir, { recursive: true });
|
|
8566
8580
|
const id = `artifact-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`;
|
|
8567
8581
|
const fm = {
|
|
8568
8582
|
id,
|
|
@@ -8588,7 +8602,7 @@ ${sanitized.text}
|
|
|
8588
8602
|
log.warn(`artifact content rejected for ${id}; violations=${sanitized.violations.join(", ")}`);
|
|
8589
8603
|
return "";
|
|
8590
8604
|
}
|
|
8591
|
-
const filePath =
|
|
8605
|
+
const filePath = path14.join(dir, `${id}.md`);
|
|
8592
8606
|
await this.writeStorageSecureFile(filePath, `${serializeFrontmatter(this.withOkfType(fm))}
|
|
8593
8607
|
|
|
8594
8608
|
${sanitized.text}
|
|
@@ -8882,7 +8896,7 @@ ${sanitized.text}
|
|
|
8882
8896
|
* per-process in-memory cache safe across process boundaries.
|
|
8883
8897
|
*/
|
|
8884
8898
|
invalidateColdMemoriesCache() {
|
|
8885
|
-
const coldRoot =
|
|
8899
|
+
const coldRoot = path14.join(this.baseDir, "cold");
|
|
8886
8900
|
_StorageManager.coldMemoriesCache.delete(coldRoot);
|
|
8887
8901
|
this.bumpColdWriteVersion();
|
|
8888
8902
|
invalidateAllForDir(this.baseDir);
|
|
@@ -9000,7 +9014,7 @@ ${sanitized.text}
|
|
|
9000
9014
|
const correctionPaths = [];
|
|
9001
9015
|
const factPaths = [];
|
|
9002
9016
|
for (const filePath of filePaths) {
|
|
9003
|
-
if (filePath === this.correctionsDir || filePath.startsWith(`${this.correctionsDir}${
|
|
9017
|
+
if (filePath === this.correctionsDir || filePath.startsWith(`${this.correctionsDir}${path14.sep}`)) {
|
|
9004
9018
|
correctionPaths.push(filePath);
|
|
9005
9019
|
} else {
|
|
9006
9020
|
factPaths.push(filePath);
|
|
@@ -9066,7 +9080,7 @@ ${sanitized.text}
|
|
|
9066
9080
|
const entries = (await readdir6(dir, { withFileTypes: true })).filter((e) => !isMacOsReplicationJunkBasename(e.name));
|
|
9067
9081
|
for (const entry of entries) {
|
|
9068
9082
|
checkCorpusReadAbort(options);
|
|
9069
|
-
const fullPath =
|
|
9083
|
+
const fullPath = path14.join(dir, entry.name);
|
|
9070
9084
|
if (entry.isDirectory()) {
|
|
9071
9085
|
await readDir(fullPath);
|
|
9072
9086
|
} else if (entry.name.endsWith(".md")) {
|
|
@@ -9106,7 +9120,7 @@ ${sanitized.text}
|
|
|
9106
9120
|
return this.rememberMemorySnapshot(await this.memoryReadStore.readMemoryByPath(filePath));
|
|
9107
9121
|
}
|
|
9108
9122
|
resolveTierRootDir(tier) {
|
|
9109
|
-
return tier === "cold" ?
|
|
9123
|
+
return tier === "cold" ? path14.join(this.baseDir, "cold") : this.baseDir;
|
|
9110
9124
|
}
|
|
9111
9125
|
resolveMemoryDateDir(memory) {
|
|
9112
9126
|
const preferred = memory.frontmatter.created || memory.frontmatter.updated;
|
|
@@ -9121,13 +9135,13 @@ ${sanitized.text}
|
|
|
9121
9135
|
buildTierMemoryPath(memory, tier) {
|
|
9122
9136
|
const root = this.resolveTierRootDir(tier);
|
|
9123
9137
|
if (this.isArtifactMemory(memory)) {
|
|
9124
|
-
return
|
|
9138
|
+
return path14.join(root, "artifacts", this.resolveMemoryDateDir(memory), `${memory.frontmatter.id}.md`);
|
|
9125
9139
|
}
|
|
9126
9140
|
if (memory.frontmatter.category === "correction") {
|
|
9127
|
-
return
|
|
9141
|
+
return path14.join(root, "corrections", `${memory.frontmatter.id}.md`);
|
|
9128
9142
|
}
|
|
9129
9143
|
const dir = categoryDirName(memory.frontmatter.category);
|
|
9130
|
-
return
|
|
9144
|
+
return path14.join(root, dir, this.resolveMemoryDateDir(memory), `${memory.frontmatter.id}.md`);
|
|
9131
9145
|
}
|
|
9132
9146
|
async writeMemoryFileAtomic(targetPath, memory) {
|
|
9133
9147
|
assertNotOkfReservedBasename(targetPath);
|
|
@@ -9206,8 +9220,8 @@ ${memory.content}
|
|
|
9206
9220
|
memory.frontmatter.entityRef = current.frontmatter.entityRef;
|
|
9207
9221
|
}
|
|
9208
9222
|
durable = true;
|
|
9209
|
-
const sourcePath =
|
|
9210
|
-
const destPath =
|
|
9223
|
+
const sourcePath = path14.resolve(current.path);
|
|
9224
|
+
const destPath = path14.resolve(targetPath);
|
|
9211
9225
|
if (sourcePath !== destPath) {
|
|
9212
9226
|
await recordArchiveDelete2(this.baseDir, current.path, () => this.deleteManagedStorageFile(current.path));
|
|
9213
9227
|
this.invalidateAllMemoriesCache();
|
|
@@ -9231,8 +9245,8 @@ ${memory.content}
|
|
|
9231
9245
|
}
|
|
9232
9246
|
async migrateMemoryToTier(memory, targetTier) {
|
|
9233
9247
|
const targetPath = this.buildTierMemoryPath(memory, targetTier);
|
|
9234
|
-
const sourcePath =
|
|
9235
|
-
const destPath =
|
|
9248
|
+
const sourcePath = path14.resolve(memory.path);
|
|
9249
|
+
const destPath = path14.resolve(targetPath);
|
|
9236
9250
|
if (sourcePath === destPath) {
|
|
9237
9251
|
return { changed: false, targetPath };
|
|
9238
9252
|
}
|
|
@@ -9242,7 +9256,7 @@ ${memory.content}
|
|
|
9242
9256
|
return { changed, targetPath };
|
|
9243
9257
|
}
|
|
9244
9258
|
get archiveDir() {
|
|
9245
|
-
return
|
|
9259
|
+
return path14.join(this.baseDir, "archive");
|
|
9246
9260
|
}
|
|
9247
9261
|
/**
|
|
9248
9262
|
* Archive a memory by moving it from facts/ to archive/YYYY-MM-DD/.
|
|
@@ -9255,8 +9269,8 @@ ${memory.content}
|
|
|
9255
9269
|
try {
|
|
9256
9270
|
const now = lifecycle?.at ?? /* @__PURE__ */ new Date();
|
|
9257
9271
|
const today = now.toISOString().slice(0, 10);
|
|
9258
|
-
const destDir =
|
|
9259
|
-
await
|
|
9272
|
+
const destDir = path14.join(this.archiveDir, today);
|
|
9273
|
+
await mkdir2(destDir, { recursive: true });
|
|
9260
9274
|
const refIdsAtWrite = this.currentHistoricalIds();
|
|
9261
9275
|
const updatedFm = canonicalizeEntityRefOption(
|
|
9262
9276
|
{
|
|
@@ -9271,7 +9285,7 @@ ${memory.content}
|
|
|
9271
9285
|
|
|
9272
9286
|
${current.content}
|
|
9273
9287
|
`;
|
|
9274
|
-
const destPath =
|
|
9288
|
+
const destPath = path14.join(destDir, path14.basename(current.path));
|
|
9275
9289
|
const priorDest = await this.readStorageSecureFile(destPath).catch(() => null);
|
|
9276
9290
|
await recordArchiveWrite(this.baseDir, destPath, () => this.writeStorageSecureFile(destPath, fileContent));
|
|
9277
9291
|
if (typeof current.frontmatter.entityRef === "string") {
|
|
@@ -9505,7 +9519,7 @@ ${memory.content}
|
|
|
9505
9519
|
`;
|
|
9506
9520
|
await this.writeTombstoneBlockedFrontmatter(memory, fileContent, updated, async () => {
|
|
9507
9521
|
this.invalidateAllMemoriesCache();
|
|
9508
|
-
if (memory.path.includes(`${
|
|
9522
|
+
if (memory.path.includes(`${path14.sep}cold${path14.sep}`)) {
|
|
9509
9523
|
this.invalidateColdMemoriesCache();
|
|
9510
9524
|
}
|
|
9511
9525
|
});
|
|
@@ -9517,7 +9531,7 @@ ${memory.content}
|
|
|
9517
9531
|
}
|
|
9518
9532
|
if (mentionReentry && !entityMentionEpoch.neutral(memory.frontmatter, updated)) entityMentionEpoch.bump(this.baseDir);
|
|
9519
9533
|
await this.patchHotMemoriesCache({ addedPath: memory.path });
|
|
9520
|
-
if (memory.path.includes(`${
|
|
9534
|
+
if (memory.path.includes(`${path14.sep}cold${path14.sep}`)) {
|
|
9521
9535
|
this.invalidateColdMemoriesCache();
|
|
9522
9536
|
}
|
|
9523
9537
|
try {
|
|
@@ -9615,8 +9629,11 @@ ${memory.content}
|
|
|
9615
9629
|
async deleteBufferSession(key) {
|
|
9616
9630
|
await this.bufferSessionFiles().remove(key);
|
|
9617
9631
|
}
|
|
9632
|
+
saveDroppedExtractionChunk(bufferKey, reason, turns) {
|
|
9633
|
+
return saveDroppedExtractionChunk(this.stateDir, (file, content) => this.writeStorageSecureFile(file, content), bufferKey, reason, turns);
|
|
9634
|
+
}
|
|
9618
9635
|
async loadMeta() {
|
|
9619
|
-
const metaPath =
|
|
9636
|
+
const metaPath = path14.join(this.stateDir, "meta.json");
|
|
9620
9637
|
try {
|
|
9621
9638
|
const raw = await this.readStorageSecureFile(metaPath);
|
|
9622
9639
|
const parsed = JSON.parse(raw);
|
|
@@ -9649,8 +9666,7 @@ ${memory.content}
|
|
|
9649
9666
|
}
|
|
9650
9667
|
async saveMeta(state) {
|
|
9651
9668
|
await this.ensureDirectories();
|
|
9652
|
-
|
|
9653
|
-
await this.writeStorageSecureFile(metaPath, JSON.stringify(state, null, 2));
|
|
9669
|
+
await this.writeStorageSecureFile(path14.join(this.stateDir, "meta.json"), JSON.stringify(state, null, 2));
|
|
9654
9670
|
}
|
|
9655
9671
|
async appendMemoryActionEvents(events) {
|
|
9656
9672
|
if (events.length === 0) return 0;
|
|
@@ -9719,7 +9735,7 @@ ${memory.content}
|
|
|
9719
9735
|
},
|
|
9720
9736
|
(payload) => this.appendStorageSecureFile(target, payload),
|
|
9721
9737
|
async () => {
|
|
9722
|
-
await
|
|
9738
|
+
await mkdir2(path14.dirname(target), { recursive: true });
|
|
9723
9739
|
}
|
|
9724
9740
|
);
|
|
9725
9741
|
}
|
|
@@ -9817,7 +9833,7 @@ ${memory.content}
|
|
|
9817
9833
|
async appendReextractJobs(events) {
|
|
9818
9834
|
if (events.length === 0) return 0;
|
|
9819
9835
|
await this.ensureDirectories();
|
|
9820
|
-
const filePath =
|
|
9836
|
+
const filePath = path14.join(this.stateDir, "reextract-jobs.jsonl");
|
|
9821
9837
|
const lines = events.map((event) => JSON.stringify(event)).join("\n") + "\n";
|
|
9822
9838
|
try {
|
|
9823
9839
|
await this.appendStorageSecureFile(filePath, lines);
|
|
@@ -9830,7 +9846,7 @@ ${memory.content}
|
|
|
9830
9846
|
}
|
|
9831
9847
|
async readReextractJobs(limit = 200) {
|
|
9832
9848
|
const safeLimit = Number.isFinite(limit) ? Math.max(1, Math.min(1e3, Math.floor(limit))) : 200;
|
|
9833
|
-
const filePath =
|
|
9849
|
+
const filePath = path14.join(this.stateDir, "reextract-jobs.jsonl");
|
|
9834
9850
|
try {
|
|
9835
9851
|
const raw = await this.readStorageSecureFile(filePath);
|
|
9836
9852
|
const lines = raw.split("\n").filter((line) => line.trim().length > 0);
|
|
@@ -10048,7 +10064,7 @@ ${memory.content}
|
|
|
10048
10064
|
return `${prefix}-${ts}-${rand}`;
|
|
10049
10065
|
}
|
|
10050
10066
|
async writeQuestion(question, context, priority) {
|
|
10051
|
-
await
|
|
10067
|
+
await mkdir2(this.questionsDir, { recursive: true });
|
|
10052
10068
|
const id = this.generateId("q");
|
|
10053
10069
|
const frontmatter = {
|
|
10054
10070
|
id,
|
|
@@ -10065,7 +10081,7 @@ ${question}
|
|
|
10065
10081
|
|
|
10066
10082
|
**Context:** ${context}
|
|
10067
10083
|
`;
|
|
10068
|
-
const filePath =
|
|
10084
|
+
const filePath = path14.join(this.questionsDir, `${id}.md`);
|
|
10069
10085
|
await this.writeStorageSecureFile(filePath, content);
|
|
10070
10086
|
log.debug(`wrote question ${id} to ${filePath}`);
|
|
10071
10087
|
this.invalidateQuestionsCache();
|
|
@@ -10124,11 +10140,11 @@ ${question}
|
|
|
10124
10140
|
} catch {
|
|
10125
10141
|
}
|
|
10126
10142
|
const hygiene = opts?.hygiene;
|
|
10127
|
-
const rotateEnabled = hygiene?.enabled === true && hygiene.rotateEnabled === true && Array.isArray(hygiene.rotatePaths) && hygiene.rotatePaths.includes(
|
|
10143
|
+
const rotateEnabled = hygiene?.enabled === true && hygiene.rotateEnabled === true && Array.isArray(hygiene.rotatePaths) && hygiene.rotatePaths.includes(path14.basename(identityPath));
|
|
10128
10144
|
if (rotateEnabled) {
|
|
10129
10145
|
const maxBytes = hygiene.rotateMaxBytes;
|
|
10130
10146
|
if (existing.length > maxBytes) {
|
|
10131
|
-
const archiveDir =
|
|
10147
|
+
const archiveDir = path14.join(workspaceDir, hygiene.archiveDir);
|
|
10132
10148
|
const { newContent } = await rotateMarkdownFileToArchive({
|
|
10133
10149
|
filePath: identityPath,
|
|
10134
10150
|
archiveDir,
|
|
@@ -10180,7 +10196,7 @@ ${reflection}
|
|
|
10180
10196
|
}
|
|
10181
10197
|
}
|
|
10182
10198
|
async writeIdentityReflections(content) {
|
|
10183
|
-
await
|
|
10199
|
+
await mkdir2(this.identityDir, { recursive: true });
|
|
10184
10200
|
await this.writeStorageSecureFile(this.identityReflectionsPath, content);
|
|
10185
10201
|
}
|
|
10186
10202
|
async appendIdentityReflection(reflection) {
|
|
@@ -10212,7 +10228,7 @@ ${reflection}
|
|
|
10212
10228
|
|
|
10213
10229
|
${reflection}
|
|
10214
10230
|
`;
|
|
10215
|
-
await
|
|
10231
|
+
await mkdir2(this.identityDir, { recursive: true });
|
|
10216
10232
|
await this.writeStorageSecureFile(this.identityReflectionsPath, `${existing.trimEnd()}${section}`);
|
|
10217
10233
|
log.debug(`appended namespace-local reflection to ${this.identityReflectionsPath}`);
|
|
10218
10234
|
}
|
|
@@ -10268,7 +10284,7 @@ ${reflection}
|
|
|
10268
10284
|
const rightTs = latestEntityTimelineTimestamp(right.entity) ?? "";
|
|
10269
10285
|
return compareEntityTimestamps(rightTs, leftTs);
|
|
10270
10286
|
}).map(({ entityName }) => entityName);
|
|
10271
|
-
await
|
|
10287
|
+
await mkdir2(this.stateDir, { recursive: true });
|
|
10272
10288
|
await this.writeStorageSecureFile(
|
|
10273
10289
|
this.entitySynthesisQueuePath,
|
|
10274
10290
|
JSON.stringify(
|
|
@@ -10288,7 +10304,7 @@ ${reflection}
|
|
|
10288
10304
|
if (queue.length === 0) return;
|
|
10289
10305
|
const removals = new Set(entityNames);
|
|
10290
10306
|
const nextQueue = queue.filter((name) => !removals.has(name));
|
|
10291
|
-
await
|
|
10307
|
+
await mkdir2(this.stateDir, { recursive: true });
|
|
10292
10308
|
await this.writeStorageSecureFile(
|
|
10293
10309
|
this.entitySynthesisQueuePath,
|
|
10294
10310
|
JSON.stringify(
|
|
@@ -10388,7 +10404,7 @@ ${reflection}
|
|
|
10388
10404
|
if (entries.length === 0) return 0;
|
|
10389
10405
|
const memories = await this.readAllMemories();
|
|
10390
10406
|
const memoryMap = new Map(memories.map((m) => [m.frontmatter.id, m]));
|
|
10391
|
-
const memoryPathMap = new Map(memories.map((m) => [
|
|
10407
|
+
const memoryPathMap = new Map(memories.map((m) => [path14.resolve(m.path), m]));
|
|
10392
10408
|
let updated = 0;
|
|
10393
10409
|
const prevVersion = this.getMemoryCorpusVersion();
|
|
10394
10410
|
let entityRefMoved = false;
|
|
@@ -10396,7 +10412,7 @@ ${reflection}
|
|
|
10396
10412
|
const warm = this.hotMemoriesCacheEnabled && getCachedMemories(this.baseDir, prevVersion, keyId, this.hotCacheTtlMs()) !== null;
|
|
10397
10413
|
const appliedPatches = /* @__PURE__ */ new Map();
|
|
10398
10414
|
for (const entry of entries) {
|
|
10399
|
-
const memory = entry.memoryPath ? memoryPathMap.get(
|
|
10415
|
+
const memory = entry.memoryPath ? memoryPathMap.get(path14.resolve(entry.memoryPath)) : memoryMap.get(entry.memoryId);
|
|
10400
10416
|
if (!memory) continue;
|
|
10401
10417
|
try {
|
|
10402
10418
|
const applied = await this.withTombstoneBlockedMemoryPathLock(memory.path, async (current) => {
|
|
@@ -10428,7 +10444,7 @@ ${current.content}
|
|
|
10428
10444
|
if (warm) {
|
|
10429
10445
|
updateCacheOnWrite(this.baseDir, { ...applied.current, frontmatter: applied.newFm }, keyId);
|
|
10430
10446
|
}
|
|
10431
|
-
appliedPatches.set(
|
|
10447
|
+
appliedPatches.set(path14.resolve(memory.path), {
|
|
10432
10448
|
accessCount: entry.newCount,
|
|
10433
10449
|
lastAccessed: entry.lastAccessed
|
|
10434
10450
|
});
|
|
@@ -10446,7 +10462,7 @@ ${current.content}
|
|
|
10446
10462
|
const cur = getCachedMemories(this.baseDir, prevVersion, keyId);
|
|
10447
10463
|
if (cur) {
|
|
10448
10464
|
const reapplied = cur.map((m) => {
|
|
10449
|
-
const patch = appliedPatches.get(
|
|
10465
|
+
const patch = appliedPatches.get(path14.resolve(m.path));
|
|
10450
10466
|
return patch ? {
|
|
10451
10467
|
...m,
|
|
10452
10468
|
frontmatter: { ...m.frontmatter, accessCount: patch.accessCount, lastAccessed: patch.lastAccessed }
|
|
@@ -10476,7 +10492,7 @@ ${current.content}
|
|
|
10476
10492
|
const pathsById = /* @__PURE__ */ new Map();
|
|
10477
10493
|
const filePathsById = /* @__PURE__ */ new Map();
|
|
10478
10494
|
for (const filePath of filePaths) {
|
|
10479
|
-
const memoryId =
|
|
10495
|
+
const memoryId = path14.basename(filePath, ".md");
|
|
10480
10496
|
if (!wantedIds.has(memoryId)) continue;
|
|
10481
10497
|
const paths = filePathsById.get(memoryId) ?? [];
|
|
10482
10498
|
paths.push(filePath);
|
|
@@ -10488,7 +10504,7 @@ ${current.content}
|
|
|
10488
10504
|
const preferredMatches = [];
|
|
10489
10505
|
for (const preferredPath of preferred) {
|
|
10490
10506
|
const directCandidates = new Set(qmdResultPathCandidates(this.baseDir, preferredPath));
|
|
10491
|
-
const directMatch = existingPaths.find((filePath) => directCandidates.has(
|
|
10507
|
+
const directMatch = existingPaths.find((filePath) => directCandidates.has(path14.resolve(filePath)));
|
|
10492
10508
|
if (directMatch) {
|
|
10493
10509
|
preferredMatches.push(directMatch);
|
|
10494
10510
|
continue;
|
|
@@ -10500,7 +10516,7 @@ ${current.content}
|
|
|
10500
10516
|
candidates.add(candidate);
|
|
10501
10517
|
}
|
|
10502
10518
|
}
|
|
10503
|
-
const match = existingPaths.find((filePath) => candidates.has(
|
|
10519
|
+
const match = existingPaths.find((filePath) => candidates.has(path14.resolve(filePath)));
|
|
10504
10520
|
if (match) preferredMatches.push(match);
|
|
10505
10521
|
}
|
|
10506
10522
|
if (preferredMatches.length > 0) {
|
|
@@ -10822,11 +10838,11 @@ ${current.content}
|
|
|
10822
10838
|
}
|
|
10823
10839
|
}
|
|
10824
10840
|
get summariesDir() {
|
|
10825
|
-
return
|
|
10841
|
+
return path14.join(this.baseDir, "summaries");
|
|
10826
10842
|
}
|
|
10827
10843
|
async writeSummary(summary) {
|
|
10828
|
-
await
|
|
10829
|
-
const filePath =
|
|
10844
|
+
await mkdir2(this.summariesDir, { recursive: true });
|
|
10845
|
+
const filePath = path14.join(this.summariesDir, `${summary.id}.json`);
|
|
10830
10846
|
await this.writeStorageSecureFile(filePath, JSON.stringify(summary, null, 2));
|
|
10831
10847
|
log.debug(`wrote summary ${summary.id}`);
|
|
10832
10848
|
}
|
|
@@ -10836,7 +10852,7 @@ ${current.content}
|
|
|
10836
10852
|
const summaries = [];
|
|
10837
10853
|
for (const file of files) {
|
|
10838
10854
|
if (isMacOsReplicationJunkBasename(file) || !file.endsWith(".json")) continue;
|
|
10839
|
-
const filePath =
|
|
10855
|
+
const filePath = path14.join(this.summariesDir, file);
|
|
10840
10856
|
const raw = await this.readStorageSecureFile(filePath);
|
|
10841
10857
|
summaries.push(JSON.parse(raw));
|
|
10842
10858
|
}
|
|
@@ -10906,16 +10922,13 @@ ${current.content}
|
|
|
10906
10922
|
return archived;
|
|
10907
10923
|
}
|
|
10908
10924
|
async saveTopics(topics) {
|
|
10909
|
-
const metaPath =
|
|
10910
|
-
await
|
|
10911
|
-
await this.writeStorageSecureFile(
|
|
10912
|
-
metaPath,
|
|
10913
|
-
JSON.stringify({ topics, updatedAt: (/* @__PURE__ */ new Date()).toISOString() }, null, 2)
|
|
10914
|
-
);
|
|
10925
|
+
const metaPath = path14.join(this.stateDir, "topics.json");
|
|
10926
|
+
await mkdir2(this.stateDir, { recursive: true });
|
|
10927
|
+
await this.writeStorageSecureFile(metaPath, JSON.stringify({ topics, updatedAt: (/* @__PURE__ */ new Date()).toISOString() }, null, 2));
|
|
10915
10928
|
log.debug(`saved ${topics.length} topic scores`);
|
|
10916
10929
|
}
|
|
10917
10930
|
async loadTopics() {
|
|
10918
|
-
const metaPath =
|
|
10931
|
+
const metaPath = path14.join(this.stateDir, "topics.json");
|
|
10919
10932
|
try {
|
|
10920
10933
|
const raw = await this.readStorageSecureFile(metaPath);
|
|
10921
10934
|
return JSON.parse(raw);
|
|
@@ -11034,4 +11047,4 @@ export {
|
|
|
11034
11047
|
isValidBufferSurpriseEvent,
|
|
11035
11048
|
StorageManager3 as StorageManager
|
|
11036
11049
|
};
|
|
11037
|
-
//# sourceMappingURL=chunk-
|
|
11050
|
+
//# sourceMappingURL=chunk-5KZNWERU.js.map
|