feat: add run.continue_on_error to record per-test failures and keep going - #40
Merged
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
…going A single unrecoverable per-test error (provider failure surviving retries, unexpected harness exception) currently aborts the whole run, discarding hours of compute and API spend. For long diagnostic runs that trade-off is wrong: one bad test should cost one record, not the run. - New run.continue_on_error (default false — legacy abort semantics, required for official runs). When enabled, a per-test TestError is warned about on one line, recorded, and the run continues. - Errored tests become canonical records via build_error_record(), filling the error field reserved by the unified schema: null scores (an ungraded test neither passes nor fails), exact canonical key structure, no schema bump. - Errored tests are excluded from score aggregates so infrastructure failures never masquerade as model failures; they are auditable via metadata.continue_on_error and metadata.errored_test_ids. - Systemic guardrail: if the first 5 processed tests all error with no success, the run aborts anyway with a clear message — a bad API key or dead runtime should fail loudly, not burn the suite. - Knowledge loops (single- and multi-model) deduplicated into a shared _run_knowledge_loop(), mirroring _run_isolated_execution_loop. - Applies to knowledge, execution, and reference-solution paths; the reference failure table already surfaces errored records as failures. Verified: pytest python (141 passed, 8 new), ruff clean, mypy python clean (0 errors). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lezama
force-pushed
the
feat/continue-on-error
branch
from
July 10, 2026 20:24
212710e to
1d942b7
Compare
Behavior-preserving cleanup from the four-angle review: - Extract _run_concurrent_loop(): the new _run_knowledge_loop was byte-for-byte the concurrent branch of _run_isolated_execution_loop (only worker count + label differed). Both now route through one helper; the serial reset_per_test branch — the genuinely different loop — stays. - Extract records._base_record(): the three record builders each re-listed the full canonical key skeleton (the keys-equality test existed to police that triplication). They now override a shared skeleton, so the shape can't drift. - Add core._error_record(): the TestError -> record extraction (type/message/test_type) was copy-pasted into all five on_error closures; each is now a one-liner. - Add records.errored_test_ids(): the same comprehension appeared in two metadata blocks. - Rename _ContinueOnErrorPolicy.should_abort -> register_error: it is a mutating predicate, so the name now signals the side effect. Documented that the policy's per-loop scope is intentional. Skipped (noted): giving ScoreAggregator a record-aware add_record() to own the "errored record contributes nothing" guard — it would couple the aggregator to the record schema (reaches into scoring.py, outside this change), and the reviewers split on it. Verified: ruff clean, mypy python clean, pytest python 142 passed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
New
run.continue_on_errorswitch (default false): when enabled, an unrecoverable per-test error — a provider failure that survives the retry policy, or an unexpected harness exception — is warned about on one line, recorded as a canonical result record with theerrorfield populated, and the run continues to the next test.error: {type, message}(reserved null since the unified schema landed), null scores, exact canonical key structure — noRESULT_SCHEMA_VERSIONbump, no fourth parser needed.execution_pass_rate/knowledge. The trade-off (a diagnostic run's denominator shrinks) is disclosed in the results file viametadata.continue_on_errorandmetadata.errored_test_ids— an auditor can always see exactly which tests were skipped and why the run is not leaderboard material.--limit 3, all erroring) also aborts instead of writing a useless null-score results file. One graded success disarms both — after that, errors are per-test facts worth recording._run_knowledge_loop(), mirroring_run_isolated_execution_loop.Why
A full run is hours of compute and thousands of model calls. The retry layer (#32) absorbs transient blips, but a single error that survives it currently aborts the entire run and discards everything already graded. For long diagnostic runs the right cost of one bad test is one record — while official leaderboard runs keep the strict default: every selected test must grade, so the flag is off by default and documented as diagnostic-only (same contract as
skip_runtime/execution_isolation: none).This is deliberately the first slice of the "distinguish infrastructure failures from model failures" direction noted in #32 — resumable runs can build on the same error-record shape later.
Verification
ruff check python— cleanmypy python— clean (0 errors)pytest python— 142 passed (9 new: default-off still aborts; error recorded + run continues on serial, concurrent, and knowledge paths; aggregates exclude errored tests; metadata audit fields; systemic abort after 5 straight errors; all-error run below the threshold aborts too; one success disarms the guardrail)runtime/untouched)Score impact
🤖 Generated with Claude Code