Expose authoritative lifecycle deletion through capability bindings
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -214,7 +214,7 @@ export function compileExecutionPlan(input: WorkspaceRevision): ExecutionPlan {
|
||||
if (binding.kind === "state") planned.dependencies.push({ kind: "state", slot: binding.slotId });
|
||||
else if (binding.kind === "edge")
|
||||
planned.dependencies.push({ kind: "edge", edge: binding.edgeTypeId, projection: binding.projectionId });
|
||||
else {
|
||||
else if (binding.kind === "package") {
|
||||
const entry = packages.get(binding.packageRevisionId)?.exports.find((e) => e.id === binding.exportId);
|
||||
if (!entry) throw new ExecutionPlanError("MISSING_EXPORT", key, "Unresolved package export");
|
||||
for (const dependency of binding.dependencies) {
|
||||
|
||||
Reference in New Issue
Block a user