Skip to Content
JobWzrd Docs

Operations

Running, deploying, and telling the truth about what is live. Every command below exists in the repo; nothing is aspirational.


1. What is deployed right now

FactValue
Domainjobwzrd.com (apex), www. 301 → apex, api., admin. → /logs, status.
EdgeCloudflare, one Worker jobwzrd-backend, version 1ff93624-abee-4818-8a53-9114d8df5639
D1jobwzrd — 28 ledger rows, 63 tables, ~1.2 MB
R2bucket jobwzrd (blobs, résumés)
KVCATALOGUE (0928033e83734b8f9f27ed763d399f04) — read cache only
Queuesjobwzrd-scrape-minizrd, jobwzrd-scrape-jobindie (+ DLQs)
Cron*/15 * * * * — reclaim, poll replies, retention
Secrets (names only)BETTER_AUTH_SECRET, BLOB_SIGNING_KEY, QUEUE_HMAC_KEY

Not live: scrapers (mz-api :8120, ji-api :8121 stopped), Gmail sending (no linked account in production), auth mail (capabilities all false), AI rank (degraded: no_key), consent UI.

2. Environment and secrets

  • backend/.dev.vars — local Worker. wrangler auto-loads the directory, so a zone-scoped token must never be placed in it.
  • backend/.env.local, app/.env.local — local app config; git-ignored.
  • Production secrets: npx wrangler secret put <NAME> --env production.
  • No secret is ever committed, echoed, or written into a report. Names only.
  • Service credentials are per surface (scrape, apply, ai, email_sync, export); a missing one fails closed, there is no shared fallback token.

2.1 Mail

StatePredicateWhat the UI shows
ResendRESEND_API_KEY and RESEND_FROMreset + verify forms
Self-hosted bridgeEMAIL_TRANSPORT_URLthe same forms
Nothingneitherno reset form at all

One predicate (mailConfigured()) decides GET /api/v1/config.capabilities, so the UI can never offer a flow nothing can perform. A provider refusal throws (auth.resend_refused, address masked, URL-scrubbed) — "check your email" is never answered for a message the provider rejected. Runbook: backend/docs/runbooks/email.md.

3. Local stack

cd backend
node scripts/db-migrate.mjs          # apply the ledger
node scripts/mail-bridge.mjs         # :8799 — captures reset/verify mail to .local-mail.jsonl
npx wrangler dev --local --persist-to .wrangler/state --test-scheduled --port 8795
cd app && npm run dev                # :2992, proxying /api/v1 and /api/auth to :8795

./dev.sh is the definition of "live locally": checks, .dev.vars, migrations, Worker :8795, app :2992, and one honest line about which half is connected. node backend/scripts/stop-local.mjs stops it.

4. Deploy

cd app && npm run pages:build          # static export → app/out  (requires an API base)
cd ../backend && node scripts/sync-web.mjs   # copies out/ + recomputes CSP hashes
npx wrangler deploy --env production
node scripts/smoke.mjs                 # 5 checks against the public hostname
node scripts/shoot-live.mjs            # screenshots + live-report.json

Order matters: skipping sync-web.mjs ships a bundle whose inline scripts the CSP blocks — a failure visible only in production. smoke.mjs --ip <addr> pins DNS when the local resolver lies (use DoH to get the real address first).

5. Verification commands (the only ones that count)

AreaCommand
Appcd app && npm run check && npm test && npm run build
Backendcd backend && npx tsc --noEmit -p tsconfig.json && npx vitest run
Contractnode backend/scripts/contract-status.mjs → 58/58
Acceptancenode backend/scripts/b1..b10-acceptance.mjs, gap-acceptance.mjs
Pythonpython3 apply/test_apply.py && python3 server/worker/test_scrape.py (repo root)
Go scrapercd scrapers/MiniWzrd && GOTOOLCHAIN=auto go test ./...
Rust scrapercd scrapers/jobindie && cargo test
Livenode backend/scripts/smoke.mjs

A claim of "green" without one of these having run in this session is a lie.

6. Operator runbooks

NeedTool
Add/repair a migrationnode scripts/db-migrate.mjs (ledger, never textual re-run)
Delete a usernode scripts/delete-user.mjs --email … [--confirm] [--remote] — dry run default
Replay a dead letternode scripts/dlq-replay.mjs
Board config (per source)node scripts/board-config.mjs
Auth schema changesnode scripts/auth-schema.mjs
Client budget reset (local)node scripts/db-reset.mjs
Mail problemsbackend/docs/runbooks/email.md
DNS / cutoverbackend/docs/runbooks/dns.md, docs/runbooks/CLOUDFLARE-FROM-SCRATCH.md
Ops semanticsserver/docs/runbooks/operations.md (module paths are API paths)

7. Logs, metrics, incidents

  • Logs live in ops_log_events (D1) and are read at /logs (operator-only view, same Worker). Client logging posts to /api/v1/logs/ingest on the live Worker — pointing it at a retired deployment was a real bug, fixed 2026-11-25.
  • Every line carries side_effect: none|possible|confirmed. Logging never fails the operation it describes.
  • Actor ids are pseudonymous and linkable (salted hash + row).
  • Dead letters: ops_dead_letters + ops_dlq_incidents; replay is manual and audited.

8. Known blockers (operator action, not code)

BlockerFix
No auth mail in productionset RESEND_API_KEY + RESEND_FROM (or EMAIL_TRANSPORT_URL), redeploy, confirm capabilities flip
Scrapers not runningstart mz-api/ji-api containers; B4–B7 acceptance is blocked on them
Proxy gateway passes traffic directupstream Webshare credentials pending; GATEWAY_DIRECT=1 is the temporary opt-out
No AI key in productionset the provider env; rank degrades to keyword until then
Remote jobwzrd tunnel + ai.clxtch.qzz.io recorddelete from the Cloudflare dashboard (CLI auth is stale)
CI still publishes to the retired Pages projectcut .github/workflows/pages.yml to the single-deploy path

9. Cost and capacity guardrails

  • D1: thresholds are percentages of D1_LIMIT_BYTES, never a routine COUNT(*).
  • R2: résumés are never swept (D-GAP-1) — accepted cost, unmeasured.
  • Queues: one message per (search_id, source_id), max_batch_size = 1, so a bad run cannot amplify into a stampede.
  • AI: budget reserved before the call and never refunded on an unparseable answer.

On this page