Railway Environment Controller
Observe-first autoscaling for Zone 32-19
A small TypeScript service that reads Railway metrics every minute and decides whether services should scale, but by default only records what it would do.
- Reads CPU, memory, replica count and deployment status through the Railway GraphQL API.
- Scales on hysteresis with sustained windows, per-service and global cooldowns, min and max replicas and a budget cap.
- Refuses to replica-scale stateful services such as databases, Redis, volumes and singleton workers.
- Writes one JSON audit line per service per run, including decisions it blocked or skipped.
- Applying a change needs an explicit mode, dry-run off and, for production, an approval file. It fails closed when it cannot confirm which environment it is running in.
- Running in observe-only mode on the development environment: it records what it would do and has applied nothing.
- Stack
- TypeScript · Node.js · Railway
- Evidence
- Zone-32-19-Environment-Controller, v0.4 (private repository)
- Case study