Implement checked aggregation plans, native SQL, and bounded RPC capture

This commit is contained in:
Timothy J. Aveni
2026-09-17 18:23:16 -07:00
parent cd13120937
commit e61b0a36ac
17 changed files with 2968 additions and 100 deletions
+9
View File
@@ -55,6 +55,13 @@ export async function queryWorkspaceFixture() {
allow TaskFacts.score predicate "Bounded local collection";
allow TaskFacts.score order "Bounded local collection";
}
query Totals id "totals" root Collection<interface TaskFacts> document "totals.graphql" operation "Totals" {
max rows 30; watch;
}
query ScoreTotals id "score-totals" root Collection<interface TaskFacts> document "score-totals.graphql" operation "ScoreTotals" {
max rows 30; max candidates 60;
allow TaskFacts.score aggregate "Complete bounded collection report";
}
}`;
sources.Queries = packageSource;
const pkgResult = compileCapabilityResourceSource(packageSource, {
@@ -70,6 +77,8 @@ export async function queryWorkspaceFixture() {
"row.graphql": `fragment TaskRow on TaskFacts {title rank done assignee {name}}`,
"enriched.graphql": `query Enriched {root {items(first: 3) {entries {key node {_qx {ref} title score}}}}}`,
"ranked.graphql": `query Ranked {root {items(first: 3, where: {score: {gt: 0}}, orderBy: [{score: DESC}]) {entries {key node {_qx {ref} title}}}}}`,
"totals.graphql": `query Totals {root {_qx {relations {items {aggregate {count sum {rank}} groups(by: {done: true}, first: 10) {entries {group {done} aggregate {count sum {rank}}}}}}}}}`,
"score-totals.graphql": `query ScoreTotals {root {_qx {relations {items {aggregate {count sum {score}}}}}}}`,
};
pkg.checkedQueries = await Promise.all(
pkg.queries!.map((query) => compileQuery(query, allInterfaces, async (name) => documents[name]!)),