Skip to content

refactor: report conformance checks independently - #4041

Merged
lafrancef merged 12 commits into
mainfrom
codex/harness-check-registry
Oct 7, 2026
Merged

lafrancef merged 12 commits into
mainfrom
codex/harness-check-registry

Conversation

@giuliolovisotto

@giuliolovisotto giuliolovisotto commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Conformance reporting previously coupled check dispatch and pass/fail gates to TE groups, and behavioral failures could obscure valid artifact evidence. Define schema, semantic and behavioral checks as typed objects with explicit IDs, tiers, evidence labels, locations, failure reasons and evaluation logic. All check definitions live under nemo_gym/harness_capabilities/; scripts supply scenarios, observations and expectations.

Each check reports pass, fail, or not applicable, with reasons and blocking prerequisites. Missing required input, blocked checks and absent results display a cross. The P0 gate requires every applicable individual P0 check to pass; all current checks are P0, including ownership and call-to-step checks. TE labels only group results. Artifact, behavioral and execution results remain separate.

The permanent first-request HTTP 400 scenario explicitly excludes step evidence; retry-and-recovery scenarios still require it. Previous-response history is resolved within its model server, avoiding false failures when servers reuse response IDs. Removes unused wrappers, internal record copies and redundant result conversions; consolidates overlapping tests.

Includes the focused evidence checks previously stacked in #4042. Removes string-based dispatch, whole-object validation and cross-copy fallback/consistency checks. Retains pre-PR profile/schema version identifiers. Schema helpers and model-call reference grammar remain in checker.py; schemas.py is removed. Follow-up to #3766; no separate issue is needed.

Harness unit tests assert native observability and health behavior without importing the conformance checker. Removes the copy-only hydrate_record() wrapper and reader.py; strict JSONL reading and hashing live in the conformance CLI, shared by the scripts.

Validation:

  • At rebased head b4f30dc96 (on main at e76a5c629): 276 checker/runner tests passed, 2 skipped; mini-SWE harness suite: 124 passed, 1 skipped. Tests use the current checkout via PYTHONPATH with existing dependency environments.
  • Cross-server response-ID reuse, same-server ambiguity, strict JSONL parsing and immutable report publication remain covered.
  • pre-commit run --all-files passed.
  • Earlier Fern validation: 0 errors, 1 warning; this cleanup changes no Fern files.
  • Earlier validation reinspected 76 saved conformance scenarios across 11 harness variants; all 5,775 individual statuses match the preceding report. Restoring all checks to P0 makes ten scenario gates fail on their existing ownership/attribution failures. Regenerated and visually checked the HTML tables.

Default pytest discovery is limited to tests. Conformance runner tests remain available through an explicit pytest scripts/harness_conformance/tests invocation; dedicated CI for that module is deferred. The core coverage threshold remains 95%. This avoids adding incidentally imported harness implementations to the core coverage measurement without their separate server suites.

At da612c420, core behavioral-check tests live in tests/unit_tests/harness_capabilities/test_behavior.py. Fifteen cases exercise model exchanges, response IDs, token counts and tool witnesses without importing harness implementations. A shared synthetic helper supplies independent saved evidence and witness records; scenario integration and protocol-normalization tests remain with the runner.

Validation for this test relocation:

  • Core conformance and runner suites: 277 passed, 2 skipped.
  • Moved behavioral tests alone: 15 passed; behavior.py coverage 96.74% (89 of 92 statements). Verified no responses_api_agents modules were imported.
  • pre-commit run --all-files passed.
  • Full CI for this head passed: core coverage 95.26% against the unchanged 95% threshold; core tests 6,671 passed / 2 skipped, sandbox tests 916 passed / 5 skipped, and all eight server-test shards passed.

Production harness and environment behavior is unchanged. This validation reuses saved controlled-run artifacts; no new live-model benchmark evaluation was performed. Full server CI was not run locally.

@copy-pr-bot

copy-pr-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@lafrancef lafrancef left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Comment thread scripts/harness_conformance/runner.py Resolved
@giuliolovisotto giuliolovisotto changed the title refactor: register harness evidence checks refactor: report conformance checks independently Oct 5, 2026
@giuliolovisotto
giuliolovisotto force-pushed the codex/harness-check-registry branch from a7a73e9 to e68a0ee Compare October 5, 2026 16:58
giuliolovisotto added a commit that referenced this pull request Oct 6, 2026
Stacked on #4041. Validate each piece of evidence once at its designated
saved location, with JSON Schema for fields and explicit semantic checks
for relationships. Missing collections block dependent checks without
invalidating unrelated evidence.

- Keep call, step, tool, grading and sandbox requirements; resolve
invocation/call references against canonical targets. All supplied
reference identifiers must agree, and ambiguous targets fail.
- Replace blanket Python-model validation and cross-copy reconciliation.
Do not repeat Gym-owned uniqueness, clock-order or provider-usage
normalization checks.
- Retain independent comparisons with scripted exchanges, response
metadata, token counts and tool outcomes. A behavioral failure does not
erase artifact passes.
- Emit one table per harness, with individual check rows grouped as
Schema, Semantic and Behavioral, scenario columns, and compact status
symbols. Process status stays separate. Missing normal rollouts leave
artifact checks unassessed.

The profile is `gym-p0/v3`. Check IDs, report format and authoritative
locations change; regenerate existing reports. TE labels only group
results. `ng_trajectory` supplies calls, steps, invocations and tool
executions; sandbox/compaction observations retain their explicitly
designated source. Capture sidecars are provenance only. Benchmark
execution and scoring code are unchanged.

