feat(results): preserve structured failure diagnostics - #1038
Conversation
|
Thanks for putting this together — losing the structured failure detail on the way into End-to-end verificationEverything below comes from real base
Diagnostics appear on failures, and only on failures. Three matched base/head pairs, each a real rollout:
The healthy pair is the one that carries the regression risk, so I ran it on both trees end to end: 1/1 passed, Unchanged callers produce unchanged bytes. Calling Redaction holds under adversarial input. I instantiated all 7 registered diagnostics with poisoned values — API keys, absolute paths, container IDs, raw exception text — in every field the classes carry, then scanned the emitted block for surviving poison. 16 poisoned fields probed, zero leaked. Every value that does reach the block is a bounded scalar: an I also probed the one path the classifier does not control — a caller passing an arbitrary Job-level aggregation via The new tests genuinely constrain the policy. To check they do more than execute the code, I broke the redaction layer five ways and re-ran the suite (136 tests):
4 of 5 caught. M5 does not affect the correctness of this PR: it is a hypothetical future edit rather than anything the current code does, and even if someone made it, the field-kind validator rejects the mismatched value at emit time, so no data can escape. The mutation is inert, not uncovered. The two tests doing the real work are One behavioural note, not a defect: the registry lookup is an exact-type match, so a subclass of a registered diagnostic is dropped from the block entirely — not even its Potential conflict with PR #1025Nothing to do with this PR's correctness, but it will bite whoever lands second — and it is the kind that is easy to miss, because git will not flag it. The two PRs touch different parts of
That is the test doing exactly its job — it is the guard that stops a new diagnostic from silently bypassing the allowlist, which is the whole point of the mechanism. But it does mean whichever of these two PRs lands second needs a one-line |
Summary
results.jsonlCloses #1037.
Schema
Failed rows may now contain:
{ "info": { "diagnostics": { "schema_version": 1, "error_category": "pipe_closed", "events": { "transport_error_info": { "channel": "error", "category": "pipe_closed", "details": { "process_exit_code": 255, "transport_diagnosis": "process_exited", "sandbox_reachable": false } } } } } }The outer category is retained even when no typed event exists. New diagnostic classes fail closed to event metadata without details until they opt safe numeric/boolean fields into the trainer export policy.
Validation
uv run python -m pytest tests/test_train_mode_artifact_emission.py tests/test_acp.py -quv run python -m pytest tests/ -quv run ty check src/uv run ruff check .The issue also asks whether this bounded infrastructure contribution is eligible for FrontierPhysics credit. This PR does not assume or claim any point value.
AI-assistance disclosure: Codex assisted with implementation, tests, QA, and PR drafting under Ziao Yang's direction. The submitted behavior and test results were verified in the repository environment.