#!/usr/bin/env python3
"""Verify illustrative three-metric outputs for PAM-SAFE-20260823."""

from __future__ import annotations

import csv
import pathlib
import sys


def main() -> int:
    path = pathlib.Path(__file__).with_name("three-metrics-PAM-SAFE-20260823.csv")
    with path.open(newline="", encoding="utf-8") as handle:
        rows = list(csv.DictReader(handle))
    values = [(row["metric"], row["value"]) for row in rows if row["status"] == "published"]
    expected = [
        ("headcount", "80"), ("headcount", "84"),
        ("voluntary_attrition", "6.1"), ("voluntary_attrition", "8.4"),
        ("contractor_share", "17"), ("contractor_share", "18"),
    ]
    held = [row for row in rows if row["status"].startswith("suppressed_")]
    if values != expected or len(held) != 3 or any(row["value"] for row in held):
        print("FAIL: metrics or held rows do not match the desk log.", file=sys.stderr)
        return 1
    print("OK: six metrics and three blank held rows verified.")
    return 0


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