---
name: deployment_env_validator
description: Scoped-but-unbuilt preflight validator asserting a target box has everything Evolution needs before serving
metadata: 
  node_type: memory
  type: project
  originSessionId: d6a60795-1105-4206-8b5c-af1bbe8450e7
  modified: 2026-07-29T13:14:08.696Z
---

Deployment environment validator — **scoped, not built**; deferred to its own ticket. Scope doc: `evolution/audits/DEPLOYMENT_ENV_VALIDATOR_SCOPE.md`.

**Why:** Evolution's env dependencies (PHP extensions, external binaries, `.env` constants, writable paths, DB reachability) are asserted nowhere. On a redeploy/DR/rebuild to a box missing one, the app doesn't fail at boot — it fails at the first request that hits that dependency, as a misleading symptom. Concrete trigger: R2 plugin-import gate needs `fileinfo`; a box without it rejects *every* import as "Invalid file type" with no hint of the real cause.

**How to apply:** proposed deliverable = dependency-free `tools/env_check.php` (CLI-first, `--json`/`--strict`, non-zero exit gates a deploy hook; optional admin-gated `?page=envcheck`). Check catalogue is ~90% enumerated in the doc from a 2026-07-29 scan: required exts (fileinfo, mbstring, curl, openssl, bcmath, gd, zip, dom, simplexml, soap, iconv, pdo_mysql, json), binaries (wkhtmltopdf @ `/usr/local/bin` + `.sh` wrapper, ghostscript `gs`, `timeout`), `.env` constant presence, writable `companies/`+temp, DB connect. Should double as the acceptance test for [[codeserver_setup_scripts]] install.sh/extensions.sh (keep the two in sync). Est ~6–10h. Ships with docs page + release notes per [[feature_release_docs_policy]]. Open Qs: required-vs-recommended per ext (decide on live boxes), config-drift check vs presence-only for v1.
