@remnic/core 9.3.760 → 9.3.762
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 +3 -3
- package/dist/access-admin-ops-surface.js +11 -10
- package/dist/access-boundary.d.ts +3 -3
- package/dist/access-boundary.js +12 -11
- package/dist/access-cli.js +46 -45
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +3 -3
- package/dist/access-http.js +18 -17
- package/dist/access-identity-continuity-surface.d.ts +2 -2
- package/dist/access-identity-continuity-surface.js +11 -10
- package/dist/access-lcm-surface.d.ts +3 -3
- package/dist/access-lcm-surface.js +11 -10
- package/dist/access-mcp.d.ts +3 -3
- package/dist/access-mcp.js +15 -14
- package/dist/access-observe-write-surface.d.ts +3 -3
- package/dist/access-observe-write-surface.js +11 -10
- package/dist/access-operations-batch.js +13 -12
- package/dist/access-operations.d.ts +7 -7
- package/dist/access-operations.js +14 -13
- package/dist/access-recall-surface.d.ts +3 -3
- package/dist/access-recall-surface.js +11 -10
- package/dist/access-schema.d.ts +68 -68
- package/dist/{access-service-BW-gb3DL.d.ts → access-service-CaWJP_f6.d.ts} +2 -2
- package/dist/access-service.d.ts +3 -3
- package/dist/access-service.js +11 -10
- package/dist/access-surface-catalog.d.ts +3 -3
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/bootstrap.d.ts +2 -2
- package/dist/briefing.js +4 -3
- package/dist/{catalog-DaKAFbSJ.d.ts → catalog-bflYNWsM.d.ts} +8 -4
- package/dist/causal-consolidation.js +5 -4
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/{chunk-OLEBPUZ7.js → chunk-2KYXXMTE.js} +6 -6
- package/dist/{chunk-6CUUFFU7.js → chunk-2PGB63VU.js} +131 -39
- package/dist/chunk-2PGB63VU.js.map +1 -0
- package/dist/{chunk-FYJWEGYP.js → chunk-4HYJETVO.js} +2 -2
- package/dist/{chunk-APJQ6UEA.js → chunk-AGNBY3VG.js} +4 -4
- package/dist/{chunk-W3M34XT4.js → chunk-BAVVI5GP.js} +2 -2
- package/dist/{chunk-XQT5GSWU.js → chunk-BRYPUVJU.js} +3 -3
- package/dist/{chunk-2XE4F3VZ.js → chunk-DB647OZ4.js} +24 -24
- package/dist/{chunk-3JBW3GHN.js → chunk-DPZ5GJMD.js} +2 -2
- package/dist/chunk-DQC3ZZYM.js +35 -0
- package/dist/chunk-DQC3ZZYM.js.map +1 -0
- package/dist/{chunk-SMLMH7S5.js → chunk-EDC7RZCW.js} +24 -24
- package/dist/{chunk-ZFXCQPNO.js → chunk-EGGE52UU.js} +2 -2
- package/dist/chunk-EGGE52UU.js.map +1 -0
- package/dist/{chunk-IOZZG75J.js → chunk-ES3GAMSQ.js} +2 -2
- package/dist/{chunk-QUGPXPFJ.js → chunk-ESDBHQY6.js} +5 -5
- package/dist/{chunk-ILVF6TIY.js → chunk-HDFS6RWQ.js} +2 -2
- package/dist/{chunk-SN2EWIAI.js → chunk-HDYFNXVO.js} +2 -2
- package/dist/{chunk-ZEQVS6AZ.js → chunk-HMUEAKSD.js} +2 -2
- package/dist/{chunk-P26O6R3Q.js → chunk-IIURIWJG.js} +102 -12
- package/dist/chunk-IIURIWJG.js.map +1 -0
- package/dist/{chunk-RKNJBZ55.js → chunk-JBPKEARU.js} +4 -4
- package/dist/{chunk-QQJMVF6P.js → chunk-JU6BKZHX.js} +3 -3
- package/dist/{chunk-SLAZZXBU.js → chunk-KZWUJC7Y.js} +2 -2
- package/dist/{chunk-IZLGHKWA.js → chunk-LAJIXABF.js} +10 -10
- package/dist/{chunk-3QLPBCFG.js → chunk-NKP6II6G.js} +4 -4
- package/dist/{chunk-WIXQ3F5P.js → chunk-OQ6F3WBX.js} +2 -2
- package/dist/{chunk-YP23FQPT.js → chunk-P7W4CDX6.js} +92 -41
- package/dist/chunk-P7W4CDX6.js.map +1 -0
- package/dist/{chunk-EGQ3AVZV.js → chunk-PNFN7SIN.js} +3 -3
- package/dist/{chunk-M2AAYJVI.js → chunk-QPFO54VC.js} +4 -4
- package/dist/{chunk-7HWOEYHW.js → chunk-QWIE43BS.js} +2 -2
- package/dist/chunk-TEKTCF2V.js +118 -0
- package/dist/chunk-TEKTCF2V.js.map +1 -0
- package/dist/{chunk-QOM3F6YW.js → chunk-TIWRP5NW.js} +5 -5
- package/dist/{chunk-CXW6Y7SI.js → chunk-V5RVMULT.js} +4 -4
- package/dist/{chunk-DTSOB2YF.js → chunk-VHYFY3JI.js} +2 -2
- package/dist/{chunk-AZSSKOG6.js → chunk-WAIMHMO3.js} +3 -3
- package/dist/{chunk-PKRRBRY2.js → chunk-ZTBH2OHD.js} +2 -2
- package/dist/{cli-D551dnva.d.ts → cli-CvWpIbMD.d.ts} +2 -2
- package/dist/cli.d.ts +4 -4
- package/dist/cli.js +35 -34
- 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/explicit-capture.d.ts +2 -2
- package/dist/{forget-OEE5OELK.js → forget-WYLR4ZFV.js} +2 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.js +48 -47
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.js +4 -4
- package/dist/maintenance/memory-governance.js +4 -3
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +11 -1
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +4 -3
- package/dist/maintenance/rebuild-memory-projection.d.ts +22 -1
- package/dist/maintenance/rebuild-memory-projection.js +5 -4
- package/dist/mcp-memory-inspector-app.d.ts +3 -3
- package/dist/namespaces/migrate.d.ts +1 -1
- package/dist/namespaces/migrate.js +9 -8
- package/dist/namespaces/search.js +4 -4
- package/dist/namespaces/storage.d.ts +1 -1
- package/dist/namespaces/storage.js +5 -4
- package/dist/operator-toolkit.js +13 -12
- package/dist/orchestration/maintenance.d.ts +1 -1
- package/dist/orchestration/maintenance.js +8 -7
- package/dist/{orchestrator-BnM187cb.d.ts → orchestrator-C04Q4Zao.d.ts} +1 -1
- package/dist/orchestrator.d.ts +2 -2
- package/dist/orchestrator.js +46 -45
- package/dist/schemas.d.ts +84 -84
- package/dist/search/factory.js +2 -2
- package/dist/search/index.js +4 -4
- 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/shared-context/manager.d.ts +8 -8
- package/dist/storage-guards.d.ts +9 -0
- package/dist/storage-guards.js +11 -0
- package/dist/storage-guards.js.map +1 -0
- package/dist/storage.js +3 -2
- package/dist/transfer/import-sqlite.js +2 -2
- package/dist/transfer/types.d.ts +66 -66
- package/dist/verified-recall.js +4 -3
- package/package.json +2 -2
- package/src/maintenance/rebuild-memory-lifecycle-ledger.ts +59 -8
- package/src/maintenance/rebuild-memory-projection.ts +149 -9
- package/src/namespaces/catalog.test.ts +133 -1
- package/src/namespaces/catalog.ts +163 -48
- package/src/namespaces/identity.ts +2 -2
- package/src/storage/secure-line-reader.ts +79 -0
- package/src/storage-guards.ts +30 -0
- package/src/storage-memory-lifecycle-ledger.test.ts +130 -0
- package/src/storage.ts +24 -41
- package/dist/chunk-6CUUFFU7.js.map +0 -1
- package/dist/chunk-LLVKDFNU.js +0 -77
- package/dist/chunk-LLVKDFNU.js.map +0 -1
- package/dist/chunk-P26O6R3Q.js.map +0 -1
- package/dist/chunk-YP23FQPT.js.map +0 -1
- package/dist/chunk-ZFXCQPNO.js.map +0 -1
- /package/dist/{chunk-OLEBPUZ7.js.map → chunk-2KYXXMTE.js.map} +0 -0
- /package/dist/{chunk-FYJWEGYP.js.map → chunk-4HYJETVO.js.map} +0 -0
- /package/dist/{chunk-APJQ6UEA.js.map → chunk-AGNBY3VG.js.map} +0 -0
- /package/dist/{chunk-W3M34XT4.js.map → chunk-BAVVI5GP.js.map} +0 -0
- /package/dist/{chunk-XQT5GSWU.js.map → chunk-BRYPUVJU.js.map} +0 -0
- /package/dist/{chunk-2XE4F3VZ.js.map → chunk-DB647OZ4.js.map} +0 -0
- /package/dist/{chunk-3JBW3GHN.js.map → chunk-DPZ5GJMD.js.map} +0 -0
- /package/dist/{chunk-SMLMH7S5.js.map → chunk-EDC7RZCW.js.map} +0 -0
- /package/dist/{chunk-IOZZG75J.js.map → chunk-ES3GAMSQ.js.map} +0 -0
- /package/dist/{chunk-QUGPXPFJ.js.map → chunk-ESDBHQY6.js.map} +0 -0
- /package/dist/{chunk-ILVF6TIY.js.map → chunk-HDFS6RWQ.js.map} +0 -0
- /package/dist/{chunk-SN2EWIAI.js.map → chunk-HDYFNXVO.js.map} +0 -0
- /package/dist/{chunk-ZEQVS6AZ.js.map → chunk-HMUEAKSD.js.map} +0 -0
- /package/dist/{chunk-RKNJBZ55.js.map → chunk-JBPKEARU.js.map} +0 -0
- /package/dist/{chunk-QQJMVF6P.js.map → chunk-JU6BKZHX.js.map} +0 -0
- /package/dist/{chunk-SLAZZXBU.js.map → chunk-KZWUJC7Y.js.map} +0 -0
- /package/dist/{chunk-IZLGHKWA.js.map → chunk-LAJIXABF.js.map} +0 -0
- /package/dist/{chunk-3QLPBCFG.js.map → chunk-NKP6II6G.js.map} +0 -0
- /package/dist/{chunk-WIXQ3F5P.js.map → chunk-OQ6F3WBX.js.map} +0 -0
- /package/dist/{chunk-EGQ3AVZV.js.map → chunk-PNFN7SIN.js.map} +0 -0
- /package/dist/{chunk-M2AAYJVI.js.map → chunk-QPFO54VC.js.map} +0 -0
- /package/dist/{chunk-7HWOEYHW.js.map → chunk-QWIE43BS.js.map} +0 -0
- /package/dist/{chunk-QOM3F6YW.js.map → chunk-TIWRP5NW.js.map} +0 -0
- /package/dist/{chunk-CXW6Y7SI.js.map → chunk-V5RVMULT.js.map} +0 -0
- /package/dist/{chunk-DTSOB2YF.js.map → chunk-VHYFY3JI.js.map} +0 -0
- /package/dist/{chunk-AZSSKOG6.js.map → chunk-WAIMHMO3.js.map} +0 -0
- /package/dist/{chunk-PKRRBRY2.js.map → chunk-ZTBH2OHD.js.map} +0 -0
- /package/dist/{forget-OEE5OELK.js.map → forget-WYLR4ZFV.js.map} +0 -0
|
@@ -7,12 +7,15 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
openclawReplayNormalizer
|
|
9
9
|
} from "./chunk-7F7Z6MOS.js";
|
|
10
|
+
import {
|
|
11
|
+
exportSqlite
|
|
12
|
+
} from "./chunk-7VFZTJ7K.js";
|
|
10
13
|
import {
|
|
11
14
|
importMarkdownBundle
|
|
12
15
|
} from "./chunk-HDDRVXX4.js";
|
|
13
16
|
import {
|
|
14
17
|
importSqlite
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-AGNBY3VG.js";
|
|
16
19
|
import {
|
|
17
20
|
detectImportFormat
|
|
18
21
|
} from "./chunk-OZKVVUJB.js";
|
|
@@ -29,8 +32,8 @@ import {
|
|
|
29
32
|
exportMarkdownBundle
|
|
30
33
|
} from "./chunk-765K3SAT.js";
|
|
31
34
|
import {
|
|
32
|
-
|
|
33
|
-
} from "./chunk-
|
|
35
|
+
WebDavServer
|
|
36
|
+
} from "./chunk-PYIFUBRK.js";
|
|
34
37
|
import {
|
|
35
38
|
buildReplayNormalizerRegistry,
|
|
36
39
|
clampBatchSize,
|
|
@@ -43,29 +46,26 @@ import {
|
|
|
43
46
|
import {
|
|
44
47
|
RoutingRulesStore
|
|
45
48
|
} from "./chunk-WIWPSQYU.js";
|
|
49
|
+
import {
|
|
50
|
+
rebuildObservations
|
|
51
|
+
} from "./chunk-LZZNTPLR.js";
|
|
46
52
|
import {
|
|
47
53
|
TailscaleHelper
|
|
48
54
|
} from "./chunk-EEC4PCG5.js";
|
|
49
55
|
import {
|
|
50
|
-
|
|
51
|
-
} from "./chunk-
|
|
56
|
+
archiveObservations
|
|
57
|
+
} from "./chunk-WMWVO45V.js";
|
|
52
58
|
import {
|
|
53
59
|
migrateObservations
|
|
54
60
|
} from "./chunk-D6RIFG4O.js";
|
|
55
61
|
import {
|
|
56
62
|
rebuildMemoryLifecycleLedger
|
|
57
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-TEKTCF2V.js";
|
|
58
64
|
import {
|
|
59
65
|
rebuildMemoryProjection,
|
|
60
66
|
repairMemoryProjection,
|
|
61
67
|
verifyMemoryProjection
|
|
62
|
-
} from "./chunk-
|
|
63
|
-
import {
|
|
64
|
-
rebuildObservations
|
|
65
|
-
} from "./chunk-LZZNTPLR.js";
|
|
66
|
-
import {
|
|
67
|
-
archiveObservations
|
|
68
|
-
} from "./chunk-WMWVO45V.js";
|
|
68
|
+
} from "./chunk-IIURIWJG.js";
|
|
69
69
|
import {
|
|
70
70
|
getBulkImportSource,
|
|
71
71
|
listBulkImportSources,
|
|
@@ -85,16 +85,16 @@ import {
|
|
|
85
85
|
} from "./chunk-TERNBNJB.js";
|
|
86
86
|
import {
|
|
87
87
|
searchVerifiedEpisodes
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-4HYJETVO.js";
|
|
89
89
|
import {
|
|
90
90
|
ThreadingManager
|
|
91
91
|
} from "./chunk-QRDOSYOR.js";
|
|
92
92
|
import {
|
|
93
93
|
promoteSemanticRuleFromMemory
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-KZWUJC7Y.js";
|
|
95
95
|
import {
|
|
96
96
|
searchVerifiedSemanticRules
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-ES3GAMSQ.js";
|
|
98
98
|
import {
|
|
99
99
|
resolveAgentAccessAuthToken
|
|
100
100
|
} from "./chunk-TGQ2NTWH.js";
|
|
@@ -126,12 +126,12 @@ import {
|
|
|
126
126
|
runOperatorInventory,
|
|
127
127
|
runOperatorRepair,
|
|
128
128
|
runOperatorSetup
|
|
129
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-ESDBHQY6.js";
|
|
130
130
|
import {
|
|
131
131
|
listNamespaces,
|
|
132
132
|
runNamespaceMigration,
|
|
133
133
|
verifyNamespaces
|
|
134
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-QPFO54VC.js";
|
|
135
135
|
import {
|
|
136
136
|
analyzeSessionIntegrity,
|
|
137
137
|
applySessionRepair,
|
|
@@ -213,7 +213,7 @@ import {
|
|
|
213
213
|
} from "./chunk-OADWQ5CR.js";
|
|
214
214
|
import {
|
|
215
215
|
EngramAccessHttpServer
|
|
216
|
-
} from "./chunk-
|
|
216
|
+
} from "./chunk-2KYXXMTE.js";
|
|
217
217
|
import {
|
|
218
218
|
WearablesInputError
|
|
219
219
|
} from "./chunk-7WV3F5DQ.js";
|
|
@@ -226,10 +226,10 @@ import {
|
|
|
226
226
|
createProductionChatLlmAdapter,
|
|
227
227
|
loadChatSession,
|
|
228
228
|
sessionBelongsToPrincipal
|
|
229
|
-
} from "./chunk-
|
|
229
|
+
} from "./chunk-WAIMHMO3.js";
|
|
230
230
|
import {
|
|
231
231
|
EngramAccessService
|
|
232
|
-
} from "./chunk-
|
|
232
|
+
} from "./chunk-LAJIXABF.js";
|
|
233
233
|
import {
|
|
234
234
|
WorkStorage
|
|
235
235
|
} from "./chunk-GDB4J2H3.js";
|
|
@@ -252,7 +252,7 @@ import {
|
|
|
252
252
|
readMemoryGovernanceRunArtifact,
|
|
253
253
|
restoreMemoryGovernanceRun,
|
|
254
254
|
runMemoryGovernance
|
|
255
|
-
} from "./chunk-
|
|
255
|
+
} from "./chunk-HDYFNXVO.js";
|
|
256
256
|
import {
|
|
257
257
|
getObjectiveStateStoreStatus
|
|
258
258
|
} from "./chunk-6HMYUWXR.js";
|
|
@@ -3590,7 +3590,7 @@ function registerCli(api, orchestrator, registerOptions = {}) {
|
|
|
3590
3590
|
const idArg = typeof args[0] === "string" ? args[0] : "";
|
|
3591
3591
|
const options = args[1] ?? {};
|
|
3592
3592
|
const reason = typeof options.reason === "string" && options.reason.trim().length > 0 ? options.reason.trim() : void 0;
|
|
3593
|
-
const { forgetMemory } = await import("./forget-
|
|
3593
|
+
const { forgetMemory } = await import("./forget-WYLR4ZFV.js");
|
|
3594
3594
|
try {
|
|
3595
3595
|
const result = await forgetMemory(orchestrator.storage, {
|
|
3596
3596
|
id: idArg,
|
|
@@ -7520,4 +7520,4 @@ export {
|
|
|
7520
7520
|
listMemoryMarkdownFilePaths,
|
|
7521
7521
|
registerCli
|
|
7522
7522
|
};
|
|
7523
|
-
//# sourceMappingURL=chunk-
|
|
7523
|
+
//# sourceMappingURL=chunk-DB647OZ4.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EngramAccessInputError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LAJIXABF.js";
|
|
4
4
|
import {
|
|
5
5
|
expandTildePath
|
|
6
6
|
} from "./chunk-EYIEWJNI.js";
|
|
@@ -130,4 +130,4 @@ export {
|
|
|
130
130
|
listRegisteredOperations,
|
|
131
131
|
__resetRegistryForTest
|
|
132
132
|
};
|
|
133
|
-
//# sourceMappingURL=chunk-
|
|
133
|
+
//# sourceMappingURL=chunk-DPZ5GJMD.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
log
|
|
3
|
+
} from "./chunk-NU3CSQ4H.js";
|
|
4
|
+
|
|
5
|
+
// src/storage-guards.ts
|
|
6
|
+
var PROJECTION_FALLBACK_WARN_INTERVAL_MS = 5 * 6e4;
|
|
7
|
+
var projectionFallbackWarnedAt = /* @__PURE__ */ new Map();
|
|
8
|
+
function assertMemoryFrontmatterId(fm) {
|
|
9
|
+
if (typeof fm.id !== "string" || fm.id.trim().length === 0) {
|
|
10
|
+
const context = [
|
|
11
|
+
fm.category ? `category=${fm.category}` : null,
|
|
12
|
+
fm.created ? `created=${fm.created}` : null,
|
|
13
|
+
fm.entityRef ? `entityRef=${fm.entityRef}` : null
|
|
14
|
+
].filter(Boolean).join(" ");
|
|
15
|
+
throw new Error(
|
|
16
|
+
`memory frontmatter id must not be blank${context ? ` (${context})` : ""}`
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function warnProjectionFallback(memoryDir, consumer) {
|
|
21
|
+
const key = `${memoryDir}\0${consumer}`;
|
|
22
|
+
const now = Date.now();
|
|
23
|
+
const warnedAt = projectionFallbackWarnedAt.get(key) ?? 0;
|
|
24
|
+
if (now - warnedAt >= PROJECTION_FALLBACK_WARN_INTERVAL_MS) {
|
|
25
|
+
projectionFallbackWarnedAt.set(key, now);
|
|
26
|
+
log.warn(`storage.${consumer}: memory projection absent or empty; falling back to full corpus`);
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
assertMemoryFrontmatterId,
|
|
33
|
+
warnProjectionFallback
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=chunk-DQC3ZZYM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/storage-guards.ts"],"sourcesContent":["import { log } from \"./logger.js\";\n\nconst PROJECTION_FALLBACK_WARN_INTERVAL_MS = 5 * 60_000;\nconst projectionFallbackWarnedAt = new Map<string, number>();\n\nexport function assertMemoryFrontmatterId(\n fm: { id: string; category?: string; created?: string; entityRef?: string },\n): void {\n if (typeof fm.id !== \"string\" || fm.id.trim().length === 0) {\n const context = [\n fm.category ? `category=${fm.category}` : null,\n fm.created ? `created=${fm.created}` : null,\n fm.entityRef ? `entityRef=${fm.entityRef}` : null,\n ].filter(Boolean).join(\" \");\n throw new Error(\n `memory frontmatter id must not be blank${context ? ` (${context})` : \"\"}`,\n );\n }\n}\n\nexport function warnProjectionFallback(memoryDir: string, consumer: string): null {\n const key = `${memoryDir}\\0${consumer}`;\n const now = Date.now();\n const warnedAt = projectionFallbackWarnedAt.get(key) ?? 0;\n if (now - warnedAt >= PROJECTION_FALLBACK_WARN_INTERVAL_MS) {\n projectionFallbackWarnedAt.set(key, now);\n log.warn(`storage.${consumer}: memory projection absent or empty; falling back to full corpus`);\n }\n return null;\n}\n"],"mappings":";;;;;AAEA,IAAM,uCAAuC,IAAI;AACjD,IAAM,6BAA6B,oBAAI,IAAoB;AAEpD,SAAS,0BACd,IACM;AACN,MAAI,OAAO,GAAG,OAAO,YAAY,GAAG,GAAG,KAAK,EAAE,WAAW,GAAG;AAC1D,UAAM,UAAU;AAAA,MACd,GAAG,WAAW,YAAY,GAAG,QAAQ,KAAK;AAAA,MAC1C,GAAG,UAAU,WAAW,GAAG,OAAO,KAAK;AAAA,MACvC,GAAG,YAAY,aAAa,GAAG,SAAS,KAAK;AAAA,IAC/C,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAC1B,UAAM,IAAI;AAAA,MACR,0CAA0C,UAAU,KAAK,OAAO,MAAM,EAAE;AAAA,IAC1E;AAAA,EACF;AACF;AAEO,SAAS,uBAAuB,WAAmB,UAAwB;AAChF,QAAM,MAAM,GAAG,SAAS,KAAK,QAAQ;AACrC,QAAM,MAAM,KAAK,IAAI;AACrB,QAAM,WAAW,2BAA2B,IAAI,GAAG,KAAK;AACxD,MAAI,MAAM,YAAY,sCAAsC;AAC1D,+BAA2B,IAAI,KAAK,GAAG;AACvC,QAAI,KAAK,WAAW,QAAQ,kEAAkE;AAAA,EAChG;AACA,SAAO;AACT;","names":[]}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-5QANTTY2.js";
|
|
11
11
|
import {
|
|
12
12
|
MaintenanceScheduler
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QWIE43BS.js";
|
|
14
14
|
import {
|
|
15
15
|
runPeerProfileReasoner
|
|
16
16
|
} from "./chunk-I74SUMNI.js";
|
|
@@ -19,20 +19,20 @@ import {
|
|
|
19
19
|
} from "./chunk-7HYPN2GC.js";
|
|
20
20
|
import {
|
|
21
21
|
LcmEngine
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-V5RVMULT.js";
|
|
23
|
+
import {
|
|
24
|
+
chunkTranscriptEntries
|
|
25
|
+
} from "./chunk-TECVW3JP.js";
|
|
23
26
|
import {
|
|
24
27
|
cleanupConversationChunks
|
|
25
28
|
} from "./chunk-O7GOFAM3.js";
|
|
26
29
|
import {
|
|
27
30
|
CompoundingEngine,
|
|
28
31
|
defaultTierMigrationCycleBudget
|
|
29
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-HMUEAKSD.js";
|
|
30
33
|
import {
|
|
31
34
|
SharedContextManager
|
|
32
35
|
} from "./chunk-JRZV3767.js";
|
|
33
|
-
import {
|
|
34
|
-
chunkTranscriptEntries
|
|
35
|
-
} from "./chunk-TECVW3JP.js";
|
|
36
36
|
import {
|
|
37
37
|
applyUtilityPromotionRuntimePolicy,
|
|
38
38
|
applyUtilityRankingRuntimeDelta,
|
|
@@ -58,6 +58,9 @@ import {
|
|
|
58
58
|
import {
|
|
59
59
|
renderEpistemicHedge
|
|
60
60
|
} from "./chunk-YN2UN7N3.js";
|
|
61
|
+
import {
|
|
62
|
+
HourlySummarizer
|
|
63
|
+
} from "./chunk-NNL4LJAD.js";
|
|
61
64
|
import {
|
|
62
65
|
buildTargetedFactRecallSection,
|
|
63
66
|
shouldRecallTargetedFactEvidence
|
|
@@ -65,9 +68,6 @@ import {
|
|
|
65
68
|
import {
|
|
66
69
|
CODEX_THREAD_KEY_PREFIX
|
|
67
70
|
} from "./chunk-4EX5WZ4M.js";
|
|
68
|
-
import {
|
|
69
|
-
HourlySummarizer
|
|
70
|
-
} from "./chunk-NNL4LJAD.js";
|
|
71
71
|
import {
|
|
72
72
|
SessionObserverState
|
|
73
73
|
} from "./chunk-DKTSR7EK.js";
|
|
@@ -191,7 +191,7 @@ import {
|
|
|
191
191
|
buildEntityRecallSection,
|
|
192
192
|
entityRecentTranscriptLookbackHours,
|
|
193
193
|
readRecentEntityTranscriptEntries
|
|
194
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-ZTBH2OHD.js";
|
|
195
195
|
import {
|
|
196
196
|
buildEventOrderRecallSection,
|
|
197
197
|
shouldRecallEventOrderEvidence
|
|
@@ -208,14 +208,14 @@ import {
|
|
|
208
208
|
import {
|
|
209
209
|
compareVerifiedEpisodeResults,
|
|
210
210
|
searchVerifiedEpisodes
|
|
211
|
-
} from "./chunk-
|
|
211
|
+
} from "./chunk-4HYJETVO.js";
|
|
212
212
|
import {
|
|
213
213
|
ThreadingManager
|
|
214
214
|
} from "./chunk-QRDOSYOR.js";
|
|
215
215
|
import {
|
|
216
216
|
compareVerifiedSemanticRuleResults,
|
|
217
217
|
searchVerifiedSemanticRules
|
|
218
|
-
} from "./chunk-
|
|
218
|
+
} from "./chunk-ES3GAMSQ.js";
|
|
219
219
|
import {
|
|
220
220
|
searchWorkProductLedgerEntries
|
|
221
221
|
} from "./chunk-ZRWB5D4H.js";
|
|
@@ -228,14 +228,14 @@ import {
|
|
|
228
228
|
import {
|
|
229
229
|
runNamespaceMaintenanceFanout,
|
|
230
230
|
summarizeNamespaceMaintenanceHealth
|
|
231
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-ESDBHQY6.js";
|
|
232
232
|
import {
|
|
233
233
|
NamespaceCatalog,
|
|
234
234
|
planNamespaceMaintenance
|
|
235
|
-
} from "./chunk-
|
|
235
|
+
} from "./chunk-2PGB63VU.js";
|
|
236
236
|
import {
|
|
237
237
|
NamespaceStorageRouter
|
|
238
|
-
} from "./chunk-
|
|
238
|
+
} from "./chunk-PNFN7SIN.js";
|
|
239
239
|
import {
|
|
240
240
|
isAboveImportanceThreshold,
|
|
241
241
|
scoreImportance
|
|
@@ -270,7 +270,7 @@ import {
|
|
|
270
270
|
materializeAfterSemanticConsolidation,
|
|
271
271
|
parseConsolidationResponse,
|
|
272
272
|
parseOperatorAwareConsolidationResponse
|
|
273
|
-
} from "./chunk-
|
|
273
|
+
} from "./chunk-HDFS6RWQ.js";
|
|
274
274
|
import {
|
|
275
275
|
BoxBuilder
|
|
276
276
|
} from "./chunk-7FL4CNPV.js";
|
|
@@ -316,7 +316,7 @@ import {
|
|
|
316
316
|
createCorrectionService,
|
|
317
317
|
detectPassiveCorrections,
|
|
318
318
|
qmdCollectionPathParts
|
|
319
|
-
} from "./chunk-
|
|
319
|
+
} from "./chunk-LAJIXABF.js";
|
|
320
320
|
import {
|
|
321
321
|
importCapsule
|
|
322
322
|
} from "./chunk-M5QKGHCR.js";
|
|
@@ -340,14 +340,14 @@ import {
|
|
|
340
340
|
resolveNamespaceFromStorageDir,
|
|
341
341
|
resolveScopePlan,
|
|
342
342
|
resolveScopeProfilePlan
|
|
343
|
-
} from "./chunk-
|
|
343
|
+
} from "./chunk-BAVVI5GP.js";
|
|
344
344
|
import {
|
|
345
345
|
NamespaceSearchRouter
|
|
346
|
-
} from "./chunk-
|
|
346
|
+
} from "./chunk-BRYPUVJU.js";
|
|
347
347
|
import {
|
|
348
348
|
createConversationIndexRuntime,
|
|
349
349
|
createSearchBackend
|
|
350
|
-
} from "./chunk-
|
|
350
|
+
} from "./chunk-NKP6II6G.js";
|
|
351
351
|
import {
|
|
352
352
|
NoopSearchBackend
|
|
353
353
|
} from "./chunk-CYEPCZN5.js";
|
|
@@ -355,7 +355,7 @@ import {
|
|
|
355
355
|
namespaceIdentityFromToken,
|
|
356
356
|
namespaceIdentityToken,
|
|
357
357
|
normalizeNamespaceIdentity
|
|
358
|
-
} from "./chunk-
|
|
358
|
+
} from "./chunk-EGGE52UU.js";
|
|
359
359
|
import {
|
|
360
360
|
writeConversationChunks
|
|
361
361
|
} from "./chunk-KCQA46NR.js";
|
|
@@ -383,7 +383,7 @@ import {
|
|
|
383
383
|
} from "./chunk-SQNED75R.js";
|
|
384
384
|
import {
|
|
385
385
|
buildChainFollowupGenerator
|
|
386
|
-
} from "./chunk-
|
|
386
|
+
} from "./chunk-VHYFY3JI.js";
|
|
387
387
|
import {
|
|
388
388
|
ContentHashIndex,
|
|
389
389
|
StorageManager,
|
|
@@ -392,7 +392,7 @@ import {
|
|
|
392
392
|
normalizeAttributePairs,
|
|
393
393
|
parseEntityFile,
|
|
394
394
|
selfDeps
|
|
395
|
-
} from "./chunk-
|
|
395
|
+
} from "./chunk-P7W4CDX6.js";
|
|
396
396
|
import {
|
|
397
397
|
isValidTranscriptDate,
|
|
398
398
|
loadSpeakerRegistry,
|
|
@@ -22723,4 +22723,4 @@ export {
|
|
|
22723
22723
|
blendGraphExpandedRecallScore,
|
|
22724
22724
|
Orchestrator
|
|
22725
22725
|
};
|
|
22726
|
-
//# sourceMappingURL=chunk-
|
|
22726
|
+
//# sourceMappingURL=chunk-EDC7RZCW.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/namespaces/identity.ts
|
|
2
2
|
function normalizeNamespaceIdentity(namespace) {
|
|
3
|
-
return namespace
|
|
3
|
+
return namespace?.trim() ?? "";
|
|
4
4
|
}
|
|
5
5
|
function namespaceIdentityToken(namespace) {
|
|
6
6
|
const normalized = normalizeNamespaceIdentity(namespace);
|
|
@@ -24,4 +24,4 @@ export {
|
|
|
24
24
|
namespaceIdentityToken,
|
|
25
25
|
namespaceIdentityFromToken
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=chunk-
|
|
27
|
+
//# sourceMappingURL=chunk-EGGE52UU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/namespaces/identity.ts"],"sourcesContent":["export function normalizeNamespaceIdentity(namespace: string | null | undefined): string {\n return namespace?.trim() ?? \"\";\n}\n\nexport function namespaceIdentityToken(namespace: string): string {\n const normalized = normalizeNamespaceIdentity(namespace);\n const bytes = new TextEncoder().encode(normalized);\n const hex = Array.from(bytes, (byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n return `ns-${hex || \"default\"}`;\n}\n\nexport function namespaceIdentityFromToken(token: string): string | null {\n if (!token.startsWith(\"ns-\")) return null;\n const hex = token.slice(3);\n if (hex === \"default\") return \"\";\n if (hex.length === 0 || hex.length % 2 !== 0 || !/^[0-9a-f]+$/i.test(hex)) {\n return null;\n }\n const decoded = Buffer.from(hex, \"hex\").toString(\"utf8\");\n return namespaceIdentityToken(decoded).toLowerCase() === token.toLowerCase()\n ? decoded\n : null;\n}\n"],"mappings":";AAAO,SAAS,2BAA2B,WAA8C;AACvF,SAAO,WAAW,KAAK,KAAK;AAC9B;AAEO,SAAS,uBAAuB,WAA2B;AAChE,QAAM,aAAa,2BAA2B,SAAS;AACvD,QAAM,QAAQ,IAAI,YAAY,EAAE,OAAO,UAAU;AACjD,QAAM,MAAM,MAAM,KAAK,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,EAAE,KAAK,EAAE;AACnF,SAAO,MAAM,OAAO,SAAS;AAC/B;AAEO,SAAS,2BAA2B,OAA8B;AACvE,MAAI,CAAC,MAAM,WAAW,KAAK,EAAG,QAAO;AACrC,QAAM,MAAM,MAAM,MAAM,CAAC;AACzB,MAAI,QAAQ,UAAW,QAAO;AAC9B,MAAI,IAAI,WAAW,KAAK,IAAI,SAAS,MAAM,KAAK,CAAC,eAAe,KAAK,GAAG,GAAG;AACzE,WAAO;AAAA,EACT;AACA,QAAM,UAAU,OAAO,KAAK,KAAK,KAAK,EAAE,SAAS,MAAM;AACvD,SAAO,uBAAuB,OAAO,EAAE,YAAY,MAAM,MAAM,YAAY,IACvE,UACA;AACN;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageManager
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-P7W4CDX6.js";
|
|
4
4
|
import {
|
|
5
5
|
getCachedRuleMemories,
|
|
6
6
|
setCachedRuleMemories
|
|
@@ -117,4 +117,4 @@ export {
|
|
|
117
117
|
compareVerifiedSemanticRuleResults,
|
|
118
118
|
searchVerifiedSemanticRules
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-ES3GAMSQ.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
readNamespaceMaintenanceLastRanStatuses,
|
|
4
4
|
readNamespaceMaintenanceStatuses,
|
|
5
5
|
runNamespaceMaintenancePlan
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2PGB63VU.js";
|
|
7
7
|
import {
|
|
8
8
|
listNamespaces
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QPFO54VC.js";
|
|
10
10
|
import {
|
|
11
11
|
analyzeSessionIntegrity,
|
|
12
12
|
applySessionRepair,
|
|
@@ -42,13 +42,13 @@ import {
|
|
|
42
42
|
import {
|
|
43
43
|
listMemoryGovernanceRuns,
|
|
44
44
|
readMemoryGovernanceRunArtifact
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-HDYFNXVO.js";
|
|
46
46
|
import {
|
|
47
47
|
analyzeGraphHealth
|
|
48
48
|
} from "./chunk-EHQ5HO5T.js";
|
|
49
49
|
import {
|
|
50
50
|
StorageManager
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-P7W4CDX6.js";
|
|
52
52
|
import {
|
|
53
53
|
lintWorkspaceFiles
|
|
54
54
|
} from "./chunk-DM2T26WE.js";
|
|
@@ -1599,4 +1599,4 @@ export {
|
|
|
1599
1599
|
runBenchmarkRecall,
|
|
1600
1600
|
runOperatorRepair
|
|
1601
1601
|
};
|
|
1602
|
-
//# sourceMappingURL=chunk-
|
|
1602
|
+
//# sourceMappingURL=chunk-ESDBHQY6.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runPostConsolidationMaterialize
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OQ6F3WBX.js";
|
|
4
4
|
import {
|
|
5
5
|
discoverMemoryExtensions,
|
|
6
6
|
renderExtensionsBlock,
|
|
@@ -220,4 +220,4 @@ export {
|
|
|
220
220
|
buildExtensionsBlockForConsolidation,
|
|
221
221
|
materializeAfterSemanticConsolidation
|
|
222
222
|
};
|
|
223
|
-
//# sourceMappingURL=chunk-
|
|
223
|
+
//# sourceMappingURL=chunk-HDFS6RWQ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageManager
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-P7W4CDX6.js";
|
|
4
4
|
import {
|
|
5
5
|
assertPathInsideRoot
|
|
6
6
|
} from "./chunk-5GPPACXK.js";
|
|
@@ -751,4 +751,4 @@ export {
|
|
|
751
751
|
listMemoryGovernanceRuns,
|
|
752
752
|
readMemoryGovernanceRunArtifact
|
|
753
753
|
};
|
|
754
|
-
//# sourceMappingURL=chunk-
|
|
754
|
+
//# sourceMappingURL=chunk-HDYFNXVO.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-JRZV3767.js";
|
|
5
5
|
import {
|
|
6
6
|
StorageManager
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-P7W4CDX6.js";
|
|
8
8
|
import {
|
|
9
9
|
parseContinuityImprovementLoops
|
|
10
10
|
} from "./chunk-LDXUBPMO.js";
|
|
@@ -1276,4 +1276,4 @@ export {
|
|
|
1276
1276
|
defaultTierMigrationCycleBudget,
|
|
1277
1277
|
CompoundingEngine
|
|
1278
1278
|
};
|
|
1279
|
-
//# sourceMappingURL=chunk-
|
|
1279
|
+
//# sourceMappingURL=chunk-HMUEAKSD.js.map
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
listMemoryGovernanceRuns,
|
|
12
12
|
readMemoryGovernanceRunArtifact
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-HDYFNXVO.js";
|
|
14
14
|
import {
|
|
15
15
|
StorageManager
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-P7W4CDX6.js";
|
|
17
17
|
import {
|
|
18
18
|
MEMORY_LIFECYCLE_EVENT_SORT_ORDER,
|
|
19
19
|
buildLifecycleEventsForMemory,
|
|
@@ -39,6 +39,9 @@ import {
|
|
|
39
39
|
import {
|
|
40
40
|
openBetterSqlite3
|
|
41
41
|
} from "./chunk-6KYMPV2O.js";
|
|
42
|
+
import {
|
|
43
|
+
log
|
|
44
|
+
} from "./chunk-NU3CSQ4H.js";
|
|
42
45
|
|
|
43
46
|
// src/maintenance/rebuild-memory-projection.ts
|
|
44
47
|
import path from "path";
|
|
@@ -291,19 +294,98 @@ function serializeGovernanceReviewQueueRow(row) {
|
|
|
291
294
|
relatedMemoryIds: row.relatedMemoryIds
|
|
292
295
|
});
|
|
293
296
|
}
|
|
297
|
+
function selectProjectionMemories(tiers) {
|
|
298
|
+
const allMemories = tiers.flat();
|
|
299
|
+
const memories = [];
|
|
300
|
+
const keptById = /* @__PURE__ */ new Map();
|
|
301
|
+
const skippedDuplicateMemories = [];
|
|
302
|
+
const skippedBlankIdMemories = [];
|
|
303
|
+
for (const tier of tiers) {
|
|
304
|
+
for (const memory of [...tier].sort((left, right) => left.path.localeCompare(right.path))) {
|
|
305
|
+
const memoryId = memory.frontmatter.id.trim();
|
|
306
|
+
if (!memoryId) {
|
|
307
|
+
skippedBlankIdMemories.push({ path: memory.path });
|
|
308
|
+
log.warn(`projection rebuild skipped blank memory id: path=${memory.path}`);
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
const kept = keptById.get(memoryId);
|
|
312
|
+
if (kept) {
|
|
313
|
+
skippedDuplicateMemories.push({
|
|
314
|
+
memoryId,
|
|
315
|
+
keptPath: kept.path,
|
|
316
|
+
skippedPath: memory.path
|
|
317
|
+
});
|
|
318
|
+
log.warn(
|
|
319
|
+
`projection rebuild skipped duplicate memory id=${memoryId}: kept=${kept.path} skipped=${memory.path}`
|
|
320
|
+
);
|
|
321
|
+
continue;
|
|
322
|
+
}
|
|
323
|
+
keptById.set(memoryId, memory);
|
|
324
|
+
memories.push(memory);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return { allMemories, memories, skippedDuplicateMemories, skippedBlankIdMemories };
|
|
328
|
+
}
|
|
329
|
+
function deduplicateTimelineEvents(events, sourcePathFor) {
|
|
330
|
+
const keptById = /* @__PURE__ */ new Map();
|
|
331
|
+
const unique = [];
|
|
332
|
+
const skipped = [];
|
|
333
|
+
const skippedBlankIds = [];
|
|
334
|
+
for (const event of sortMemoryLifecycleEvents(events)) {
|
|
335
|
+
const sourcePath = sourcePathFor(event);
|
|
336
|
+
if (!event.memoryId.trim()) {
|
|
337
|
+
skippedBlankIds.push({ eventId: event.eventId, path: sourcePath });
|
|
338
|
+
log.warn(
|
|
339
|
+
`projection rebuild skipped timeline event with blank memory id: event_id=${event.eventId} path=${sourcePath}`
|
|
340
|
+
);
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
const kept = keptById.get(event.eventId);
|
|
344
|
+
if (kept) {
|
|
345
|
+
skipped.push({
|
|
346
|
+
eventId: event.eventId,
|
|
347
|
+
keptPath: kept.path,
|
|
348
|
+
skippedPath: sourcePath
|
|
349
|
+
});
|
|
350
|
+
log.warn(
|
|
351
|
+
`projection rebuild skipped duplicate timeline event_id=${event.eventId}: kept=${kept.path} skipped=${sourcePath}`
|
|
352
|
+
);
|
|
353
|
+
continue;
|
|
354
|
+
}
|
|
355
|
+
keptById.set(event.eventId, { event, path: sourcePath });
|
|
356
|
+
unique.push(event);
|
|
357
|
+
}
|
|
358
|
+
return { events: unique, skipped, skippedBlankIds };
|
|
359
|
+
}
|
|
294
360
|
async function loadAuthoritativeProjectionSnapshot(options) {
|
|
295
361
|
const storage = new StorageManager(options.memoryDir);
|
|
296
362
|
storage.invalidateAllMemoriesCacheForDir();
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
]
|
|
363
|
+
const selected = selectProjectionMemories([
|
|
364
|
+
await storage.readAllMemories(),
|
|
365
|
+
await storage.readAllColdMemories(),
|
|
366
|
+
await storage.readArchivedMemories()
|
|
367
|
+
]);
|
|
368
|
+
const allMemories = selected.allMemories;
|
|
369
|
+
const projectionMemories = selected.memories;
|
|
302
370
|
const lifecycleEvents = await storage.readAllMemoryLifecycleEvents();
|
|
303
|
-
const
|
|
304
|
-
const
|
|
371
|
+
const timeline = loadTimelineEvents(projectionMemories, lifecycleEvents);
|
|
372
|
+
const lifecycleLedgerPath = path.join(
|
|
373
|
+
options.memoryDir,
|
|
374
|
+
"state",
|
|
375
|
+
"memory-lifecycle-ledger.jsonl"
|
|
376
|
+
);
|
|
377
|
+
const memoryPathById = new Map(
|
|
378
|
+
projectionMemories.map((memory) => [memory.frontmatter.id, memory.path])
|
|
379
|
+
);
|
|
380
|
+
const deduplicatedTimeline = deduplicateTimelineEvents(
|
|
381
|
+
timeline.events,
|
|
382
|
+
(event) => timeline.usedLifecycleLedger ? lifecycleLedgerPath : memoryPathById.get(event.memoryId) ?? lifecycleLedgerPath
|
|
383
|
+
);
|
|
384
|
+
const events = deduplicatedTimeline.events;
|
|
385
|
+
const usedLifecycleLedger = timeline.usedLifecycleLedger;
|
|
386
|
+
const currentRows = projectionMemories.map((memory) => toCurrentStateRow(options.memoryDir, memory));
|
|
305
387
|
const scope = normalizeProjectionScope(options);
|
|
306
|
-
const scopedMemories = filterMemoriesForProjectionScope(
|
|
388
|
+
const scopedMemories = filterMemoriesForProjectionScope(projectionMemories, scope);
|
|
307
389
|
const scopedMemoryIds = new Set(scopedMemories.map((memory) => memory.frontmatter.id));
|
|
308
390
|
const nativeKnowledgeRows = await loadPersistedNativeKnowledgeChunks({
|
|
309
391
|
memoryDir: options.memoryDir,
|
|
@@ -338,7 +420,11 @@ async function loadAuthoritativeProjectionSnapshot(options) {
|
|
|
338
420
|
nativeKnowledgeRows,
|
|
339
421
|
governance,
|
|
340
422
|
usedLifecycleLedger,
|
|
341
|
-
scope
|
|
423
|
+
scope,
|
|
424
|
+
skippedDuplicateMemories: selected.skippedDuplicateMemories,
|
|
425
|
+
skippedBlankIdMemories: selected.skippedBlankIdMemories,
|
|
426
|
+
skippedDuplicateTimelineEvents: deduplicatedTimeline.skipped,
|
|
427
|
+
skippedBlankIdTimelineEvents: deduplicatedTimeline.skippedBlankIds
|
|
342
428
|
};
|
|
343
429
|
}
|
|
344
430
|
function readProjectedCurrentRows(memoryDir) {
|
|
@@ -778,6 +864,10 @@ async function rebuildMemoryProjection(options) {
|
|
|
778
864
|
outputPath,
|
|
779
865
|
backupPath,
|
|
780
866
|
usedLifecycleLedger: snapshot.usedLifecycleLedger,
|
|
867
|
+
skippedDuplicateMemories: snapshot.skippedDuplicateMemories,
|
|
868
|
+
skippedBlankIdMemories: snapshot.skippedBlankIdMemories,
|
|
869
|
+
skippedDuplicateTimelineEvents: snapshot.skippedDuplicateTimelineEvents,
|
|
870
|
+
skippedBlankIdTimelineEvents: snapshot.skippedBlankIdTimelineEvents,
|
|
781
871
|
scope: snapshot.scope
|
|
782
872
|
};
|
|
783
873
|
}
|
|
@@ -929,4 +1019,4 @@ export {
|
|
|
929
1019
|
verifyMemoryProjection,
|
|
930
1020
|
repairMemoryProjection
|
|
931
1021
|
};
|
|
932
|
-
//# sourceMappingURL=chunk-
|
|
1022
|
+
//# sourceMappingURL=chunk-IIURIWJG.js.map
|