#!/usr/bin/env bash
# CHECK -- ledger commit census (2026-10-28) extraction verification gate.
#
# Re-derives the committed census from git at the pinned head (committed
# commits_by_author.json 'head' field), re-renders csv/json/md with the same
# functions the extraction uses, and diffs each against the committed file.
# Exits 0 only when every file matches byte-identically.
set -u

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$DIR" || exit 1
exec python3 "$DIR/verify_commits_by_author.py" "$DIR"
