burn: Fix crisis backend tests, gateway injection, and nginx rate limiting

- Fixed test imports (relative → absolute package imports)
- Added conftest.py for pytest path configuration
- Fixed get_system_prompt() to inject crisis context when detected
- Added pytest.ini configuration
- Expanded tests: 49 tests covering detection, response, gateway, edge cases, router
- Added deploy/rate-limit.conf for nginx http block inclusion
- Updated nginx.conf with correct zone name and limit_req_status 429
- Updated BACKEND_SETUP.md with complete setup instructions
This commit is contained in:
Alexander Whitestone
2026-04-09 12:34:15 -04:00
parent 0dab8dfcfc
commit bb4ba82ac8
7 changed files with 268 additions and 28 deletions

8
deploy/rate-limit.conf Normal file
View File

@@ -0,0 +1,8 @@
# The Door — Rate Limiting
# Add this block to your nginx main config http block:
# /etc/nginx/nginx.conf -> http { ... }
#
# This defines the rate limit zone used by the-door's server block.
# 10 requests per minute per IP, burst of 5 with nodelay.
limit_req_zone $binary_remote_addr zone=the_door_api:10m rate=10r/m;