48-Hour Field Notes: Phantom Env Keys in Agent Infra Patches
Description and use
The inventory script identifies unused environment variables added in patches, preventing runtime crashes.
Problem
Environment variables introduced in patches may never be used by the application, causing boot-time crashes that CI pipelines miss.
Outcome
The inventory script revealed that several env keys added in patches were never used, preventing potential runtime failures and keeping CI pipelines reliable.
Workflow
- 1. Freeze baseline of env keys the repo currently reads by running the inventory script on the main branch.
- 2. For each new patch, run the inventory script again.
- 3. Compare the two sets to identify keys introduced by the patch that are not referenced in source code.
- 4. Flag or remove phantom keys before merging.
- 5. Integrate the script into CI to enforce the check automatically.
Evidence
A thicker .env.example, a rewritten docker-compose.yml, and a GitHub Action that "only needed" PROD_DATABASE_URL plus CACHE_PASSWORD.
The script below is a proposal you can run locally; it is not a claim that any production fleet already ships it.
- Record date: 2026-09-09T21:15:14.751Z