# WhatsApp production rollout

## Non-negotiable gates

- Preserve the existing Laravel `APP_KEY`; encrypted payout and WhatsApp records depend on it.
- Put WhatsApp, Razorpay, MCP, bridge bearer/HMAC, encryption, and hashing secrets in deployment secret managers. Rotate them during rollout, never in source control.
- Use `APP_ENV=production`, `APP_DEBUG=false`, warning-or-higher logs, Redis queues/cache, and a public HTTPS `APP_URL`.
- Supply a valid CKEditor self-hosting license key, or use `GPL` only when the entire application satisfies GPL terms.
- Files containing environment secrets, SQLite, retained messages, memory, or media use mode `600`; their directories use `700`.

## Release checks

```sh
composer install --no-dev --prefer-dist --optimize-autoloader
composer audit --locked --no-interaction
npm ci
npm audit --audit-level=moderate
npm run build
php artisan migrate --force
php artisan config:cache
php artisan route:cache
php artisan view:cache
```

Run the full PHP and bridge suites in CI before packaging. Laravel scheduler and queue workers must be supervised. Monitor critical Laravel logs plus bridge `/ready` and `/metrics` for queue age, outbound failures, delivery/read rates, agent failures, handoffs, failed jobs, and captured-payment confirmation gaps.

## Rollout order

1. Release Laravel 13, schemas, and backward-compatible signed service APIs.
2. Release the durable bridge with `ALLOW_FROM` limited to staff and Laravel mirroring enabled.
3. Complete staff handset tests: forwarded event reference, slow response note, UPI landing/intent, card or netbanking, capture, ticket, duplicate retry, and human handoff.
4. Expand to a small participant allowlist.
5. Enable normal traffic only after 48 hours of clean payment/ticket and delivery metrics.

Keep legacy logs/readers for seven days. Roll back code with feature flags if necessary, but do not reverse the new schemas. Live-mode handset UPI Intent remains a deployment gate; test-mode checkout alone cannot prove the live native-app behavior.
