#!/usr/bin/env bash
# CHECK -- ledger commit census 2026-11-01..03 (extract lane). Exit 0 iff both
# committed TSV tables match a fresh re-derivation from the live git tree.

git -C /root/troupe-standup log --since=2026-11-01 --until=2026-11-04 --format='%ad' --date=short | sort | uniq -c > "$TMPDIR/census-day.check.tsv" && git -C /root/troupe-standup log --since=2026-11-01 --until=2026-11-04 --format='%an' | sort | uniq -c | sort -rn > "$TMPDIR/census-author.check.tsv" && diff "$TMPDIR/census-day.check.tsv" /root/troupe-standup/wizard-work/ledger/commits-by-day.tsv && diff "$TMPDIR/census-author.check.tsv" /root/troupe-standup/wizard-work/ledger/commits-by-author.tsv
