Repository navigation
eval: Responses API, repeat-based variance, and harness tests - #1
Open
NullLabTests wants to merge 1 commit into
Open
NullLabTests wants to merge 1 commit into
NullLabTests wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The eval harness reported a single number per scenario with no indication of spread. With
LLM_API_KEYunset it runs mock plans that always pass, sonpm run evalin CI proved nothing about real model behaviour and nothing about whether the scoring code still worked. The LLM path also hard-coded/chat/completionswith agpt-4odefault, had no retry or timeout, and no tests at all.Changes
eval/llm.ts— Responses API by default, auto-detecting/chat/completionsfor non-OpenAI gateways (vLLM, Ollama, Together, Groq). Strict JSON Schema on the plan instead ofjson_object, so responses parse without coercion. Retry with exponential backoff plus jitter on 408/409/425/429/5xx, per-request timeout, andcoerceJson()for fenced or prose-wrapped output.eval/metrics.ts—aggregateRepeats(),mean(),stdev(), andsummarizeAggregates()for mean ± sd per scenario.eval/runner.ts—EVAL_REPEATS(default 3), per-scenario aggregates, and astableflag that is false unless every repeat was valid.eval/metrics.test.ts— 8 tests covering the stats helpers, JSON coercion, and gateway URL handling.npm testand a mock-modenpm run evaljob. Addspermissions: contents: readand concurrency cancellation.Verification
Note on reading the numbers
EVAL_REPEATSdefaults to 3 because a single sample cannot distinguish a reliable result from a lucky draw. Aggregate output marks a scenariostableonly when all repeats were valid.estimateTokens()is still a 4-chars-per-token heuristic, so relative comparisons hold but absolute token counts should not be quoted as measurements.Not run: live LLM mode, which needs
LLM_API_KEY. The API-shape changes are compile-checked and unit-tested against a stub, not exercised against a real endpoint.🤖 Generated with Claude Code