#!/usr/bin/env python3
"""Verify illustrative feed-match outputs for MDA-MAP-20260823."""

from __future__ import annotations

import csv
import pathlib
import sys


EXPECTED = ["42000", "1100", "38600", "980", "1240", "126", "89.8", "7", "3"]


def main() -> int:
    path = pathlib.Path(__file__).with_name("feed-match-MDA-MAP-20260823.csv")
    with path.open(newline="", encoding="utf-8") as handle:
        rows = list(csv.DictReader(handle))
    values = [row["value"] for row in rows if row["status"] == "published"]
    held = [row for row in rows if row["status"].startswith("held_")]
    if values != EXPECTED or len(held) != 1 or held[0]["value"]:
        print("FAIL: feed-match outputs or held action are incorrect.", file=sys.stderr)
        return 1
    print("OK: nine feed aggregates and one held action verified.")
    return 0


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