@zq-silk/yui 0.15.2 → 0.15.3
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.
|
@@ -84,33 +84,14 @@ export async function assertExactControlPlanePreflight(input, options = {}) {
|
|
|
84
84
|
assertSamePath(descriptor.executable, input.actualExecutable, "Control-plane executable");
|
|
85
85
|
assertSamePath(descriptor.cliEntry, input.actualCliEntry, "Control-plane CLI entry");
|
|
86
86
|
assertSamePath(descriptor.yuiHome, input.actualHome, "Control-plane YUI_HOME");
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
+ `(expected ${descriptor.identity.storageVersion}, found `
|
|
96
|
-
+ `${storage.currentVersion ?? "unknown"}).`);
|
|
97
|
-
}
|
|
98
|
-
// A frozen descriptor authenticates the command that created it; it no
|
|
99
|
-
// longer pins the Home's deployment pointer for the lifetime of a Session.
|
|
100
|
-
// Continuity is the protocol/storage contract checked above and the durable
|
|
101
|
-
// Task/Role/Turn identity checked below. This lets a compatible Controller or
|
|
102
|
-
// active release advance without invalidating a still-current Session.
|
|
103
|
-
if (options.checkController !== false) {
|
|
104
|
-
const call = options.callController ?? defaultCallController;
|
|
105
|
-
try {
|
|
106
|
-
const status = await call(descriptor.yuiHome, "controller.status", {});
|
|
107
|
-
assertControllerContinuityIdentity(status, descriptor.identity);
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
if (!isDefinitelyNotRunning(error))
|
|
111
|
-
throw error;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
87
|
+
// A frozen descriptor can only assert what cannot legitimately change for a
|
|
88
|
+
// Session: which Home it belongs to, and which installation launched it. The
|
|
89
|
+
// protocol and storage numbers it also captured describe the world at launch
|
|
90
|
+
// time, and Yui upgrades that world on purpose. Asking today's Home to still
|
|
91
|
+
// match yesterday's snapshot would silence a healthy Session's callbacks the
|
|
92
|
+
// moment a migration lands, so runtime coherence is proven against the
|
|
93
|
+
// current CLI, Home, and Controller instead.
|
|
94
|
+
await assertCompatibleControlPlanePreflight({ actualHome: descriptor.yuiHome }, options);
|
|
114
95
|
return descriptor;
|
|
115
96
|
}
|
|
116
97
|
/**
|
|
@@ -170,18 +151,6 @@ function validateVersionIdentity(value) {
|
|
|
170
151
|
minimumStorageVersion
|
|
171
152
|
};
|
|
172
153
|
}
|
|
173
|
-
/** Managed continuity is a protocol/storage contract, not a package pin. */
|
|
174
|
-
function assertContinuityIdentity(label, expected, actual) {
|
|
175
|
-
for (const field of [
|
|
176
|
-
"controllerProtocolVersion",
|
|
177
|
-
"storageVersion"
|
|
178
|
-
]) {
|
|
179
|
-
if (expected[field] !== actual[field]) {
|
|
180
|
-
throw new Error(`${label} ${field} does not match the frozen control plane `
|
|
181
|
-
+ `(expected ${expected[field]}, found ${actual[field]}).`);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
154
|
function assertControllerContinuityIdentity(status, expected) {
|
|
186
155
|
if (!isRecord(status) || status.running !== true) {
|
|
187
156
|
throw new Error("Controller status does not describe a running Controller.");
|