package com.correx.core.inference

import kotlinx.serialization.Serializable
import kotlin.time.Duration

sealed class CancellationReason {
    object UserRequested : CancellationReason()
    object StageTimeout : CancellationReason()
    object SessionCancelled : CancellationReason()
    object ProviderEvicted : CancellationReason()
}

/**
 * Records a deadline that has fired. Used by the harness to carry timeout context when
 * cancelling an [InferenceCancellationToken] with [CancellationReason.StageTimeout].
 * Produced by the harness only — providers must not construct this.
 */
@JvmInline
@Serializable
value class InferenceTimeout(val duration: Duration)
