Reuse verified immutable plans and streamline cooperative hashing
Continue final hosted development reliability qualification.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { ExecutionPlanError, hexDigest, type ExecutionPlan, type PlannedQuery } from "./plan.js";
|
||||
import { executionPlanDigest, ExecutionPlanError, type ExecutionPlan, type PlannedQuery } from "./plan.js";
|
||||
|
||||
/** Contracts promised by a direct result. Interface dependencies are explicit; accidental
|
||||
* overlap among today's implementations does not silently widen an exported interface contract. */
|
||||
export function resultInterfaces(plan: ExecutionPlan, operationKey: string): string[] {
|
||||
@@ -23,7 +24,7 @@ export function resultInterfaces(plan: ExecutionPlan, operationKey: string): str
|
||||
}
|
||||
/** Compile-time observeResult compatibility. Observation does not grant read or mutation authority. */
|
||||
export function checkResultProjection(plan: ExecutionPlan, operationKey: string, queryId: string): PlannedQuery {
|
||||
if (hexDigest(plan.definition) !== plan.digest)
|
||||
if (executionPlanDigest(plan) !== plan.digest)
|
||||
throw new ExecutionPlanError("INVALID_PLAN", "projection", "Plan digest mismatch");
|
||||
const query = plan.definition.queries.find((q) => q.id === queryId);
|
||||
if (!query) throw new ExecutionPlanError("UNKNOWN_PROJECTION", queryId, "No installed query");
|
||||
|
||||
Reference in New Issue
Block a user