Files
Dragan Spiridonov bd6164c031 test(trajectory-judge): unit coverage for env-gate, schema check, and parsing
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>
2026-05-08 08:18:55 +00:00
..
2026-04-30 14:39:10 +00:00