feat: add startup env validation #57

Closed
pook wants to merge 4 commits from feature/startup-env-validation into main
Owner

Summary

  • Adds a validate-env.ts module that validates all required environment variables before the server starts listening
  • Validates presence and format of: DATABASE_URL (postgres/sqlite URI), OPENAI_API_KEY or ANTHROPIC_API_KEY (sk-* prefix), STRIPE_SECRET_KEY (sk_test_/sk_live_), STRIPE_WEBHOOK_SECRET (whsec_)
  • Collects ALL errors before exiting with code 1, so developers see every problem at once
  • Development mode (NODE_ENV != production) treats Stripe vars as optional (warns instead of failing)
  • Restructured index.ts to use dynamic import so validation runs before any module-level side effects (e.g., database connection)

Test plan

  • 12 unit tests covering valid configs, missing vars, format validation, dev mode permissiveness, and multi-error reporting
  • Manual: start server with missing DATABASE_URL → should print clear error and exit 1
  • Manual: start in dev mode without STRIPE vars → should warn but not fail

🤖 Generated with Claude Code

## Summary - Adds a `validate-env.ts` module that validates all required environment variables before the server starts listening - Validates presence and format of: `DATABASE_URL` (postgres/sqlite URI), `OPENAI_API_KEY` or `ANTHROPIC_API_KEY` (sk-* prefix), `STRIPE_SECRET_KEY` (sk_test_/sk_live_*), `STRIPE_WEBHOOK_SECRET` (whsec_*) - Collects ALL errors before exiting with code 1, so developers see every problem at once - Development mode (`NODE_ENV != production`) treats Stripe vars as optional (warns instead of failing) - Restructured `index.ts` to use dynamic import so validation runs before any module-level side effects (e.g., database connection) ## Test plan - [x] 12 unit tests covering valid configs, missing vars, format validation, dev mode permissiveness, and multi-error reporting - [ ] Manual: start server with missing DATABASE_URL → should print clear error and exit 1 - [ ] Manual: start in dev mode without STRIPE vars → should warn but not fail 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

Closed 2026-04-10 during pipeline triage.

Merge conflicts with current main were blocking the CEO agent's backlog view. The compliancebot repo had ~60 open PRs and 141 open agent-task issues. CEO couldn't see progress and kept duplicating work due to a git-push race in agent-worker (now fixed — runId threaded through dispatch pipeline for unique branch names).

Reopen / resubmit against current main if the work is still relevant. Shim /shim/ceo route now injects open issues + PRs into the CEO prompt and refuses dispatch when backlog exceeds 20.

Closed 2026-04-10 during pipeline triage. Merge conflicts with current main were blocking the CEO agent's backlog view. The compliancebot repo had ~60 open PRs and 141 open agent-task issues. CEO couldn't see progress and kept duplicating work due to a git-push race in agent-worker (now fixed — runId threaded through dispatch pipeline for unique branch names). Reopen / resubmit against current main if the work is still relevant. Shim `/shim/ceo` route now injects open issues + PRs into the CEO prompt and refuses dispatch when backlog exceeds 20.
pook closed this pull request 2026-04-10 15:08:21 -04:00
Author
Owner

Duplicate of #68 — consolidated stale issue cleanup

Duplicate of #68 — consolidated stale issue cleanup

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot!57
No description provided.