State Re-base Groups (rebase-state-group.sh)
State re-base groups
scripts/rebase-state-group.sh drives recovery batches 2–5 from
RECOVERY-PURGED-CITIES-2026-11-04.md (tracking: issue #233): the 20 states
not yet re-based, one group at a time, so canonical generator output replaces
in-place-repaired HTML — and the stored RightRep banner is stripped as a side
effect (HANDOFF-REVENUE-RECOVERY-2026-11-04B.md §2).
scripts/rebase-state-group.sh G1 # MGscripts/rebase-state-group.sh G2 # CE BA PE GO RJscripts/rebase-state-group.sh G3 # MT MS ES PB PI RN MAscripts/rebase-state-group.sh G4 # TO SE AL AM AP RR DFscripts/rebase-state-group.sh --states "MG SP" # custom set (cache-only too)DRY_RUN=1 scripts/rebase-state-group.sh G1 # print the commands only| Group | States | estado pages | est. mutations |
|---|---|---|---|
| G1 | MG | 1,840 | ~12.9k |
| G2 | CE BA PE GO RJ | 2,689 | ~18.8k |
| G3 | MT MS ES PB PI RN MA | 1,666 | ~11.7k |
| G4 | TO SE AL AM AP RR DF | 532 | ~3.7k |
Cache-only by construction
SERPER_API_KEY is unset for every regen (after sourcing .env for
DEEPSEEK_API_KEY). Batch 1 (refetch-missing-cities.sh) already
keyed-refetched the 314 purged earning cities; a keyed group run would also
refetch zero-result cities — the October quota-bomb bug class. Cities with no
usable cache gain DeepSeek fallback content; without a DeepSeek key they stay
no-data and the script warns.
What it checks per state
- Silent no-op detection: each state’s log section must contain
Building pages forand must not containError fetching cities for— otherwise the run “completed” having built nothing (IBGE fetch failure) and the state is markedNOOP. - Results land in
logs/regen-<group>-<date>-results.tsv(OK/NOOP/FAILper state) with the full log atlogs/regen-<group>-<date>.log. Any NOOP or FAIL fails the run — diagnose, never re-run blind. - Custom sets warn when a state was already re-based on 4 Nov (AC PA PR RO RS SC SP): regenerating those moves lastmods with no genuine change.
Deploy is deliberately not part of the script
Every group deploy needs the operator checkpoint (issue #233 procedure):
dated batch record on #198 first → public/ snapshot → explicit
go-ahead → smart-deploy --approve-large-deploy <#198 URL> --yes (nohup +
poll) → post-gates (audit-metadata, build-freshness --remote, rclone
rightrep spot-check, next 03:00 build back to ~0 mutations).