ledger: add wizard-work census 2026-10-27 (extract table + CHECK)

This commit is contained in:
ledger committed 2026-10-27 11:48:27 +00:00
1 parent aa1e87e017
commit 7d436b0dcc
3 files changed
+104 -4

No files matched your search

+56 -4
View File
@@ -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
@@ -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 <dir> -type f | wc -l` (excluding the 3 census files).
- `bytes` per dir: `find <dir> -type f -printf '%s\n' | awk '{s+=$1} END {print s}'`
(excluding the 3 census files).
- Totals: `find wizard-work -type f` excluding the 3 census files = 3795;
size sum = 205544693.
- Check: `./CHECK` independently recomputes the tree (with the same exclusion)
and diffs the TSV.
@@ -0,0 +1,12 @@
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
1 dir,files,bytes
2 beam,334,1624859
3 forge,169,1005323
4 ledger,280,7578722
5 null,305,3584280
6 quill,60,106182
7 sol,142,2916866
8 spark,457,8107790
9 sphinx,1973,179898802
10 volt,74,711574
11 zeph,1,10295
12 TOTAL,3795,205544693