@remnic/core 9.3.658 → 9.3.660
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-cli.js +17 -17
- package/dist/access-http.js +11 -10
- package/dist/access-mcp.js +10 -9
- package/dist/access-service.js +9 -8
- package/dist/briefing.js +4 -3
- package/dist/causal-consolidation.js +5 -4
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/{chunk-QFKRE7AU.js → chunk-256W7AXC.js} +4 -4
- package/dist/{chunk-5PFIMBJJ.js → chunk-2EVZ5EN6.js} +12 -12
- package/dist/{chunk-SCPFRKIT.js → chunk-42JKGUFJ.js} +6 -2
- package/dist/{chunk-SCPFRKIT.js.map → chunk-42JKGUFJ.js.map} +1 -1
- package/dist/{chunk-2VCTTEJM.js → chunk-7H7J3ZWN.js} +3 -3
- package/dist/{chunk-QRSKPI62.js → chunk-7PCZGNG2.js} +2 -2
- package/dist/{chunk-ZCMO46YY.js → chunk-A7EF2XRO.js} +2 -2
- package/dist/{chunk-BNUAOLDK.js → chunk-ANJOULTP.js} +2 -2
- package/dist/{chunk-CPPS65WS.js → chunk-AWJ2FHCF.js} +84 -17
- package/dist/chunk-AWJ2FHCF.js.map +1 -0
- package/dist/{chunk-4PLOQDBB.js → chunk-AX5O25EF.js} +7 -5
- package/dist/chunk-AX5O25EF.js.map +1 -0
- package/dist/{chunk-7VWDC7AD.js → chunk-B57QYSWN.js} +17 -17
- package/dist/{chunk-BKRIAXTU.js → chunk-D2EFNQMY.js} +2 -2
- package/dist/{chunk-MBZAESQ3.js → chunk-F6O7IOS3.js} +2 -2
- package/dist/{chunk-KI6QM5AV.js → chunk-GY3V3SUI.js} +2 -2
- package/dist/{chunk-GGL7R2L2.js → chunk-MO77TWPS.js} +4 -4
- package/dist/{chunk-VJYFXDCZ.js → chunk-NMPEJV5M.js} +3 -3
- package/dist/{chunk-3R6OP33G.js → chunk-OYXVENIS.js} +3 -3
- package/dist/{chunk-7KSPKZIQ.js → chunk-PXVFMQLD.js} +3 -3
- package/dist/{chunk-FIS5RT6K.js → chunk-QXHBWFR3.js} +2 -2
- package/dist/{chunk-SSSXWIBP.js → chunk-R2EBP6CM.js} +2 -2
- package/dist/{chunk-6M4LYWA2.js → chunk-RP2U54GG.js} +5 -5
- package/dist/{chunk-G2VVBWFU.js → chunk-RQGR3ETH.js} +2 -2
- package/dist/{chunk-JI3LQFJH.js → chunk-TBLGI2LT.js} +2 -2
- package/dist/{chunk-RVT6U6PV.js → chunk-TWAJICBN.js} +2 -2
- package/dist/{chunk-46RXRASB.js → chunk-TYIXG4VR.js} +3 -3
- package/dist/{chunk-EKQMQQ3U.js → chunk-UNLHHTKN.js} +2 -2
- package/dist/cli.js +20 -19
- package/dist/compounding/engine.js +4 -3
- package/dist/connectors/codex-materialize-runner.js +4 -3
- package/dist/connectors/index.js +4 -3
- package/dist/entity-retrieval.js +4 -3
- package/dist/index.js +25 -25
- package/dist/maintenance/memory-governance.js +4 -3
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +4 -3
- package/dist/maintenance/rebuild-memory-projection.js +5 -4
- package/dist/memory-cache.d.ts +43 -1
- package/dist/memory-cache.js +6 -1
- package/dist/namespaces/migrate.js +8 -7
- package/dist/namespaces/search.js +5 -4
- package/dist/namespaces/storage.js +4 -3
- package/dist/operator-toolkit.js +10 -9
- package/dist/orchestrator.js +15 -15
- package/dist/qmd-recall-cache.d.ts +4 -1
- package/dist/qmd-recall-cache.js +3 -1
- package/dist/qmd.js +3 -2
- package/dist/schemas.d.ts +24 -24
- package/dist/search/factory.js +4 -3
- package/dist/search/index.js +4 -3
- package/dist/semantic-consolidation.js +5 -4
- package/dist/semantic-rule-promotion.js +4 -3
- package/dist/semantic-rule-verifier.js +4 -3
- package/dist/storage.js +3 -2
- package/dist/verified-recall.js +4 -3
- package/package.json +1 -1
- package/src/memory-cache.test.ts +30 -0
- package/src/memory-cache.ts +129 -16
- package/src/qmd-recall-cache.ts +6 -0
- package/src/storage.ts +27 -3
- package/dist/chunk-4PLOQDBB.js.map +0 -1
- package/dist/chunk-CPPS65WS.js.map +0 -1
- /package/dist/{chunk-QFKRE7AU.js.map → chunk-256W7AXC.js.map} +0 -0
- /package/dist/{chunk-5PFIMBJJ.js.map → chunk-2EVZ5EN6.js.map} +0 -0
- /package/dist/{chunk-2VCTTEJM.js.map → chunk-7H7J3ZWN.js.map} +0 -0
- /package/dist/{chunk-QRSKPI62.js.map → chunk-7PCZGNG2.js.map} +0 -0
- /package/dist/{chunk-ZCMO46YY.js.map → chunk-A7EF2XRO.js.map} +0 -0
- /package/dist/{chunk-BNUAOLDK.js.map → chunk-ANJOULTP.js.map} +0 -0
- /package/dist/{chunk-7VWDC7AD.js.map → chunk-B57QYSWN.js.map} +0 -0
- /package/dist/{chunk-BKRIAXTU.js.map → chunk-D2EFNQMY.js.map} +0 -0
- /package/dist/{chunk-MBZAESQ3.js.map → chunk-F6O7IOS3.js.map} +0 -0
- /package/dist/{chunk-KI6QM5AV.js.map → chunk-GY3V3SUI.js.map} +0 -0
- /package/dist/{chunk-GGL7R2L2.js.map → chunk-MO77TWPS.js.map} +0 -0
- /package/dist/{chunk-VJYFXDCZ.js.map → chunk-NMPEJV5M.js.map} +0 -0
- /package/dist/{chunk-3R6OP33G.js.map → chunk-OYXVENIS.js.map} +0 -0
- /package/dist/{chunk-7KSPKZIQ.js.map → chunk-PXVFMQLD.js.map} +0 -0
- /package/dist/{chunk-FIS5RT6K.js.map → chunk-QXHBWFR3.js.map} +0 -0
- /package/dist/{chunk-SSSXWIBP.js.map → chunk-R2EBP6CM.js.map} +0 -0
- /package/dist/{chunk-6M4LYWA2.js.map → chunk-RP2U54GG.js.map} +0 -0
- /package/dist/{chunk-G2VVBWFU.js.map → chunk-RQGR3ETH.js.map} +0 -0
- /package/dist/{chunk-JI3LQFJH.js.map → chunk-TBLGI2LT.js.map} +0 -0
- /package/dist/{chunk-RVT6U6PV.js.map → chunk-TWAJICBN.js.map} +0 -0
- /package/dist/{chunk-46RXRASB.js.map → chunk-TYIXG4VR.js.map} +0 -0
- /package/dist/{chunk-EKQMQQ3U.js.map → chunk-UNLHHTKN.js.map} +0 -0
package/src/storage.ts
CHANGED
|
@@ -5,7 +5,7 @@ import path from "node:path";
|
|
|
5
5
|
import { log } from "./logger.js";
|
|
6
6
|
import { isErrnoCode } from "./utils/errno.js";
|
|
7
7
|
import { RECALL_FALLBACK_DIRS } from "./utils/category-dir.js";
|
|
8
|
-
import { getCachedEntities,
|
|
8
|
+
import { getCachedEntities, invalidateAllForDir, setCachedEntities } from "./memory-cache.js";
|
|
9
9
|
import { rotateMarkdownFileToArchive } from "./hygiene.js";
|
|
10
10
|
import { sanitizeMemoryContent } from "./sanitize.js";
|
|
11
11
|
import { createVersion as createPageVersion, type VersioningConfig, type VersionTrigger } from "./page-versioning.js";
|
|
@@ -2335,7 +2335,10 @@ export class StorageManager {
|
|
|
2335
2335
|
setSecureStoreKey(key: Buffer | null, encryptOnWrite = true): void {
|
|
2336
2336
|
this._secureStoreKey = key;
|
|
2337
2337
|
this._secureStoreEncryptOnWrite = encryptOnWrite;
|
|
2338
|
-
|
|
2338
|
+
// Route through the invalidation chokepoint (issue #1535): a key change
|
|
2339
|
+
// (or store lock) must evict every cache layer that may hold content
|
|
2340
|
+
// decrypted under the previous key, not just the entity layer.
|
|
2341
|
+
invalidateAllForDir(this.baseDir);
|
|
2339
2342
|
this.invalidateKnowledgeIndexCache();
|
|
2340
2343
|
}
|
|
2341
2344
|
|
|
@@ -2511,6 +2514,13 @@ export class StorageManager {
|
|
|
2511
2514
|
|
|
2512
2515
|
private bumpMemoryStatusVersion(): void {
|
|
2513
2516
|
this.bumpSharedVersion("memory-status", StorageManager.memoryStatusVersionByDir);
|
|
2517
|
+
// Invalidation chokepoint (issue #1535): status/entity mutations funnel
|
|
2518
|
+
// through this bump — several of them (supersedeMemory, archiveMemories,
|
|
2519
|
+
// writeEntity, cleanExpiredCommitments) do NOT call
|
|
2520
|
+
// invalidateAllMemoriesCache(), so the chokepoint must fire here as well.
|
|
2521
|
+
// Version bumps only invalidate the version-checked layers lazily; the
|
|
2522
|
+
// TTL-based QMD caches need this eager clear.
|
|
2523
|
+
invalidateAllForDir(this.baseDir);
|
|
2514
2524
|
}
|
|
2515
2525
|
|
|
2516
2526
|
getMemoryStatusVersion(): number {
|
|
@@ -2943,8 +2953,9 @@ export class StorageManager {
|
|
|
2943
2953
|
}
|
|
2944
2954
|
|
|
2945
2955
|
private async invalidateAfterOfflineSyncMutation(filePath: string): Promise<void> {
|
|
2956
|
+
// invalidateAllMemoriesCache() routes through the invalidateAllForDir()
|
|
2957
|
+
// chokepoint, which also covers the entity cache (issue #1535).
|
|
2946
2958
|
this.invalidateAllMemoriesCache();
|
|
2947
|
-
invalidateCachedEntities(this.baseDir);
|
|
2948
2959
|
this.invalidateKnowledgeIndexCache();
|
|
2949
2960
|
this.factHashIndexAuthoritative = false;
|
|
2950
2961
|
await unlink(this.factHashIndexReadyPath).catch((error: unknown) => {
|
|
@@ -4002,6 +4013,13 @@ export class StorageManager {
|
|
|
4002
4013
|
* inside cold/, archiveMemory, etc.). */
|
|
4003
4014
|
private invalidateAllMemoriesCache(): void {
|
|
4004
4015
|
StorageManager.allMemoriesInFlight.delete(this.baseDir);
|
|
4016
|
+
// Invalidation chokepoint (issue #1535): eagerly evict EVERY process-level
|
|
4017
|
+
// cache layer that can serve memory-derived content for this dir — hot,
|
|
4018
|
+
// archive, entity, derived episode/rule views, and both QMD result caches
|
|
4019
|
+
// (qmdSearchCache and qmdRecallCache). Before this call was added, the QMD
|
|
4020
|
+
// recall cache was never invalidated on mutations, so recall served
|
|
4021
|
+
// pre-edit bundles for the remainder of its fresh/stale TTL window.
|
|
4022
|
+
invalidateAllForDir(this.baseDir);
|
|
4005
4023
|
}
|
|
4006
4024
|
|
|
4007
4025
|
/**
|
|
@@ -4020,6 +4038,12 @@ export class StorageManager {
|
|
|
4020
4038
|
const coldRoot = path.join(this.baseDir, "cold");
|
|
4021
4039
|
StorageManager.coldMemoriesCache.delete(coldRoot);
|
|
4022
4040
|
this.bumpColdWriteVersion();
|
|
4041
|
+
// Invalidation chokepoint (issue #1535): cold-tier mutations can reach
|
|
4042
|
+
// this funnel without invalidateAllMemoriesCache() (e.g. the cold-only
|
|
4043
|
+
// branch of invalidateMemoryCachesForTiers used by maintenance/purge), so
|
|
4044
|
+
// the chokepoint must fire here too — cold memories are recallable and a
|
|
4045
|
+
// cold delete must not leave stale QMD recall bundles behind.
|
|
4046
|
+
invalidateAllForDir(this.baseDir);
|
|
4023
4047
|
}
|
|
4024
4048
|
|
|
4025
4049
|
/** Return the current cold-write version counter for this storage root.
|