#!/usr/bin/env python3
"""Verify illustrative weekly outputs for HRA-MONDAY-20260823."""

from __future__ import annotations

import csv
import pathlib
import sys


def main() -> int:
    path = pathlib.Path(__file__).with_name("weekly-pack-HRA-MONDAY-20260823.csv")
    with path.open(newline="", encoding="utf-8") as handle:
        rows = list(csv.DictReader(handle))
    values = [row["headcount"] for row in rows if row["status"] == "published"]
    held = [row for row in rows if row["status"] == "suppressed_n_under_5"]
    if values != ["79", "84", "41", "41"] or len(held) != 2:
        print("FAIL: weekly values or held-row count is incorrect.", file=sys.stderr)
        return 1
    if any(row["headcount"] for row in held):
        print("FAIL: a held row exposes headcount.", file=sys.stderr)
        return 1
    print("OK: four weekly values and two blank held rows verified.")
    return 0


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