Implement Studio root and placement capabilities on the replica graph (WI-10)

This commit is contained in:
Timothy J. Aveni
2026-09-21 16:37:00 -07:00
parent 2cf53280e4
commit e1ad15c620
9 changed files with 103 additions and 19 deletions
+15
View File
@@ -1,3 +1,4 @@
import { portableReflectionType, portableReflectionValue } from "./reflection.js";
import type {
ValueType,
InitializationField,
@@ -119,6 +120,20 @@ export function compileKernelProgram(plan: ExecutionPlan): unknown {
const requirement = entry.dependencyPorts.find((p) => p.id === dependency.portId)!.requirement;
const bound = dependency.binding;
const common = { id: dependency.portId, ...via(bound) };
if (bound.kind === "reflection" && requirement.kind === "reflection")
return {
...common,
kind: "reflection",
values: Object.fromEntries(
bound.selectors.map((selector) => [
selector,
{
schema: portableValueSchema(portableReflectionType(selector)),
value: portableReflectionValue(workspace, selector),
},
]),
),
};
if (bound.kind === "state" && requirement.kind === "state")
return {
...common,