Skip to content

Commit ff0dff8

Browse files
fix: classify Modal sandbox / tests-dir loss as transient_infra
The harbor backend's error taxonomy records any unrecognized case failure as TASK_FAILURE: an informative, scoreable sample at the failure value with status SUCCESS. That is right for a candidate that crashes on its own, but Modal sandbox lifecycle failures and a missing held-out tests fixture are infrastructure the candidate did not cause. Seen on a swe-atlas-qna run (2026-07-24): all 396 cases returned status=success, error_category=task_failure, score=0.0. Terminal exceptions were AddTestsDirError x144, Modal sandbox NotFound x125, RuntimeError x67, BadRequestError x60. Classified as task failures, the aggregate reported error_rate 0.0 and objective feasible at 0.0, so a fully broken environment looked like a real, shippable zero and the optimizer ran with no gradient (baseline and every candidate 0.0). Add the harness/Modal environment-loss signals (sandbox lifecycle, AddTestsDirError / "failed to add tests directory", container fetch failures, StreamTerminatedError) to the TRANSIENT_INFRA patterns. Those cases are now excluded from the aggregate and counted toward invalidity, so a collapsed environment surfaces as an invalid run instead of a silent zero. A candidate's own bug (ValueError, KeyError, no answer) is still a task failure, unchanged. Covered by two new tests; existing behavior asserted unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ccc7d07 commit ff0dff8

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

vero/src/vero/evaluation/error_taxonomy.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,22 @@ def policy(category: ErrorCategory) -> CategoryPolicy:
158158
),
159159
ErrorCategory.TRANSIENT_INFRA,
160160
),
161+
(
162+
# Harness / Modal environment loss: the task sandbox died, was never
163+
# created, or its container or held-out tests fixture could not be
164+
# provisioned. This is infrastructure the candidate did not cause, so
165+
# it is excluded from the aggregate and counted toward invalidity,
166+
# never scored as an informative task failure. Without this, a run
167+
# whose sandboxes all collapsed reports a fully "successful" 0.0
168+
# instead of an invalid aggregate.
169+
re.compile(
170+
r"sandbox|streamterminated|"
171+
r"failed.?to.?add.?tests.?directory|addtestsdirerror|"
172+
r"loading.?container|fetchspec",
173+
re.IGNORECASE,
174+
),
175+
ErrorCategory.TRANSIENT_INFRA,
176+
),
161177
]
162178

163179

vero/tests/test_v05_error_taxonomy.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,40 @@ def test_policy_encodes_the_intended_treatment():
5858
task = policy(ErrorCategory.TASK_FAILURE)
5959
assert task.is_informative_sample
6060
assert not task.counts_toward_invalidity and not task.terminating
61+
62+
63+
def test_classify_signal_recognizes_harness_environment_loss():
64+
# Modal sandbox lifecycle failures and a missing held-out tests fixture are
65+
# infrastructure the candidate did not cause, not an informative zero.
66+
assert classify_signal("AddTestsDirError") is ErrorCategory.TRANSIENT_INFRA
67+
assert (
68+
classify_signal("Failed to add tests directory to environment.")
69+
is ErrorCategory.TRANSIENT_INFRA
70+
)
71+
assert (
72+
classify_signal("The Sandbox is unavailable. It may have already shut down.")
73+
is ErrorCategory.TRANSIENT_INFRA
74+
)
75+
assert (
76+
classify_signal("Modal Sandbox with container ID ta-01 not found.")
77+
is ErrorCategory.TRANSIENT_INFRA
78+
)
79+
assert (
80+
classify_signal("FetchSpec failed: loading container: file does not exist")
81+
is ErrorCategory.TRANSIENT_INFRA
82+
)
83+
84+
85+
def test_classify_case_treats_environment_loss_as_infra_not_task_failure():
86+
# Regression for the swe-atlas-qna flat-zero: the majority of cases died on
87+
# Modal sandbox / tests-dir provisioning yet were masked as scoreable task
88+
# failures at 0.0. They must be excluded infrastructure, not informative.
89+
assert classify_case(["AddTestsDirError"]) is ErrorCategory.TRANSIENT_INFRA
90+
assert (
91+
classify_case(
92+
["NotFoundError", "Modal Sandbox with container ID ta-01 not found."]
93+
)
94+
is ErrorCategory.TRANSIENT_INFRA
95+
)
96+
# A candidate's own bug is still an informative task failure, unchanged.
97+
assert classify_case(["ValueError"]) is ErrorCategory.TASK_FAILURE

0 commit comments

Comments
 (0)