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
+3 -2
View File
@@ -1,3 +1,4 @@
import { executionPlanDigest, type ExecutionPlan, ExecutionPlanError, hexDigest } from "./plan.js";
import { portableReflectionType, portableReflectionValue } from "./reflection.js";
import type {
ValueType,
@@ -7,7 +8,7 @@ import type {
BoundDependency,
PackageExport,
} from "../capability-model/types.js";
import { type ExecutionPlan, ExecutionPlanError, hexDigest } from "./plan.js";
import { portableValueSchema } from "../bindings/portable.js";
import { subscriptionContract } from "../capability-model/journals.js";
type PreparedStep = string | null | { case: string; id: string };
@@ -25,7 +26,7 @@ function preparedInputPaths(type: ValueType, path: PreparedStep[] = []): Prepare
}
/** Small data-only interpreter input; no compiler, parser, Node module or SQL dependency reaches the browser. */
export function compileKernelProgram(plan: ExecutionPlan): unknown {
if (hexDigest(plan.definition) !== plan.digest)
if (executionPlanDigest(plan) !== plan.digest)
throw new ExecutionPlanError("INVALID_PLAN", "kernel", "Plan digest mismatch");
const workspace = plan.definition.workspace;
if (workspace.sharedAttachments.some((attachment) => attachment.kind !== "edge"))