# Local Runtime Runbook — v0.39.4-dev Consolidated

## Non-technical Windows UAT
Use the root-level files in this order:
1. `01-SETUP-LOCAL-UAT-WINDOWS.bat`
2. `02-START-LOCAL-UAT-WINDOWS.bat`
3. `03-CHECK-LOCAL-UAT-WINDOWS.bat` when a diagnostic is needed.

The setup automates virtual environment creation, dependency installation, local environment file creation, frozen-migration verification, migration drift checking, database migration, role/master seed, UAT sample seed, first Super Admin creation and runtime checks.

## Developer/manual equivalent
```text
python -m venv .venv
.venv/Scripts/python -m pip install -r requirements.txt
python manage.py makemigrations --check --dry-run
python manage.py migrate
python manage.py first_run_setup --with-demo-data
python manage.py check
python manage.py first_run_status
python manage.py runserver 127.0.0.1:8000
```

## Security / Backup gate before Go-Live
- `python manage.py security_readiness`
- `python manage.py check --deploy` using production-like environment values
- `python manage.py backup_database`
- `python manage.py verify_backup <dump-file>`
- Perform a real restore test in a disposable/test PostgreSQL database.

## v0.39.4-dev Consolidated smoke-test gate
After setup and server start, run `04-RUN-SMOKE-TESTS-WINDOWS.bat` (Windows) or `03-run-smoke-tests-linux.sh` (Linux). The runner verifies Django checks, unapplied migrations, model/migration drift, seeded first-run state, runtime health and the core automated test suite. The result is saved as `LOCAL-UAT-SMOKE-RESULT.txt`.

After automated smoke tests pass, use `LOCAL-UAT-SMOKE-TEST-SCENARIOS.csv` for practical end-to-end testing. Record defects in `BUG-LOG-TEMPLATE.csv`. FO-M1 live-device and parallel-payroll proof remain separate mandatory pre-Go-Live gates.
