#!/usr/bin/env python3
"""Verify illustrative strip summary for HRIS-STRIP-20260823."""

from __future__ import annotations

import csv
import pathlib
import sys


def main() -> int:
    path = pathlib.Path(__file__).with_name("strip-summary-HRIS-STRIP-20260823.csv")
    with path.open(newline="", encoding="utf-8") as handle:
        rows = list(csv.DictReader(handle))
    observed = {(row["check"], row["item"]): (row["prior_value"], row["current_value"]) for row in rows}
    held = [row for row in rows if row["status"].startswith("suppressed_")]
    expected = {
        ("columns", "workbook_columns"): ("18", "8"),
        ("tabs", "lookup_tabs"): ("2", "0"),
        ("headcount", "EMEA_Staff"): ("79", "84"),
    }
    if any(observed.get(key) != value for key, value in expected.items()):
        print("FAIL: strip or headcount summary is incorrect.", file=sys.stderr)
        return 1
    if len(held) != 3 or any(row["prior_value"] or row["current_value"] for row in held):
        print("FAIL: held rows are not blank.", file=sys.stderr)
        return 1
    print("OK: 18-to-8 strip, two deleted tabs, 79/84 headcount, and three holds verified.")
    return 0


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