package com.correx.apps.server.memory

/**
 * Version the serialized repo-map embedding namespace. A descriptor change alters the semantic
 * document, so a new version deliberately ignores stale vectors and causes one re-embed per
 * recorded workspace state. The recorded repo-map event remains backwards compatible.
 */
internal const val REPO_MAP_EMBEDDING_VERSION = "v2"

internal fun repoMapEmbeddingPrefix(repoRoot: String): String =
    "repomap:$REPO_MAP_EMBEDDING_VERSION:$repoRoot:"

internal fun repoMapEmbeddingTag(repoRoot: String, stateKey: String?): String =
    stateKey?.let { repoMapEmbeddingPrefix(repoRoot) + it } ?: repoMapEmbeddingPrefix(repoRoot)
