Reuse verified immutable plans and streamline cooperative hashing

Continue final hosted development reliability qualification.
This commit is contained in:
Timothy J. Aveni
2026-10-12 20:16:56 -07:00
parent 47b316180d
commit 62a09605cf
15 changed files with 214 additions and 57 deletions
+2 -2
View File
@@ -1,3 +1,4 @@
import { executionPlanDigestAsync, type ExecutionPlan, hexDigest, hexDigestAsync, ExecutionPlanError } from "./plan.js";
import { portableReflectionValue } from "./reflection.js";
import type {
BoundDependency,
@@ -6,7 +7,6 @@ import type {
PersistentAttachment,
} from "../capability-model/types.js";
import { type ExecutionInstallation, type ExecutionGroupIdentity } from "./installation.js";
import { type ExecutionPlan, hexDigest, hexDigestAsync, ExecutionPlanError } from "./plan.js";
export interface ExecutionEnvironment {
/** Explicit host placement. Merely including an optional module does not select it. */
@@ -28,7 +28,7 @@ export async function compileExecutionGroups(
installation: ExecutionInstallation,
environments: Readonly<Record<string, ExecutionEnvironment>>,
): Promise<InstalledExecutionGroup[]> {
if (installation.plan !== plan.digest || (await hexDigestAsync(plan.definition)) !== plan.digest)
if (installation.plan !== plan.digest || (await executionPlanDigestAsync(plan)) !== plan.digest)
throw new ExecutionPlanError("GROUP_PLAN_MISMATCH", plan.digest, "Expected one checked installation");
const workspace = plan.definition.workspace;
const packages = new Map(workspace.packageImports.map((p) => [p.revisionId as string, p]));