Skip to content

feat: add Environment Server compliance checks for agent servers - #5441

Merged
marta-sd merged 13 commits into
mainfrom
martas/fep-1925-static-agent-tests
Nov 13, 2026
Merged

marta-sd merged 13 commits into
mainfrom
martas/fep-1925-static-agent-tests

Conversation

@marta-sd

@marta-sd marta-sd commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a non-blocking CI check that flags legacy patterns in agent servers. For each agent directory a PR changes, it installs the agent's venv the way Gym does for its tests, imports there the entry point that the agent's default config (configs/<component>.yaml) names, or app.py when it names none, and checks the concrete server classes that file defines:

  • A1: the agent defines run().
  • A2: the agent does not implement agent session seed and close.
  • A3: the agent overrides aggregate_metrics.

A2 is structural: it passes when the agent implements session seed and close, directly or by inheritance. It does not check that the session path serves the task the way /run does. #6035 lists inheriting agents whose sessions do not (agentic_turn_simulation_agent, gdp_pdf_agent, labbench2_vlm_agent, langchain_deepagents_agent, pi_sandboxed_agent, vision2code_agent). A2 passes for them, and AGENT_SESSION_AGENT_TYPES stays the source of truth for which agents serve sessions.

Findings are ::warning annotations with the file and line, and the result is published as "Environment Server compliance (non-blocking)". The scheduled run of cicd-main.yml skips it. A manual dispatch of cicd-main.yml, or a change to the suite itself (scripts/environment_server_compliance/, scripts/check_suites/ or its workflow), checks every agent. Also skips harness conformance for changes under scripts/environment_server_compliance/. Stacked on #5370.

