"""Single source of truth for the agent version. Every script, ``app.py``, the manifest generator and the tests read the version from the ``VERSION`` file at the package root instead of hard-coding it. v14 audit finding F-02 (incoherent version identity) recurred in v15 because the value was copied by hand into several files; centralising it here removes the class of error rather than detecting it after the fact. """ from __future__ import annotations from pathlib import Path ROOT = Path(__file__).resolve().parent.parent VERSION_FILE = ROOT / "VERSION" def read_version() -> str: """Return the agent version declared in ``VERSION`` (e.g. ``16.0.0``).""" return VERSION_FILE.read_text(encoding="utf-8").strip() def major_label() -> str: """Return the short label used in banners, e.g. ``v16``.""" return "v" + read_version().split(".")[0] AGENT_VERSION = read_version()