Four pools at max 10 each (40) ran against max_connections=30. Pool maxima now
come from lib/db/pool-limits.ts (identity 6, app 12, service 8, admin 3,
health 1 = 30, env-tunable 1-20) with a reserve of 10 for backup, migration,
psql and the second web container during a deploy. Idle connections close
after 10 s. Postgres max_connections 30 -> 60. A test pins the budget against
the compose file and forbids hard-coded pool maxima.
Production picks this up on the next deploy: run-production-deploy.sh runs
`compose up -d --wait postgres`, which recreates the Postgres container once
(a few seconds; data stays on the volume).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8