Harden graph recovery and shadow persistence

This commit is contained in:
Youzini-afk
2026-04-07 17:18:18 +08:00
parent aa1d194c28
commit 854e3a7a79
11 changed files with 713 additions and 20 deletions

View File

@@ -6,6 +6,7 @@ import {
createDefaultHistoryState,
createDefaultVectorIndexState,
normalizeGraphRuntimeState,
PROCESSED_MESSAGE_HASH_VERSION,
} from "./runtime-state.js";
import {
hasSameScopeIdentity,
@@ -717,7 +718,10 @@ export function importGraph(json) {
node.embedding = null;
}
graph.batchJournal = createDefaultBatchJournal();
graph.historyState.processedMessageHashVersion =
PROCESSED_MESSAGE_HASH_VERSION;
graph.historyState.processedMessageHashes = {};
graph.historyState.processedMessageHashesNeedRefresh = true;
graph.historyState.historyDirtyFrom = null;
graph.vectorIndexState.hashToNodeId = {};
graph.vectorIndexState.nodeToHash = {};