@remnic/core 9.54.7 → 9.54.8
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 +5 -5
- package/dist/access-admin-ops-surface.js +42 -41
- package/dist/access-authorization-probe.d.ts +5 -5
- package/dist/access-authorization-probe.js +43 -42
- package/dist/access-boundary.d.ts +5 -5
- package/dist/access-boundary.js +42 -41
- package/dist/access-cli.js +92 -91
- package/dist/access-cli.js.map +1 -1
- package/dist/access-extraction-force-flush.d.ts +5 -5
- package/dist/access-extraction-force-flush.js +42 -41
- package/dist/access-http-lcm-compaction.d.ts +5 -5
- package/dist/access-http-lifecycle-flush.d.ts +5 -5
- package/dist/access-http-offline-stream.d.ts +5 -5
- package/dist/access-http-query.js +42 -41
- package/dist/access-http.d.ts +6 -6
- package/dist/access-http.js +56 -55
- package/dist/access-identity-continuity-surface.d.ts +4 -4
- package/dist/access-identity-continuity-surface.js +42 -41
- package/dist/access-lcm-surface.d.ts +5 -5
- package/dist/access-lcm-surface.js +42 -41
- package/dist/access-mcp.d.ts +5 -5
- package/dist/access-mcp.js +49 -48
- package/dist/access-namespace-preflight.js +42 -41
- package/dist/access-observe-write-surface.d.ts +5 -5
- package/dist/access-observe-write-surface.js +42 -41
- package/dist/access-offline-manifest.d.ts +4 -4
- package/dist/access-offline-manifest.js +1 -1
- package/dist/access-operations-batch.js +44 -43
- package/dist/access-operations.d.ts +5 -5
- package/dist/access-operations.js +48 -47
- package/dist/access-recall-concurrency.d.ts +5 -5
- package/dist/access-recall-concurrency.js +42 -41
- package/dist/access-recall-response.d.ts +5 -5
- package/dist/access-recall-response.js +42 -41
- package/dist/access-recall-surface.d.ts +5 -5
- package/dist/access-recall-surface.js +42 -41
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-DK82xdNi.d.ts → access-service-PEduVt8q.d.ts} +3 -3
- package/dist/access-service-helpers.d.ts +5 -5
- package/dist/access-service.d.ts +5 -5
- package/dist/access-service.js +42 -41
- package/dist/access-surface-catalog.d.ts +5 -5
- package/dist/access-surface-catalog.js +44 -43
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-wearables-meetings-surface.d.ts +2 -2
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/behavior-learner.js +1 -1
- package/dist/bootstrap.d.ts +4 -4
- package/dist/briefing-window.d.ts +36 -0
- package/dist/briefing-window.js +9 -0
- package/dist/briefing.d.ts +1 -1
- package/dist/briefing.js +15 -14
- package/dist/buffer.d.ts +1 -1
- package/dist/buffer.js +4 -4
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.js +17 -17
- 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-LEPOP46W.js → chunk-227UFSEQ.js} +4 -4
- package/dist/{chunk-ZUKIUXHQ.js → chunk-2GD6MLXD.js} +9 -9
- package/dist/{chunk-2FKEIPIT.js → chunk-2T5AWWMF.js} +2 -2
- package/dist/{chunk-HBUFQRIM.js → chunk-3DVG3GRQ.js} +2 -2
- package/dist/{chunk-QZLDRQ4I.js → chunk-47J4EDGR.js} +3 -3
- package/dist/{chunk-K26NWEOC.js → chunk-4ESX4WX2.js} +4 -4
- package/dist/{chunk-46SZBVDS.js → chunk-4GE3NA5I.js} +2 -2
- package/dist/{chunk-FPLM2TKD.js → chunk-5V64M56S.js} +2 -2
- package/dist/{chunk-37DZZFFM.js → chunk-6G4D222J.js} +2 -2
- package/dist/{chunk-FFRTNF3L.js → chunk-6PCND4O2.js} +2 -2
- package/dist/{chunk-26ZXBTYN.js → chunk-7DISPKXT.js} +4 -4
- package/dist/{chunk-JYG4OLWH.js → chunk-7SF5BAWF.js} +2 -2
- package/dist/{chunk-XZHE2DEN.js → chunk-BXIMH7MC.js} +2 -2
- package/dist/{chunk-FTPONF6B.js → chunk-E2GZSFR5.js} +2 -2
- package/dist/{chunk-I3MSGFGD.js → chunk-ELXP665P.js} +2 -2
- package/dist/{chunk-EKTP7MNS.js → chunk-F2BOUJUS.js} +6 -6
- package/dist/{chunk-3TIZPSJC.js → chunk-FEBHRT2I.js} +3 -3
- package/dist/{chunk-W5ZKPI34.js → chunk-FPKKFDO4.js} +124 -124
- package/dist/{chunk-UPLZNJKN.js → chunk-FYZKFLKY.js} +2 -2
- package/dist/{chunk-FWX7W5PM.js → chunk-G7YUH4WT.js} +2 -2
- package/dist/{chunk-PT54WISF.js → chunk-IEQCHXUS.js} +9 -9
- package/dist/{chunk-YXQEKCZM.js → chunk-IOYXIY7W.js} +2 -2
- package/dist/{chunk-CIAI24TQ.js → chunk-JKW663ZN.js} +2 -2
- package/dist/{chunk-V6ERBR7U.js → chunk-K44N3CFW.js} +2 -2
- package/dist/{chunk-TO7ZTWJW.js → chunk-KMWYZTIE.js} +2 -2
- package/dist/{chunk-IPLYGWQF.js → chunk-KQAFEZQX.js} +5 -5
- package/dist/{chunk-S354QO4R.js → chunk-LHIBA4G7.js} +2 -2
- package/dist/{chunk-UCTS3DDH.js → chunk-M3UYE6PS.js} +2 -2
- package/dist/{chunk-RUNORG2P.js → chunk-MANCJV6J.js} +6 -11
- package/dist/chunk-MANCJV6J.js.map +1 -0
- package/dist/{chunk-D3LBIUWV.js → chunk-MTF5EFFF.js} +39 -39
- package/dist/{chunk-IKP5OYQQ.js → chunk-NUA4VM46.js} +2 -2
- package/dist/{chunk-UYYW2KPU.js → chunk-OIOV4RJE.js} +2 -2
- package/dist/{chunk-BIJAWZYW.js → chunk-OLT3YTDH.js} +4 -4
- package/dist/{chunk-RZQ6W2W4.js → chunk-OS5DYALF.js} +23 -23
- package/dist/{chunk-IQ4NVWEF.js → chunk-OTUFRUV3.js} +2 -2
- package/dist/{chunk-KFBOPMF6.js → chunk-OWC42MDT.js} +4 -4
- package/dist/{chunk-GJ776BC2.js → chunk-P2FA65P2.js} +4 -3
- package/dist/{chunk-GJ776BC2.js.map → chunk-P2FA65P2.js.map} +1 -1
- package/dist/{chunk-43SEBY2M.js → chunk-PCRHFB75.js} +1 -1
- package/dist/{chunk-GN3WRFJY.js → chunk-QC6BILS7.js} +6 -6
- package/dist/{chunk-NISZQW72.js → chunk-QDWDVNWU.js} +2 -2
- package/dist/{chunk-6CYHUWCO.js → chunk-QGKCM7C4.js} +2 -2
- package/dist/{chunk-2QSZNTDO.js → chunk-RKNJBZ55.js} +4 -4
- package/dist/{chunk-QCECHYZL.js → chunk-RVO6TCTU.js} +6 -6
- package/dist/{chunk-MIH3CJPN.js → chunk-TPWBUKS3.js} +3 -3
- package/dist/chunk-UBCBDJOB.js +22 -0
- package/dist/chunk-UBCBDJOB.js.map +1 -0
- package/dist/{chunk-UKYS3NU5.js → chunk-UQWUDD7E.js} +2 -2
- package/dist/{chunk-7BD6O7ZV.js → chunk-XCO2NXPZ.js} +3 -3
- package/dist/{chunk-7TBXNYLO.js → chunk-XDBFSUHX.js} +2 -2
- package/dist/{chunk-W6FNX2LP.js → chunk-XWZ6KOL6.js} +2 -2
- package/dist/{chunk-M4YHAODQ.js → chunk-XXRRHING.js} +285 -232
- package/dist/chunk-XXRRHING.js.map +1 -0
- package/dist/{chunk-ZRZVLB7O.js → chunk-YZFPEHXF.js} +2 -2
- package/dist/{chunk-OUKBMQ2O.js → chunk-Z3SQEEB6.js} +2 -2
- package/dist/{chunk-BRR5EUTF.js → chunk-Z463UYI6.js} +2 -2
- package/dist/{chunk-5FD7JMTX.js → chunk-ZUJW327U.js} +2 -2
- package/dist/{chunk-AHZOMHWN.js → chunk-ZXGKQQ3L.js} +1 -1
- package/dist/{cli-BPDUXnAl.d.ts → cli-DNvGlD4i.d.ts} +3 -3
- package/dist/cli.d.ts +6 -6
- package/dist/cli.js +68 -67
- package/dist/coding/pre-action-gate.js +2 -2
- package/dist/compounding/engine.d.ts +1 -1
- package/dist/compounding/engine.js +14 -14
- package/dist/connectors/codex-materialize-runner.js +14 -14
- package/dist/connectors/index.js +14 -14
- package/dist/consolidation-provenance-check.d.ts +1 -1
- package/dist/consolidation-undo.d.ts +1 -1
- package/dist/contradiction/index.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +1 -1
- package/dist/convergence-refresh.js +16 -16
- package/dist/conversation-index/backend.js +2 -2
- package/dist/corpus-watermark.js +16 -16
- package/dist/entity-retrieval.d.ts +1 -1
- package/dist/entity-retrieval.js +14 -14
- package/dist/explicit-capture.d.ts +4 -4
- package/dist/external-wiki-access.d.ts +5 -5
- package/dist/external-wiki-access.js +43 -42
- package/dist/external-wiki-mcp-tools.d.ts +5 -5
- package/dist/extraction.js +24 -24
- package/dist/{graph-edge-decay-65KMOJWY.js → graph-edge-decay-JI2XDCTY.js} +4 -4
- package/dist/graph-edge-decay-JI2XDCTY.js.map +1 -0
- package/dist/graph-snapshot.js +3 -3
- package/dist/graph.js +2 -2
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +124 -123
- package/dist/local-llm.js +2 -2
- package/dist/maintenance/memory-governance.js +14 -14
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +1 -1
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +14 -14
- package/dist/maintenance/rebuild-memory-projection.d.ts +1 -1
- package/dist/maintenance/rebuild-memory-projection.js +15 -15
- package/dist/{maintenance-C8aRWfhq.d.ts → maintenance-laHYTo0s.d.ts} +1 -1
- package/dist/mcp-memory-inspector-app.d.ts +5 -5
- package/dist/memory-worth-outcomes.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +1 -1
- package/dist/namespaces/migrate.js +15 -15
- package/dist/namespaces/search.js +6 -6
- package/dist/namespaces/storage.d.ts +1 -1
- package/dist/namespaces/storage.js +14 -14
- package/dist/offline-sync-impression-drain.js +1 -1
- package/dist/operator-doctor-corpus.js +17 -17
- package/dist/operator-toolkit.d.ts +1 -1
- package/dist/operator-toolkit.js +24 -24
- package/dist/orchestration/compression-guideline-coordinator.d.ts +1 -1
- package/dist/orchestration/maintenance.d.ts +2 -2
- package/dist/orchestration/maintenance.js +20 -20
- package/dist/{orchestrator-D85CzDDY.d.ts → orchestrator-Cz2QmqsN.d.ts} +3 -3
- package/dist/orchestrator.d.ts +4 -4
- package/dist/orchestrator.js +127 -126
- package/dist/policy-runtime.js +1 -1
- package/dist/{public-http-D3GBeII4.d.ts → public-http-Dq2iqtcI.d.ts} +1 -1
- package/dist/qmd.js +4 -4
- package/dist/recall-planner-llm.js +3 -3
- package/dist/search/factory.js +5 -5
- package/dist/search/index.js +5 -5
- package/dist/semantic-consolidation.js +15 -15
- package/dist/semantic-rule-promotion.js +14 -14
- package/dist/semantic-rule-verifier.js +14 -14
- package/dist/{service-DT-pJyda.d.ts → service-D_ddZmpI.d.ts} +1 -1
- package/dist/source-agent-qualifier.js +19 -19
- package/dist/{storage-qOnaJ1Lw.d.ts → storage-Cdz7jb9t.d.ts} +14 -9
- package/dist/storage.d.ts +1 -1
- package/dist/storage.js +13 -13
- package/dist/summarizer.js +3 -3
- package/dist/support-passport/index.d.ts +8 -8
- package/dist/support-passport/index.js +45 -44
- package/dist/tier-migration.d.ts +1 -1
- package/dist/transfer/autodetect.js +1 -1
- package/dist/transfer/backup.js +1 -1
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/verified-recall.js +14 -14
- package/package.json +2 -2
- package/src/briefing-window.ts +27 -0
- package/src/briefing.test.ts +29 -0
- package/src/briefing.ts +2 -9
- package/src/maintenance/memory-governance.ts +1 -0
- package/src/storage/memory-read-store.ts +1 -0
- package/src/storage/windowed-memory-read.ts +109 -0
- package/src/storage.ts +7 -13
- package/src/testing/subjects/windowed-memory-read.test.ts +146 -0
- package/dist/chunk-M4YHAODQ.js.map +0 -1
- package/dist/chunk-RUNORG2P.js.map +0 -1
- /package/dist/{graph-edge-decay-65KMOJWY.js.map → briefing-window.js.map} +0 -0
- /package/dist/{chunk-LEPOP46W.js.map → chunk-227UFSEQ.js.map} +0 -0
- /package/dist/{chunk-ZUKIUXHQ.js.map → chunk-2GD6MLXD.js.map} +0 -0
- /package/dist/{chunk-2FKEIPIT.js.map → chunk-2T5AWWMF.js.map} +0 -0
- /package/dist/{chunk-HBUFQRIM.js.map → chunk-3DVG3GRQ.js.map} +0 -0
- /package/dist/{chunk-QZLDRQ4I.js.map → chunk-47J4EDGR.js.map} +0 -0
- /package/dist/{chunk-K26NWEOC.js.map → chunk-4ESX4WX2.js.map} +0 -0
- /package/dist/{chunk-46SZBVDS.js.map → chunk-4GE3NA5I.js.map} +0 -0
- /package/dist/{chunk-FPLM2TKD.js.map → chunk-5V64M56S.js.map} +0 -0
- /package/dist/{chunk-37DZZFFM.js.map → chunk-6G4D222J.js.map} +0 -0
- /package/dist/{chunk-FFRTNF3L.js.map → chunk-6PCND4O2.js.map} +0 -0
- /package/dist/{chunk-26ZXBTYN.js.map → chunk-7DISPKXT.js.map} +0 -0
- /package/dist/{chunk-JYG4OLWH.js.map → chunk-7SF5BAWF.js.map} +0 -0
- /package/dist/{chunk-XZHE2DEN.js.map → chunk-BXIMH7MC.js.map} +0 -0
- /package/dist/{chunk-FTPONF6B.js.map → chunk-E2GZSFR5.js.map} +0 -0
- /package/dist/{chunk-I3MSGFGD.js.map → chunk-ELXP665P.js.map} +0 -0
- /package/dist/{chunk-EKTP7MNS.js.map → chunk-F2BOUJUS.js.map} +0 -0
- /package/dist/{chunk-3TIZPSJC.js.map → chunk-FEBHRT2I.js.map} +0 -0
- /package/dist/{chunk-W5ZKPI34.js.map → chunk-FPKKFDO4.js.map} +0 -0
- /package/dist/{chunk-UPLZNJKN.js.map → chunk-FYZKFLKY.js.map} +0 -0
- /package/dist/{chunk-FWX7W5PM.js.map → chunk-G7YUH4WT.js.map} +0 -0
- /package/dist/{chunk-PT54WISF.js.map → chunk-IEQCHXUS.js.map} +0 -0
- /package/dist/{chunk-YXQEKCZM.js.map → chunk-IOYXIY7W.js.map} +0 -0
- /package/dist/{chunk-CIAI24TQ.js.map → chunk-JKW663ZN.js.map} +0 -0
- /package/dist/{chunk-V6ERBR7U.js.map → chunk-K44N3CFW.js.map} +0 -0
- /package/dist/{chunk-TO7ZTWJW.js.map → chunk-KMWYZTIE.js.map} +0 -0
- /package/dist/{chunk-IPLYGWQF.js.map → chunk-KQAFEZQX.js.map} +0 -0
- /package/dist/{chunk-S354QO4R.js.map → chunk-LHIBA4G7.js.map} +0 -0
- /package/dist/{chunk-UCTS3DDH.js.map → chunk-M3UYE6PS.js.map} +0 -0
- /package/dist/{chunk-D3LBIUWV.js.map → chunk-MTF5EFFF.js.map} +0 -0
- /package/dist/{chunk-IKP5OYQQ.js.map → chunk-NUA4VM46.js.map} +0 -0
- /package/dist/{chunk-UYYW2KPU.js.map → chunk-OIOV4RJE.js.map} +0 -0
- /package/dist/{chunk-BIJAWZYW.js.map → chunk-OLT3YTDH.js.map} +0 -0
- /package/dist/{chunk-RZQ6W2W4.js.map → chunk-OS5DYALF.js.map} +0 -0
- /package/dist/{chunk-IQ4NVWEF.js.map → chunk-OTUFRUV3.js.map} +0 -0
- /package/dist/{chunk-KFBOPMF6.js.map → chunk-OWC42MDT.js.map} +0 -0
- /package/dist/{chunk-43SEBY2M.js.map → chunk-PCRHFB75.js.map} +0 -0
- /package/dist/{chunk-GN3WRFJY.js.map → chunk-QC6BILS7.js.map} +0 -0
- /package/dist/{chunk-NISZQW72.js.map → chunk-QDWDVNWU.js.map} +0 -0
- /package/dist/{chunk-6CYHUWCO.js.map → chunk-QGKCM7C4.js.map} +0 -0
- /package/dist/{chunk-2QSZNTDO.js.map → chunk-RKNJBZ55.js.map} +0 -0
- /package/dist/{chunk-QCECHYZL.js.map → chunk-RVO6TCTU.js.map} +0 -0
- /package/dist/{chunk-MIH3CJPN.js.map → chunk-TPWBUKS3.js.map} +0 -0
- /package/dist/{chunk-UKYS3NU5.js.map → chunk-UQWUDD7E.js.map} +0 -0
- /package/dist/{chunk-7BD6O7ZV.js.map → chunk-XCO2NXPZ.js.map} +0 -0
- /package/dist/{chunk-7TBXNYLO.js.map → chunk-XDBFSUHX.js.map} +0 -0
- /package/dist/{chunk-W6FNX2LP.js.map → chunk-XWZ6KOL6.js.map} +0 -0
- /package/dist/{chunk-ZRZVLB7O.js.map → chunk-YZFPEHXF.js.map} +0 -0
- /package/dist/{chunk-OUKBMQ2O.js.map → chunk-Z3SQEEB6.js.map} +0 -0
- /package/dist/{chunk-BRR5EUTF.js.map → chunk-Z463UYI6.js.map} +0 -0
- /package/dist/{chunk-5FD7JMTX.js.map → chunk-ZUJW327U.js.map} +0 -0
- /package/dist/{chunk-AHZOMHWN.js.map → chunk-ZXGKQQ3L.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
exportCapsule,
|
|
3
3
|
isValidCapsuleSince
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-J4EB7DNW.js";
|
|
4
|
+
} from "../chunk-KQAFEZQX.js";
|
|
6
5
|
import "../chunk-WEHSQBFR.js";
|
|
7
6
|
import "../chunk-X7Y7WX73.js";
|
|
7
|
+
import "../chunk-J4EB7DNW.js";
|
|
8
8
|
import "../chunk-BJMBJZ2Y.js";
|
|
9
9
|
import "../chunk-UKJAGEXH.js";
|
|
10
10
|
import "../chunk-FP2373TW.js";
|
package/dist/verified-recall.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compareVerifiedEpisodeResults,
|
|
3
3
|
searchVerifiedEpisodes
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZUJW327U.js";
|
|
5
5
|
import "./chunk-B7RWBZXW.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-MLPTFODV.js";
|
|
6
|
+
import "./chunk-XXRRHING.js";
|
|
8
7
|
import "./chunk-UHVXE24Y.js";
|
|
8
|
+
import "./chunk-MLPTFODV.js";
|
|
9
9
|
import "./chunk-SXIMQLGV.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-KMWYZTIE.js";
|
|
11
|
+
import "./chunk-47J4EDGR.js";
|
|
12
12
|
import "./chunk-XL3TATMJ.js";
|
|
13
13
|
import "./chunk-VANZKHTN.js";
|
|
14
14
|
import "./chunk-CYEPCZN5.js";
|
|
@@ -17,10 +17,10 @@ import "./chunk-VYISFWVX.js";
|
|
|
17
17
|
import "./chunk-W7IGLX4G.js";
|
|
18
18
|
import "./chunk-GWFSVJ4P.js";
|
|
19
19
|
import "./chunk-GUMZC2BO.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-227UFSEQ.js";
|
|
21
|
+
import "./chunk-ET356KSB.js";
|
|
21
22
|
import "./chunk-72A4L5JJ.js";
|
|
22
23
|
import "./chunk-A7Q43EUZ.js";
|
|
23
|
-
import "./chunk-ET356KSB.js";
|
|
24
24
|
import "./chunk-S2V7RUCL.js";
|
|
25
25
|
import "./chunk-76JJSXK7.js";
|
|
26
26
|
import "./chunk-SCU65EZI.js";
|
|
@@ -33,8 +33,8 @@ import "./chunk-AAD2ZS6P.js";
|
|
|
33
33
|
import "./chunk-K2UGPTYY.js";
|
|
34
34
|
import "./chunk-NSVDUN76.js";
|
|
35
35
|
import "./chunk-BT7NVCML.js";
|
|
36
|
-
import "./chunk-3ONXXHQO.js";
|
|
37
36
|
import "./chunk-YXZG5TVN.js";
|
|
37
|
+
import "./chunk-3ONXXHQO.js";
|
|
38
38
|
import "./chunk-5GINB5LC.js";
|
|
39
39
|
import "./chunk-G7D6GZ5J.js";
|
|
40
40
|
import "./chunk-ZMSZVISA.js";
|
|
@@ -43,18 +43,18 @@ import "./chunk-RBOJCG4T.js";
|
|
|
43
43
|
import "./chunk-GSTIBXBW.js";
|
|
44
44
|
import "./chunk-5WITETWU.js";
|
|
45
45
|
import "./chunk-6CIAGZ6X.js";
|
|
46
|
+
import "./chunk-RVO6TCTU.js";
|
|
47
|
+
import "./chunk-URS5GSM7.js";
|
|
48
|
+
import "./chunk-IUM3VSHI.js";
|
|
49
|
+
import "./chunk-ZLQ37WJX.js";
|
|
50
|
+
import "./chunk-XMMESCPD.js";
|
|
51
|
+
import "./chunk-42JKGUFJ.js";
|
|
46
52
|
import "./chunk-UW5NPZJ2.js";
|
|
47
53
|
import "./chunk-QIEUU4UK.js";
|
|
48
54
|
import "./chunk-L2EXJQJP.js";
|
|
49
55
|
import "./chunk-45GF7Y3V.js";
|
|
50
56
|
import "./chunk-RGMVMVMF.js";
|
|
51
57
|
import "./chunk-N7RWREIQ.js";
|
|
52
|
-
import "./chunk-QCECHYZL.js";
|
|
53
|
-
import "./chunk-URS5GSM7.js";
|
|
54
|
-
import "./chunk-ZLQ37WJX.js";
|
|
55
|
-
import "./chunk-IUM3VSHI.js";
|
|
56
|
-
import "./chunk-XMMESCPD.js";
|
|
57
|
-
import "./chunk-42JKGUFJ.js";
|
|
58
58
|
import "./chunk-VOELBUS4.js";
|
|
59
59
|
import "./chunk-ZIKENA2C.js";
|
|
60
60
|
import "./chunk-PQVCH2AE.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/core",
|
|
3
|
-
"version": "9.54.
|
|
3
|
+
"version": "9.54.8",
|
|
4
4
|
"description": "Framework-agnostic Remnic memory engine — orchestrator, storage, extraction, search, trust zones",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -3136,7 +3136,7 @@
|
|
|
3136
3136
|
"core"
|
|
3137
3137
|
],
|
|
3138
3138
|
"peerDependencies": {
|
|
3139
|
-
"@remnic/coding-graph": "^9.54.
|
|
3139
|
+
"@remnic/coding-graph": "^9.54.8"
|
|
3140
3140
|
},
|
|
3141
3141
|
"peerDependenciesMeta": {
|
|
3142
3142
|
"@remnic/coding-graph": {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { log } from "./logger.js";
|
|
2
|
+
import type { MemoryFile } from "./types.js";
|
|
3
|
+
type BriefingMemoryReader = {
|
|
4
|
+
readMemoriesWindow?: (options: { updatedAfter?: Date }) => Promise<{ memories: MemoryFile[] }>;
|
|
5
|
+
readAllMemories: () => Promise<MemoryFile[]>;
|
|
6
|
+
};
|
|
7
|
+
import type { ParsedBriefingWindow } from "./briefing.js";
|
|
8
|
+
|
|
9
|
+
/** Read only the memories needed by a briefing, with compatibility fallback. */
|
|
10
|
+
export async function safeReadMemories(
|
|
11
|
+
storage: BriefingMemoryReader,
|
|
12
|
+
window: ParsedBriefingWindow
|
|
13
|
+
): Promise<MemoryFile[]> {
|
|
14
|
+
try {
|
|
15
|
+
// A briefing only needs memories inside its lookback window. Avoid parsing
|
|
16
|
+
// the full corpus on cache misses; keep the full-read fallback for custom
|
|
17
|
+
// StorageManager-compatible callers that predate readMemoriesWindow().
|
|
18
|
+
if (typeof storage.readMemoriesWindow === "function") {
|
|
19
|
+
const result = await storage.readMemoriesWindow({ updatedAfter: window.from });
|
|
20
|
+
return result.memories;
|
|
21
|
+
}
|
|
22
|
+
return await storage.readAllMemories();
|
|
23
|
+
} catch (err) {
|
|
24
|
+
log.warn(`briefing: read memories failed: ${err}`);
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
}
|
package/src/briefing.test.ts
CHANGED
|
@@ -913,6 +913,35 @@ function makeEmptyStorage(): StorageManager {
|
|
|
913
913
|
readAllEntityFiles: async () => [],
|
|
914
914
|
} as unknown as StorageManager;
|
|
915
915
|
}
|
|
916
|
+
test("buildBriefing reads only memories updated inside the briefing window", async () => {
|
|
917
|
+
let readWindowOptions: { updatedAfter?: Date } | undefined;
|
|
918
|
+
const atWindowStart = makeMemory("2026-04-10T00:00:00.000Z");
|
|
919
|
+
const atWindowEnd = makeMemory("2026-04-11T00:00:00.000Z");
|
|
920
|
+
const storage = {
|
|
921
|
+
readAllMemories: async () => {
|
|
922
|
+
throw new Error("full corpus read must not be used by briefing");
|
|
923
|
+
},
|
|
924
|
+
readMemoriesWindow: async (options: { updatedAfter?: Date }) => {
|
|
925
|
+
readWindowOptions = options;
|
|
926
|
+
return {
|
|
927
|
+
memories: [atWindowStart, atWindowEnd],
|
|
928
|
+
filePaths: [atWindowStart.path, atWindowEnd.path],
|
|
929
|
+
};
|
|
930
|
+
},
|
|
931
|
+
readAllEntityFiles: async () => [],
|
|
932
|
+
} as unknown as StorageManager;
|
|
933
|
+
|
|
934
|
+
const result = await buildBriefing({
|
|
935
|
+
storage,
|
|
936
|
+
window: makeWindow("2026-04-10T00:00:00.000Z", "2026-04-11T00:00:00.000Z"),
|
|
937
|
+
allowLlm: false,
|
|
938
|
+
now: new Date("2026-04-11T10:00:00.000Z"),
|
|
939
|
+
});
|
|
940
|
+
|
|
941
|
+
assert.equal(readWindowOptions?.updatedAfter?.toISOString(), "2026-04-10T00:00:00.000Z");
|
|
942
|
+
assert.equal(result.sections.activeThreads.length, 1);
|
|
943
|
+
});
|
|
944
|
+
|
|
916
945
|
|
|
917
946
|
test("buildBriefing excludes support passport records from generated context", async () => {
|
|
918
947
|
const generatedPrompts: unknown[] = [];
|
package/src/briefing.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { extractJsonCandidates } from "./json-extract.js";
|
|
|
23
23
|
import { drainPassiveCorrectionNotifications } from "./correction/passive-correction-notifications.js";
|
|
24
24
|
import { excludeSupportPassportPrivateMemories } from "./support-passport/card-projection.js";
|
|
25
25
|
import { normalizeEntityName, StorageManager } from "./storage.js";
|
|
26
|
+
import { safeReadMemories } from "./briefing-window.js";
|
|
26
27
|
import { readEnvVar, resolveHomeDir } from "./runtime/env.js";
|
|
27
28
|
import type {
|
|
28
29
|
BriefingActiveThread,
|
|
@@ -834,7 +835,7 @@ export async function buildBriefing(options: BuildBriefingOptions): Promise<Brie
|
|
|
834
835
|
const focus = options.focus ?? null;
|
|
835
836
|
|
|
836
837
|
const [allMemories, allEntities] = await Promise.all([
|
|
837
|
-
safeReadMemories(options.storage),
|
|
838
|
+
safeReadMemories(options.storage, window).then(excludeSupportPassportPrivateMemories),
|
|
838
839
|
safeReadEntities(options.storage),
|
|
839
840
|
]);
|
|
840
841
|
|
|
@@ -977,14 +978,6 @@ function defaultWindow(now: Date): ParsedBriefingWindow {
|
|
|
977
978
|
return { from: new Date(now.getTime() - DAY_MS), to: now, label: "yesterday" };
|
|
978
979
|
}
|
|
979
980
|
|
|
980
|
-
async function safeReadMemories(storage: StorageManager): Promise<MemoryFile[]> {
|
|
981
|
-
try {
|
|
982
|
-
return excludeSupportPassportPrivateMemories(await storage.readAllMemories());
|
|
983
|
-
} catch (err) { log.warn(`briefing: readAllMemories failed: ${err}`);
|
|
984
|
-
return [];
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
|
|
988
981
|
async function safeReadEntities(storage: StorageManager): Promise<EntityFile[]> {
|
|
989
982
|
try {
|
|
990
983
|
return await storage.readAllEntityFiles();
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { stat } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { getCachedMemories } from "../memory-cache.js";
|
|
4
|
+
import { readRawMemoryDocument } from "./memory-frontmatter-metadata.js";
|
|
5
|
+
import type { MemoryFile } from "../types.js";
|
|
6
|
+
import type { MemoryReadStore } from "./memory-read-store.js";
|
|
7
|
+
|
|
8
|
+
export interface WindowedMemoryReadOptions {
|
|
9
|
+
maxMemories?: number;
|
|
10
|
+
batchSize?: number;
|
|
11
|
+
updatedAfter?: Date;
|
|
12
|
+
/** Require candidate paths so malformed files can be reported by governance. */
|
|
13
|
+
includeMalformedPaths?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface WindowedMemoryReadResult {
|
|
17
|
+
memories: MemoryFile[];
|
|
18
|
+
filePaths: string[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
type WindowedMemoryReadStore = Pick<MemoryReadStore, "readMemoriesWindow">;
|
|
22
|
+
|
|
23
|
+
type HotMemoryCache = {
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
baseDir: string;
|
|
26
|
+
corpusVersion: number;
|
|
27
|
+
cacheKeyId: string;
|
|
28
|
+
ttlMs?: number;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Serve the briefing-only updatedAfter shape from the warm corpus cache, then
|
|
33
|
+
* delegate all other window reads to MemoryReadStore.
|
|
34
|
+
*/
|
|
35
|
+
export async function readWindowedMemories(
|
|
36
|
+
store: WindowedMemoryReadStore,
|
|
37
|
+
options: WindowedMemoryReadOptions,
|
|
38
|
+
hotCache: HotMemoryCache,
|
|
39
|
+
rememberMemorySnapshots: (memories: MemoryFile[]) => MemoryFile[]
|
|
40
|
+
): Promise<WindowedMemoryReadResult> {
|
|
41
|
+
if (
|
|
42
|
+
options.updatedAfter !== undefined &&
|
|
43
|
+
(!(options.updatedAfter instanceof Date) || !Number.isFinite(options.updatedAfter.getTime()))
|
|
44
|
+
) {
|
|
45
|
+
throw new TypeError("updatedAfter must be a valid Date");
|
|
46
|
+
}
|
|
47
|
+
if (
|
|
48
|
+
hotCache.enabled &&
|
|
49
|
+
options.updatedAfter !== undefined &&
|
|
50
|
+
options.maxMemories === undefined &&
|
|
51
|
+
options.batchSize === undefined &&
|
|
52
|
+
options.includeMalformedPaths !== true
|
|
53
|
+
) {
|
|
54
|
+
const cached = getCachedMemories(hotCache.baseDir, hotCache.corpusVersion, hotCache.cacheKeyId, hotCache.ttlMs);
|
|
55
|
+
if (cached !== null) {
|
|
56
|
+
const updatedAfterMs = options.updatedAfter.getTime();
|
|
57
|
+
const selected = (
|
|
58
|
+
await Promise.all(
|
|
59
|
+
cached.map(async (memory) => {
|
|
60
|
+
const timestampMs = await readWindowTimestamp(memory);
|
|
61
|
+
return timestampMs === null || timestampMs >= updatedAfterMs ? memory : null;
|
|
62
|
+
})
|
|
63
|
+
)
|
|
64
|
+
).filter((memory): memory is MemoryFile => memory !== null);
|
|
65
|
+
const memories = orderWindowMemories(selected, hotCache.baseDir);
|
|
66
|
+
return { memories: rememberMemorySnapshots(memories), filePaths: memories.map((memory) => memory.path) };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const result = await store.readMemoriesWindow(options);
|
|
70
|
+
return {
|
|
71
|
+
...result,
|
|
72
|
+
memories: rememberMemorySnapshots(result.memories),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async function readWindowTimestamp(memory: MemoryFile): Promise<number | null> {
|
|
77
|
+
const rawDocument = readRawMemoryDocument(memory);
|
|
78
|
+
const frontmatterBlock = rawDocument?.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/)?.[1];
|
|
79
|
+
const rawTimestamp =
|
|
80
|
+
frontmatterBlock?.match(/^[ \t]*updated:[ \t]*"?([^"\r\n]*)"?/m)?.[1] ||
|
|
81
|
+
frontmatterBlock?.match(/^[ \t]*created:[ \t]*"?([^"\r\n]*)"?/m)?.[1] ||
|
|
82
|
+
memory.frontmatter.updated ||
|
|
83
|
+
memory.frontmatter.created;
|
|
84
|
+
const timestampMs = typeof rawTimestamp === "string" ? Date.parse(rawTimestamp.trim()) : Number.NaN;
|
|
85
|
+
if (Number.isFinite(timestampMs)) return timestampMs;
|
|
86
|
+
try {
|
|
87
|
+
return (await stat(memory.path)).mtimeMs;
|
|
88
|
+
} catch {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function orderWindowMemories(memories: MemoryFile[], baseDir: string): MemoryFile[] {
|
|
94
|
+
const correctionsRoot = path.join(baseDir, "corrections");
|
|
95
|
+
const corrections = memories
|
|
96
|
+
.filter((memory) => memory.path === correctionsRoot || memory.path.startsWith(`${correctionsRoot}${path.sep}`))
|
|
97
|
+
.sort((left, right) => right.path.localeCompare(left.path));
|
|
98
|
+
const facts = memories
|
|
99
|
+
.filter((memory) => memory.path !== correctionsRoot && !memory.path.startsWith(`${correctionsRoot}${path.sep}`))
|
|
100
|
+
.sort((left, right) => right.path.localeCompare(left.path));
|
|
101
|
+
const ordered: MemoryFile[] = [];
|
|
102
|
+
for (let index = 0; index < Math.max(corrections.length, facts.length); index += 1) {
|
|
103
|
+
const correction = corrections[index];
|
|
104
|
+
if (correction) ordered.push(correction);
|
|
105
|
+
const fact = facts[index];
|
|
106
|
+
if (fact) ordered.push(fact);
|
|
107
|
+
}
|
|
108
|
+
return ordered;
|
|
109
|
+
}
|
package/src/storage.ts
CHANGED
|
@@ -26,7 +26,7 @@ import { resolveSafeStoragePath } from "./storage-paths.js";
|
|
|
26
26
|
import { log } from "./logger.js";
|
|
27
27
|
import { createMemorySnapshot } from "./memory-snapshot.js";
|
|
28
28
|
import { assertMemoryFrontmatterId, warnProjectionFallback } from "./storage-guards.js";
|
|
29
|
-
import { MemoryReadStore } from "./storage/memory-read-store.js";
|
|
29
|
+
import { MemoryReadStore, readWindowedMemories, type WindowedMemoryReadOptions, type WindowedMemoryReadResult } from "./storage/memory-read-store.js";
|
|
30
30
|
import { hasSupersessionAudit } from "./storage/supersession-audit.js";
|
|
31
31
|
import { runCommittedInvalidation } from "./storage/committed-invalidation.js";
|
|
32
32
|
import { renderProfileWithLastUpdated } from "./storage/profile-header.js";
|
|
@@ -4735,14 +4735,14 @@ export class StorageManager extends TombstoneBlockedCaptureIndexHost {
|
|
|
4735
4735
|
private async readWindowUpdatedMs(filePath: string): Promise<number | null> {
|
|
4736
4736
|
try {
|
|
4737
4737
|
const raw = await readMaybeEncryptedFile(filePath, this._secureStoreKey, this.baseDir);
|
|
4738
|
-
const match = raw.match(/^---\n([\s\S]*?)\n
|
|
4738
|
+
const match = raw.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
|
|
4739
4739
|
if (!match) return null;
|
|
4740
4740
|
const frontmatterBlock = match[1];
|
|
4741
4741
|
const rawUpdated =
|
|
4742
|
-
frontmatterBlock.match(/^updated
|
|
4743
|
-
frontmatterBlock.match(/^created
|
|
4742
|
+
frontmatterBlock.match(/^[ \t]*updated:[ \t]*"?([^"\r\n]*)"?/m)?.[1] ||
|
|
4743
|
+
frontmatterBlock.match(/^[ \t]*created:[ \t]*"?([^"\r\n]*)"?/m)?.[1] ||
|
|
4744
4744
|
null;
|
|
4745
|
-
const updatedMs = rawUpdated ? Date.parse(rawUpdated) : Number.NaN;
|
|
4745
|
+
const updatedMs = rawUpdated ? Date.parse(rawUpdated.trim()) : Number.NaN;
|
|
4746
4746
|
return Number.isFinite(updatedMs) ? updatedMs : null;
|
|
4747
4747
|
} catch {
|
|
4748
4748
|
return null;
|
|
@@ -4827,14 +4827,8 @@ export class StorageManager extends TombstoneBlockedCaptureIndexHost {
|
|
|
4827
4827
|
return { memories, filePaths };
|
|
4828
4828
|
}
|
|
4829
4829
|
|
|
4830
|
-
async readMemoriesWindow(
|
|
4831
|
-
options:
|
|
4832
|
-
maxMemories?: number;
|
|
4833
|
-
batchSize?: number;
|
|
4834
|
-
updatedAfter?: Date;
|
|
4835
|
-
} = {}
|
|
4836
|
-
): Promise<{ memories: MemoryFile[]; filePaths: string[] }> {
|
|
4837
|
-
return this.memoryReadStore.readMemoriesWindow(options);
|
|
4830
|
+
async readMemoriesWindow(options: WindowedMemoryReadOptions = {}): Promise<WindowedMemoryReadResult> {
|
|
4831
|
+
return readWindowedMemories(this.memoryReadStore, options, { enabled: this.hotMemoriesCacheEnabled, baseDir: this.baseDir, corpusVersion: this.getMemoryCorpusVersion(), cacheKeyId: this.hotCacheKeyId(), ttlMs: this.hotCacheTtlMs() }, (memories) => this.rememberMemorySnapshots(memories));
|
|
4838
4832
|
}
|
|
4839
4833
|
|
|
4840
4834
|
private async _readAllMemoriesFromDisk(options?: CorpusReadOptions): Promise<MemoryFile[]> {
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { readFile, rm, utimes, writeFile } from "node:fs/promises";
|
|
3
|
+
|
|
4
|
+
import { type WindowedMemoryReadResult } from "../../storage/windowed-memory-read.js";
|
|
5
|
+
import { StorageManager } from "../../storage.js";
|
|
6
|
+
import { type LifecycleSubject, type MatrixRow, runLifecycleMatrix } from "../lifecycle-matrix.js";
|
|
7
|
+
import { mkTempMemoryDir } from "../orchestrator-lite.js";
|
|
8
|
+
|
|
9
|
+
type WindowResult = WindowedMemoryReadResult;
|
|
10
|
+
interface WindowedMemoryState {
|
|
11
|
+
dir: string;
|
|
12
|
+
storage: StorageManager;
|
|
13
|
+
updatedAfter: Date;
|
|
14
|
+
expectedIds: Set<string>;
|
|
15
|
+
excludedIds: Set<string>;
|
|
16
|
+
cold?: WindowResult;
|
|
17
|
+
warm?: WindowResult;
|
|
18
|
+
afterWrite?: WindowResult;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const UPDATED_AFTER = new Date("2021-01-01T00:00:00.000Z");
|
|
22
|
+
const INCLUDED = new Date("2021-01-02T00:00:00.000Z");
|
|
23
|
+
const BOUNDARY = UPDATED_AFTER.toISOString();
|
|
24
|
+
const OLD = new Date("2020-12-31T23:59:59.000Z").toISOString();
|
|
25
|
+
|
|
26
|
+
async function writeFixture(
|
|
27
|
+
storage: StorageManager,
|
|
28
|
+
content: string,
|
|
29
|
+
editFrontmatter: (raw: string) => string,
|
|
30
|
+
): Promise<{ id: string; filePath: string }> {
|
|
31
|
+
const written = await storage.writeMemory("fact", content);
|
|
32
|
+
const raw = await readFile(written.memory.path, "utf8");
|
|
33
|
+
await writeFile(written.memory.path, editFrontmatter(raw), "utf8");
|
|
34
|
+
return { id: written.id, filePath: written.memory.path };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async function readColdThenWarm(state: WindowedMemoryState): Promise<void> {
|
|
38
|
+
// The first window read must miss the process cache and exercise the real
|
|
39
|
+
// path census/filter/parser. Populate the hot corpus cache explicitly, then
|
|
40
|
+
// repeat the identical request through readWindowedMemories' warm branch.
|
|
41
|
+
state.cold = await state.storage.readMemoriesWindow({ updatedAfter: state.updatedAfter });
|
|
42
|
+
await state.storage.readAllMemories();
|
|
43
|
+
state.warm = await state.storage.readMemoriesWindow({ updatedAfter: state.updatedAfter });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const subject: LifecycleSubject<WindowedMemoryState> = {
|
|
47
|
+
async setup(row: MatrixRow): Promise<WindowedMemoryState> {
|
|
48
|
+
const dir = await mkTempMemoryDir(`windowed-read-${row.id}`);
|
|
49
|
+
try {
|
|
50
|
+
const storage = new StorageManager(dir, undefined, true);
|
|
51
|
+
await storage.ensureDirectories();
|
|
52
|
+
const expectedIds = new Set<string>();
|
|
53
|
+
const excludedIds = new Set<string>();
|
|
54
|
+
|
|
55
|
+
const boundary = await writeFixture(storage, "boundary timestamp", (raw) =>
|
|
56
|
+
raw.replace(/^updated:.*$/m, `updated: ${BOUNDARY}`),
|
|
57
|
+
);
|
|
58
|
+
expectedIds.add(boundary.id);
|
|
59
|
+
|
|
60
|
+
const old = await writeFixture(storage, "outside lower boundary", (raw) =>
|
|
61
|
+
raw.replace(/^updated:.*$/m, `updated: ${OLD}`),
|
|
62
|
+
);
|
|
63
|
+
excludedIds.add(old.id);
|
|
64
|
+
|
|
65
|
+
const blankUpdated = await writeFixture(storage, "blank updated falls back to created", (raw) =>
|
|
66
|
+
raw
|
|
67
|
+
.replace(/^created:.*$/m, `created: ${INCLUDED.toISOString()}`)
|
|
68
|
+
.replace(/^updated:.*$/m, "updated:"),
|
|
69
|
+
);
|
|
70
|
+
expectedIds.add(blankUpdated.id);
|
|
71
|
+
|
|
72
|
+
const indented = await writeFixture(storage, "indented keys parse on both paths", (raw) =>
|
|
73
|
+
raw
|
|
74
|
+
.replace(/^created:/m, " created:")
|
|
75
|
+
.replace(/^updated:/m, " updated:"),
|
|
76
|
+
);
|
|
77
|
+
expectedIds.add(indented.id);
|
|
78
|
+
|
|
79
|
+
const mtimeAbsent = await writeFixture(storage, "mtime fallback with absent timestamps", (raw) =>
|
|
80
|
+
raw.replace(/^created:.*\n/m, "").replace(/^updated:.*\n/m, ""),
|
|
81
|
+
);
|
|
82
|
+
await utimes(mtimeAbsent.filePath, INCLUDED, INCLUDED);
|
|
83
|
+
expectedIds.add(mtimeAbsent.id);
|
|
84
|
+
|
|
85
|
+
const mtimeInvalid = await writeFixture(storage, "mtime fallback with invalid timestamps", (raw) =>
|
|
86
|
+
raw
|
|
87
|
+
.replace(/^created:.*$/m, "created: not-a-timestamp")
|
|
88
|
+
.replace(/^updated:.*$/m, "updated: not-a-timestamp"),
|
|
89
|
+
);
|
|
90
|
+
await utimes(mtimeInvalid.filePath, INCLUDED, INCLUDED);
|
|
91
|
+
expectedIds.add(mtimeInvalid.id);
|
|
92
|
+
|
|
93
|
+
return { dir, storage, updatedAfter: UPDATED_AFTER, expectedIds, excludedIds };
|
|
94
|
+
} catch (error) {
|
|
95
|
+
await rm(dir, { recursive: true, force: true });
|
|
96
|
+
throw error;
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
async exercise(state: WindowedMemoryState, row: MatrixRow): Promise<void> {
|
|
101
|
+
if (row.dimensions.restart) {
|
|
102
|
+
state.storage = new StorageManager(state.dir, undefined, true);
|
|
103
|
+
await state.storage.ensureDirectories();
|
|
104
|
+
}
|
|
105
|
+
await readColdThenWarm(state);
|
|
106
|
+
|
|
107
|
+
if (row.id === "session-end") {
|
|
108
|
+
await state.storage.writeMemory("fact", "write after the first window read");
|
|
109
|
+
state.afterWrite = await state.storage.readMemoriesWindow({ updatedAfter: state.updatedAfter });
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
async invariants(state: WindowedMemoryState, row: MatrixRow): Promise<void> {
|
|
114
|
+
assert.ok(state.cold, `${row.id}: cold window result must exist`);
|
|
115
|
+
assert.ok(state.warm, `${row.id}: warm window result must exist`);
|
|
116
|
+
assert.deepEqual(
|
|
117
|
+
state.warm!.filePaths,
|
|
118
|
+
state.cold!.filePaths,
|
|
119
|
+
`${row.id}: warm and cold path selection/order must match`,
|
|
120
|
+
);
|
|
121
|
+
assert.deepEqual(
|
|
122
|
+
state.warm!.memories.map((memory) => memory.path),
|
|
123
|
+
state.cold!.memories.map((memory) => memory.path),
|
|
124
|
+
`${row.id}: warm and cold memory selection/order must match`,
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
const selectedIds = new Set(state.cold!.memories.map((memory) => memory.frontmatter.id));
|
|
128
|
+
for (const id of state.expectedIds) assert.ok(selectedIds.has(id), `${row.id}: expected fixture ${id} was selected`);
|
|
129
|
+
for (const id of state.excludedIds) assert.ok(!selectedIds.has(id), `${row.id}: pre-boundary fixture ${id} was excluded`);
|
|
130
|
+
|
|
131
|
+
if (row.id === "session-end") {
|
|
132
|
+
assert.ok(state.afterWrite, "cache invalidation row must perform a read after writing");
|
|
133
|
+
assert.equal(
|
|
134
|
+
state.afterWrite!.memories.some((memory) => memory.content.includes("write after the first window read")),
|
|
135
|
+
true,
|
|
136
|
+
"a write between reads must invalidate the window cache and expose the new memory",
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
async teardown(state: WindowedMemoryState): Promise<void> {
|
|
142
|
+
await rm(state.dir, { recursive: true, force: true });
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
runLifecycleMatrix("windowed-memory-read", subject);
|