Scripts & Automation
Dev Environment
scripts/dev.js
Starts the unified dev environment (static site + 4 Workers + proxy):
# Start all servicesnode scripts/dev.js
# With a fresh site buildnode scripts/dev.js --buildscripts/dev-stop.js
Stops all services started by dev.js.
node scripts/dev-stop.jsDaily Build
scripts/daily-build.sh
Publish-only by default (no page regeneration):
generate-sitemap(full disk traversal; writes changed shards only)validate-schema.pyreconcile-assets(scoped; refuses >500 uploads and honours the freeze)- sitemap-first smart deploy (500-file gate)
- gated content deploy (journaled and resumable)
- provenance + success marker
./scripts/daily-build.sh # publish-onlyFULL_BUILD=1 FORCE_BUILD=1 ./scripts/daily-build.sh # regenerate pagesFULL_BUILD=1 DAILY_REFRESH=1 FORCE_BUILD=1 ./scripts/daily-build.shFORCE_BUILD=1 only bypasses the same-day marker; it no longer implies a full
build. A malformed site/cache/deploy/FREEZE.json is treated as frozen.
scripts/estate-freeze.sh
Freeze or lift automated estate activity and snapshot the deploy baseline:
./scripts/estate-freeze.sh on --reason "P0 revenue incident" --issue https://github.com/mauricionr/brasil/issues/199./scripts/estate-freeze.sh status --check./scripts/estate-freeze.sh off --approval https://github.com/mauricionr/brasil/issues/199#issuecomment-...off re-enables only the daily build and freshness timers; the four content
agents stay disabled.
Systemd Schedule
Units live in scripts/systemd-units/. Install them with:
cp scripts/systemd-units/redecasas-daily-build.{service,timer} ~/.config/systemd/user/cp scripts/systemd-units/redecasas-build-freshness.{service,timer} ~/.config/systemd/user/cp scripts/systemd-units/redecasas-gsc-watch.{service,timer} ~/.config/systemd/user/systemctl --user daemon-reloadsystemctl --user enable --now redecasas-daily-build.timer redecasas-build-freshness.timer redecasas-gsc-watch.timerThe daily build runs at 03:00 with a 24h timeout. A 12:00 freshness check
alerts when the build or sitemap is stale. See the Daily Build page for the
resume and FORCE_REBUILD semantics.
The 13:00 recovery watch runs the daily GSC/AdSense read against operator-dropped exports; unlike the build timers it keeps running through an estate freeze. See the Recovery Watch page for the drop-folder contract and the paging policy.
Recovery
scripts/refetch-missing-cities.sh
Recovery batch 1: one keyed per-city regen per city in the purged-census list
(RECOVERY-PURGED-CITIES-2026-11-04.md). Deploy is not part of the script.
scripts/rebase-state-group.sh
Recovery batches 2–5: cache-only per-state regens for the remaining 20 states (G1–G4), with silent no-op detection and the checkpointed deploy procedure. See the State Re-base Groups page.
scripts/verify-overnight-receipts.sh
Morning gate after the automated batch-1 run: machine-verifies every receipt (overnight log, results TSV, determinism gate, last-diff bands, census, audit-metadata, freeze, tree, #198 record) and prints the G1 go/no-go. See the Overnight Receipts Verifier page.
Database
scripts/init-chat-db.sh
Applies D1 migrations for local chat worker development.
scripts/provision-chat.sh
Provisions the chat worker database.
Build & Deploy
scripts/build-chat-indices.js
Builds search indices for the chat worker.
scripts/deploy-all.sh
Deploys all workers with type-checking, D1 migrations, schema verification, and secret upload.
scripts/deploy-auth.sh
Deploys the auth worker specifically.
scripts/deploy-billing.sh
Deploys the billing worker specifically.
scripts/deploy-listings.sh
Deploys the listings worker specifically.
Note: There is no
deploy-chat.shscript. Deploy the chat worker individually withcd chat-worker && npm run deploy, or usedeploy-all.shfor a full deployment.