package com.correx.core.tasks

import kotlinx.serialization.Serializable

/**
 * Port for resolving a link target (e.g. "adr-7" or a "docs/…/x.md" path) to an inline document
 * summary, so the context bundle can carry the doc's title + excerpt instead of a bare id the
 * agent has to fetch separately. Implemented in a higher layer (apps/server reads the repo's
 * docs); `core:tasks` stays decoupled from the filesystem. Returns null when the target is not a
 * resolvable document — the link then stays a raw related link.
 */
interface TaskDocumentResolver {
    suspend fun resolve(targetId: String): ResolvedDocument?
}

@Serializable
data class ResolvedDocument(
    val title: String,
    val path: String,
    val excerpt: String,
)
