Repository navigation
feat(environment): add selection fields to environment manifests - #6098
Conversation
|
/ok to test 497823f |
8d9475a to
ecad439
Compare
|
/ok to test 5592b73 |
5592b73 to
9c85b85
Compare
|
/ok to test 9c85b85 |
|
/ok to test 64dbabf |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
One RISK: related-manifest lookup can accept a path-shaped link outside the catalog when the target declares the same name.
I reviewed all 12 changed files and their directly affected paths. This was a static review; I didn't execute tests.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
|
/ok to test 67e86d1 |
ef1c0af to
9e47ee7
Compare
|
/ok to test 9e47ee7 |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
The prior catalog-link finding is resolved in the current source. The canonical-name guard rejects ../outside and absolute links before loading the target, including when its manifest declares that exact string. The regression test covers both cases; canonical links and setup-of-protocol acceptance remain covered.
I also checked the targeted Harbor-target comparison and selection-metadata changes through their affected contracts and tests. No unresolved prior findings or new regressions eligible under the follow-up impact filter remain.
This was a static follow-up review; I didn't execute tests. The previously reviewed tree wasn't supplied, so I couldn't compare the complete inter-review delta. This isn't a fresh whole-PR approval.
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
|
/ok to test 5c3f12c |
|
Thanks, Yuhe. To clarify the second option: I wrote that "setups stay as thin shipped run presets … and a protocol means a task variant", which reads as keeping both terms with new meanings. What I meant was to keep the agentic AI terms already in Gym (environment, taskset, agent), make sure their meaning is clear, and not add new ones, which can cause more confusion. Your changes made the model clear: a setup changes only the agent, a protocol changes the taskset, and other tools mean another environment. Each of those already has a name. Setup and protocol on top of them are two more words to learn for relations a reader can get from the parts. They also collide with existing uses (agent-session setup and So I'd propose that each config names the parts it combines instead: # the entry for benchmarks/hle/pi.yaml
environment: hle
taskset: hle # at the manifest's version
agent: pi_agent
The validation you built stays, keyed on these fields: configs that share a taskset must not differ in prompt, scoring or limits. You offered to split the PR. Could the selection fields land now, with the composition fields going into the folder reorganization you're planning, where a manifest gets to name its environment anyway? That would also stop #6234 and #6403 from writing 58 setup and protocol entries that would then change again. Happy to talk it through. |
After review (#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]>
…r path A manifest's name no longer has to match its folder under benchmarks/ or environments/, so a folder can move without changing the ID that `gym list`, --benchmark and --environment use. - Catalog discovery reads each manifest once, takes its name as the ID, and refuses two manifests in one tree that declare the same name. A manifest directly in benchmarks/ or environments/ is still refused. A manifest that an earlier search root shadows by name still claims its config, so the config is not listed again under its folder path. - --benchmark and --environment select what the catalog lists under a name: in the first search root that has it, the manifest of that name, or else a config the catalog lists under that name that no manifest claims. Another config at that path is selected only when no root lists the name. Each tree's names are read once per process; a selection re-reads the one manifest its answer came from and reads the tree again when that answer no longer holds. - Validation refuses a name another manifest in the tree declares, a config another manifest declares, and a name other than the manifest's folder path that is another config's path, which it would hide. - `gym env init` refuses a name that a manifest in another folder declares. - Typo suggestions include declared names. This replaces the 13 commits of the earlier head (2345083), rebuilt on the #6098 head without setups and protocols; the parts about setup and protocol names are dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yuhe Zhang <[email protected]>
|
/ok to test 6440d07 |
- 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]>
|
/ok to test dda3e35 |
ffrujeri
left a comment
There was a problem hiding this comment.
Thanks, Yuhe. The split is what I hoped for. The diff is the selection fields alone, the docs give one rule for a config that only changes the harness, and the description says that the fields naming a config's environment, taskset and agent will come with the folder reorganization. Approving.
One question, not blocking this PR: do we need intended_use? On #6234, 247 of 248 manifests have the scaffold's default for their kind. The exception is osworld, and its dataset types already show that it ships train data. Evaluating or training is what a team does with the reward, and the environment is the same in both cases, so kind and the dataset types may already say it. Could we decide that before the backfill writes the field into every manifest?
…r path A manifest's name no longer has to match its folder under benchmarks/ or environments/, so a folder can move without changing the ID that `gym list`, --benchmark and --environment use. - Catalog discovery reads each manifest once, takes its name as the ID, and refuses two manifests in one tree that declare the same name. A manifest directly in benchmarks/ or environments/ is still refused. A manifest that an earlier search root shadows by name still claims its config, so the config is not listed again under its folder path. - --benchmark and --environment select what the catalog lists under a name: in the first search root that has it, the manifest of that name, or else a config the catalog lists under that name that no manifest claims. Another config at that path is selected only when no root lists the name. Each tree's names are read once per process; a selection re-reads the one manifest its answer came from and reads the tree again when that answer no longer holds. - Validation refuses a name another manifest in the tree declares, a config another manifest declares, and a name other than the manifest's folder path that is another config's path, which it would hide. - `gym env init` refuses a name that a manifest in another folder declares. - Typo suggestions include declared names. This replaces the 13 commits of the earlier head (2345083), rebuilt on the #6098 head without setups and protocols; the parts about setup and protocol names are dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yuhe Zhang <[email protected]>
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 #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]>
|
Thanks, @ffrujeri , agreed. I checked all 248 manifests on #6234: every The last commit ( |
|
/ok to test 85aa105 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/45296660705 |
…r path A manifest's name no longer has to match its folder under benchmarks/ or environments/, so a folder can move without changing the ID that `gym list`, --benchmark and --environment use. - Catalog discovery reads each manifest once, takes its name as the ID, and refuses two manifests in one tree that declare the same name. A manifest directly in benchmarks/ or environments/ is still refused. A manifest that an earlier search root shadows by name still claims its config, so the config is not listed again under its folder path. - --benchmark and --environment select what the catalog lists under a name: in the first search root that has it, the manifest of that name, or else a config the catalog lists under that name that no manifest claims. Another config at that path is selected only when no root lists the name. Each tree's names are read once per process; a selection re-reads the one manifest its answer came from and reads the tree again when that answer no longer holds. - Validation refuses a name another manifest in the tree declares, a config another manifest declares, and a name other than the manifest's folder path that is another config's path, which it would hide. - `gym env init` refuses a name that a manifest in another folder declares. - Typo suggestions include declared names. This replaces the 13 commits of the earlier head (2345083), rebuilt on the #6098 head without setups and protocols; the parts about setup and protocol names are dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yuhe Zhang <[email protected]>
What changed and why
This PR adds optional selection fields to environment manifests. These fields help someone choose an environment: who maintains it, what it is for, which skills and fields of expertise it tests, what it overlaps with, its headline metric, and what a run needs.
Earlier versions of this PR also let a main manifest list its setups (the same tasks run by another harness or runtime) and protocols (task variants). Those were dropped after Felipe's review:
start_with_setup, the Responses API protocol, and the benchmark comparison protocol.gym list environments --json, they are hard to remove.A config will name the parts it combines when the folders are reorganized. Until then, the docs and skills give one rule:
allowed_agents, its agent goes there only after a representative rollout shows that the pairing works, as the Terminal Bench 2.1 note inagent-server/integrate-existing-agents.mdxdescribes. Until then, the preset runs with--allow-unsupported-pairing.main.*_legacy_agentconfigs get no new manifests.Commit
6440d07090removes the setup and protocol code, schema, docs, skill rules and tests. The files that carried only that code are back to their state onmain, so the PR's diff is the selection fields alone. The earlier commits stay in the branch history; the PR is squash-merged.Selection fields (all optional)
maintainers: GitHub logins of the current maintainers. A managed user's login, with GitHub's underscore and enterprise shortcode (mona-cat_octo), is accepted too.capabilities: the skills the environment exercises, from the capability taxonomy (capability_taxonomy_v0_1). Each value is<capability>or<capability>/<specialization>, for examplereasoningorcoding/code_generation. The first entry is the main capability. By convention its top level (the part before the slash) is the environment's coarse category, which readers and tools such as catalogs can group by;gym liststill groups bydomain. That ordering is a rule for authors and reviewers; validation does not check it.domains: the fields of expertise its tasks need, from the domain list (enrichment_tags_v0_1), with the main domain first. It keepsgeneral(no specialist field) andother(a field the list does not have).capabilities: []), or the whole wordunknown, the same pattern asrequirements.gpuandrequirements.network.unknowninside a list is rejected with a message that says to writecapabilities: unknown. The source list's ownunknowndomain is left out of Gym's copy, so there is one way to say "not known".overlaps_with: benchmarks that training on this environment would invalidate, for example because their tasks overlap with its data.training_allowedfield. 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 other teams choose differently. What every team can use stays in the manifest: each dataset's type (train or benchmark),overlaps_withandlicensing.intended_usefield. Every value the backfill wrote equals what the manifest's kind and its config's dataset types already say (248 of 248 on chore(benchmarks): backfill the manifest selection fields and require them #6234: a benchmark is for evaluation, an environment for training, and a train dataset adds training), and whether a team trains or evaluates on an environment is that team's choice. The last commit removes it; an optional field can be added back without breaking anyone if a selection decision comes to need a maintainer's own recommendation.primary_metric: the headline score's exact key in the run's aggregate metrics, such asmean/reward(as the backfill writes it) orpass@1[avg-of-4]/accuracy, not a display label. Apass@kkey includes the repeat count it was computed with.requirements: what a run needs beyond the model under test.gpu(the environment itself needs a GPU) istrue,false, orunknown; Gym, like the JSON Schema, rejects a number or another string.networkisno-network,allowlist(only specific services, such as a search API or a hosted judge model),public(the open internet), orunknown. These are the same words as a Harbor task'snetwork_mode. It is a level rather than yes or no, because a cluster with restricted egress can allowlist a few named services but not the open internet.unknownmeans the value hasn't been established. The scaffold writes it and publication accepts it, so it doesn't show that anyone checked. An absent field means the manifest doesn't state it. A bare YAMLyesornoreads as a boolean.gym env init --benchmark/--environment) writes every selection field, so authors see them:maintainers: [TODO],capabilitiesanddomainsasunknown,requirementsasunknown, andprimary_metric: TODOfor benchmarks.gym env publishrejects a leftoverTODOinmaintainersorprimary_metric, as it already does for the older placeholder fields. It now uses one check for every field: the value isTODO, or starts withTODO:, which is what the scaffold writes. The old prefix check also rejected real values that start with "todo", such as an author written "Todorov, E.".Where the capability and domain lists come from
unknown). EvalBench's mapping rules and guidance are not.nemo_gym/environment/capabilities_and_domains.yaml, which names both versions. EvalBench expects to revise them within a few months; moving to a new version means replacing that file. There is no alias map for renamed values yet.domainis unchanged and still required. It is Gym's single category, and its values mix subjects (math) with capabilities (coding,agent,instruction_following). That's why a later PR plans to deprecate it:capabilitiesnames the skill, with the first entry's top level as the coarse category for listings, anddomainsnames the subject.Docs:
contribute/environments/new-environment.mdxgains the selection-field rows and, after the paragraph on named configs, the rule above for configs that change only the harness, including when a preset's agent may joinallowed_agents.contribute/environments/adding-a-benchmark.mdxgains one bullet for the selection fields and one for that rule.Author guidance (from the former #6136, folded in so code and docs are reviewed together)
.agents/skills/add-benchmark/SKILL.md: starts manifest-backed benchmarks withgym env init --benchmark, points preparation, prompting and the representative evaluation at the onboarding page, and adds "Step 4b: Complete the manifest". That step fills the authored and selection metadata from the code, the data's licence and terms (forlicensing), and what the user supplied. It asks for missing maintainers instead of guessing, replaces every scaffoldTODO, notes thatunknownis valid only forcapabilities,domains,requirements.gpuandrequirements.network, says where the capability and domain values are listed, and gives the rule for harness-only configs..agents/skills/pr-review/SKILL.md: a manifest check. A new manifest completes its authored and selection metadata and leaves noTODO; an existing manifest's review covers the declarations it changes, without requiring unrelated backfill. A harness-only config gets no manifest, and a*_legacy_agentconfig gets no new one. A preset's agent joins a declaredallowed_agentsonly with a representative rollout that shows the pairing works.Not in this PR:
gym env publishrejects a leftoverTODO, and the skills ask for them.Issue
Refs #1520 (manifest work under the custom-environment epic).
Internal tracking: GYMINT-739 (part of GYMINT-738, standardize environment manifests). Its setup and protocol half is dropped, as above.
Compatibility
Every new field defaults to
Noneand is omitted when a manifest is dumped, so existing manifests and their validation are unchanged. No manifest in the repository sets the new fields yet; the backfill (#6234) fills them. This PR doesn't changevalidate_environment, the catalog orgym env validate.Validation
Dropping
intended_use(the last commit,85aa105864), after Felipe's review:IntendedUseenum and the scaffold's default, and the mentions in the field reference, the benchmark guide and the add-benchmark and pr-review skills.pytest tests/unit_tests/environment tests/unit_tests/cli tests/unit_tests/test_public_api.py tests/unit_tests/test_moved_paths.py -n 8, deselecting the memory-profiler CLI test that also fails without these changes: 1,645 passed.pre-commit runon the changed files: passed. No manifest onmainsets the field.Review fixes (Codex) (
dda3e35fd1), from a local dual review of6440d07090:maintainersaccepts a login followed by_and a 3- to 8-character shortcode (mona-cat_octo,octo_admin), in Gym and in the JSON Schema, and still caps a login at 39 characters with its suffix, as GitHub's docs describe. Tests: three logins pass both validators;_x, a doubled suffix (mona-cat_octo_octo), an empty or 2-character shortcode, and a 40-character managed login fail both. The managed logins fail with the old pattern, and the 40-character one passes without the length cap.requirements.gpuisStrictBool | "unknown". Tests:1,0,"false"and"true"fail in Gym and in the JSON Schema (all four load with a plainbool), and YAMLtrue,false,yes,noandunknownstill load. Every manifest on the pushed backfill heads loads with the change, as without it: 248 on chore(benchmarks): backfill the manifest selection fields and require them #6234 (9abdbe0252), 263 on chore(benchmarks): describe 15 benchmark configs the catalog listed without a manifest #6403 (474b4728ce) and 291 on chore(environments): add manifests for 39 training environments the catalog listed without one #6317 (93fafa40b3).allowed_agents: the onboarding pages and the add-benchmark and pr-review skills add a preset's agent only after a representative rollout shows that the pairing works, with a link to the Terminal Bench 2.1 note; until then the preset runs with--allow-unsupported-pairing.gym liststill groups bydomain.primary_metricis the exact key in the run's aggregate metrics (mean/<field>orpass@1[avg-of-<k>]/<name>, the keys the reward profiler writes), not a display label.unknownnow reads "the value hasn't been established" in themanifest.pycomment, the add-benchmark skill, a test comment and this description.pytest tests/unit_tests/environment tests/unit_tests/cli tests/unit_tests/benchmarks/test_indic_frontier_math.py tests/unit_tests/test_moved_paths.py tests/unit_tests/test_public_api.py tests/unit_tests/tooling/test_review_policy.py -n 8: 1,676 passed; 1 failed, the memory-profiler CLI test, which fails the same way locally without these changes.pre-commit runon the changed files: passed. The catalog (545 entries, 242 with manifests) and all 359--benchmark/--environmentselections are the same as at6440d07090.The split (
6440d07090):pytest tests/unit_tests/environment tests/unit_tests/cli tests/unit_tests/benchmarks/test_indic_frontier_math.py tests/unit_tests/test_moved_paths.py tests/unit_tests/test_public_api.py tests/unit_tests/tooling/test_review_policy.py -n 8: 1,662 passed; 1 failed, the memory-profiler CLI test, which fails the same way locally without this change.pre-commit runon the changed files: passed (ruff, ruff-format, guardwords, import-linter).git diff 95c841be0 HEAD(themainthis PR is on) touches 11 files, and none of it is setup or protocol code:setup_of,protocol_of,ManifestSetup,listed_configs,resolve_listed_manifestandload_listed_manifestappear nowhere in the code, tests, docs or skills.main, 242 of them with manifests.Selection fields (earlier commits):
capabilitiesanddomains: tests cover a capability, a capability with a specialization,[],unknown, typos (with the suggestion), a specialization under the wrong capability,unknowninside a list, unknown domains, and that the JSON schema lists exactly the values validation accepts. The copied lists were compared with EvalBench's source files: the same capability and specialization names and descriptions, and the same domains apart from EvalBench'sunknown. No committed manifest declares the new fields yet, and every manifest that loaded before still loads. The end-to-end publish test now fillsmaintainerstoo; without that, the new placeholder check stops it, as intended.pytest tests/unit_tests -n 8, skippingartifacts/test_exporters.py, which needsmlflow): 21,800 passed; 183 failed and 8 errored. The same 191 tests fail onmainwithout this change in the same local environment. They come from optional packages that were not installed (opensandbox,mlflow,tenacity,PIL,cloudpickle) and from Linux-only behavior on macOS. None are environment tests.gym env init --benchmarkcreates the files Step 1 lists, andpytest tests/unit_tests/toolingshows only the failuresmainalso has.EnvironmentKindin the schema, scaffoldrequirementsfrom the model, one placeholder check): the test for real values that start with "todo" fails on the old placeholder check.Rollout evidence
N/A: this adds optional manifest fields and their validation. No server, agent or verifier behavior changes, and no existing manifest uses the new fields.
🤖 Generated with Claude Code