from __future__ import annotations

import json
from pathlib import Path


def main() -> int:
    path = Path("Temp/shadow_ledger_v1.json")
    if not path.exists():
        print("FAIL")
        return 1
    data = json.loads(path.read_text(encoding="utf-8"))
    rows = data.get("rows", [])
    if not rows:
        print("FAIL")
        return 1
    print("SHADOW_LEDGER_OK")
    print(f"row_count={len(rows)}")
    return 0


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