A rule is a check on the class under test plus the ids of the rules it requires. A rule whose required rules did not pass does not apply, and rules share facts about the class through Target.once, so a rule that runs the agent fits the same shape. The suite is split into engine.py (rule types and evaluation, standard library only), component.py (default config, entry point and server classes), rules.py (the rules) and inspection.py (the entry point that the agent's venv runs).

Also:

  • select takes --compare {branch,commit} like harness conformance, so a push to main is compared with the commit before it.
  • The inspection puts the component directory on PYTHONPATH, as Gym does when it starts a server, so apps that import sibling modules by name (such as scicode_agent) load.
  • Abstract classes are not checked, since they cannot be deployed.
  • The check tests the commit that the rest of CI tests (checkout-ref, the merge commit of a PR mirror), and posts the check run to the event head, as harness conformance does.
  • scripts/environment_server_compliance/README.md lists the rules and how to run the check locally. The harness guide (add-or-update-a-harness.mdx) points new adapters to it.
  • tests/unit_tests/tooling/test_ci_environment.py leaves the new job out of the failure-notification gate, as it does for harness conformance.

Validation

  • tests/unit_tests/tooling/test_environment_server_compliance.py and tests/unit_tests/tooling/test_harness_conformance_ci.py
  • pre-commit run on the changed files
  • ci check run locally on all 65 agents: 3 compliant, 62 with findings, 0 unavailable. langchain_deepagents_agent is checked at its entry point, reasoning_search_agent.py, not at the abstract base in app.py.
  • Earlier full run through a cicd-main.yml dispatch (41627950847): all 62 agents were inspected and the check run read 1 compliant, 60 with findings, 1 unavailable. The one unavailable agent, scicode_agent, is fixed by the PYTHONPATH change above.

Rollouts

N/A: CI-only change.

Compatibility and benchmark impact

None. The check is a separate workflow job and does not gate other jobs.

🤖 Generated with Claude Code

@marta-sd
marta-sd added this pull request to stack #5369 November 2, 2026 13:32
@copy-pr-bot

copy-pr-bot Bot commented Nov 2, 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.

@marta-sd marta-sd changed the title martas/fep 1925 static agent tests feat: add Environment Server compliance checks for agent servers Nov 2, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added ci CI, automation, test queue, or workflow infrastructure work area:ci CI workflows, test routing, and repository automation labels Nov 2, 2026
@marta-sd

marta-sd commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ea1f7cf

@marta-sd
marta-sd force-pushed the martas/fep-1925-static-agent-tests branch 3 times, most recently from 0fd4ec4 to 5548957 Compare November 3, 2026 07:26
@marta-sd

marta-sd commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 5548957

@marta-sd

marta-sd commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 69d8800

@marta-sd
marta-sd force-pushed the martas/fep-1925-static-agent-tests branch from 69d8800 to 37f7a45 Compare November 3, 2026 12:44
@marta-sd
marta-sd force-pushed the martas/fep-1925-static-agent-tests branch from 37f7a45 to 99cfcd0 Compare November 4, 2026 08:53
@marta-sd
marta-sd force-pushed the martas/fep-1925-static-agent-tests branch from 99cfcd0 to 26d0b2b Compare November 4, 2026 09:37
@github-actions

Copy link
Copy Markdown
Contributor

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

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue because a pull request earlier in the stack was removed Nov 13, 2026
@marta-sd
marta-sd added this pull request to the merge queue Nov 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 13, 2026
Base automatically changed from martas/fep-1924-remove-unneeded-selectors to main November 13, 2026 12:24
marta-sd and others added 13 commits November 13, 2026 12:24
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Co-authored-by: svcnvidia-nemo-ci <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
… guide

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
@marta-sd
marta-sd force-pushed the martas/fep-1925-static-agent-tests branch from aa677f6 to a4b3090 Compare November 13, 2026 12:24
@marta-sd

Copy link
Copy Markdown
Contributor Author

/ok to test a4b3090

@marta-sd
marta-sd enabled stacked auto-merge November 13, 2026 12:35
@marta-sd
marta-sd added this pull request to the merge queue Nov 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

Merged via the queue into main with commit dd8d81f Nov 13, 2026
148 of 150 checks passed
@marta-sd
marta-sd deleted the martas/fep-1925-static-agent-tests branch November 13, 2026 12:54
ADharaUTEXAS123007 added a commit that referenced this pull request Nov 13, 2026
Preserve the non-blocking compliance contract introduced by #5441: publish valid completed findings as neutral and let successful reporting exit zero. Keep all rule findings, locations, tested commit and artifact links visible. Missing, malformed, stale or contradictory evidence, failed probes and publication errors still fail closed. The shared strict reporting helper, agent APIs and compliance rules are unchanged. Validation: 253 focused reporting/conformance tests passed; all five findings from the previous CI artifacts are retained; pre-commit passed with the private catalog unavailable.

Signed-off-by: Arnab Dhara <[email protected]>
yaoyu-33 pushed a commit to yaoyu-33/Gym that referenced this pull request Nov 23, 2026
…VIDIA-NeMo#5314)

* feat(partner_if): add advertised tool-call checker

Signed-off-by: Arnab Dhara <[email protected]>

* docs(partner_if): record checker integration validation

Signed-off-by: Arnab Dhara <[email protected]>

* feat(partner_if): pin published dataset 2.1.5

Signed-off-by: Arnab Dhara <[email protected]>

* feat(partner_if): integrate Prime child report sessions

Signed-off-by: Arnab Dhara <[email protected]>

* docs(prime_agent): remove local Docker smoke notes

Signed-off-by: Arnab Dhara <[email protected]>

* fix(ci): annotate public Prime integrity hashes

Signed-off-by: Arnab Dhara <[email protected]>

* feat(partner_if): add bounded recorded-context evaluation

Pin the validated dataset and runtime assets, route the recorded-context task through agent sessions, and stop at a decisive ordering prefix. Keep private inputs external and use synthetic public fixtures. Retain Prime child observations and permit an explicit OpenCode snapshot setting.

Signed-off-by: Arnab Dhara <[email protected]>

* test(partner_if): declare no external tool servers in replay fixture

Signed-off-by: Arnab Dhara <[email protected]>

* fix(partner_if): declare replay search dependency and catalog manifest

Signed-off-by: Arnab Dhara <[email protected]>

* fix(partner_if): validate registry refs and preserve replay evidence

Signed-off-by: Arnab Dhara <[email protected]>

* chore(partner_if): refresh recorded-context dependency locks

Align both recorded-context component locks with the OpenAI 2.45.0 requirement already on main. Regenerated using CI uv 0.13.4; no application code changes.

Signed-off-by: Arnab Dhara <[email protected]>

* test(partner_if): cover task and replay contract validation

Exercise invalid prerequisite graphs, live-agent harness metadata, backend bundle layout, and pinned replay asset/path validation in the core test suite. All 52 new cases pass; combining their coverage with the five original CI artifacts raises coverage from 94.99% to 95.05% with the existing 95% gate unchanged. No production code or benchmark results change.

Signed-off-by: Arnab Dhara <[email protected]>

* fix(ci): keep completed compliance findings advisory

Preserve the non-blocking compliance contract introduced by NVIDIA-NeMo#5441: publish valid completed findings as neutral and let successful reporting exit zero. Keep all rule findings, locations, tested commit and artifact links visible. Missing, malformed, stale or contradictory evidence, failed probes and publication errors still fail closed. The shared strict reporting helper, agent APIs and compliance rules are unchanged. Validation: 253 focused reporting/conformance tests passed; all five findings from the previous CI artifacts are retained; pre-commit passed with the private catalog unavailable.

Signed-off-by: Arnab Dhara <[email protected]>

* refactor(partner_if): reuse single_agent_turn for recorded replay

Move bounded verifier-directed activations into the existing single-agent environment and use its typed episode protocol through the dispatcher. Keep ordering decisions and immutable capture checks in partner_if, preserving saved-prefix reuse, scoped evidence, and grading bindings.

Validate with 2323 targeted tests, available pre-commit checks, and one fresh pif_029 evaluation each for Super and Astra. Both executions were healthy and unmasked; private guardword catalog was unavailable locally.

Signed-off-by: Arnab Dhara <[email protected]>

* fix(partner_if): install ripgrep in CI test environments

Declare the pinned replay search dependency in the isolated Resources component and provision system ripgrep through the shared CI setup for core integration tests. Preserve startup validation and keep root package metadata and unrelated component locks unchanged.

Validated with 2,585 regression tests, clean-PATH resource and core integrations, six installer tests, lock freshness checks, and all available pre-commit hooks. The private guardword catalog was unavailable locally.

Signed-off-by: Arnab Dhara <[email protected]>

* refactor(partner_if): run replay within the existing Gym lifecycle

Move the bounded prefix loop into the response agent and retain trusted review receipts in PartnerIF Resources. Restore stock single_agent_turn and server-runtime types, keep continuation controls out of actor input, and validate the ordinary lifecycle with local HTTP integration tests.

Signed-off-by: Arnab Dhara <[email protected]>

* refactor(partner_if): reuse stock agents and Prime lifecycle

Run recorded-context tasks with the stock Gymnasium agent and move frozen
simulation, Explore, ordering checks and call budgets into PartnerIF Resources.
Remove the dedicated agent and replay protocol, isolate ordinary grading,
and keep the existing Gym core and Environment Servers unchanged.

Reuse Prime session installation and lifecycle, restrict sandbox provider
configuration to nemo, pin task wheels, and align deadlines and concurrency.
Mask tool-schema recursion failures and retain supported recursive schemas.
Refresh documentation and remove the obsolete validation history.

Component and supplemental regressions and pre-commit pass. The real pif_029
Astra smoke passed. Prime live pairing/reproducibility, latest-main integration,
and dataset publication/repinning remain explicit merge requirements.

Signed-off-by: Arnab Dhara <[email protected]>

* fix(partner-if): pin published dataset 2.1.8

Signed-off-by: Arnab Dhara <[email protected]>

* refactor(partner-if): finish Prime session lifecycle

Signed-off-by: Arnab Dhara <[email protected]>

* fix(prime): lock shared runtime dependency installation

Signed-off-by: Arnab Dhara <[email protected]>

* fix(prime_agent): include cache writes in prompt usage

Signed-off-by: Arnab Dhara <[email protected]>

* fix(partner_if): address grading and replay review findings

Validate advertised tool schemas for empty responses, release recorded-context state on checkpoint retirement, and preserve empty search input.

AGA job 2098260 passed 738 PartnerIF tests. With Astra as policy and judge, 75 rollouts per revision on the same 25 tasks gave 82.67% to 84.00% full IF pass and 92.72% to 92.80% partial IF credit, with zero exclusions after rerunning the five simulated-tool tasks through OpenSandbox on both revisions. All nine rollouts on the three added tasks scored 1.0.

Signed-off-by: Arnab Dhara <[email protected]>

* fix(partner_if): retain scoped grading and interrupted delivery evidence

Keep independent IF grading available when a completion-only tool registry is invalid. Normalize recorded probe options, reject virtual file and directory collisions before writes, and recover already delivered Prime reports from the SDK journals after confirmed supervisor interruption.

AGA job 2102039 passed 752 PartnerIF and 168 Prime tests, including four real Linux supervisor interruption cases. AGA job 2101999 scored 1.0 on each of pif_027, pif_028, and pif_029, with three healthy rollouts and zero containers remaining.

Signed-off-by: Arnab Dhara <[email protected]>

* fix(partner_if): keep rejected shell commands from changing replay state

Signed-off-by: Arnab Dhara <[email protected]>

* fix(partner_if): handle recorded shell and parser edge cases

Signed-off-by: Arnab Dhara <[email protected]>

---------

Signed-off-by: Arnab Dhara <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI workflows, test routing, and repository automation ci CI, automation, test queue, or workflow infrastructure work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants