#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12,<3.14"
# dependencies = ["pydantic>=2"]
# ///

"""Verify Todo11 evidence hashes and cross-artifact invariants."""

from __future__ import annotations

import argparse
import sys
from pathlib import Path

REPOSITORY = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(REPOSITORY))

from scripts.nutricoach_v140_artifacts import verify_artifacts


def main() -> int:
    parser = argparse.ArgumentParser()
    _ = parser.add_argument("--evidence-dir", type=Path, required=True)
    argv = sys.argv[1:]
    if argv == ["--help"]:
        parser.print_help()
        return 0
    if len(argv) != 2 or argv[0] != "--evidence-dir":
        parser.error("--evidence-dir is required")
    reason = verify_artifacts(Path(argv[1]))
    if reason is not None:
        print(reason)
        return 1
    print("TASK11_ARTIFACTS_PASS")
    return 0


if __name__ == "__main__":
    raise SystemExit(main())