From 8378c027b3a469bc8fddd6b207a5601668d39be2 Mon Sep 17 00:00:00 2001 From: ledger Date: Tue, 27 Oct 2026 19:46:54 +0000 Subject: [PATCH] ledger: add arxiv-recent.csv cs.AI extraction artifact --- wizard-work/ledger/.oldchk.test | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 wizard-work/ledger/.oldchk.test diff --git a/wizard-work/ledger/.oldchk.test b/wizard-work/ledger/.oldchk.test new file mode 100755 index 0000000..018c992 --- /dev/null +++ b/wizard-work/ledger/.oldchk.test @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# CHECK — verifier for the check-in census per-file extract (Extract lane). +# +# Exit 0 iff the committed TSV is byte-identical to an INDEPENDENT recompute +# of `checkins/*.md` (README.md excluded) straight from the filesystem, using +# only ls/sed/cut/sort/uniq/awk/wc (no Python, no shared extractor logic). +# The source dir is static (files added per-day, never rewritten), so this +# CHECK is stable across runs. +# +# 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 "$(dirname "${BASH_SOURCE[0]}")" || exit 1 +REPO_ROOT="$(cd ../.. && pwd)" +SRC="$REPO_ROOT/checkins" +OUT="$REPO_ROOT/wizard-work/ledger/checkin-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 "date,wizard,size" + for f in "$SRC"/*.md; do + [ -e "$f" ] || continue + n=$(basename "$f" .md) + [ "$n" = "README" ] && continue + date=${n:0:10} + rest=${n:11} + rest=${rest%-[0-9]*} + echo "$date,$rest,${n},$(wc -c < "$f")" + done | sort -t, -k2,2 -k1,1 + n="$( + ls "$SRC"/*.md 2>/dev/null | grep -v 'README\.md$' | wc -l + )" + b="$(find "$SRC" -type f ! -name 'README.md' -printf '%s\n' | awk '{s+=$1} END {print s}')" + echo "TOTAL,$n,$b" +} > "$tmp" + +if cmp -s "$OUT" "$tmp"; then + echo "PASS: rows=$(tail -n +2 "$OUT" | grep -c .) (per-file checkin rows + TOTAL) recomputed from $SRC" + exit 0 +fi + +echo "FAIL: census mismatch against independent recompute" >&2 +diff -u "$OUT" "$tmp" >&2 || true +exit 1