R2
What to build¶
Candidate-raised TimeoutError is classified as candidate failure; only an expired evaluator deadline becomes timeout evidence.
Source and evidence¶
Repository scientific/architectural review, snapshot 86c8517, item R2.
Classification: confirmed defect; medium severity.
The except TimeoutError catches both the timeout context's translated cancellation
and an exception raised by candidate setup, invocation, or teardown. A candidate
that immediately raises TimeoutError is reported as PER_CALL_TIMEOUT, with
error_type=None, rather than FAILED with error_type='TimeoutError'.
This corrupts failure counts and deadline evidence used to assess candidates.
Reproduction: an adapter with the asynchronous, lifecycle, and context capabilities,
no-op setup/teardown, and invoke() raising TimeoutError('candidate failure');
run asyncio.run(evaluate_async_candidate(adapter, [1])). Observed result:
candidate_timeout: per_call_timeout None. No deadline elapsed.
Acceptance criteria¶
- [ ] TimeoutError raised by setup, invoke and teardown before expiry retains the safe exception class and correct failure accounting.
- [ ] Actual per-call expiry and total expiry retain their distinct public timeout statuses.
- [ ] Caller cancellation continues to propagate after cleanup.
- [ ] Tests exercise both immediately raised exceptions and controlled expiration, not elapsed-time guesses alone.
- [ ] Preserve Consumer-owned meaning, payload-free evidence, disabled optional-import isolation, safe diagnostics and the non-relaxable Safety Floor.
- [ ] Run the narrowest observable contract, then applicable committed Make gates. Record every command and outcome; update specifications/compatibility evidence for changed public or wire contracts. Run native Collector verification for changed Collector assets and build for packaging changes.
Design guidance¶
Retain the timeout context and inspect expiration state when classifying exceptions. Centralize this decision without catching unrelated candidate failures as evaluator timeouts.
Keep prefactoring narrow and verifiable in this slice. Reuse established owners and structural interfaces; introduce a pattern only when it clarifies a real responsibility or variation point. Do not add consumer vocabulary or private payloads to platform code or evidence. Mocked/local results must not claim hosted, production, accelerator or release qualification.
Blocked by¶
None (can start immediately). Shared-area coordination is useful, but no other review fix is a genuine prerequisite for this slice.
Verification scope¶
Convert the described counterexample or investigation oracle into an observable test at the lowest suitable public boundary. Prefer bounded operation-count or deterministic interleaving evidence to flaky timing assertions; timing guarantees need a declared tolerance and independently owned cleanup. This ticket authorizes remediation/research, not publication or deployment.