#!/usr/bin/env python3
"""Verify published aggregate rows for desk log ADR-DAA-20260825.

This script checks the first-party CSV only. It does not reconstruct the
screenshot versus downloaded-pack run, and it is not a third-party
reproduction.
"""

from __future__ import annotations

import csv
import pathlib
import sys

EXPECTED = [
    {
        "retrieval_state": "screenshot_forwarded",
        "exclusion_in_handoff": "0",
        "csv_matches_memo": "0",
        "files_on_disk": "0",
    },
    {
        "retrieval_state": "downloaded_pack",
        "exclusion_in_handoff": "1",
        "csv_matches_memo": "1",
        "files_on_disk": "1",
    },
]


def main() -> int:
    csv_path = pathlib.Path(__file__).with_name(
        "aggregate-ADR-DAA-20260825.csv"
    )
    with csv_path.open(newline="", encoding="utf-8") as handle:
        rows = list(csv.DictReader(handle))
    if rows != EXPECTED:
        print("FAIL: published aggregate rows do not match the desk log.", file=sys.stderr)
        return 1
    print("OK: published aggregate rows match desk log ADR-DAA-20260825.")
    return 0


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