test: add 111 tests for trigger-server security and validation logic (#774)

Add comprehensive test coverage for the trigger-server HTTP service
(.claude/skills/setup-agent-team/trigger-server.ts), which had zero
test coverage despite recent security-critical changes (PRs #745, #747).

Tests cover:
- Timing-safe Bearer token auth (17 tests including injection attempts)
- VALID_REASONS allowlist enforcement (13 tests including injection)
- Issue parameter validation regex (17 tests including shell injection)
- Issue dedup logic (8 tests)
- Capacity checking (6 tests)
- reapAndEnforce process cleanup (9 tests including boundary cases)
- Health response structure (4 tests)
- Streaming response metadata (4 tests)
- Environment variable parsing (5 tests)
- Route matching logic (10 tests)
- Full validation flow with priority ordering (8 tests)

Agent: test-engineer

Co-authored-by: A <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
A 2026-02-12 16:46:10 -08:00 committed by GitHub
parent cdf6f1dba5
commit a290815108
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

File diff suppressed because it is too large Load diff