ENV-004 critical environment-config

Staging runs in production mode

NODE_ENV=production or equivalent, same build process as production

Question to ask

"Is staging running in dev mode and masking real prod issues?"

Verification guide

Severity: Critical

Check automatically:

  1. Check staging workflow for NODE_ENV / environment mode:

    grep -A 20 -i "staging" .github/workflows/*.yml | grep -i "NODE_ENV\|RAILS_ENV\|APP_ENV\|ENVIRONMENT"
    
  2. Check for build flags in staging deploy:

    grep -A 20 -i "staging" .github/workflows/*.yml | grep -i "build\|--prod\|--production"
    
  3. Check IaC/platform configs for staging environment variables:

    grep -r "NODE_ENV\|RAILS_ENV\|APP_ENV" terraform/ pulumi/ 2>/dev/null | grep -i stag
    

Ask user:

  • Is staging explicitly set to production mode?
  • Any intentional differences from prod mode?

Pass criteria:

  • Staging runs with production mode enabled (NODE_ENV=production or equivalent)
  • Same build process as production

Fail criteria:

  • Staging runs in development mode
  • Different build flags than production (e.g., unminified, debug enabled)

Evidence to capture:

  • Environment mode setting (NODE_ENV=production, etc.)
  • Where this is configured (workflow, platform, IaC)
  • Any intentional deviations documented

Cross-reference with:

  • ENV-002 (staging exists)
  • ENV-005 (contrast with dev mode)
  • ENV-006 (staging env vars match prod)

Section

04. Environments

Infrastructure & Setup