Make local graph execution optional across composed packages

This commit is contained in:
Timothy J. Aveni
2026-09-28 21:05:42 -07:00
parent 1e72713ae2
commit e9c15fe40f
87 changed files with 3703 additions and 3400 deletions
+9 -8
View File
@@ -6,10 +6,11 @@ import { generatePortableTypeScriptBindings } from "../src/bindings/portable.js"
import { formatQx } from "../src/capability-language/source.js";
const source = { repository: "https://example.test/reference.git", commit: "a".repeat(40) };
const iface = `interface Data id "data" revision "data@1" {
value content id "content" : string { get id "content:get" execution snapshot targets [server]; }
operation peek id "peek" : interface-ref<Data> -> string { call id "peek:call" execution snapshot targets [server]; }
value content id "content" : string { get id "content:get" execution snapshot; }
operation peek id "peek" : interface-ref<Data> -> string { call id "peek:call" execution snapshot; }
}`;
const pkg = `external atom Item id "item";
const pkg = `symbol JavaScript id "target:org.quixos.execution.javascript@1";
external atom Item id "item";
import interface Data;
package Runtime id "runtime" revision "runtime@1" {
operation peek id "runtime:peek" : interface-ref<Data> -> string mode call execution snapshot targets [server]
@@ -83,15 +84,15 @@ test("closed generic specialization preserves reference-selected interface ports
});
test("portable input-selected reads use installed support beyond the public minimum", () => {
const portable = pkg.replaceAll("targets [server]", "targets [browser, server]");
const portable = pkg.replaceAll("targets [server]", "targets [JavaScript, server]");
const optional = compile(portable);
assert.ok(optional.ok, JSON.stringify(optional.diagnostics));
const plan = compileExecutionPlan(optional.workspace);
assert.deepEqual(plan.definition.operations.find((op) => op.operationId === "peek:call")!.availableTargets, [
"browser",
"server",
"target:org.quixos.execution.javascript@1",
]);
const result = compile(portable, workspace, iface.replaceAll("targets [server]", "targets [browser, server]"));
const result = compile(portable, workspace, iface);
assert.ok(result.ok, JSON.stringify(result.diagnostics));
});
@@ -102,8 +103,8 @@ test("input-selected transactions compose only within a compatible transaction c
const txPackage = pkg.replace("execution snapshot targets [server]", "execution transaction targets [server]");
// Use an operation for the selected write; value getters themselves must remain snapshots.
const contract = txInterface.replace(
'value content id "content" : string { get id "content:get" execution transaction targets [server]; }',
'operation update id "content" : unit -> string { call id "content:get" execution transaction targets [server]; }',
'value content id "content" : string { get id "content:get" execution transaction; }',
'operation update id "content" : unit -> string { call id "content:get" execution transaction; }',
);
const implementation = txPackage.replace("using [content.get]", "using [update.call]");
const model = workspace.replace(