Overnight Receipts Verifier (verify-overnight-receipts.sh)
Overnight receipts verifier
scripts/verify-overnight-receipts.sh is the morning-arrival checklist
(handoff E §2.1, HANDOFF-REVENUE-RECOVERY-2026-11-04D.md §1, issue #233
procedure step 1) as an executable gate: every artifact the 03:05 automation
gates on is re-verified independently — trust nothing, read the receipts.
scripts/verify-overnight-receipts.sh # full check, todayscripts/verify-overnight-receipts.sh --skip-slow # file checks onlyscripts/verify-overnight-receipts.sh --remote # + live R2 spot-checkscripts/verify-overnight-receipts.sh --date 20261105 # explicit run datescripts/verify-overnight-receipts.sh --gsc <export> # pin the GSC exportRead-only by construction: no public/ writes, no deploys, no cache
mutations. The two slow checks (serper-cache-census --missing,
audit-metadata) only read the estate.
Checks
| # | Check | Verdict |
|---|---|---|
| 1 | Artifacts present (overnight log, batch-1 TSV+log, daily-build log, last-diff.json) | hard |
| 2 | Overnight log abort scan + tail | warn |
| 3 | 03:00 determinism: total mutations ≤4 (5–20 warn, >20 fail) | hard |
| 4 | Batch-1 TSV: 0 FAIL, no unknown status; OK = 314 (mismatch warns — a pass-2 re-run truncates the TSV; check 7 reconciles) | hard/warn |
| 5 | Building pages for ≥ 314 in the batch-1 log (silent no-op landmine) | hard |
| 6 | last-diff.json: created on run date, mutation_count within the documented composition band (7×TSV-OK + hub/sitemap/agent-status slack — the #198-accepted batch-1 arithmetic, not the old flat 330–2,200 estimate), deletions ≤10, prefixes ⊆ the 7 documented families {estado, casas, casa-casas, jardim, condominios, casa-jardim, casa-condominios} + sitemap-*.xml/root/admin artifacts, gate approved | hard |
| 7 | serper-cache-census --missing ≤ 15 (newest GSC export under site/cache/gsc/inbox/) | hard, slow |
| 8 | audit-metadata exit 0 | hard, slow |
| 9 | Estate freeze off | hard |
| 10 | Tree clean on main (untracked tolerated, like the automation’s Step 0) | hard |
| 11 | A batch-1 record comment dated the run date exists on #198 (any position — later comments such as the #240 code-fix record do not invalidate it) | hard, network |
| 12 | --remote: rclone cat the live Lucélia page — zero rightrep, og: filled, imobiliariasCount > 0 | hard, opt-in |
Exit codes
0— G1 preconditions MET (launchscripts/rebase-state-group.sh G1; its deploy still needs the operator checkpoint)1— NOT MET, with the failing checks listed; diagnose from the artifacts, never re-run a driver blindly2— INCOMPLETE: a hard check was skipped (--skip-slow/--skip-gh); rerun without the skip flags before launching a group
The R2 spot-check path uses state slugs (estado/sao-paulo/lucelia),
not UF codes — the disk and R2 layouts are slug-based.