Add checked query composition foundations for prepared presentations
Move React navigation query generation behind an explicit build frontend. Add checked result-dependent query bindings and pure composition evaluation, including one-snapshot server execution. Preserve the existing rendering path while the React manifest, worker preparation, and replica admission integration remain pending; see docs/PREPARED_PRESENTATIONS_PROGRESS.md.
This commit is contained in:
@@ -65,6 +65,27 @@ let
|
||||
}) (flatten root)
|
||||
)
|
||||
);
|
||||
# Frontends are an explicit build choice. The capability assembler itself
|
||||
# neither discovers React contracts nor loads executable package code.
|
||||
queryFrontends = pkgs.lib.unique (
|
||||
pkgs.lib.concatMap (
|
||||
node:
|
||||
let
|
||||
config = node.directory + "/quixos.check.json";
|
||||
in
|
||||
if builtins.pathExists config then
|
||||
(builtins.fromJSON (builtins.readFile config)).queryFrontends or [ ]
|
||||
else
|
||||
[ ]
|
||||
) (capabilityFlatten root)
|
||||
);
|
||||
queryGeneratorFlags =
|
||||
if queryFrontends == [ ] then
|
||||
""
|
||||
else if queryFrontends == [ "react" ] then
|
||||
"--query-generator ${protocol}/libexec/quixos-protocol/react-query-generator.mjs"
|
||||
else
|
||||
throw "Unsupported query frontend selection: ${builtins.toJSON queryFrontends}";
|
||||
snapshots = pkgs.writeText "qx-nix-source-graph.json" (
|
||||
builtins.toJSON {
|
||||
resources = map (node: {
|
||||
@@ -85,6 +106,7 @@ let
|
||||
if node.kind == "workspace" then
|
||||
''
|
||||
${protocol}/bin/quixos-workspace-compile --root ${node.directory} \
|
||||
${queryGeneratorFlags} \
|
||||
--source-root-commit ${pkgs.lib.escapeShellArg node.commit} \
|
||||
--checkout-root "$TMPDIR/checkouts" --snapshot-map ${snapshots} \
|
||||
--graph-out "$out/graph.json" --schemas-out "$out/package-schemas.json" \
|
||||
@@ -93,6 +115,7 @@ let
|
||||
else
|
||||
''
|
||||
${protocol}/bin/quixos-resource-compile --root ${node.directory} \
|
||||
${queryGeneratorFlags} \
|
||||
--kind ${node.kind} --repository ${pkgs.lib.escapeShellArg node.repository} \
|
||||
--commit ${pkgs.lib.escapeShellArg node.commit} \
|
||||
--checkout-root "$TMPDIR/checkouts" --snapshot-map ${snapshots} --snapshot-only true \
|
||||
|
||||
Reference in New Issue
Block a user