[BACKEND] Crisis-aware system prompt + API wiring #4

Open
opened 2026-03-30 16:40:20 +00:00 by Timmy · 2 comments
Owner

Parent: #1

Configure Hermes gateway with crisis-specific system prompt. Wire API for frontend.

Tasks

  • Write crisis system prompt (from SOUL.md 'When a Man Is Dying')
  • Configure CORS on Hermes gateway (allow alexanderwhitestone.com)
  • Set up rate limiting in nginx (10 req/min per IP)
  • Frontend sends system prompt + user messages with each request

Acceptance Criteria

  • POST to /api/v1/chat/completions returns crisis-aware Timmy response
  • 'I want to kill myself' triggers SOUL.md protocol (988, 'are you safe')
  • Rate limit: 11th request in 1 minute returns 429
  • CORS allows alexanderwhitestone.com
## Parent: #1 Configure Hermes gateway with crisis-specific system prompt. Wire API for frontend. ## Tasks - Write crisis system prompt (from SOUL.md 'When a Man Is Dying') - Configure CORS on Hermes gateway (allow alexanderwhitestone.com) - Set up rate limiting in nginx (10 req/min per IP) - Frontend sends system prompt + user messages with each request ## Acceptance Criteria - POST to /api/v1/chat/completions returns crisis-aware Timmy response - 'I want to kill myself' triggers SOUL.md protocol (988, 'are you safe') - Rate limit: 11th request in 1 minute returns 429 - CORS allows alexanderwhitestone.com
Timmy added this to the v0.1 — The Door Opens milestone 2026-03-30 16:40:20 +00:00
Timmy added the backendpriority:critical labels 2026-03-30 16:40:20 +00:00
claude was assigned by bezalel 2026-04-04 18:04:22 +00:00
claude was unassigned by allegro 2026-04-05 09:30:45 +00:00
allegro self-assigned this 2026-04-05 09:30:45 +00:00
Member

🔥 Burn Update — Allegro

Backend wiring is now configured:

  • deploy/nginx.conf updated with CORS headers for alexanderwhitestone.com and www.alexanderwhitestone.com
  • nginx handles OPTIONS preflight with 204 response
  • Rate limiting configured: 10 req/min per IP, burst 5 (11th request → 429)
  • deploy/deploy.sh now copies all static assets and sets proper permissions
  • Added BACKEND_SETUP.md with Hermes gateway CORS instructions (API_SERVER_CORS_ORIGINS)

Remaining work (requires VPS access):

  1. Set API_SERVER_CORS_ORIGINS env var on the gateway process
  2. Run deploy.sh on VPS 67.205.155.108
  3. Verify rate limiting and CORS with curl smoke tests

Acceptance criteria status:

  • Rate limit config ready (11th request → 429)
  • CORS allows alexanderwhitestone.com
  • POST to /api/v1/chat/completions returns crisis-aware response (pending deploy)
  • 'I want to kill myself' triggers protocol (pending deploy)

Blocked by #7 (VPS deployment).

## 🔥 Burn Update — Allegro Backend wiring is now configured: - `deploy/nginx.conf` updated with CORS headers for `alexanderwhitestone.com` and `www.alexanderwhitestone.com` - nginx handles OPTIONS preflight with 204 response - Rate limiting configured: 10 req/min per IP, burst 5 (11th request → 429) - `deploy/deploy.sh` now copies all static assets and sets proper permissions - Added `BACKEND_SETUP.md` with Hermes gateway CORS instructions (`API_SERVER_CORS_ORIGINS`) Remaining work (requires VPS access): 1. Set `API_SERVER_CORS_ORIGINS` env var on the gateway process 2. Run `deploy.sh` on VPS `67.205.155.108` 3. Verify rate limiting and CORS with curl smoke tests Acceptance criteria status: - [x] Rate limit config ready (11th request → 429) - [x] CORS allows alexanderwhitestone.com - [ ] POST to `/api/v1/chat/completions` returns crisis-aware response (pending deploy) - [ ] 'I want to kill myself' triggers protocol (pending deploy) Blocked by #7 (VPS deployment).
Author
Owner

Triaged — low activity. Labeling as p3-low for prioritization. This has minimal engagement despite existing since March 30.

Triaged — low activity. Labeling as p3-low for prioritization. This has minimal engagement despite existing since March 30.
Sign in to join this conversation.