test: add live-LLM E2E moderation test suite

Add tests/llmE2e.test.ts — 7 end-to-end tests driving the REAL
moderation prompt pipeline (buildSystemPrompt → XML payload → llmChat
→ parseModerationResponse) against a live model via omniroute.

Covers: clean technical content (no false positives), harassment
(flagged), username-only offenses including 'Pecinta Pria' +
sexual/provocative usernames + SARA-in-username (always warn/low,
NEVER delete — the nickname-reset path), and spam bursts.

Gated behind AI_LLM_BASE_URL + AI_LLM_API_KEY: CI (no creds) skips
the file → 216 unit tests stay green, zero LLM cost. Run locally via
pnpm test:e2e:live (scripts/run-llm-e2e.sh injects creds from bws).

Verified: 223/223 tests pass with live LLM, stability across 4 runs,
typecheck + biome clean. docs: TESTING.md. ignore .hermes/ plans.
This commit is contained in:
asepharyana
2026-09-18 21:27:06 +07:00
parent ef41898a60
commit 43e35a71dd
5 changed files with 341 additions and 1 deletions
+1
View File
@@ -7,6 +7,7 @@ services/frontend/frontend/dist/
public/app/
.muxer-queue.**
.claude/
.hermes/
.env.test
logs/
.codegraph/