padosoft-environment-gatinglisted
Install: claude install-skill padosoft/skills
# Environment gating
An environment check is a **string comparison with a value somebody typed into a file**. It is exact, it is
unvalidated, and when it does not match, nothing goes wrong — the development branch simply lights up on the
live site, doing exactly what it was asked to do.
**The rule: the answers are three, not two — and the branch decides which default is safe.**
---
## 1. Why the two-valued check fails
```text
APP_ENV = "Production" → is_production("production") false
APP_ENV = "production " → false (a trailing space, invisible in the file)
APP_ENV = "prod" → false
APP_ENV = "prod-eu-1" → false
APP_ENV = "produzione" → false
```
Every one of those is a live deployment answering *no, I am not production*. Downstream: error pages with
credentials in them, a profiler recording session cookies, diagnostic endpoints open, orders sent to a
provider in test mode. No exception, no alert — the code did what it was told.
The real incidence is not one call site. It is **dozens**, spread over the codebase, all written the same
way by people copying the line above.
## 2. The three answers
"I am in production" and "I am not in production" are **not** each other's negation, because there is a
third case: **the name is unknown** — a typo, a new deployment nobody added to the list. Treating it as
either of the first two is the whole defect.
So: two separate questions, each answering *yes* only when it is certain.
| Predica