Keep cold Candidate verification cooperative with controller renewals

This commit is contained in:
Timothy J. Aveni
2026-10-12 18:24:38 -07:00
parent 755c008a88
commit a48fccc328
5 changed files with 93 additions and 11 deletions
+9 -2
View File
@@ -1,6 +1,13 @@
import { createHash } from "node:crypto";
import { canonicalJson } from "../capability-model/evolution.js";
import { type ExecutionPlan, type PlanPackage, ExecutionPlanError, hexDigest, executionVersions } from "./plan.js";
import {
type ExecutionPlan,
type PlanPackage,
ExecutionPlanError,
hexDigest,
hexDigestAsync,
executionVersions,
} from "./plan.js";
export interface ArtifactFile {
path: string;
@@ -359,7 +366,7 @@ export async function checkExecutionWorld(
): Promise<CheckedWorld> {
if (canonicalJson(plan.definition.versions) !== canonicalJson(executionVersions))
fail("world", "Unsupported plan codec versions");
if (hexDigest(plan.definition) !== plan.digest) fail("plan", "Plan digest mismatch");
if ((await hexDigestAsync(plan.definition)) !== plan.digest) fail("plan", "Plan digest mismatch");
const manifests = inputs.map(parsePackageArtifacts);
unique(
manifests.map((m) => m.packageRevisionId),