Validation:
- Focused checker/runner suite: **253 passed, 2 skipped** (`jj`
unavailable).
- `pre-commit run --all-files`: passed.
- Fern check: zero errors, one warning.
- Fresh scripted runs on main `b0e3fa6cf` plus this checker stack for
simple_agent, SciCode, OpenCode, Terminus2, mini-SWE, Hermes, NOOA,
Codex, Pi and Stirrup. OpenCode is also tested separately with
observability stack tip `ccf9f997b` (#3872). Failure sidecars leave
artifact checks unassessed.
- Local additional-driver/checker suite: **272 passed, 2 skipped**.
Combined current OpenCode stack, producer/capture and checker tests:
**625 passed, 2 skipped**.

Controlled-endpoint tests execute shell commands and inspect actual
model/tool/verifier exchanges. These scripted runs do not qualify
production benchmarks. Stirrup also ran all seven scenarios in
Lima/Apptainer with a small shell-test image: six normal rollouts and
one terminal-error failure record. The six normal rollouts retain
model-call evidence but lack invocation, step and tool records. This
uses a local native-tool driver; it does not qualify the full GDPval
environment. Full server CI was not run locally.

Follow-up to #3766 and #4041; no separate issue is needed for this
focused integration.

---------

Signed-off-by: Giulio Lovisotto <glovisotto@nvidia.com>
@giuliolovisotto
giuliolovisotto marked this pull request as ready for review October 6, 2026 14:59
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team October 6, 2026 15:00
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

@yaoyu-33 yaoyu-33 added area:core Shared APIs, servers, telemetry, health, and registries complexity:high Cross-component or shared-contract change with a large review surface feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer labels Oct 6, 2026
@giuliolovisotto
giuliolovisotto requested a review from a team as a code owner October 6, 2026 15:41
Signed-off-by: Giulio Lovisotto <glovisotto@nvidia.com>
Signed-off-by: Giulio Lovisotto <glovisotto@nvidia.com>
Keep JSONL and hashing helpers with the CLI. Remove the copy-only hydration wrapper and keep harness unit tests focused on native evidence and health.

Signed-off-by: Giulio Lovisotto <glovisotto@nvidia.com>
Remove conformance runner tests from default discovery. Dedicated CI for the runner is deferred.

Signed-off-by: Giulio Lovisotto <glovisotto@nvidia.com>
Keep model and tool witness comparisons in default core discovery. Share independent synthetic evidence with runner integration tests and retain protocol normalization coverage in the runner suite.

Signed-off-by: Giulio Lovisotto <glovisotto@nvidia.com>
@giuliolovisotto
giuliolovisotto added this pull request to the merge queue Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/37640288114

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Oct 7, 2026
@lafrancef
lafrancef added this pull request to the merge queue Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/37696271660

Merged via the queue into main with commit e2b682b Oct 7, 2026
43 checks passed
@lafrancef
lafrancef deleted the codex/harness-check-registry branch October 7, 2026 22:42
wdykas pushed a commit to wdykas/Gym that referenced this pull request Oct 8, 2026
Adds health expectations to the conformance checker introduced by NVIDIA-NeMo#4041.
Rebased onto main after NVIDIA-NeMo#4041 merged; this PR contains only the
health-check addition.

A harness can satisfy artifact checks while Gym health still lacks
required evidence or finds incorrect aggregate usage. Add P0
`HealthCheck` objects generated from Gym's rollout health registry. The
conformance runner calls the public health engine once on saved rollout
and failure artifacts, then compares each individual health result with
the scenario's expectation.

Scenarios default to `healthy` and manually declare exceptions.
Deliberately omitted usage and injected HTTP errors expect missing-token
findings and unobserved token reconciliation; terminal HTTP errors also
expect an ended-on-failed-call finding. Missing health results fail. New
registered rollout checks default to healthy; unknown scenario override
IDs are configuration errors. Explicit step scope remains respected, and
task-level checks requiring repeats remain outside this suite.

Results appear in a separate Health group in the existing scenario
tables. A pass means the expected outcome occurred, including expected
unhealthy or unobserved outcomes. Gym's health-check logic and
production harness behavior are unchanged. Tracking:
[FEA-402](https://linear.app/nvidia/issue/FEA-402).

Validation after rebasing onto main (`cc2046c84`), 8 October 2026:
- 395 checker, runner and rollout-health tests passed; 2 skipped (Python
3.13.14).
- `pre-commit run --all-files` passed.
- Fern check: 0 errors, 1 warning.
- Preserved main’s moved reader helpers and shared evidence/witness
fixture. Updated the step-scope regression test: invocation-owned token
reconciliation can pass without turns, and a real aggregate mismatch
still fails when step checks are excluded.

Original pre-rebase runtime validation:
- 293 checker/runner tests passed; 2 skipped.
- `pre-commit run --all-files` passed.
- Fern check: 0 errors, 1 warning.
- Seven fresh scripted-model Pi scenarios completed. Four match every
health expectation; retry and terminal-error scenarios expose existing
ownership gaps.
- Seven saved sandboxed OpenCode scenarios from NVIDIA-NeMo#4106 reinspected using
their compatible native Gym health version: all health expectations
match. These artifacts use a newer trajectory schema than this branch's
base, so the matching health reader is required.

No new harness/model execution was performed for this conflict
resolution; full server CI was not run locally. The changes resolve
imports and test-fixture compatibility without changing the health
expectation implementation.

---------

Signed-off-by: Giulio Lovisotto <glovisotto@nvidia.com>

This branch was previously deployed

1 inactive deployment
public — da612c42 Deployed Oct 7, 2026 by copy-pr-bot[bot] via release / finalize / notify #4550
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core Shared APIs, servers, telemetry, health, and registries complexity:high Cross-component or shared-contract change with a large review surface feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants