Expose authoritative lifecycle deletion through capability bindings

This commit is contained in:
Timothy J. Aveni
2026-09-20 22:48:09 -07:00
parent d80464d285
commit 115976cacd
15 changed files with 1837 additions and 1698 deletions
+5 -8
View File
@@ -44,16 +44,11 @@ export function compileKernelProgram(plan: ExecutionPlan): unknown {
});
} else {
const endpoints = storage.endpoints.map((endpoint) => {
if (
endpoint.ordered ||
endpoint.keyType ||
endpoint.retainOther ||
(endpoint.onDelete && endpoint.onDelete !== "restrict")
)
if (endpoint.ordered || endpoint.keyType || endpoint.retainOther)
throw new ExecutionPlanError(
"UNSUPPORTED_GRAPH_FEATURE",
storage.id,
"Ordered/keyed/deletion policies require LF-18",
"Ordered/keyed relations and automatic retention are not implemented",
);
return {
projection: endpoint.projectionId,
@@ -65,6 +60,7 @@ export function compileKernelProgram(plan: ExecutionPlan): unknown {
: endpoint.constraint.interfaceRevisionId,
},
cardinality: endpoint.cardinality,
...(endpoint.onDelete ? { onDelete: endpoint.onDelete } : {}),
};
});
edges.push({ id: storage.id, owner: owner.id, a: endpoints[0], b: endpoints[1] });
@@ -97,7 +93,8 @@ export function compileKernelProgram(plan: ExecutionPlan): unknown {
const binding = operation.binding;
let target: unknown;
let unsupported: string | null = null;
if (binding.kind === "state")
if (binding.kind === "lifecycle") target = { kind: "lifecycle", primitive: binding.primitive };
else if (binding.kind === "state")
target = { kind: "state", owner: slotOwner(binding.slotId), slot: binding.slotId, primitive: binding.primitive };
else if (binding.kind === "edge")
target = {