Skip to content

feat(eval): run a benchmark config that names a Harbor target - #5794

Merged
weijiac0619 merged 14 commits into
mainfrom
weijiac/n4p0-harbor-benchmark-target
Nov 13, 2026
Merged

weijiac0619 merged 14 commits into
mainfrom
weijiac/n4p0-harbor-benchmark-target

Conversation

@weijiac0619

@weijiac0619 weijiac0619 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

What and why

A benchmark config can now hand gym eval prepare --benchmark and gym eval run --benchmark to a Harbor target. It does this by setting harbor_target, which can be a task folder, a committed entry under environments/harbor/, or a harbor: reference. The config also defines one agent instance: the harness the benchmark runs by default, with its benchmark settings.

The run is the target's run, the one gym eval run <target> --agent ... already makes:

  • the same per-taskset Harbor environment server, rows, run config and outputs;
  • --sandbox, --only-tasks, --exclude-tasks and --skip-unloadable apply as they do for a target.

Why: Harbor-format task sets (Terminal-Bench 4.0 in environments/harbor/terminal_bench_4, TB 2.1, SkillsBench) run through the Harbor environment server only as a positional target today. A benchmark preset cannot point at that server, because the server's config block (task folder, task digests, rows) is generated at prepare time. As a result, no --benchmark name runs on the Harbor environment server yet. This change lets a preset keep its --benchmark name while moving onto that server. The first user is terminal_bench_4/miniswe in the stacked PR.

