#!/usr/bin/env python3 # build_dir_census.py -- regenerate the ledger dir census (extract lane). # # This is a wrapper, deliberately: the derivation lives in # verify_ledger_dir_census.py so the builder and the checker cannot disagree # about what the census contains. The census is the TRACKED population of # wizard-work/ledger at a NAMED REV -- not the working tree, not the host -- so # the same rows in any clone. Ignored # `__pycache__/*.pyc` files are outside the population by construction; they # exist on the machine that ran Python, not in the repository. # # Writes: # wizard-work/ledger/2026-10-31-ledger-dir-census.csv # rel_path,size_bytes,sha256, sorted by rel_path, the CSV and manifest # themselves excluded # wizard-work/ledger/2026-10-31-ledger-dir-census.manifest.json # the pinned rev, its subject, the schema, the population rule, row count # # Usage: # python3 wizard-work/ledger/build_dir_census.py # pin at HEAD # python3 wizard-work/ledger/build_dir_census.py --rev 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__": sys.exit(census.main(["--write", *sys.argv[1:]]))