mirror of
https://github.com/proffesor-for-testing/agentic-qe.git
synced 2026-09-19 08:45:47 +08:00
bd6164c031
New file from patch 420 had no tests. Adds tests/unit/mcp/handlers/
trajectory-judge.test.ts with 7 cases:
• no-op when ANTHROPIC_API_KEY is unset (env-var gate)
• no-op when feedback column is absent (schema-presence check)
• happy path writes structured {quality, reasoning, improvement}
• quality clamped to [0,1] and fenced ```json``` parses correctly
• malformed responses don't write partial feedback
• batch cap at 5 rows even when more are unscored
• ANTHROPIC_BASE_URL is honored for the fetch target (patch 380 wiring)
Mocks getUnifiedMemory + globalThis.fetch — never reaches Anthropic.
Caught during pre-PR gap audit.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>