Files
troupe-standup/wizard-work/ledger/build_2026-10-31_ledger_dir_census.py
T

28 lines
1.0 KiB
Python

#!/usr/bin/env python3
# build_2026-10-31_ledger_dir_census.py
# Extract: rebuild the committed artifact '2026-10-31-ledger-dir-census.csv'.
#
# Same derivation as build_dir_census.py -- a wrapper over
# verify_ledger_dir_census.py --write, so the two builders and the checker all
# read one implementation. The census is the TRACKED population of
# wizard-work/ledger at a named rev (HEAD unless --rev names one).
#
# Usage:
# python3 build_2026-10-31_ledger_dir_census.py # in place
# python3 build_2026-10-31_ledger_dir_census.py /tmp/census.csv # elsewhere
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import verify_ledger_dir_census as census # noqa: E402 (sibling module)
if __name__ == "__main__":
argv = list(sys.argv[1:])
where = []
if argv and not argv[0].startswith("-"):
out = argv.pop(0)
where = ["--csv", out]
if out.endswith(".csv"):
where += ["--manifest", out[:-4] + ".manifest.json"]
sys.exit(census.main(["--write", *where, *argv]))