@llblab/pi-state-flow 0.27.6 → 1.0.0
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/AGENTS.md +3 -3
- package/BACKLOG.md +5 -1
- package/CHANGELOG.md +11 -0
- package/README.md +1 -1
- package/dist/lib/durable.js +4 -2
- package/dist/lib/extension.js +118 -16
- package/dist/lib/healing.d.ts +47 -0
- package/dist/lib/healing.js +160 -0
- package/dist/lib/logging.d.ts +3 -1
- package/dist/lib/logging.js +4 -0
- package/dist/lib/migration.d.ts +7 -5
- package/dist/lib/migration.js +13 -54
- package/dist/package.json +1 -1
- package/docs/architecture.md +1 -1
- package/docs/compatibility.md +2 -2
- package/docs/filesystem-recovery.md +14 -0
- package/docs/semantic-compatibility-decision.md +5 -7
- package/docs/usage.md +19 -17
- package/lib/durable.ts +3 -2
- package/lib/extension.ts +105 -14
- package/lib/healing.ts +169 -0
- package/lib/logging.ts +6 -1
- package/lib/migration.ts +13 -51
- package/package.json +1 -1
package/lib/healing.ts
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// Domain: visible self-healing of unrecoverable canonical scope cohorts by quarantine and reset to absence.
|
|
2
|
+
// Excludes: semantic repair, Git restoration, foreign-owner data, transient I/O failures and Pi lifecycle policy.
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
4
|
+
import { constants, lstatSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
5
|
+
import { basename, dirname, relative, resolve } from "node:path";
|
|
6
|
+
import { canonicalJson } from "./json.ts";
|
|
7
|
+
import { RetiredSemanticFormatError } from "./migration.ts";
|
|
8
|
+
import { sessionRuntimePaths, temporalScopePaths } from "./durable.ts";
|
|
9
|
+
import { captureScopeSelection, type ScopeSelection } from "./selection.ts";
|
|
10
|
+
import { RevisionUnavailableError } from "./snapshot.ts";
|
|
11
|
+
import type { StateScope } from "./state.ts";
|
|
12
|
+
import { assertStorageDirectory, PublicationBusyError, withStorageTransaction, type StorageTransaction } from "./storage.ts";
|
|
13
|
+
|
|
14
|
+
/** One visible reset: the scope became wholly absent after its exact bytes were quarantined. */
|
|
15
|
+
export interface HealedScope {
|
|
16
|
+
scope: StateScope;
|
|
17
|
+
reason: string;
|
|
18
|
+
quarantine: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Healing outcome; `lifecycleAbsent` means this session owns no lifecycle after healing. */
|
|
22
|
+
export interface HealResult {
|
|
23
|
+
healed: HealedScope[];
|
|
24
|
+
lifecycleAbsent: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface HealRequest {
|
|
28
|
+
cwd: string;
|
|
29
|
+
sessionId: string;
|
|
30
|
+
sessionKey: string;
|
|
31
|
+
selection: ScopeSelection;
|
|
32
|
+
historyLimit: number;
|
|
33
|
+
root: string;
|
|
34
|
+
/** Wall-clock source for deterministic tests. */
|
|
35
|
+
now?: () => Date;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Only semantic decoding/validation failures are healable. Filesystem, lock, cancellation and
|
|
40
|
+
* foreign-owner identity failures keep failing closed because resetting cannot fix them safely.
|
|
41
|
+
*/
|
|
42
|
+
export function isHealableCorruption(error: unknown): boolean {
|
|
43
|
+
if (!(error instanceof Error)) return false;
|
|
44
|
+
if (error instanceof RevisionUnavailableError || error instanceof PublicationBusyError || error instanceof RetiredSemanticFormatError) return false;
|
|
45
|
+
if (error.name === "AbortError") return false;
|
|
46
|
+
if (typeof (error as NodeJS.ErrnoException).code === "string") return false;
|
|
47
|
+
if (/identity mismatch/i.test(error.message)) return false;
|
|
48
|
+
if (error instanceof AggregateError) return error.errors.every(isHealableCorruption);
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function scopeFiles(request: HealRequest, scope: StateScope): string[] {
|
|
53
|
+
const paths = temporalScopePaths(request.cwd, request.sessionId, scope, request.root, request.sessionKey);
|
|
54
|
+
const semantic = [paths.checkpoint, paths.patches, paths.meta, resolve(paths.directory, "state.json")];
|
|
55
|
+
if (scope !== "session") return semantic;
|
|
56
|
+
const runtime = sessionRuntimePaths(request.cwd, request.sessionId, request.root, request.sessionKey);
|
|
57
|
+
return [...semantic, runtime.config, runtime.runtime];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function readPresent(path: string): Buffer | undefined {
|
|
61
|
+
const stat = lstatSync(path, { throwIfNoEntry: false });
|
|
62
|
+
if (!stat) return undefined;
|
|
63
|
+
if (!stat.isFile() || stat.isSymbolicLink()) throw new Error(`State Flow quarantine refuses a non-regular file: ${JSON.stringify(path)}`);
|
|
64
|
+
return readFileSync(path, { flag: constants.O_RDONLY | constants.O_NOFOLLOW });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Exact-byte private record first; canonical files are removed only after the record verifies. */
|
|
68
|
+
function quarantineScope(request: HealRequest, scope: StateScope, reason: string): HealedScope | undefined {
|
|
69
|
+
const root = resolve(request.root);
|
|
70
|
+
const files = scopeFiles(request, scope).map(path => ({ path, bytes: readPresent(path) })).filter(file => file.bytes !== undefined);
|
|
71
|
+
if (files.length === 0) return undefined;
|
|
72
|
+
const at = (request.now?.() ?? new Date()).toISOString();
|
|
73
|
+
const content = `${canonicalJson({ version: 1, kind: "state-flow-quarantine", at, root, cwd: resolve(request.cwd),
|
|
74
|
+
sessionId: request.sessionId, sessionKey: request.sessionKey, scope, reason,
|
|
75
|
+
files: files.map(file => ({ path: relative(root, file.path), bytes: file.bytes!.toString("base64") })) })}\n`;
|
|
76
|
+
const directory = resolve(dirname(root), `${basename(root)}-quarantine`);
|
|
77
|
+
assertStorageDirectory(directory);
|
|
78
|
+
mkdirSync(directory, { recursive: true, mode: 0o700 });
|
|
79
|
+
const directoryStat = lstatSync(directory);
|
|
80
|
+
if (!directoryStat.isDirectory() || directoryStat.isSymbolicLink() || (directoryStat.mode & 0o077) !== 0) {
|
|
81
|
+
throw new Error("State Flow quarantine directory must be private; canonical files preserved");
|
|
82
|
+
}
|
|
83
|
+
const digest = createHash("sha256").update(content).digest("hex").slice(0, 16);
|
|
84
|
+
const path = resolve(directory, `${at.replace(/[:.]/g, "-")}-${scope}-${digest}.json`);
|
|
85
|
+
try { writeFileSync(path, content, { flag: "wx", mode: 0o600 }); }
|
|
86
|
+
catch (error) { if ((error as NodeJS.ErrnoException).code !== "EEXIST") throw error; }
|
|
87
|
+
if (readFileSync(path, { encoding: "utf8", flag: constants.O_RDONLY | constants.O_NOFOLLOW }) !== content) {
|
|
88
|
+
throw new Error("State Flow quarantine record changed; canonical files preserved");
|
|
89
|
+
}
|
|
90
|
+
for (const file of files) rmSync(file.path);
|
|
91
|
+
return { scope, reason, quarantine: path };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function probe(action: () => unknown, signal?: AbortSignal): Error | undefined {
|
|
95
|
+
try { action(); return undefined; }
|
|
96
|
+
catch (error) {
|
|
97
|
+
// Cancellation reasons are arbitrary values; they never prove corruption.
|
|
98
|
+
signal?.throwIfAborted();
|
|
99
|
+
if (!isHealableCorruption(error)) throw error;
|
|
100
|
+
return error as Error;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Converge the selected owners to a loadable store: decode each owner independently, then the
|
|
106
|
+
* complete selected cohort. A broken owner is quarantined and becomes wholly absent, which the
|
|
107
|
+
* normal lifecycle treats as empty memory. Healthy stores are never written.
|
|
108
|
+
*/
|
|
109
|
+
export function healSelectedStoreLocked(storage: StorageTransaction, request: HealRequest, signal?: AbortSignal): HealResult {
|
|
110
|
+
const wanted = captureScopeSelection(request.selection);
|
|
111
|
+
const { cwd, sessionId, sessionKey, root, historyLimit } = request;
|
|
112
|
+
const healed: HealedScope[] = [];
|
|
113
|
+
const reset = (scope: StateScope, error: Error) => {
|
|
114
|
+
const result = quarantineScope(request, scope, error.message);
|
|
115
|
+
if (result) healed.push(result);
|
|
116
|
+
};
|
|
117
|
+
for (const scope of wanted.filter(owner => owner !== "session")) {
|
|
118
|
+
const failure = probe(() => storage.observeSelectedShared(cwd, captureScopeSelection([scope]), root), signal);
|
|
119
|
+
if (failure) reset(scope, failure);
|
|
120
|
+
}
|
|
121
|
+
let lifecycle: ReturnType<StorageTransaction["inspectSelectedLifecycle"]>;
|
|
122
|
+
const lifecycleFailure = probe(() => { lifecycle = storage.inspectSelectedLifecycle(cwd, sessionId, wanted, root, sessionKey); }, signal);
|
|
123
|
+
if (lifecycleFailure) {
|
|
124
|
+
reset("session", lifecycleFailure);
|
|
125
|
+
return { healed, lifecycleAbsent: true };
|
|
126
|
+
}
|
|
127
|
+
if (!lifecycle) return { healed, lifecycleAbsent: true };
|
|
128
|
+
if (wanted.includes("session") && lifecycle.runtime.meta.privateAcquisition !== "acquired") return { healed, lifecycleAbsent: false };
|
|
129
|
+
// The session lifecycle anchors cross-owner lineage, so a contradictory cohort resets that private anchor.
|
|
130
|
+
const cohortFailure = probe(() => storage.prepareSelectedCurrent(cwd, sessionId, wanted, historyLimit, root, sessionKey), signal);
|
|
131
|
+
if (cohortFailure) reset("session", cohortFailure);
|
|
132
|
+
return { healed, lifecycleAbsent: cohortFailure !== undefined };
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** Never waits behind a live writer: a busy store is being used, so healing defers to a later attempt. */
|
|
136
|
+
export async function healSelectedStore(request: HealRequest, signal?: AbortSignal): Promise<HealResult> {
|
|
137
|
+
const root = resolve(request.root);
|
|
138
|
+
if (!lstatSync(root, { throwIfNoEntry: false })) return { healed: [], lifecycleAbsent: true };
|
|
139
|
+
return withStorageTransaction(root, storage => healSelectedStoreLocked(storage, { ...request, root }, signal), signal, false);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** One pending reset notice: projected to the model until an agent run settles after seeing it. */
|
|
143
|
+
export class HealNotice {
|
|
144
|
+
#message: string | undefined;
|
|
145
|
+
#projected = false;
|
|
146
|
+
|
|
147
|
+
announce(message: string): void {
|
|
148
|
+
this.#message = message;
|
|
149
|
+
this.#projected = false;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** Model-facing text for the current request, marking it as seen. */
|
|
153
|
+
project(): string | undefined {
|
|
154
|
+
if (this.#message === undefined) return undefined;
|
|
155
|
+
this.#projected = true;
|
|
156
|
+
return `${this.#message}. Tell the user about this State Flow memory reset in your next answer.`;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** A settled run that saw the notice consumes it; an unseen notice survives. */
|
|
160
|
+
settle(): void {
|
|
161
|
+
if (!this.#projected) return;
|
|
162
|
+
this.#message = undefined;
|
|
163
|
+
this.#projected = false;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function describeHealedScopes(healed: readonly HealedScope[]): string {
|
|
168
|
+
return healed.map(item => `${item.scope} memory was unreadable (${item.reason}) and was reset to empty; original bytes quarantined at ${item.quarantine}`).join("; ");
|
|
169
|
+
}
|
package/lib/logging.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { appendFileSync, closeSync, constants, fstatSync, lstatSync, mkdirSync,
|
|
|
3
3
|
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
4
4
|
import { isObject } from "./json.ts";
|
|
5
5
|
|
|
6
|
-
export type StateFlowDiagnosticCategory = "invalid-patch" | "publication-conflict" | "finalization" | "barrier-block";
|
|
6
|
+
export type StateFlowDiagnosticCategory = "invalid-patch" | "publication-conflict" | "finalization" | "barrier-block" | "self-heal";
|
|
7
7
|
|
|
8
8
|
/** Minimal structural block; only ordinary text keeps its exact content. */
|
|
9
9
|
export interface StateFlowDiagnosticBlock {
|
|
@@ -92,6 +92,11 @@ export class StateFlowDiagnosticWriter {
|
|
|
92
92
|
return this.write(sessionId, cwd, error, "publication-conflict", {}, false);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
/** Memory resets are always recorded locally, independently of opt-in logging. */
|
|
96
|
+
recordSelfHeal(sessionId: string, cwd: string, error: string): boolean {
|
|
97
|
+
return this.write(sessionId, cwd, error, "self-heal", {});
|
|
98
|
+
}
|
|
99
|
+
|
|
95
100
|
private write(sessionId: string, cwd: string, error: string, category: StateFlowDiagnosticCategory, extras: DiagnosticExtras, reportFailure = true): boolean {
|
|
96
101
|
try {
|
|
97
102
|
const fromRepository = relative(this.repositoryRoot, this.path);
|
package/lib/migration.ts
CHANGED
|
@@ -3,14 +3,13 @@ import { resolve } from "node:path";
|
|
|
3
3
|
import { parseArtifactProvenanceRegistry } from "./artifact.ts";
|
|
4
4
|
import { MAX_HISTORY_LIMIT } from "./history.ts";
|
|
5
5
|
import { canonicalJson, isJsonValue, isObject, validatePatch, type JsonObject, type JsonValue } from "./json.ts";
|
|
6
|
-
import { parseStateReadPath, parseValuePath } from "./query.ts";
|
|
7
6
|
import { assertRetainedModules, validateRetainedModules, type RetainedModules } from "./semantic-module.ts";
|
|
8
7
|
import { assertNoRetiredSemanticPlanes, type StateScope } from "./state.ts";
|
|
9
8
|
import { validateScopeStream, type ScopeStream } from "./temporal.ts";
|
|
10
9
|
|
|
11
|
-
/** Owns
|
|
10
|
+
/** Owns the pure v3/v4 semantic codec and module-descriptor upgrade; excludes I/O, publication, backup and lifecycle authority. */
|
|
12
11
|
export interface SemanticMigrationCandidate {
|
|
13
|
-
sourceVersion:
|
|
12
|
+
sourceVersion: 3 | 4;
|
|
14
13
|
targetVersion: 3 | 4;
|
|
15
14
|
/** A format conversion is not an authored semantic transition or revision. */
|
|
16
15
|
requiresConversion: boolean;
|
|
@@ -31,57 +30,20 @@ export interface SerializedSemanticMigrationCandidate extends SemanticMigrationC
|
|
|
31
30
|
target: Record<ScopeMigrationFile, string>;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const LEGACY_LOCATOR = /^(?:((?:effective|global|cwd|session)(?:\[\d+\])?(?:\.patches(?:\[\d+\])?)?)\.)?(contract|working)(?=$|\.|\[)/;
|
|
37
|
-
const MARKED_LOCATOR = /(?<![\p{L}\p{N}_$.[\]:/\\-])\$([\p{L}\p{N}_$.[\]:-]+)(?![\p{L}\p{N}_$.[\]:/\\-])/gu;
|
|
33
|
+
/** A known retired format, not corruption: self-healing must never reset it. */
|
|
34
|
+
export class RetiredSemanticFormatError extends Error {}
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const [, prefix, plane] = match;
|
|
43
|
-
const suffix = path.slice(match[0].length);
|
|
44
|
-
try {
|
|
45
|
-
if (prefix) parseStateReadPath(prefix, MAX_HISTORY_LIMIT);
|
|
46
|
-
// The unchanged lazy root lets the shared parser validate selectors after legacy names retire.
|
|
47
|
-
parseValuePath(`lazy${suffix}`);
|
|
48
|
-
} catch {
|
|
49
|
-
return path;
|
|
50
|
-
}
|
|
51
|
-
return `${prefix ? `${prefix}.` : ""}${LEGACY_PLANES.get(plane!)!}${suffix}`;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function translateReferences(value: JsonValue): JsonValue {
|
|
55
|
-
if (typeof value === "string") return value.replace(MARKED_LOCATOR, (_token, path: string) => `$${translateLocator(path)}`);
|
|
56
|
-
if (Array.isArray(value)) return value.map(translateReferences);
|
|
57
|
-
if (!isObject(value)) return value;
|
|
58
|
-
return Object.fromEntries(Object.entries(value).map(([key, child]) => [key,
|
|
59
|
-
key === "$ref" && typeof child === "string" ? translateLocator(child) : translateReferences(child)]));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function translateArtifacts(value: JsonValue): JsonValue {
|
|
63
|
-
if (!isObject(value)) return translateReferences(value);
|
|
64
|
-
return Object.fromEntries(Object.entries(value).map(([path, card]) => [path, !isObject(card) ? translateReferences(card)
|
|
65
|
-
: Object.fromEntries(Object.entries(card).map(([key, child]) => [key,
|
|
66
|
-
// Retired embedded provenance is evidence, never a semantic reference namespace.
|
|
67
|
-
["hash", "compiler", "compiled_at"].includes(key) ? structuredClone(child) : translateReferences(child)]))]));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** Translate a raw legacy checkpoint or replay patch before any known-field filtering. */
|
|
71
|
-
export function translateLegacySemanticObject(value: unknown): JsonObject {
|
|
72
|
-
validatePatch(value);
|
|
73
|
-
for (const plane of LEGACY_PLANES.values()) {
|
|
74
|
-
if (Object.hasOwn(value, plane)) throw new Error(`Target State Flow semantic plane in legacy format: ${plane}`);
|
|
75
|
-
}
|
|
76
|
-
return Object.fromEntries(Object.entries(value).map(([key, child]) => [LEGACY_PLANES.get(key) ?? key,
|
|
77
|
-
key === "artifacts" ? translateArtifacts(child) : LEGACY_SEMANTIC_PLANES.has(key) ? translateReferences(child) : structuredClone(child)]));
|
|
36
|
+
/** State Flow 1.0.0 ended the temporary contract/working conversion window; refusal stays explicit. */
|
|
37
|
+
export function refuseRetiredSemanticVersion(version: unknown): never {
|
|
38
|
+
throw new RetiredSemanticFormatError(`Unsupported State Flow semantic metadata version ${String(version)}: legacy contract/working memory is no longer converted since State Flow 1.0.0; open it once with State Flow 0.x to convert it`);
|
|
78
39
|
}
|
|
79
40
|
|
|
80
41
|
/** Build a detached target candidate; publication still belongs to the guarded storage transaction. */
|
|
81
42
|
export function prepareSemanticMigration(
|
|
82
43
|
value: unknown, scope: StateScope, sourceVersion: number, historyLimit = MAX_HISTORY_LIMIT, targetModules?: RetainedModules,
|
|
83
44
|
): SemanticMigrationCandidate {
|
|
84
|
-
if (sourceVersion
|
|
45
|
+
if (sourceVersion === 1 || sourceVersion === 2) refuseRetiredSemanticVersion(sourceVersion);
|
|
46
|
+
if (sourceVersion !== 3 && sourceVersion !== 4) throw new Error("Unsupported State Flow migration source version");
|
|
85
47
|
validatePatch(value);
|
|
86
48
|
if (!isObject(value.checkpoint) || !Array.isArray(value.patches)) throw new Error("Invalid temporal checkpoint/tail envelope");
|
|
87
49
|
if (targetModules !== undefined) validateRetainedModules(targetModules);
|
|
@@ -93,7 +55,6 @@ export function prepareSemanticMigration(
|
|
|
93
55
|
const translate = (state: unknown): JsonObject => {
|
|
94
56
|
if (sourceVersion !== 4 && targetModules !== undefined && isObject(state)
|
|
95
57
|
&& Object.keys(state).some(key => key.startsWith("x_"))) throw new Error("Legacy State Flow external namespace collision");
|
|
96
|
-
if (sourceVersion < 3) return translateLegacySemanticObject(state);
|
|
97
58
|
validatePatch(state);
|
|
98
59
|
assertNoRetiredSemanticPlanes(state);
|
|
99
60
|
return structuredClone(state);
|
|
@@ -149,7 +110,8 @@ export function prepareSerializedScopeMigration(
|
|
|
149
110
|
const metadata = parseMigrationJson(metaText, "metadata");
|
|
150
111
|
if (!isObject(metadata)) throw new Error("Invalid State Flow migration metadata");
|
|
151
112
|
const version = metadata.version;
|
|
152
|
-
if (version
|
|
113
|
+
if (version === 1 || version === 2) refuseRetiredSemanticVersion(version);
|
|
114
|
+
if (version !== 3 && version !== 4) throw new Error("Unsupported State Flow migration source version");
|
|
153
115
|
if (version === 4) validateRetainedModules(metadata.modules);
|
|
154
116
|
else if (targetModules !== undefined && Object.hasOwn(metadata, "modules")) throw new Error("Legacy State Flow modules metadata collision");
|
|
155
117
|
if (scope === "cwd") {
|
|
@@ -164,7 +126,7 @@ export function prepareSerializedScopeMigration(
|
|
|
164
126
|
if (!isObject(temporal) || !Object.hasOwn(temporal, "checkpoint") || !Array.isArray(temporal.patches)) {
|
|
165
127
|
throw new Error("Invalid State Flow migration temporal metadata");
|
|
166
128
|
}
|
|
167
|
-
if (
|
|
129
|
+
if (!Object.hasOwn(temporal, "revision")) throw new Error("State Flow target migration metadata requires a revision");
|
|
168
130
|
const checkpointText = decodeMigrationText(basis.checkpoint.bytes, "checkpoint");
|
|
169
131
|
const patchesText = decodeMigrationText(basis.patches.bytes, "tail");
|
|
170
132
|
const checkpoint = parseMigrationJson(checkpointText, "checkpoint");
|
|
@@ -174,7 +136,7 @@ export function prepareSerializedScopeMigration(
|
|
|
174
136
|
if (boundaries.length !== patches.length) throw new Error("State Flow migration metadata does not match its semantic tail");
|
|
175
137
|
const candidate = prepareSemanticMigration({
|
|
176
138
|
...(version === 4 ? { modules: metadata.modules } : {}),
|
|
177
|
-
revision: temporal.revision
|
|
139
|
+
revision: temporal.revision,
|
|
178
140
|
checkpoint: { through: temporal.checkpoint, state: checkpoint },
|
|
179
141
|
patches: patches.map((patch, index) => ({ transition: boundaries[index], patch })),
|
|
180
142
|
}, scope, version, MAX_HISTORY_LIMIT, targetModules);
|