What changes:

  • nemo_gym/data/tasks/harbor/prepare.py: harbor_benchmark(config_path) reads a config's harbor_target and its one agent instance.
    • It checks the config together with every config it includes, merged as the run merges them. It refuses an empty target, more or fewer than one agent instance, an agent instance that sets _inherit_from, and any other resources or environment server instance, which would start beside the taskset's.
    • The other top-level keys of the config and the configs it includes travel with the selected agent as benchmark_settings (keys only the harness's shipped config sets stay with that harness; an included Harbor-backed preset, which also defines the agent, is a benchmark config, so a variant that includes it keeps its settings): the shipped harbor_environment_server instance's settings (for example a longer episode bound), builds: and sandbox blocks, and the keys they interpolate. build_run writes them to benchmark_settings_<agent>.yaml beside the run config and loads it after the server's own config (harbor.yaml) and the sandbox provider's, which would otherwise override them, and before user overlays.
  • nemo_gym/cli/main.py, nemo_gym/cli/eval.py: with no positional target, gym eval run and gym eval prepare check whether the selected benchmark names a Harbor target and, if so, delegate to the target path.
    • By default the benchmark's own agent instance is the harness. build_run loads the benchmark config for the run, so the benchmark's harness settings apply.
    • --agent-type NAME[/FLAVOR] swaps in that harness's shipped config instead, without the benchmark's harness settings. The benchmark's settings for the Harbor environment server, such as its episode bound, still apply. The dataset's [gym] allowed_agents is checked at prepare, as for any target.
    • --agent is refused with a message, since it names the harness of a positional target and would otherwise silently lose to the benchmark's.
    • --sandbox, --only-tasks, --exclude-tasks, --skip-unloadable and --agent-type apply to gym eval run --benchmark. gym eval prepare --benchmark registers none of them: it writes every task's rows for the benchmark's own harness.
    • A config whose includes set harbor_target while the file itself does not (a variant of a Harbor-backed preset) is refused with a usage error, and gym eval run --config <Harbor-backed preset> is refused before plain collection would start its bare agent.
    • The configs the CLI loaded to make the choice are dropped from the collection overrides, so only one agent instance reaches the run config.
    • Preparation runs before the run config exists, so its overrides load the benchmark config first, below every --config overlay and command-line override: the preset's builds:, sandbox, Compose overlay and pairing settings reach prepare_target.
    • A malformed benchmark YAML is a usage error, not a traceback.
    • The prepare step of run_target moved unchanged into _prepare_for_agent, which gym eval prepare reuses.
  • nemo_gym/environment/manifest.py, validation.py: manifests gain an optional harbor_target, mirrored from the config like the other composition fields. _resolve_config_wiring, which manifest validation and gym list environments share, selects a Harbor-backed config's agent instance. The environment catalog carries the manifest's harbor_target, so inspecting a Harbor-backed entry (gym list benchmarks <name>) shows a gym eval run example instead of gym env start, which does not compose its Harbor environment server.
    • With it, datasets is empty (the rows are the target's tasks) and prompt_source is prepared or agent. Without it, datasets is required and non-empty as before. The JSON schema and the model agree.
    • Validation resolves the config's agent as the generated run binds it (with the same per-harness overrides build_run applies, so Terminus's composition-only resources_server.name is cleared) and its model. It checks that the target names an entry, an existing directory or a well-formed harbor: reference, without fetching.
  • Docs: the Harbor page under agent interactions (a new section, "A benchmark config that names a target", after "Harnesses"), the CLI reference (gym eval run and "Swapping the agent", which no longer promises that --config and --agent-type are equivalent for a Harbor-backed benchmark) and the manifest field reference and requirements paragraph.

Builds on #5654, now on main. The docs example uses mini_swe_agent/configs/mini_swe_agent_sandboxed.yaml, the session adapter #5654 added, and the TB4 preset stacked on this PR runs it. The CLI code here does not import or depend on mini_swe_agent.

Deliberately left alone:

  • --agent-type composition for benchmarks that compose their own servers.
  • The legacy agent-side resources_server matching.
  • The relay presets.

Relation to the planned CLI agent selection. The planned selection work makes --agent-type select the agent through environment-server bindings. For sandbox benchmarks, agent swapping for Terminal-Bench 2.1 is planned on the Harbor environment server, its main path now. That server already takes the agent from config and owns the task sandbox and grading. So keeping the tasks and verifier while changing only --agent-type should pair the Harbor environment server with the chosen session agent, not the TB 2.1 resources server with single_agent_turn. SWE families keep the resources-server contract.

This PR is that path. gym eval run --benchmark <harbor-backed> --agent-type <session agent> generates the per-taskset Harbor environment server bound to the selected harness. --agent-type only picks that harness's config, so no second composer is added. Nothing is specific to TB4: a TB 2.1 or SkillsBench preset that names its Harbor entry gets the same behavior with no new code. Left to that work:

  • environment-bound selection for benchmarks that compose their own servers;
  • the compatibility inventory;
  • the TB 2.1 preset;
  • qualifying each advertised pairing.

No issue is linked: the work is tracked internally.

Compatibility

  • Other benchmarks: a benchmark config without harbor_target prepares and runs exactly as before. Regression tests pin the dispatch target and overrides for gym eval run --benchmark and gym eval prepare --benchmark.
  • Positional targets: gym eval run <target> --agent <harness> is unchanged.
  • Manifests: manifests without harbor_target validate and dump as before. The new field is omitted when unset.
  • Refusals for a Harbor-backed benchmark:
    • combined with a second --benchmark (its run config binds one taskset);
    • gym eval plan (it points to gym eval prepare --benchmark and gym dataset validate);
    • gym eval prepare reached through --config instead of --benchmark;
    • --no-serve, as for any target.

Validation

Unit tests

At 2fa8b5b0 (this branch with main at acb67734 merged in), Linux, Python 3.13:

  • pytest tests/unit_tests/cli/test_eval_harbor_benchmark.py tests/unit_tests/environment/test_environment_manifest.py tests/unit_tests/environment/test_environment_validation.py: 279 passed.
  • pytest tests/unit_tests/cli: 674 passed.
  • pytest tests/unit_tests/environment: 626 passed.
  • pytest tests/unit_tests/test_public_api_facades.py tests/unit_tests/test_public_api.py tests/unit_tests/test_moved_paths.py: 1026 passed.
  • pytest tests/unit_tests/data/tasks/harbor: the same 6 failures and 31 errors as on main, from optional dependencies missing in the test environment (for example jinja2). No new failures.

At b0bf428d (the review fixes, on this branch's merge of main at 0dc9f549), same environment:

  • pytest tests/unit_tests/cli tests/unit_tests/environment: 1320 passed.
  • pytest tests/unit_tests/test_public_api_facades.py tests/unit_tests/test_public_api.py tests/unit_tests/test_moved_paths.py: 1061 passed.
  • pytest tests/unit_tests/data/tasks/harbor: the same failing test IDs as on main (6 failures, 31 errors), from the test environment.

At 5f5cbe23 (main at f26664c7 merged in, with no conflicts) and on the stacked TB4 PR's 0e3e499b, same environment: pytest tests/unit_tests/cli tests/unit_tests/environment 1322 passed, the public API tests 1061 passed, the Harbor directory has the same failing test IDs as above, and pre-commit run --from-ref main passes.

At fc63175f (the second review's fixes, on this branch's merge of main at b2a27913), same environment:

  • The three Harbor benchmark test files: 316 passed.
  • pytest tests/unit_tests/cli tests/unit_tests/environment: 1352 passed.
  • The public API tests: 1142 passed. pytest tests/unit_tests/rollouts: 2771 passed.
  • pytest tests/unit_tests/data/tasks/harbor: the same failing test IDs as on main (6 failures, 31 errors), from the test environment.
  • pre-commit run on the changed files: passed.

At 3c938cec (the included-preset and inspect fixes), same environment:

  • The three Harbor benchmark test files: 319 passed.
  • pytest tests/unit_tests/cli tests/unit_tests/environment: 1358 passed.
  • The public API tests: 1142 passed.
  • pytest tests/unit_tests/rollouts: 2767 passed, 4 failed. The 4 are subprocess-timing tests (collection never started within 30 s on a loaded login node). None of them reaches the changed code, and all 2771 passed at fc63175f.
  • pytest tests/unit_tests/data/tasks/harbor: 5 failures, all compose_overlay tests that need jinja2, a subset of main's failing test IDs.
  • ruff format changed three of the commit's files, which the local hook run missed. 30fd6831 applies it with no other change, and pre-commit run --from-ref main passes there.

New tests cover:

  • the config reader: target, agent instance (also from an include alone), the benchmark's settings, and each refusal, including an _inherit_from instance and a server an included config defines;
  • preparation: a preset's builds: {enabled: false} reaches prepare_target for gym eval run and gym eval prepare, with the benchmark's harness, with --agent-type and with the oracle (harbor_oracle_agent, through validate_target), and a --config overlay or ++ override still wins;
  • settings from an included config: an included episode bound (interpolated from a key in the same include) wins in the run's merged config under both harnesses, and a key only the harness's shipped config sets does not travel;
  • a variant that repeats harbor_target and includes a Harbor-backed preset keeps the preset's settings: its episode bound (54000 s) wins in the run's merged config under both harnesses;
  • the inspect view's example: gym eval run --benchmark for a Harbor-backed benchmark, gym eval run <target> --agent for a Harbor-backed environment, gym env start otherwise;
  • refusals: a variant that only includes harbor_target (for run, prepare and validation), gym eval run --config <Harbor-backed preset> with and without --no-serve, a malformed include as a usage error, and dataset_owner with a Harbor target;
  • the environment-manifest schema rule: no harbor_target and datasets: [] is refused by pydantic and the JSON schema;
  • an interpolated server setting (${episode_bound}) resolves with either harness, and a later overlay still wins;
  • manifest validation with mini_swe_agent and with Terminus, the catalog lookup for both, and malformed or non-directory targets;
  • malformed benchmark YAML as a usage error;
  • the benchmark's server settings in the run's merged configuration: the run's config files, merged in Gym's order, give the benchmark's episode bound (54000 s) over the server's default, with the benchmark's harness and with --agent-type. At fd0aabb0 this test fails with 21600;
  • gym eval run --benchmark delegation, task selection, and refusal of a second benchmark;
  • the --agent-type swap and the --agent refusal, at preparation;
  • removal of the CLI-loaded configs from the overrides;
  • gym eval prepare --benchmark delegation, with the unchanged path for other benchmarks;
  • the gym eval plan and gym eval prepare refusals;
  • manifest rules (pydantic and JSON schema), mirroring and target resolution.

Real runs

Source: this branch with the stacked TB4 preset applied (8bbad052), using the same model, sandbox deployments and vLLM endpoint as the comparison in the TB4 PR. At that commit the preset ran miniswe_sandboxed_agent; the TB4 PR now runs mini_swe_agent and reports its own runs.

The run was:

gym dataset pull terminal_bench_4
gym eval run --benchmark terminal_bench_4/miniswe --sandbox opensandbox \
  --config environments/harbor/terminal_bench_4/harbor_sandbox.yaml --config <deployment overlay> \
  --only-tasks wal-recovery-ordering,medical-claims-processing ++tb4_agent_max_timeout_sec=900

Results:

  • --benchmark handed off to the target path. Gym generated harbor_terminal_bench_4_environment for the selected agent, miniswe_sandboxed_agent from the benchmark config.
  • No gym eval prepare step was needed.
  • The resolved config carries the benchmark's harness settings (500 steps, 30 s per command, the 900 s cap from the override).
  • Correction: the resolved 54000 s episode bound came from the deployment overlay, which sets the same value. Without the overlay, the server's own default (21600 s) overrode the benchmark's setting at fd0aabb0, because harbor.yaml loads after the benchmark config. f213f767 fixes this. With the fix, build_run plus Gym's config parser on the TB4 preset, with no deployment overlay, gives 54000 s, both with its own harness and with --agent-type hermes_agent.
Task Reward Tests mini-SWE exit Model calls Time
wal-recovery-ordering 0 89/97 completed 23 287 s
medical-claims-processing (Compose, MCP) 0 1/1 completed 62 868 s

Both rollouts were measured: 0 failed, 0 masked. The --agent-type swap is covered by unit tests only.

Checks

  • pre-commit run --files <changed files>: passed, no files modified.
  • DCO sign-off and GPG signature on each commit.

Known limits

  • gym eval plan does not plan a Harbor-backed benchmark. gym list benchmarks lists it through its manifest, which sets the same harbor_target.
  • Only gym eval run --benchmark runs a Harbor-backed benchmark (and gym eval prepare --benchmark prepares it, for its own harness and every task). gym env start, gym env prefetch, gym eval reverify and gym eval submit do not compose its Harbor environment server.
  • No preset in this PR uses harbor_target yet; the first one (Terminal-Bench 4's mini-SWE preset) is to land with or after it.
  • --agent-type on a Harbor-backed benchmark uses the selected harness's shipped config. A benchmark that needs different settings per harness needs its own config per harness.

🤖 Generated with Claude Code

A benchmark config may set `harbor_target` (a task folder, a committed entry
under environments/harbor/, or a harbor: reference) and define the one agent
instance the benchmark runs. `gym eval prepare --benchmark` and
`gym eval run --benchmark` then run that target as `gym eval run <target>`
does, with the benchmark's harness and its settings. `--agent-type` swaps in
another harness's shipped config; the dataset's allowed_agents still decides at
prepare. `--agent` is refused rather than ignored.

Manifests gain an optional `harbor_target`, mirrored from the config; with it
`datasets` is empty and validation checks the target resolves without a fetch.
Benchmarks that compose their own servers prepare and run as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>
@copy-pr-bot

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

@svcnvidia-nemo-ci svcnvidia-nemo-ci added feature New capabilities, enhancements, or enablement work area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters labels Nov 7, 2026
weijiac0619 and others added 2 commits November 7, 2026 22:42
…server defaults

A benchmark config that names a Harbor target may set the shipped
harbor_environment_server instance's settings, such as a longer episode bound.
build_run loaded the server's own config (harbor.yaml) after the benchmark
config, so the server defaults won: terminal_bench_4/miniswe's 54000 s episode
bound resolved to 21600 s. With --agent-type the benchmark config is not loaded
at all, so its server settings were dropped too.

The settings now travel with the selected agent as server_settings, for the
benchmark's own harness and for one --agent-type swaps in. build_run writes them
to server_config_<agent>.yaml beside the run config and loads it after
harbor.yaml. A test merges the run's config files in Gym's order and checks the
benchmark's episode bound wins with both harnesses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>
main split the manifest resolver: `_resolve_config_wiring` now picks a
config's agent and resources server for both manifest validation and
`gym list environments`. The `harbor_target` handling moves into it, and
`_ConfigWiring` carries the target to the manifest composition.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>
@weijiac0619
weijiac0619 marked this pull request as ready for review November 9, 2026 21:26
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team November 9, 2026 21:27
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

@svcnvidia-nemo-ci svcnvidia-nemo-ci 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.

SHIP WITH CARE — I found six RISK findings in configuration preparation, run composition, and manifest validation, plus three smaller NOTEs.

I reviewed all 11 changed files and traced the affected CLI, config-loading, inheritance, server-startup, and catalog paths. The main concern is that the benchmark configuration is interpreted differently during preparation, collection, and static validation. The findings below include repair requirements and preservation checks.

This was a read-only source review. I didn't execute tests or independently verify the PR-reported runs; all proposed regression checks are unexecuted.


Inline comments (escaped v1):

  • nemo_gym/cli/eval.py line 1806: RISK — Keep the benchmark's preparation settings available before collection.

    Removing the benchmark config here also removes settings needed before build_run reloads it. For example, add builds: {enabled: false} to a Harbor-backed preset and run gym eval run --benchmark tb. _prepare_for_agent receives no benchmark config, so build_options_from_overrides returns enabled=True and preparation can build images despite the preset disabling builds. The same omission affects preset-defined Compose overlays, provider settings, volume mappings, registry credentials, and pairing waivers. See the preparation readers and their config sources. Reloading these settings during collection is too late.

    Could you separate preparation inputs from collection overrides? Keep removing duplicate agent/benchmark configs from collection overrides, but make run, prepare, and oracle preparation read the applicable benchmark settings below explicit deployment overlays and CLI overrides. With an agent swap, retain those environment/preparation settings without restoring the original agent. The invariant is that preparation checks and records the environment the runtime will start. Simply retaining the benchmark in every override list would reintroduce the second-agent problem; I haven't established a safe small patch for this separation.

    Proposed acceptance: with no overriding deployment config, assert that public run and prepare pass BuildOptions(enabled=False) for that preset; assert that a preset Compose overlay reaches preparation and its images are recorded. Repeat with an agent swap, and verify explicit overlay/CLI values still win. Retain the existing duplicate-config removal and 54000-second server-bound assertions for both harnesses. These checks weren't executed.

  • nemo_gym/data/tasks/harbor/prepare.py line 1001: RISK — Flatten an inherited benchmark agent before inheriting it again.

    A benchmark can include the shipped mini-SWE config and declare tb_agent: {_inherit_from: miniswe_sandboxed_agent, responses_api_agents: {miniswe_sandboxed_agent: {harness: {step_limit: 123}}}}. This passes harbor_benchmark and follows the existing named-instance convention.

    build_run then makes the generated taskset agent inherit tb_agent. The swap helper copies that source from the frozen, unresolved tree and doesn't recurse after the swap. The generated agent retains _inherit_from: miniswe_sandboxed_agent and lacks the shipped entrypoint, so full config validation cannot bind the Harbor environment to it. The intended result is one fully configured agent running the generated rows.

    Could you resolve the selected benchmark instance's included defaults and inheritance before writing the standalone source that the generated agent inherits? Consume its templates rather than loading a partially resolved source into this second inheritance step. Keep this correction in the Harbor composition path unless the generic swap contract is separately verified; I haven't established a safe small replacement patch.

    Proposed acceptance: fully parse a generated run for the tb_agent setup and assert exactly one agent remains, with entrypoint: app.py, harness.step_limit == 123, the generated rows dataset, and the Harbor server's agent reference. Preserve the same-name mini-SWE and swapped-Hermes cases, the 54000-second bound, and the positional-target full-config assertions. These are source-derived checks, not executed results.

  • nemo_gym/data/tasks/harbor/prepare.py line 978: RISK — Check included configs for additional live servers.

    This refusal inspects only the immediate YAML mapping, while the accepted benchmark's config_paths are loaded recursively. Take the documented mini-SWE preset and add an included YAML containing extra_verifier: {resources_servers: {example_single_tool_call: {entrypoint: app.py, domain: agent}}}. The reader accepts it, and the default-harness run starts that resources server beside the generated Harbor server: startup enumerates every configured server, not only the taskset route.

    That bypasses the new explicit refusal and can start unrelated services or fail the run during their setup. Could you validate the effective include closure for additional resources/environment instances before task preparation? Preserve the selected agent's included defaults and the allowed harbor_environment_server settings overlay. Account for consumed inheritance templates rather than rejecting all includes or treating templates as additional live instances. The resolver arrangement needs verification, so I haven't supplied a speculative patch.

    Proposed acceptance: the included extra_verifier example must receive the same actionable refusal as a directly declared extra server, before preparation/startup, including when --agent-type is supplied. The ordinary mini-SWE include with a 54000-second Harbor overlay must still produce only the selected generated agent, Harbor server, and selected model. Retain the existing direct refusal cases. Tests weren't executed.

  • nemo_gym/data/tasks/harbor/prepare.py line 1095: RISK — Carry interpolation inputs with server settings when swapping agents.

    Define episode_bound: 54000 in a benchmark and set harbor_environment_server.environment_servers.harbor.default_episode_timeout_seconds: ${episode_bound}. The default-harness run loads the benchmark and can resolve the value. With --agent-type hermes_agent, selection drops the benchmark config but copies its raw server_settings. This file now contains ${episode_bound} without the key supplying it, so config resolution fails instead of preserving the benchmark's server bound.

    Could you carry the effective Harbor settings with their required interpolation inputs, or selectively resolve those settings against the benchmark's effective configuration before writing the overlay? Don't restore the benchmark's original agent to a swapped run or eagerly resolve unrelated model placeholders. Later deployment overlays, env.yaml, and CLI values must retain their precedence. I haven't established a safe small patch for selecting those dependencies.

    Proposed acceptance: fully parse this interpolated preset with its own harness and with Hermes; both generated Harbor servers must resolve the bound to 54000 and leave exactly one agent. A later user overlay must still change it to 60000. Preserve the literal-bound assertions and the existing overlay/default assertions. These checks weren't executed.

  • nemo_gym/environment/validation.py line 253: RISK — Normalize Harbor's agent before standalone composition validation.

    A Harbor preset using the shipped Terminus config is runnable but cannot pass manifest validation. Adapt the new Harbor fixture to include responses_api_agents/terminus_2_sandboxed_agent/configs/terminus_2_sandboxed_agent.yaml, declare that one agent instance with an empty implementation override, and mirror it in the manifest. Its shipped config intentionally leaves resources_server.name: ???. The generic parser runs before this Harbor branch, so compose_unbound_agent raises because there's no second agent to rehost. Catalog wiring resolution also falls back.

    The runtime handles this through AGENT_OVERRIDES, applied by build_run, which clears that resources binding on the generated session agent.

    Could you identify Harbor wiring before generic composition validation and share the required agent normalization with build_run? Static resolution must inspect the agent as the generated Harbor run binds it, while keeping mirrored datasets empty. A blanket parser relaxation or clearing resources bindings on ordinary configs would break their composition contract; I haven't established a safe complete patch for this integration.

    Proposed acceptance: this Terminus fixture should validate with datasets == (), select Terminus and policy_model, and make resolve_config_servers return (None, "terminus_2_sandboxed_agent"). Preserve the mini-SWE Harbor assertions, ordinary unbound-agent errors, resource-backed routing, and dataset_owner selection. Checks weren't executed.

  • nemo_gym/environment/validation.py line 747: RISK — Validate the target's reference syntax and filesystem type.

    Set the new Harbor fixture's target to harbor:. Static validation succeeds because is_hub_ref checks only the prefix, but running the benchmark fails in HubRef.parse. An existing regular file also passes this condition, although task discovery requires a directory. Both cases receive false successful validation.

    Could you add HubError and HubRef to the local hub import and replace this acceptance branch with:

    if is_hub_ref(target):
        try:
            HubRef.parse(target)
        except HubError as error:
            raise EnvironmentValidationError(str(error)) from error
        return
    if entry_target(target) is not None or Path(target).expanduser().is_dir():
        return

    Keep the existing error below it. This aligns validation with runtime reference syntax without fetching or loading tasks.

    Proposed acceptance: reject harbor:, harbor:org/name/extra, and a temporary regular-file target. Continue accepting valid registry/package references, an unpulled committed entry, and an existing empty directory without fetching. Retain the existing empty-directory assertion; full task loading is not needed here. This suggested patch and these checks weren't executed.

  • nemo_gym/cli/main.py line 809: NOTE — Suggestion: retain clean errors for malformed benchmark YAML.

    Both gym eval run --benchmark bad and gym eval prepare --benchmark bad now probe the file with yaml.safe_load before normal dispatch. A file containing config_paths: [ raises yaml.YAMLError, which this handler doesn't catch, so the commands print a traceback. Previously the normal loader translated YAML errors into a file-specific ConfigError.

    A small correction in _harbor_benchmark is to import YAMLError locally and include it in the handler:

    from yaml import YAMLError
    
    try:
        return harbor_benchmark_from_args(args)
    except (ValueError, OSError, YAMLError) as exc:
        args._parser.error(str(exc))

    Preserve the existing handling of invalid targets, missing configs, and multiple benchmark selection. Proposed acceptance: invoke both public commands with malformed YAML and assert a nonzero usage/config error containing the YAML diagnostic but no traceback; valid ordinary and Harbor benchmarks must retain their dispatch targets. The patch is a source-derived suggestion, not an executed result.

  • fern/versions/latest/pages/reference/cli-commands.mdx line 126: NOTE — Suggestion: qualify the selector-equivalence claim for Harbor presets.

    The unconditional claim that --agent-type and --config behave identically is no longer true. With a Harbor preset, _benchmark_agent uses args.agent_type to select the replacement harness. Loading the Hermes config through --config leaves that selector unset, so the benchmark's original harness remains selected and the extra config remains an overlay. The paragraph added below doesn't retract this earlier promise.

    Replace the equivalence sentence with: “For benchmarks that compose their own servers, these selectors are pure shorthand, so --agent-type terminus_2_sandboxed_agent and --config <that file> behave identically. For a Harbor-backed benchmark, use --agent-type to swap the harness; loading an agent config with --config does not select it.”

    Static acceptance: retain the ordinary composition explanation and --no-serve restriction, but don't promise selector equivalence for Harbor-backed benchmarks.

  • fern/versions/latest/pages/contribute/environments/new-environment.mdx line 460: NOTE — Suggestion: qualify the remaining unconditional dataset requirements.

    The new field table correctly permits empty Harbor datasets, but this paragraph still says every profile needs a dataset and every benchmark needs a benchmark dataset with prepare_script. Following it for a Harbor preset produces a manifest rejected by the new model contract.

    Replace the paragraph with:

    Every profile declares resources_server and agent_server. Without harbor_target, it also declares at least one dataset. If the workload has no resources server, profiles other than custom-gym-verifier may explicitly declare resources_server: null. rollout_driver is valid only for external-rollout-driver. Every benchmark requires canonical_split; a benchmark without harbor_target additionally requires at least one benchmark dataset with prepare_script. A Harbor-backed manifest instead has empty datasets and uses prompt_source: prepared or agent.

    Static acceptance: this paragraph and the field reference must describe the same Harbor/non-Harbor cases, preserving non-Harbor dataset requirements and the canonical-split requirement for both.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

# benchmarks/my_benchmark/config.yaml
harbor_target: terminal_bench_4
config_paths:
- responses_api_agents/miniswe_sandboxed_agent/configs/miniswe_sandboxed_agent.yaml

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.

this needs to be careful, sandboxed_agent is not compatible with multiharness

@weijiac0619 weijiac0619 Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Two things from cross-checking.
EFB runs this benchmark submits config paths through gym eval submit, which forwards only overrides to gym eval prepare / gym eval run. Neither harbor_target nor a positional Harbor target is reachable from it today. It still loads terminal_bench_4/miniswe.yaml on the /run path with the TB4 resources-server knobs (tb4_concurrency, tb4_split_sandbox_endpoints, tb4_jobs_dir), and it tracks Gym main, so replacing the preset in place (#5697) would break it on its next bump. GYMINT-229’s work items (point the preset at the Harbor server → compare rewards → retire /run) don’t cover EFB yet.

The Harbor path itself has been on main since #3746/#3745. gym eval run terminal_bench_4 --agent <harness> already runs TB4 with the harness chosen at run time. Only the preset is still on the relay.

On your comment: do you mean that a benchmark preset shouldn’t pin miniswe_sandboxed_agent’s own harness: settings as the default, since they don’t carry over when --agent-type swaps in another harness? Or something about the sandboxed agent’s session path itself?

Question for GYMINT-229 / the P0 row: what should “migrated” mean for TB4 right now?

  1. The config EFB runs today stops using the relay. The only way without new submit support is single_agent_turn_legacy with the TB4 resources server lending its sandbox, which is the path GYMINT-229 moved away from on 11/03.
  2. TB4 moves to the Harbor server, with /run retired once the consumer can follow. Then I’d follow the SkillsBench pattern (#5699):
    park this PR;
    keep miniswe.yaml on /run, marked deprecated;
    shrink feat(terminal_bench_4): run the mini-SWE preset on the Harbor environment server and keep the relay preset as miniswe_legacy_agent #5697 to the nextjs-performance override in dataset.toml (with its test), docs, and the reward comparison;
    switch the preset once gym eval submit can run a Harbor target.

Which do you have in mind?

@weijiac0619
weijiac0619 removed request for a team November 10, 2026 06:31
weijiac0619 and others added 6 commits November 10, 2026 14:35
Main moved the Harbor task-folder guide under data/task-folders/ and the
Harbor run docs to agent-interactions/harbor.mdx. The "benchmark config
that names a target" section moves there, after Harnesses, and the CLI
reference links to its new anchor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>
Brings in #5654's mini_swe_agent agent sessions (0dc9f54), which the TB4
preset stacked on this branch runs and the docs example names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>
…settings

Preparation runs before the run config exists, and it read only the
overrides left after the benchmark config was dropped, so a preset's
builds:, sandbox, Compose overlay, volume, registry and pairing settings
never reached it. Preparation now loads the benchmark config first, below
every --config overlay and command-line override; collection keeps the
de-duplicated overrides.

The benchmark's own top-level keys besides its agent instance now travel
as benchmark_settings (not only the Harbor server block), loaded after the
server's and the sandbox provider's configs, so a harness --agent-type
swaps in keeps them and the keys they interpolate.

harbor_benchmark checks the config's include closure for the agent count
and for extra resources or environment servers, and refuses an agent
instance that sets _inherit_from. A malformed benchmark YAML is a usage
error rather than a traceback. Test fixtures use mini_swe_agent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>
…its agent

Static resolution applies the same agent overrides build_run applies to
the generated agent, so a harness whose shipped template leaves
resources_server.name for benchmark composition (Terminus) validates.
The catalog lookup reports no resources server for a Harbor-backed
config. A harbor: target must parse as a hub reference, and a local
target must be a directory.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>
…nifest

The Harbor section lists the settings a benchmark config carries and
when they apply, the CLI reference no longer promises --config and
--agent-type are equivalent for a Harbor-backed benchmark, and the
manifest paragraph matches the field reference's Harbor cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>
weijiac0619 and others added 2 commits November 12, 2026 14:01
…s the run cannot honor

- benchmark_settings now come from the benchmark config with the configs it
  includes, minus its agent instance and keys only the harness's shipped
  config sets, so an included episode bound or builds block reaches the run
  as it reaches preparation, also with --agent-type.
- A config whose includes set harbor_target while it does not is refused
  with a usage error, and `gym eval run --config <Harbor-backed preset>` is
  refused before plain collection starts its bare agent.
- A malformed included config (ConfigError) is a usage error, not a traceback.
- Validation drops an unreachable condition.
- Tests: included settings under both harnesses, variant and --config
  refusals, a malformed include, the oracle's preparation settings, the
  environment-manifest datasets schema rule, and the dataset_owner and
  include-only target validation branches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>
… list benchmark_settings_<agent>.yaml

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team November 12, 2026 22:05
@weijiac0619

Copy link
Copy Markdown
Contributor Author

/ok to test fc63175

@weijiac0619
weijiac0619 requested a review from adil-a November 13, 2026 00:09
…w a gym eval run example for it

A variant that repeats harbor_target and includes a Harbor-backed preset lost the preset's
benchmark settings: the preset also defines the agent instance, so it was read as the harness's
shipped config and its server settings (the episode bound) fell back to the server's default.
A config that sets harbor_target is now a benchmark source; only configs that define the agent
without a target are harness configs.

The environment catalog carries the manifest's harbor_target, so inspecting a Harbor-backed entry
shows a `gym eval run` example instead of `gym env start`, which does not compose its Harbor
environment server. The Harbor page now says `gym list benchmarks` lists such a benchmark through
its manifest.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>
yaoyu-33
yaoyu-33 previously approved these changes Nov 13, 2026
@yaoyu-33
yaoyu-33 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/43484408635

@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/43485864955

@weijiac0619
weijiac0619 removed this pull request from the merge queue due to a manual request Nov 13, 2026
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team November 13, 2026 19:05
…hanges

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: weijia chen <[email protected]>
@weijiac0619

Copy link
Copy Markdown
Contributor Author

/ok to test 30fd683

@weijiac0619
weijiac0619 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/43498428020

Merged via the queue into main with commit 9e2e5d0 Nov 13, 2026
63 checks passed
@weijiac0619
weijiac0619 deleted the weijiac/n4p0-harbor-benchmark-target branch November 13, 2026 20:21
weijiac0619 added a commit that referenced this pull request Nov 14, 2026
…into the TB-Science preset

Signed-off-by: weijia chen <[email protected]>
weijiac0619 added a commit that referenced this pull request Nov 14, 2026
yuhezhang-ai added a commit that referenced this pull request Nov 16, 2026
main added harbor_target (#5794): a Harbor-backed manifest declares no
datasets, and its rows are the target's tasks. A setup is compared with
its target by task datasets, so two Harbor-backed manifests always
matched, and a setup could run another Harbor target than the benchmark
it names. Validation now also requires the same harbor_target.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
aiden200 pushed a commit to aiden200/Gym that referenced this pull request Nov 24, 2026
…DIA-NeMo#6098)

* feat(environment): link setups and protocols to their manifest and add selection fields

A named config is often a variant of another workload: the same tasks run
with another harness or runtime (a setup), or a benchmark's tasks scored
under another prompt, tools or scoring (a protocol). Manifests had no way to
say so, so a catalog could not group variants or tell which scores compare.

Add optional `setup_of` and `protocol_of` fields. A manifest declares at most
one of them, only benchmarks declare `protocol_of`, and a manifest cannot
name itself. Validation loads the named manifest from the same catalog
directory and checks that it exists, has the same kind and is not itself a
setup; a protocol does not name another protocol. A setup must also run the
same task datasets, resources server and grading mode as the manifest it
names. A setup may name a protocol, so one result can carry its environment,
protocol and setup.

Add optional selection fields: `maintainers` (GitHub logins),
`intended_use`, `training_allowed`, `overlaps_with`, `primary_metric` and
`requirements` (`gpu`, `internet`). Every new field defaults to None and is
omitted when dumped, so existing manifests are unchanged.

Refs NVIDIA-NeMo#1520

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* fix(environment): check prompt templates and declared names in links

Review of setup and protocol links found two gaps:

- A config that kept the tasks and scorer but changed the benchmark's
  prompt template validated as a setup. For example,
  arxivmath_0626/config_with_system adds a system prompt and passed as a
  setup of arxivmath_0626. When both manifests build prompts from
  templates, a setup must now declare the same standard_prompt_config and
  dataset prompt_config. A harness's own instructions are not compared.
- A link written as a path, such as ./demo or an absolute path, resolved
  to a manifest whose declared name differs from the link. A link must
  now be the name the target declares.

The "other task datasets" error now suggests syncing the target first, and
a test covers the example-dataset comparison for environments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* feat(environment): let yes-or-no fields say unknown, and scaffold them

training_allowed and requirements.gpu and requirements.internet could only
be true, false or absent, so an absent value meant either "nobody knows" or
"nobody answered". They now also take an explicit "unknown". A bare YAML
yes or no still reads as a boolean.

New manifests from the scaffold write every selection field, so authors
see them: maintainers (TODO), intended_use from the kind, training_allowed
and requirements as unknown, and primary_metric (TODO) for benchmarks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* fix(environment): reject scaffold placeholders in maintainers and primary_metric

The scaffold now writes maintainers: [TODO] and, for benchmarks,
primary_metric: TODO, but `gym env publish` only checked the older
placeholder fields, so both passed. The publication check now reports
them as placeholders to replace.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* docs(skills): ask authors to fill a manifest's selection fields

The selection fields (maintainers, intended_use, training_allowed,
primary_metric, requirements) are optional in the schema, so nothing asks
authors to fill them. The add-benchmark skill now has a manifest step that
fills each field from what the author knows, asks the user for maintainers
and training_allowed, writes "unknown" when nobody knows, and replaces every
scaffold TODO. The pr-review skill treats a leftover TODO as a finding, and
the benchmark guide lists the fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* docs(skills): integrate manifest completion into onboarding

Signed-off-by: Yuhe Zhang <[email protected]>

* feat(environment): require a setup's training_allowed to match its target's

A setup runs its target's task data, so whether that data may be used for
training cannot differ between them. When both declare training_allowed,
validation now requires the same answer.

Setups and protocols declare their own selection fields rather than taking
them from the manifest they name, so each manifest can be read on its own.
The docs and the add-benchmark and pr-review skills say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* fix(environment): match the TODO placeholder exactly in logins and metrics

`gym env publish` treated any maintainer login or primary_metric that
starts with "todo" as a placeholder, so a real login such as todorov was
rejected. Those fields now match only the scaffold's literal TODO.

The setup training_allowed test again covers a manifest that leaves the
answer out, which stays valid while the field is optional.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* feat(environment): describe a run's network need as a level, not yes or no

requirements.internet (true, false or unknown) could not tell a run that
calls a few named services, such as a search API or a hosted judge model,
from one that needs the open internet. A cluster with restricted egress can
allowlist the first but not the second.

requirements.network takes no-network, allowlist, public or unknown: the
same words as a Harbor task's network_mode. No manifest sets the field yet,
so nothing needs migrating.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* fix(environment): keep setup and protocol links inside the catalog

A link was joined onto the catalog folder as a path, and the only check was
that the manifest found there declares the same string. So `protocol_of:
../outside` validated when a manifest outside benchmarks/ declared
`name: ../outside`. A link must now be written as a plain name in the
catalog: no `..`, no absolute path, no other spelling of the same path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* docs(environment): define training_allowed as held-out status, not licence

The hub's metadata page lists licence ("Can I use it") separately from
training_allowed and overlaps_with ("Can I train on it"). The field and the
skills described training_allowed as a licence question. It now says whether
training on the tasks would invalidate an evaluation: false for a held-out
benchmark, true for training data. overlaps_with names the benchmarks that
training on this environment would invalidate. Licence terms stay in
licensing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* refactor(environment): drop training_allowed from the manifest

Whether a team may train on an environment is that team's policy, not a
property of the environment. Nemotron holds out the benchmarks its eval team
scores, and another team may hold out different ones. A public manifest
should mean the same thing to every reader, and `training_allowed: false`
there would read like a legal restriction.

What a manifest can say for every team stays: each dataset's type (train or
benchmark), overlaps_with (benchmarks that training on this would
invalidate) and licensing. Nemotron's held-out list stays with its eval
team. Removed the field, its scaffold line, the rule that a setup's answer
must match its target's, and their docs and skill guidance.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* fix(environment): require a setup to run its target's Harbor target

main added harbor_target (NVIDIA-NeMo#5794): a Harbor-backed manifest declares no
datasets, and its rows are the target's tasks. A setup is compared with
its target by task datasets, so two Harbor-backed manifests always
matched, and a setup could run another Harbor target than the benchmark
it names. Validation now also requires the same harbor_target.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* feat(environment): add capabilities and domains from EvalBench's lists

A manifest can now say which skills its environment exercises and which
fields of expertise its tasks need, in the terms EvalBench's capability
coverage uses, so Gym, the environment hub and EvalBench describe an
environment with the same words.

- `capabilities` names values from EvalBench's capability taxonomy
  (capability_taxonomy_v0_1), as `<capability>` or
  `<capability>/<specialization>`. The first entry is the main
  capability; its top level is the environment's coarse category in
  listings and charts. Validation does not check this.
- `domains` names values from EvalBench's domain list
  (enrichment_tags_v0_1), main domain first.
- Each is a list, an empty list when none applies, or the whole word
  `unknown`, like `requirements.gpu`. `unknown` inside a list is rejected.
  EvalBench's own `unknown` domain is left out of Gym's copy, so there is
  one way to say "not known".

Only the value lists are copied, into
nemo_gym/environment/evalbench_taxonomy.yaml, which is replaced as a whole
for a new EvalBench version. Validation rejects other values with a
suggestion, and the JSON schema lists the same values. The scaffold writes
both fields as `unknown`. Gym's `domain` field is unchanged.

The add-benchmark skill's "training permission" referred to the removed
training_allowed field; that sentence now lists the selection fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* build: drop the redundant package-data entry for evalbench_taxonomy.yaml

The setuptools-scm file finder already puts every git-tracked file under
nemo_gym/ into the wheel, as it does for the sandbox provider configs. A
wheel built without the entry contains
nemo_gym/environment/evalbench_taxonomy.yaml. Without the entry this PR no
longer changes the root pyproject.toml, so the lock-freshness advisory has
nothing to flag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* refactor(environment): name the capability and domain lists without EvalBench

EvalBench is an internal tool, so a public user cannot look up what an error
such as "not in EvalBench's capability taxonomy" refers to. Rename the lists
file to capabilities_and_domains.yaml and use neutral names in the code,
error messages, docs and skills. The two version keys stay, so the lists can
still be matched to the versions they were copied from.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* refactor(environment): name the environment kind by its enum in the manifest schema

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* refactor(environment): write every requirement in a scaffolded manifest from the model

The scaffold listed gpu and network by hand, so a field added to
ManifestRequirements would be left out of new manifests. Build the value from
the model's fields instead; every field takes "unknown", and the scaffold
validates what it writes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* fix(environment): use one check for scaffold placeholders before publishing

The scaffold writes TODO, or TODO: followed by an instruction. One check for
those two forms replaces the two placeholder functions. The old prefix check
also rejected real values that start with "todo", such as an author written
"Todorov, E." or a description that starts "Todo-list".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* feat(environment): list setups and protocols in their main manifest

A setup or protocol had a manifest of its own that named its main manifest
with setup_of or protocol_of. It repeated every field of the main manifest,
and the copies drifted. A main manifest now lists its setups and protocols
instead, and each entry sets only what differs.

- Schema: setup_of and protocol_of are gone. `setups` and `protocols` list
  each config's catalog name and config_path. An entry may set
  description, maintainers, requirements, primary_metric,
  integration_profile, dataset_owner and the composition fields its own
  config mirrors; null clears a main manifest's value. A protocol must
  describe itself and may set standard_prompt_config. Protocols are for
  benchmarks only, and every name and config_path is distinct.
- resolve_listed_manifest combines the main manifest with an entry, and
  load_listed_manifest loads one by name. The catalog, validation,
  publication, the verifier run and reward comparison read a setup or
  protocol through them.
- Catalog: each listed config is an entry of its own, with setup_of or
  protocol_of naming its main manifest, and its config no longer appears
  as a legacy entry.
- Validation: validate_environment(name=...) validates one listed config.
  Validating the main manifest checks that each listed config exists, has
  the name the catalog gives its config and has no manifest of its own.
  --sync writes a listed config's composition into its entry and drops a
  value that matches the main manifest again. The setup checks are as
  before, now against the main manifest.
- gym env validate --manifest validates the main manifest and then each
  listed config.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* docs(environment): describe the setups and protocols a main manifest lists

The field reference and the Setups and Protocols section now describe the
setups and protocols lists, what an entry may set and how --sync keeps an
entry's composition. The benchmark page, the add-benchmark skill and the
pr-review skill say to list a config with another harness, prompt, tools
or scoring in the main manifest instead of giving it a manifest of its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* feat(environment): let a protocol list the setups that run it

A protocol can run under several harnesses: GDPval's harness-neutral
prompt runs under OpenCode, Codex, OpenClaw and Pi, and HLE's OpenCode
prompt under OpenCode and Pi. Those configs share the protocol's tasks,
prompt and scorer, not the main manifest's, so none of them could be
listed as a setup.

A protocol entry may now list `setups` of its own. Such a setup takes the
protocol's complete manifest and sets only what differs from it, so the
protocol's prompt and rows are written once:

- resolve_listed_manifest resolves a nested setup from its protocol, and
  listed_configs lists each protocol followed by its setups.
- Validation checks a nested setup against its protocol's tasks, scoring
  and prompt templates, and --sync writes its composition into its entry,
  dropping a value once it matches the protocol's.
- The catalog names the protocol in a nested setup's setup_of.
- Names and config paths stay distinct across every level.

A setup lists no setups of its own: a setup of a setup runs the same tasks
and prompt as its parent, so one level is enough.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* fix(environment): check a setup or protocol selected by name like the rest of its listing

validate_environment ran the listing checks only when it validated the main manifest. A setup or protocol selected by name, as `gym env validate demo/renamed` selects it, skipped them: a name that is not its config's catalog name passed, and so did a config with a manifest of its own. The selected entry now gets the same checks: its config exists, it has its config's catalog name, and no manifest of its own claims it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* test(environment): publish a listed setup from the facts it sets

Publication was tested only with a main manifest, so reading only the main manifest for a listed setup still passed. Two tests publish a setup the main manifest lists: one sets a real description over the main manifest's scaffold placeholder and publishes under its own name, and one sets a placeholder maintainer over the main manifest's real ones and is rejected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* docs(environment): name the nested setup example as the catalog names its config

The example protocol was named my_benchmark/harness_neutral with config_path opencode.yaml, which validation rejects: a listed config takes its config's catalog name. It is now my_benchmark/opencode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* fix(environment): combine a listed config's requirements field by field

A listed config's fields replaced the inherited ones whole, so a setup that set only requirements.network lost the inherited gpu and resolved to gpu: null, although a field it leaves out is meant to keep the inherited value. resolve_listed_manifest now combines requirements key by key, from the main manifest through a protocol to its setup. A list such as datasets or maintainers still replaces the inherited one whole, and null still clears requirements. The field description and the docs say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* fix(environment): reject a listed name that is not its config's catalog path in discovery

Validation required a setup's or protocol's name to equal its config's
catalog name, but catalog discovery did not check it. A setup named
`other` that runs demo/variant.yaml was listed as `other`, taking that
name from benchmarks/other/config.yaml, which `--benchmark other` still
ran, and demo/variant dropped out of the catalog. Discovery now refuses
such a manifest, as it refuses a main manifest whose name is not its
folder path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* feat(environment): let a setup carry the benchmark's prompt in the form its harness needs

A setup had to use the main manifest's prompt templates. A benchmark whose official prompt is a system message could therefore have no agent-harness setup: OpenCode and Pi own the system prompt, so hle/opencode and hle/pi carry the HLE authors' prompt word for word in the user message, under their own template. That is a harness adaptation, which the setup rule already allows when a harness adds its own instructions.

A setup entry may now set standard_prompt_config, as a protocol may. When it does, validation skips the template comparison and requires the entry's description, which says how the prompt was adapted; review checks that the benchmark's wording is unchanged. A setup that does not set it keeps the comparison, so an undeclared template difference still fails.

The docs now open the setup and protocol definitions with the deciding question, whether the config's score is still the benchmark's score, give an example of each, and move the validation details after them. The add-benchmark and pr-review skills and adding-a-benchmark.mdx say the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* fix(environment): let a setup name its own prompt template only for another agent server

A setup that sets standard_prompt_config skipped the template comparison
whenever it had a description. That also accepted a system-prompt variant
run by the same agent: arxivmath_0626/config_with_system validated when
moved unchanged from protocols to setups. The exception is for a harness
that needs the benchmark's prompt in another form, so it now applies only
when the setup's agent_server differs from its parent's (the main manifest,
or the protocol that lists it). Otherwise the templates are compared as
usual. Agent servers that choose the harness through a setting, such as
harness_agent and harness_exa_search, keep one agent_server name and cannot
use it; none needs it today.

The setup and protocol definitions now say what each keeps, in the field
descriptions, the docs and the add-benchmark and pr-review skills. A setup
keeps the tasks, prompt wording, scoring and task limits (turn and time
budgets, tool caps), and "runtime" covers what drives or hosts the run with
the same harness. A protocol is a task variant; a config with other tools
is listed as one until manifests can name environments separately, and
serving the same tools over MCP is not a change of tools. *_legacy_agent
relay configs are not listed. Validation still compares neither limits nor
repeats.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* refactor(environment): drop setups and protocols from the manifest

After review (NVIDIA-NeMo#6098 (comment)),
this PR lands only the selection fields. "Setup" and "protocol" are two more
terms for relations a reader can get from the parts a config combines, and they
collide with existing uses: agent-session setup and start_with_setup, the
Responses API protocol and the benchmark comparison protocol. Once they are
manifest keys and catalog fields they are hard to remove. A config will name
its parts with the folder work instead.

Removed: the setups and protocols manifest fields and their JSON schema rule,
resolve_listed_manifest and load_listed_manifest and their exports, the
catalog's setup_of and protocol_of, the setup checks and the prompt-template
exception, validation and --sync of a listed config by name, and their docs,
skill rules and tests. The files that only carried them are back to their
state on main.

The docs and skills now say instead: a config that only changes the harness
is a run preset with no manifest of its own, and its agent goes in the main
config's allowed_agents when that list exists; a config that changes the
prompt, scoring, task limits or tools gets its own manifest; *_legacy_agent
configs get no new manifests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* fix(environment): address the review of the selection fields

- maintainers: a login may end in GitHub's managed-user suffix, an
  underscore and the enterprise's 3- to 8-character shortcode
  (`mona-cat_octo`), in Gym and in the JSON Schema. A login is still at most
  39 characters with its suffix.
- requirements.gpu: a strict boolean or "unknown", so Gym rejects `1` and
  `"false"` as the JSON Schema already does. YAML still reads a bare `yes`
  or `no` as a boolean.
- unknown: says the value hasn't been established, since the scaffold writes
  it and publication accepts it. An absent field means the manifest doesn't
  state it.
- capabilities: the first entry's top level is a grouping convention for
  readers and tools such as catalogs; `gym list` groups by `domain`.
- primary_metric: the exact key in the run's aggregate metrics, such as
  `mean/reward` or `pass@1[avg-of-4]/accuracy`, not a display label.
- A harness-only preset's agent goes into a declared `allowed_agents` only
  after a representative rollout shows that the pairing works, as the
  Terminal Bench 2.1 note describes; until then the preset runs with
  `--allow-unsupported-pairing`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

* refactor(environment): drop intended_use from the manifest

Every value the backfill wrote equals what the manifest's kind and its
config's dataset types already say: a benchmark is for evaluation, an
environment for training, and a train dataset adds training (248 of 248
manifests on NVIDIA-NeMo#6234). Whether a team trains or evaluates on an environment
is that team's choice, not a property of the environment, and nothing in
Gym reads the field. An optional field can be added back without breaking
anyone if a selection decision comes to need the maintainer's own
recommendation.

Removes the field and its IntendedUse enum, the scaffold's default, and
the mentions in the field reference, the benchmark guide and the
add-benchmark and pr-review skills.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>

---------

Signed-off-by: Yuhe Zhang <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters feature New capabilities, enhancements, or enablement work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants