Files
evig/docs/RELIABILITY.md
894b203602 docs: sync docs with actual stack (#447)
Docs truth-sweep against ground truth (package.json, CI workflows):
- npm → pnpm across evergreen docs (pnpm 11.25.0 is the package manager;
  npx tsx → pnpm exec tsx, npx ts-prune/jscpd → pnpm dlx, npm ci →
  pnpm install --frozen-lockfile, package-lock.json → pnpm-lock.yaml)
- Jest → Vitest in README, CONTRIBUTING, COMMANDS (vitest 4 is installed)
- Node claims: README 20+ → 22.13+ (engines) with CI/deploy on 24;
  deployment.md "Setup Node 20 (npm cache)" → Node 24 (pnpm cache), and
  the pipeline line now shows `pnpm run verify` as CI actually runs
- TypeScript 5.x claims → 6 (typescript ^6.0.3); Next.js 14 → 16 in
  BLOG_SYSTEM, guides/ARCHITECTURE, AI_BOT_SYSTEM_PROMPT
- COMMANDS.md: dropped nonexistent `dev:cms` script; services list fixed
  to db/meilisearch/listmonk (no redis in compose)
- HR_RUNBOOK: `npm run test -- src/…` → `pnpm run test src/…` (pnpm
  passes args without the `--` separator)

Historical records (docs/archive/**, dated audit reports, UPGRADE_PLAN)
left as-is — they describe what was true when written.


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-04 15:01:39 +00:00

1.5 KiB
Raw Permalink Blame History

Reliability Hardening Summary

This project is configured to favor reliability of Auth and Database while keeping CMS disabled by default.

What’s configured

  • CMS disabled by default

    • ENABLE_CMS=false gates all CMS API routes and client calls.
    • cms_api service is commented out in docker-compose.yml.
  • Database hardening

    • New migration scripts/db/migrations/005_auth_hardening_and_indexes.sql:
      • Enforces case-insensitive emails via CITEXT with a safety pre-check.
      • Ensures Auth.js timestamp columns exist (users."emailVerified", "createdAt", "updatedAt").
      • Adds critical indexes for interactions, preferences, segments, workshop instances, registrations, service appointments, and JSONB fields.
    • Migration runner updated to apply all migrations in order.
  • Redis-backed rate limiter and lockout (optional)

    • Enable via env:
      • ENABLE_REDIS_RATE_LIMITER=true
      • REDIS_URL=redis://localhost:6380
    • Falls back to in-memory if Redis client is not available.

How to run migrations

pnpm run db:up
bash scripts/db/run-migration.sh

This applies all scripts/db/migrations/*.sql in order.

  • Managed HA Postgres (Multi-AZ, PITR) and PgBouncer (transaction pooling)
  • Enforce Postgres timeouts: statement_timeout (~15s), idle_in_transaction_session_timeout (~30s)
  • Enable Redis rate limiting (ENABLE_REDIS_RATE_LIMITER=true)
  • Admin 2FA (TOTP) and backup codes (future enhancement)