Reuse verified immutable plans and streamline cooperative hashing
Continue final hosted development reliability qualification.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { executionPlanDigest, hexDigest, type ExecutionPlan, type PlannedQuery } from "./plan.js";
|
||||
import { compileQuery } from "../query/compile.js";
|
||||
import { linkQueries } from "../query/link.js";
|
||||
import { capabilityId } from "../capability-model/types.js";
|
||||
import { portableValueSchema } from "../bindings/portable.js";
|
||||
import { hexDigest, type ExecutionPlan, type PlannedQuery } from "./plan.js";
|
||||
|
||||
import { compileKernelProgram } from "./kernel.js";
|
||||
import { queryProgramEntry } from "./queries.js";
|
||||
import { unsupportedQueryOperator } from "./query-operators.js";
|
||||
@@ -17,7 +18,7 @@ export interface QueryDocument {
|
||||
/** Runtime query documents use the same language, nominal contracts, linking
|
||||
* and interpreter as packaged queries. They introduce no resources or code. */
|
||||
export async function compilePublicQuery(plan: ExecutionPlan, request: QueryDocument) {
|
||||
if (hexDigest(plan.definition) !== plan.digest) throw Error("INVALID_PLAN");
|
||||
if (executionPlanDigest(plan) !== plan.digest) throw Error("INVALID_PLAN");
|
||||
if (
|
||||
typeof request.document !== "string" ||
|
||||
Buffer.byteLength(request.document) > 32768 ||
|
||||
|
||||
Reference in New Issue
Block a user