Add composable interface operation forwarding
Support bind member.operation to interface Target<Args>.member.operation. Check exact signatures and scopes, same-receiver conformances, cycles and watch pairing. Resolve chains for native queries, editing and dispatch while retaining the terminal conformance owner and injected package dependencies. Track forwarded providers in dependency and semantic-major review machinery. Cover native get/set/watch chains, generic targets, invalid bindings, package forwarding, runtime owner authority and watch cancellation. Document the language feature and keep Studio search adoption explicitly pending. No push or deployment.
This commit is contained in:
+11
-2
@@ -10,6 +10,7 @@ import type {
|
||||
import { QueryCompileError, type CheckedQuery } from "./types.js";
|
||||
import { queryRuntimePlan } from "./proto.js";
|
||||
import { canonicalJson } from "../capability-model/evolution.js";
|
||||
import { resolveForwardedBinding } from "../capability-model/forwarding.js";
|
||||
|
||||
export interface LinkedQueryField {
|
||||
atomId: AtomId;
|
||||
@@ -74,7 +75,12 @@ export function linkQueries(workspace: WorkspaceRevision): LinkedQuery[] {
|
||||
const provider = conformance.operationBindings.find((entry) => entry.operationId === getter.id);
|
||||
if (!provider)
|
||||
throw new QueryCompileError("QUERY_CONTRACT", `Missing binding ${conformance.atomId}.${getter.id}`);
|
||||
const binding = provider.binding;
|
||||
const binding = resolveForwardedBinding(
|
||||
workspace,
|
||||
conformance.atomId,
|
||||
conformance.interfaceRevisionId,
|
||||
getter.id,
|
||||
).binding;
|
||||
if (binding.kind === "package") {
|
||||
if (effect.execution !== "rpc-permitted")
|
||||
throw new QueryCompileError(
|
||||
@@ -95,7 +101,10 @@ export function linkQueries(workspace: WorkspaceRevision): LinkedQuery[] {
|
||||
);
|
||||
const start = member.operations.find((op) => op.displayName === "watch-start");
|
||||
const stop = member.operations.find((op) => op.displayName === "watch-stop");
|
||||
const watch = start && stop && conformance.operationBindings.find((entry) => entry.operationId === start.id);
|
||||
const watch =
|
||||
start && stop && conformance.operationBindings.some((entry) => entry.operationId === start.id)
|
||||
? resolveForwardedBinding(workspace, conformance.atomId, conformance.interfaceRevisionId, start.id)
|
||||
: undefined;
|
||||
if (
|
||||
binding.kind === "state" &&
|
||||
watch &&
|
||||
|
||||
Reference in New Issue
Block a user