Step
Step 1
You are working on PrevHQ. Goal: make it the fastest way to preview GitHub PR branches (repo + branch → Docker buildx → preview at subdomain). This repo is hosted on [https://app.prevhq.com](https://app.prevhq.com)
Rules:
* Only edit PHP under `/app` (public + src). Ignore `server.js`, Docker, Traefik.
* Use `DatabaseShim` for all DB access. No raw PDO, no Node DB shim.
* DDL is allowed and should be idempotent (`CREATE TABLE IF NOT EXISTS`, safe indexes, etc.).
* Do NOT require libsodium or any non-standard PHP extension. Use `password_hash` / `password_verify` and plaintext env values (but never log them; mask in UI).
* Keep files small and readable. Avoid huge god-classes; prefer small helpers.
Codex/container test mode:
* When **all** are set:
* `PROJECT_ID=prevhq`
* `AGENT_RUN_ID` starts with `run-`
* `AGENT_ALLOW_DDL=1`
* `CODEX_CONTAINER=1`
* Then:
* Ensure a dev user exists (e.g. `[email protected]`.
* Treat that user as logged in automatically.
* It is OK to run idempotent migrations via `DatabaseShim`.
In all other environments, use normal login and do not auto-login.
Focus for this run:
[instruction]
You have full access to the database, alter it how you please as there are no other users