Support captured CRDT changes in compound transaction contracts

This commit is contained in:
Timothy J. Aveni
2026-09-20 23:07:09 -07:00
parent 33f674321b
commit 2056c1e352
10 changed files with 171 additions and 16 deletions
+4 -4
View File
@@ -144,8 +144,8 @@ export function compileExecutionPlan(input: WorkspaceRevision): ExecutionPlan {
for (const pkg of workspace.packageImports)
for (const entry of pkg.exports)
if (entry.execution && entry.execution.kind !== "remote") {
checkValue(entry.inputType, `${pkg.revisionId}/${entry.id}/input`);
checkValue(entry.outputType, `${pkg.revisionId}/${entry.id}/output`);
checkValue(entry.inputType, `${pkg.revisionId}/${entry.id}/input`, true);
checkValue(entry.outputType, `${pkg.revisionId}/${entry.id}/output`, true);
}
for (const attachment of attachments)
if (attachment.kind === "state" && attachment.storagePolicy.kind === "crdt-document")
@@ -208,8 +208,8 @@ export function compileExecutionPlan(input: WorkspaceRevision): ExecutionPlan {
operationMap.set(key, planned);
const portable = planned.execution.kind !== "remote";
if (portable) {
checkValue(planned.input, `${key}/input`, binding.kind === "state" && binding.primitive === "edit");
checkValue(planned.output, `${key}/output`);
checkValue(planned.input, `${key}/input`, true);
checkValue(planned.output, `${key}/output`, true);
}
if (binding.kind === "state") planned.dependencies.push({ kind: "state", slot: binding.slotId });
else if (binding.kind === "edge")