package com.correx.core.kernel.orchestration

import com.correx.core.toolintent.WorkspacePolicy
import com.correx.core.tools.contract.ToolExecutor
import com.correx.core.tools.registry.ToolRegistry
import com.correx.core.transitions.execution.StageExecutionResult

/** Per-run effective tool wiring (workspace-scoped registry/executor/policy or the orchestrator defaults). */
internal data class RunEffectives(
    val registry: ToolRegistry?,
    val executor: ToolExecutor?,
    val policy: WorkspacePolicy?,
)

/** Result of the artifact extraction/repair ladder: usable text, or a hard stage failure. */
internal sealed interface ArtifactLadderOutcome {
    data class Text(val text: String) : ArtifactLadderOutcome
    data class Reject(val failure: StageExecutionResult.Failure) : ArtifactLadderOutcome
}

/** A tool result rendered for the model, with the CAS hash of the full (pre-truncation) output if spilled. */
internal data class RenderedToolResult(val content: String, val fullOutputHash: String?)
