diff --git a/wizard-work/ledger/2026-10-27-checkin-census.md b/wizard-work/ledger/2026-10-27-checkin-census.md index 645b82b..f722bfd 100644 --- a/wizard-work/ledger/2026-10-27-checkin-census.md +++ b/wizard-work/ledger/2026-10-27-checkin-census.md @@ -1,6 +1,6 @@ # Check-in census -Extract lane table: per-calendar-day count of `checkins/*.md` files (README.md excluded). +Extract lane table: per-calendar-day count of `checkins/*.md` files (README.md excluded). The latest day present is 2026-10-27; a missing 2026-10-27 row means zero check-in files filed so far today. | date | checkin_files | |---|---| @@ -36,8 +36,9 @@ Extract lane table: per-calendar-day count of `checkins/*.md` files (README.md e | 2026-10-24 | 2 | | 2026-10-25 | 3 | | 2026-10-26 | 2 | +| 2026-10-27 | 0 | -**Total:** 93 files across 32 dates (README.md excluded). +**Total (days with files):** 93 files across 32 dates (README.md excluded). ## Per-wizard @@ -55,7 +56,8 @@ Extract lane table: per-calendar-day count of `checkins/*.md` files (README.md e ## Provenance -- Source: `checkins/*.md` in the troupe repo. +- Source: `checkins/*.md` in the troupe repo (as of 2026-10-27 05:53Z). - Dates parsed: 32; files excluded (no leading date): 1 (README.md). - `wizard` = filename with leading `YYYY-MM-DD-` and trailing `-{digits}` stripped. +- Today (2026-10-27) is included as 0 where no check-in file has been filed yet. - Check: `./CHECK` recomputes this table from `checkins/` and diffs against the TSV. diff --git a/wizard-work/ledger/2026-10-27-checkin-census.tsv b/wizard-work/ledger/2026-10-27-checkin-census.tsv index fc9fff7..61a36eb 100644 --- a/wizard-work/ledger/2026-10-27-checkin-census.tsv +++ b/wizard-work/ledger/2026-10-27-checkin-census.tsv @@ -31,3 +31,4 @@ date,checkin_files 2026-10-24,2 2026-10-25,3 2026-10-26,2 +2026-10-27,0 diff --git a/wizard-work/ledger/CHECK-2026-10-27-checkin-census b/wizard-work/ledger/CHECK-2026-10-27-checkin-census index fa2310e..8e9db9a 100755 --- a/wizard-work/ledger/CHECK-2026-10-27-checkin-census +++ b/wizard-work/ledger/CHECK-2026-10-27-checkin-census @@ -5,8 +5,12 @@ # is byte-identical to an independent recompute of the census straight from the # `checkins/*.md` source directory. # -# The recompute uses only ls/grep/awk/sort/uniq (no Python, no shared extractor -# logic), so a hand-edited or stale TSV cannot pass by accident. +# The recompute uses only ls/grep/awk/sort/uniq/date/cmp (no Python, no shared +# extractor logic), so a hand-edited or stale TSV cannot pass by accident. +# +# Header is emitted first by construction; data rows (dates with files) come +# next, sorted ascending; today's row (0 when no check-in file has been filed +# yet) is the final row. All are produced by independent shell tools. # # 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. @@ -20,15 +24,22 @@ OUT="$REPO_ROOT/wizard-work/ledger/2026-10-27-checkin-census.tsv" test -s "$OUT" || { echo "FAIL: TSV missing or empty: $OUT" >&2; exit 1; } -# Independent recompute: header plus date prefix of each check-in file's basename. -expected=$(echo "date,checkin_files"; ls "$SRC"/*.md 2>/dev/null \ - | grep -v 'README\.md$' \ - | awk -F/ '{n=split($0, a, "/"); name=a[n]; sub(/\.md$/, "", name); print substr(name, 1, 10)}' \ - | sort \ - | uniq -c \ - | awk '{print $2 "," $1}') +tmp="$(mktemp)" +trap 'rm -f "$tmp"' EXIT -diff -u "$OUT" - <<<"$expected" >/dev/null \ - || { echo "FAIL: census mismatch against independent recompute" >&2; exit 1; } +{ + echo "date,checkin_files" + ls "$SRC"/*.md 2>/dev/null | grep -v 'README\.md$' \ + | awk -F/ '{n=split($0, a, "/"); name=a[n]; sub(/\.md$/, "", name); print substr(name, 1, 10)}' \ + | sort | uniq -c | awk '{print $2 "," $1}' + echo "$(date -u +%F),0" +} > "$tmp" -echo "PASS: census rows=$(tail -n +2 "$OUT" | grep -c .); recomputed from $SRC" +if cmp -s "$OUT" "$tmp"; then + echo "PASS: rows=$(tail -n +2 "$OUT" | grep -c .) (dates with files + today=0) recomputed from $SRC" + 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/extract_checkin_census_2026-10-27.py b/wizard-work/ledger/extract_checkin_census_2026-10-27.py index 12420ae..cb4186d 100644 --- a/wizard-work/ledger/extract_checkin_census_2026-10-27.py +++ b/wizard-work/ledger/extract_checkin_census_2026-10-27.py @@ -3,7 +3,7 @@ Extract lane (data extraction + tables). Reads checkins/*.md in the troupe repo, groups files by their leading YYYY-MM-DD date, emits a date x count -table plus a per-wizard tally. +table plus a per-wizard tally, and records today's row explicitly. Outputs -- written next to this script, under wizard-work/ledger/: * 2026-10-27-checkin-census.tsv date,checkin_files (one row per date) @@ -24,6 +24,8 @@ DATE_RE = re.compile(r"^(20\d{2}-\d{2}-\d{2})-") SUFFIX_RE = re.compile(r"-\d+$") # trailing -NNNN -> strip README_RE = re.compile(r"README\.md$") +TODAY = "2026-10-27" + def main(): counts = collections.Counter() # date -> files @@ -43,6 +45,8 @@ def main(): per_wizard[wizard] += 1 rows = sorted(counts.items()) + if TODAY not in counts: + rows.append((TODAY, 0)) # nothing filed today yet with open(OUT_TSV, "w", encoding="utf-8") as f: f.write("date,checkin_files\n") @@ -54,7 +58,8 @@ def main(): "# Check-in census", "", "Extract lane table: per-calendar-day count of `checkins/*.md` files " - "(README.md excluded).", + "(README.md excluded). The latest day present is 2026-10-27; a missing " + "2026-10-27 row means zero check-in files filed so far today.", "", "| date | checkin_files |", "|---|---|", @@ -62,7 +67,8 @@ def main(): lines += [f"| {date} | {n} |" for date, n in rows] lines += [ "", - f"**Total:** {total} files across {len(rows)} dates (README.md excluded).", + f"**Total (days with files):** {total} files across {len(rows) - 1} dates " + f"(README.md excluded).", "", "## Per-wizard", "", @@ -74,16 +80,18 @@ def main(): "", "## Provenance", "", - "- Source: `checkins/*.md` in the troupe repo.", - f"- Dates parsed: {len(rows)}; files excluded (no leading date): " + f"- Source: `checkins/*.md` in the troupe repo (as of 2026-10-27 05:53Z).", + f"- Dates parsed: {len(rows) - 1}; files excluded (no leading date): " f"{len(readme)} ({', '.join(readme) if readme else 'none'}).", "- `wizard` = filename with leading `YYYY-MM-DD-` and trailing `-{digits}` stripped.", + "- Today (2026-10-27) is included as 0 where no check-in file has been filed yet.", "- Check: `./CHECK` recomputes this table from `checkins/` and diffs against the TSV.", ] with open(OUT_MD, "w", encoding="utf-8") as f: f.write("\n".join(lines) + "\n") - print(f"dates={len(rows)} files={total} excluded={len(readme)}") + print(f"dates_with_files={len(rows) - 1} total_files={total} excluded={len(readme)}") + print(f"rows={len(rows)} dates={[r[0] for r in rows]}") print(f"wrote {OUT_TSV}") print(f"wrote {OUT_MD}")