"""Lock test for the chunk schema version constant.

Bumping `CHUNK_SCHEMA_VERSION` must be an intentional, reviewed act — this test
fails on any change so the bump shows up in the diff alongside consumer updates.
"""

import re
import sys
from pathlib import Path

REPO_ROOT = Path(__file__).resolve().parents[2]
sys.path.insert(0, str(REPO_ROOT / "airflow" / "dags"))

from tasks.chunk_schema import CHUNK_SCHEMA_VERSION  # noqa: E402


def test_chunk_schema_version_is_frozen():
    # Bumped to 1.1 in TEXTIQ-569 — additive `verified_tag_names` Milvus column.
    assert CHUNK_SCHEMA_VERSION == "1.1"


def test_chunk_schema_version_format():
    assert re.fullmatch(r"\d+\.\d+", CHUNK_SCHEMA_VERSION), (
        f"CHUNK_SCHEMA_VERSION must be <major>.<minor>, got {CHUNK_SCHEMA_VERSION!r}"
    )
