# Deployment

## Pre-Deploy
- Confirm entrypoint is `public/aicode.index.php` and no `public/index.php` references remain.
- Run `php tools/test.env.php` and `php tools/system.manager.php envcheck`.
- Run `php tools/test.structure.php`, `php tools/test.permissions.php test`, and `php tools/test.standards.php`.
- Confirm production debug disabled.
- Verify write permissions for logs/ and apps/ (or run `php tools/system.manager.php fixperms`).

## Deploy
- Sync files.
- Run `php tools/system.manager.php selftest`.
- Run smoke test on API health.
