Add checked workspace-interface query roots
Implement scoped interface extents across QX, generated bindings, SDK, Orch, Camino and browser queries. Preserve native projection, aggregation, pagination and watch invalidation without synthetic persisted objects. Validate exact query grants and scope freshness on execution and replay. Add local PostgreSQL, transport, browser and code-generation coverage. C1 implementation slice only: full-text indexes and Studio search adoption (C2/C3) remain tracked in the implementation handoff. No publication or deployment.
This commit is contained in:
@@ -292,7 +292,13 @@ export interface PackageRevision {
|
||||
}
|
||||
|
||||
export type DependencyBinding =
|
||||
| { kind: "query"; packageRevisionId: PackageRevisionId; queryId: string; via?: EdgeTraversal }
|
||||
| {
|
||||
kind: "query";
|
||||
packageRevisionId: PackageRevisionId;
|
||||
queryId: string;
|
||||
scope: "object" | "workspace";
|
||||
via?: EdgeTraversal;
|
||||
}
|
||||
| { kind: "state"; slotId: SlotId; via?: EdgeTraversal }
|
||||
| {
|
||||
kind: "edge";
|
||||
|
||||
@@ -1173,6 +1173,20 @@ const validateBoundDependencies = (
|
||||
issue(issues, "invalid-dependency-binding", path, "Query port must bind its exact checked query export");
|
||||
break;
|
||||
}
|
||||
if (query.root.kind === "workspace-interface") {
|
||||
if (selected.scope !== "workspace" || selected.via)
|
||||
issue(
|
||||
issues,
|
||||
"invalid-dependency-binding",
|
||||
path,
|
||||
"Workspace-interface queries require an explicit workspace scope without an object traversal",
|
||||
);
|
||||
break;
|
||||
}
|
||||
if (selected.scope !== "object") {
|
||||
issue(issues, "invalid-dependency-binding", path, "Object-root queries require an object dependency binding");
|
||||
break;
|
||||
}
|
||||
const traversal = selected.via
|
||||
? validateTraversal(
|
||||
issues,
|
||||
@@ -1191,8 +1205,13 @@ const validateBoundDependencies = (
|
||||
: []
|
||||
: [params.atomId];
|
||||
for (const atom of targets)
|
||||
if (!params.indexes.conformances.has(conformanceKey(atom as AtomId, query.root)))
|
||||
issue(issues, "unsatisfied-interface", path, `Query root ${atom} does not conform to ${query.root}`);
|
||||
if (!params.indexes.conformances.has(conformanceKey(atom as AtomId, query.root.interface)))
|
||||
issue(
|
||||
issues,
|
||||
"unsatisfied-interface",
|
||||
path,
|
||||
`Query root ${atom} does not conform to ${query.root.interface}`,
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "state": {
|
||||
|
||||
Reference in New Issue
Block a user