Skip to content

feat(data): task_data validation gating: auto mode, misplaced-field check, repo drift test (#2827 cherry-pick into r0.6.0) - #2854

Open
adil-a wants to merge 1 commit into
r0.6.0from
cherry-pick-2827-r0.6.0
Open

feat(data): task_data validation gating: auto mode, misplaced-field check, repo drift test (#2827 cherry-pick into r0.6.0)#2854
adil-a wants to merge 1 commit into
r0.6.0from
cherry-pick-2827-r0.6.0

Conversation

@adil-a

@adil-a adil-a commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Cherry-pick of #2827 (merge commit b369322) into r0.6.0.

Clean pick: #2827 was built on the exact commit the release branch was cut from, so the commit applied without conflicts. All 330 task_data and collate tests pass on this branch.

See #2827 for the full description and verification.

@copy-pr-bot

copy-pr-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@adil-a

adil-a commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 3444562

…heck, repo drift test (#2827)

## What this does

This PR turns the schema validation from #2800 into a gate.

**Auto validation mode.** `task_data_validation` gains an `auto`
setting. Auto is now the default. Auto resolves to `error` in
`example_validation` mode and to `warn` in `train_preparation` mode.
Committed example data is known clean, so a bad row should fail the PR
gate. User training data must not crash long collate jobs, so it warns
instead.

Before: the default was `warn` everywhere. A bad committed example row
only printed a warning.
After: `gym dataset collate +mode=example_validation` fails on a bad row
with a per-row error report. Training collate still warns and completes.

**Misplaced-field check.** Some schema fields carry a `legacy_location:
verifier_metadata` marker. The marker means the server reads that field
only from inside `verifier_metadata`. If a row puts the field at the top
level instead, the server never sees it. The validator now counts these
rows and reports them as `misplaced_keys`. The instruction_following
schema drops its markers because that server accepts both placements.

**Schema presence test.** Every resources server with an `app.py` must
ship a `task_data.py`. New servers can no longer skip the schema.

**Repo drift test.** A new unit test walks every committed dataset in
the repo and validates each row against its server's schema. If a
server's wire model changes and the schema does not, this test fails.
This is the drift gate requested in the #2795 review.

The presence test already paid for itself. terminal_bench_2_1 landed on
main after the schema sweep and had no schema. The test caught it, and
this PR adds its schema.

**Review fixes.** Three additions from the first review round.
Undeclared row keys now fail the gate instead of only being reported; no
committed row carries one, and the stricter gate immediately caught two
missing fields in a new schema. The drift test now also validates
datasets owned by self-contained agents (agents with no resources
server), using the same schema fallback collate uses; schemas for the
nine such agents with committed data are included.
`normalize_task_fields` now unpacks a migrated `task_data` container the
same way it unpacks `verifier_metadata`, so nested fields cannot dodge
validation.

## Verification

- All 302 tests in `tests/unit_tests/test_task_data.py` pass.
- Live smoke: a bad row (`expected_city` as an int) fails `gym dataset
collate` in `example_validation` mode with a per-row pydantic report.
The same row only warns in `train_preparation` mode and the run
completes.
- Golden routing gate: base capture vs branch capture, strict compare, 0
differences across 233 closures.
- ruff and pre-commit are clean.

---------

Signed-off-by: Adil Asif <adasif@nvidia.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit b369322)
@ananthsub
ananthsub force-pushed the cherry-pick-2827-r0.6.0 branch from 3444562 to 27f790a Compare August 28, 2026 21:44
@adil-a

adil-a commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 27f790a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant