package com.correx.core.tasks

import kotlinx.serialization.Serializable

/**
 * Port for resolving an ARTIFACT link target (an `ArtifactId`) to an inline summary, so the
 * context bundle can carry the producing stage/session and a content excerpt instead of a bare id.
 * Implemented in a higher layer (apps/server reads the event log + CAS); `core:tasks` stays
 * decoupled from storage. Returns null when the artifact can't be resolved — the link then stays a
 * raw related link.
 */
interface TaskArtifactResolver {
    suspend fun resolve(targetId: String): ResolvedArtifact?
}

@Serializable
data class ResolvedArtifact(
    val stage: String?,
    val sessionId: String?,
    val excerpt: String?,
)
