package com.correx.core.kernel.orchestration

/**
 * Seam for compiling a freestyle execution_plan as a post-stage gate. Like [ContractAssertionEvaluator]
 * and [StaticAnalysisRunner], the real implementation (which wraps the infrastructure
 * ExecutionPlanCompiler) is injected, so the deterministic core never depends on infrastructure and
 * the gate stays unit-testable with a fake.
 *
 * [check] returns null when the plan compiles, or a bounded compiler-error string when it does not.
 * The orchestrator records the verdict in a
 * [com.correx.core.events.events.PlanCompileCheckedEvent] (invariant #9), and on failure fails the
 * architect stage retryably so the existing retry-feedback loop hands the error back and the model
 * self-corrects — replacing the post-planning compile failure that parked the session in ACTIVE.
 */
fun interface PlanCompilationCheck {
    fun check(planJson: String, candidateId: String): String?
}
