/** * Runtime Patch Evaluation * * Evaluates RuntimeConditionalPatchOp[] to produce concrete Patch[]. */ import type { Patch } from "@manifesto-ai/core"; import type { RuntimeConditionalPatchOp } from "../lowering/lower-runtime-patch.js"; import type { EvaluationContext, EvaluationSnapshot } from "./context.js"; /** * Skip reason for runtime patches. */ export type RuntimePatchSkipReason = "false" | "null" | "non-boolean" | "invalid-path"; /** * Skipped patch info. */ export interface SkippedRuntimePatch { /** * Index in the original ops array. */ index: number; /** * Target path (display form). */ path: string; /** * Reason why patch was skipped. */ reason: RuntimePatchSkipReason; } /** * Result of runtime patch evaluation with trace information. */ export interface RuntimePatchEvaluationResult { /** * Concrete patches that passed conditions. * Order is preserved from input. */ patches: Patch[]; /** * Patches that were skipped due to false/null/non-boolean conditions. */ skipped: SkippedRuntimePatch[]; /** * Non-fatal warnings collected during evaluation. */ warnings: string[]; /** * Final working snapshot after all evaluations. */ finalSnapshot: EvaluationSnapshot; } /** * Evaluate runtime conditional patches to concrete Patch[]. */ export declare function evaluateRuntimePatches(ops: RuntimeConditionalPatchOp[], ctx: EvaluationContext): Patch[]; /** * Evaluate runtime patches with trace information. */ export declare function evaluateRuntimePatchesWithTrace(ops: RuntimeConditionalPatchOp[], ctx: EvaluationContext): RuntimePatchEvaluationResult;