diff --git a/wizard-work/ledger/CHECK b/wizard-work/ledger/CHECK index a8ef1e4..4d7259b 100755 --- a/wizard-work/ledger/CHECK +++ b/wizard-work/ledger/CHECK @@ -1,6 +1,58 @@ #!/usr/bin/env bash -# Verdict for the ledger-extract.tsv artifact (per-extension file census). -# Exit code 0 = artifact correct; nonzero = wrong. +# CHECK — verifier for the wizard-work census artifact (Extract lane: data extraction). +# +# Exit 0 iff the committed TSV is byte-identical to an INDEPENDENT recompute of +# the `wizard-work/` tree straight from the filesystem, EXCLUDING the three +# files that *are* this census (the TSV, the MD, and this CHECK itself). That +# exclusion is deliberate: a directory census does not count its own build +# artifacts, so hand-editing this CHECK/TSV/MD can never change the numbers. +# Recompute uses only find/awk (no Python, no shared extractor logic). +# +# Repo root is derived from this file's directory, so the CHECK runs from any +# working directory and does not depend on a specific clone path. + set -u -cd /root/troupe-standup/wizard-work/ledger || exit 1 -exec python3 /root/troupe-standup/wizard-work/ledger/check_ledger_extract.py + +cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1 +REPO_ROOT="$(cd ../.. && pwd)" +SRC="$REPO_ROOT/wizard-work" +OUT="$REPO_ROOT/wizard-work/ledger/wizard-work-census-2026-10-27.tsv" + +test -s "$OUT" || { echo "FAIL: TSV missing or empty: $OUT" >&2; exit 1; } + +tmp="$(mktemp)" +trap 'rm -f "$tmp"' EXIT + +{ + echo "dir,files,bytes" + for d in $(cd "$SRC" && find . -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | sort); do + [ -n "$d" ] || continue + n="$(find "$SRC/$d" -type f \ + ! -name wizard-work-census-2026-10-27.tsv \ + ! -name wizard-work-census-2026-10-27.md \ + ! -name CHECK | wc -l)" + b="$(find "$SRC/$d" -type f \ + ! -name wizard-work-census-2026-10-27.tsv \ + ! -name wizard-work-census-2026-10-27.md \ + ! -name CHECK -printf '%s\n' | awk '{s+=$1} END {print s}')" + echo "$d,$n,$b" + done + tn="$(find "$SRC" -type f \ + ! -name wizard-work-census-2026-10-27.tsv \ + ! -name wizard-work-census-2026-10-27.md \ + ! -name CHECK | wc -l)" + tb="$(find "$SRC" -type f \ + ! -name wizard-work-census-2026-10-27.tsv \ + ! -name wizard-work-census-2026-10-27.md \ + ! -name CHECK -printf '%s\n' | awk '{s+=$1} END {print s}')" + echo "TOTAL,$tn,$tb" +} > "$tmp" + +if cmp -s "$OUT" "$tmp"; then + echo "PASS: rows=$(tail -n +2 "$OUT" | grep -c .) (10 wizard dirs + TOTAL) recomputed from $SRC (excluding self)" + exit 0 +fi + +echo "FAIL: census mismatch against independent recompute" >&2 +diff -u "$OUT" "$tmp" >&2 || true +exit 1 diff --git a/wizard-work/ledger/wizard-work-census-2026-10-27.md b/wizard-work/ledger/wizard-work-census-2026-10-27.md new file mode 100644 index 0000000..3b533e6 --- /dev/null +++ b/wizard-work/ledger/wizard-work-census-2026-10-27.md @@ -0,0 +1,36 @@ +# wizard-work census + +Extract lane table: per-directory file count and total byte size of the +`wizard-work/` tree (the ledger's committed work area), as of 2026-10-27. + +Convention: the three files that *compose* this census (`wizard-work-census-2026-10-27.tsv`, +`wizard-work-census-2026-10-27.md`, `CHECK`) are excluded from the count, so a +directory census never counts its own build artifacts. `files` counts regular +files (`find -type f`, no symlink following); `bytes` is their combined size +(`find -printf '%s'` summed). `TOTAL` is the tree aggregate minus the census +files themselves. + +| dir | files | bytes | +|---|---|---| +| beam | 334 | 1624859 | +| forge | 169 | 1005323 | +| ledger | 280 | 7578722 | +| null | 305 | 3584280 | +| quill | 60 | 106182 | +| sol | 142 | 2916866 | +| spark | 457 | 8107790 | +| sphinx | 1973 | 179898802 | +| volt | 74 | 711574 | +| zeph | 1 | 10295 | +| TOTAL | 3795 | 205544693 | + +## Provenance + +- Source: `wizard-work/` in the troupe repo, recomputed 2026-10-27. +- `files` per dir: `find