Separate graph execution identity from installation provenance

This commit is contained in:
Timothy J. Aveni
2026-09-22 18:27:59 -07:00
parent c5e79ae3c9
commit 1b296daf42
13 changed files with 243 additions and 20 deletions
+17 -4
View File
@@ -36,7 +36,7 @@ export function compileKernelProgram(plan: ExecutionPlan): unknown {
}
};
const ownerBySlot = new Map<string, string>();
const edges: unknown[] = [];
const edges: { id: string; owner: string; a: unknown; b: unknown }[] = [];
const owners = plan.definition.owners.map((owner) => {
const slots: unknown[] = [];
for (const storage of owner.storage as PersistentAttachment[]) {
@@ -166,7 +166,19 @@ export function compileKernelProgram(plan: ExecutionPlan): unknown {
kind: "creation",
atom: bound.atomId,
schema: portableValueSchema(requirement.inputType),
recipe: hexDigest({ plan: plan.digest, operation: operation.key, port: dependency.portId }),
recipe: hexDigest({
codec: "camino-creation-recipe-v1",
versions: plan.definition.versions,
operation: operation.key,
export: entry.id,
port: dependency.portId,
requirement,
binding: bound,
owners: owners.filter((owner) => owner.atom === bound.atomId),
edges: edges.filter((edge) =>
owners.some((owner) => owner.atom === bound.atomId && owner.id === edge.owner),
),
}),
owners: bound.owners.map((seed) => {
const owner = owners.find((o) => o.atom === bound.atomId && o.interface === seed.interfaceRevisionId);
if (!owner)
@@ -230,11 +242,12 @@ export function compileKernelProgram(plan: ExecutionPlan): unknown {
output: schema(entry.outputType),
})),
}));
return {
const body = {
codec: "camino-kernel-program-v1",
plan: plan.digest,
model: { workspace: workspace.workspaceId, atoms: workspace.atoms.map((atom) => atom.id), owners, edges },
operations,
packages,
};
// The interpreter's plan key covers its real input, not source/build evidence.
return { ...body, plan: hexDigest({ versions: plan.definition.versions, program: body }) };
}