Skip to content

feat(environment): make a manifest's name its ID instead of its folder path - #6102

Draft
yuhezhang-ai wants to merge 4 commits into
mainfrom
yuhez/manifest-stable-name
Draft

yuhezhang-ai wants to merge 4 commits into
mainfrom
yuhez/manifest-stable-name

Conversation

@yuhezhang-ai

@yuhezhang-ai yuhezhang-ai commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #6098. This PR's base is that PR's branch, so the diff shows only this change. It will be rebased onto main once #6098 merges.

Status: deferred

This PR stays a draft unless we decide that an ID should not depend on the folder path. Nothing needs it now:

  • A manifest's name must equal its folder path inside its tree (nemo_gym/environment/registry.py), and that folder needn't hold the config: benchmarks/swebench/verified/opencode/manifest.yaml points at ../opencode.yaml. So renaming an entry only moves its manifest to another folder, and the configs stay put. Moving a whole tree, to another repository or from benchmarks/ to tasksets/, keeps every ID.
  • The proposed taskset naming uses these path-shaped IDs: a runtime taskset name is <catalog ID>[:<label>], for example swebench/verified or swebench/verified:hermes, so it needs no ID that differs from the path.
  • If IDs should not depend on the path (for example a form such as swebench:verified), this PR is what allows it. The cost is that an ID no longer shows which folder it is in, and --benchmark has to read every manifest to find a name (about 0.5 s more per launch).
  • Merging this later changes no existing ID, because every name equals its folder path today.

What changed and why

A manifest's name had to equal its folder path under benchmarks/ or environments/. Moving a folder within its tree, for example from benchmarks/gsm/ to benchmarks/math/gsm/, would therefore change its ID and break every record that refers to it.

A name is now an ID, and it no longer has to match a path.

#6098 no longer lists setups and protocols in a main manifest (see the review), so this PR no longer makes their names IDs. It covers main manifests only.

Catalog (nemo_gym/environment/registry.py)

  • Discovery reads each manifest once and keys its entry by name instead of by folder path.
  • No two manifests in one search root may declare the same name, whether they sit in benchmarks/ or environments/. Discovery raises RegistryError naming both files, as it already does for other broken manifests. A config without a manifest keeps its folder path as its name, so a folder of the same name may still exist in both trees.
  • An earlier search root still shadows a later one, now by kind and name. A shadowed manifest still claims its config, so that config is not listed again under its folder path.
  • Discovery now has two steps. The first, the private _list_catalog, finds the config each name selects and applies every rule above. The second reads the description and domain of each config without a manifest, which builds the whole config with every file it includes and is most of gym list's time (about 3.4 of 4.5 s here). discover_environment_catalog() runs both. --benchmark and --environment run only the first (see Selectors).
  • New helpers: declared_manifests(tree_dir), the readable manifests of one tree, and the private _manifest_config(manifest_path, manifest), the config a manifest declares (none when its path leaves the tree).

Validation (nemo_gym/environment/validation.py)

  • The rule that a manifest's name equals its folder path is removed.
  • The kind-matches-tree rule stays. A manifest directly in benchmarks/ or environments/, rather than in a folder of its own, is refused, as discovery refuses it.
  • New checks on the manifest's name:
    • No other manifest in the root's benchmarks/ or environments/ tree declares the name.
    • No other manifest points at the same config. Configs are compared after resolving their paths, so config.yaml in benchmarks/demo/ and ../demo/config.yaml in benchmarks/copy/ are one config. A config with two IDs would be listed twice.
    • A name other than the manifest's own folder path is not another config's path. Otherwise it would hide that config from the catalog and from --benchmark and --environment. That includes a loose benchmark config benchmarks/<name>.yaml, which the catalog lists under its file name; a new private helper, registry._legacy_config_name, tells whether the catalog lists such a config, reading only that file.
  • The checks use the config the catalog reads from the manifest. A config_path passed to validate_environment does not change it.

Selectors (nemo_gym/environment/assets.py, registry.py)

  • --benchmark and --environment run the catalog's first step and select what it lists under the name, so they pick what gym list shows by construction, and a moved benchmark still runs by its ID. They don't read descriptions. They read every manifest of the search roots (the unique-name rule needs them), the configs without a manifest of their own kind only, and the resources servers' runnable configs only for a resources_servers/... name.
  • What follows from using the catalog's lookup:
    • A name that two manifests in one root declare, in one tree or across both, fails with the catalog's RegistryError naming both files. So does a manifest the catalog refuses: wrong kind, missing config, or directly in the tree. Only that name fails: other names from the same root still select, and gym list still fails with the first problem, as before. Before, the selector took the first folder in sorted order, or returned the missing path.
    • A loose benchmarks/<name>.yaml and a resources server's runnable config (resources_servers/<server>), both of which the catalog lists, now select. An earlier root's one wins over a later root's manifest of that name, as in the catalog.
    • When several roots have the name, the selector still warns which configs it ignores.
  • The listing is kept for the rest of the process, since a command can select several names and a test selects every benchmark. A selection rechecks the one file its answer came from: the manifest still declares that name for that config, or the config without a manifest still exists. It reads the listing again when that check fails or the name is missing, but not right after reading it. So a manifest that changes, moves or is added during the process is still seen. The code comment names what a kept listing misses: a file added during the process that changes an answer it still gives, such as a second manifest declaring the name, a manifest claiming a config the listing has without one, or an entry of that name in an earlier root. Each CLI command is a new process.
  • When no root lists the name, a config at its path still selects, in the order before this PR: a nested <name>/config.yaml in any root, then a flavor file <folder>/<flavor>.yaml. Examples:
    • a config whose manifest has another name;
    • an environment's flavor file (suite/fast.yaml);
    • a nested benchmark config (suite/v1/config.yaml, listed as suite/v1/config);
    • an absolute folder (--benchmark /path/to/folder).
  • Only manifests that discovery reads count, so a manifest below a hidden folder or a pulled Harbor dataset does not select.
  • An unknown name's "did you mean" hint covers every search root. It suggests the names the catalog lists and the folder paths that still select. For --environment, it also suggests the flavor files in the typed folder.
  • The catalog modules load only when a benchmark or environment is selected, so gym --help doesn't pay for them.

Scaffold (nemo_gym/environment/scaffold.py)

  • gym env init --benchmark/--environment <name> refuses a name that a manifest in another folder of the root's benchmarks/ or environments/ tree already declares. This stops it from creating a duplicate ID after a move. Running it again for the same folder still works.

Docs: contribute/environments/new-environment.mdx gets a "Names" section and an updated name row, both saying that a name is unique across the two trees of a search root. reference/configuration.mdx now says that --benchmark and --environment find a name the way gym list does, gives the path fallback's order, and points to --config <path> for a particular file.

Other:

  • tests/unit_tests/benchmarks/test_indic_frontier_math.py passes the loaded manifest to _manifest_entry, which now takes it instead of loading it again.
  • tests/unit_tests/fixtures/import_surface.json drops the removed private helper _path_identity from the nemo_gym.registry entry, because test_moved_paths.py asks for each name that is removed on purpose.

Issue

Refs #1520 (manifest work under the custom-environment epic).

Internal tracking: GYMINT-738 (standardize environment manifests). It is not needed for GYMINT-741 (separate environments repository): moving whole trees keeps every ID (see Status).

Supersedes #2622, which is no longer being worked on. Its exclusion of manifest.yaml from benchmark discovery is already on main. Its other goal, reporting a broken manifest without failing the whole catalog, is not part of this PR.

Compatibility

  • Every manifest in the repository already uses its folder path as its name, and no two share a name or a config. The catalog lists the same entries as before, and every existing name resolves to the same config. Details under Validation.
  • Names that used to be rejected for not matching their folder now validate if they are unique and aren't another config's path.
  • New rule: two manifests in one tree can no longer share a config. No manifest in the repository does.
  • New rule: a manifest's name is unique across the benchmarks/ and environments/ trees of its search root, so a benchmark manifest and an environment manifest can no longer share a name. The name is meant to be the one ID that the catalog and run records share, and benchmarks and environments are planned to be listed together, so tightening the rule later would force renames. No two manifests collide today. Three folders exist in both trees: biomnibench_da and ether0, each with a benchmark manifest and an environment folder without one, and labbench2_pdf, with no manifest in either. Their environment versions will need other names when they get manifests. Configs without a manifest keep today's behavior.
  • Across search roots, a benchmark manifest and an environment manifest of the same name are both listed, as before. Making an earlier root's manifest shadow a later root's whatever its kind would be a few lines in the catalog, but --benchmark and --environment would then also have to read the other kind's trees and decide what a shadowed name falls back to. Today the path fallback would still run the shadowed config, so listing and launching would disagree. That is left for a separate decision.
  • Across search roots, --benchmark and --environment follow the catalog: an earlier root's config at a name's path no longer wins over a later root's entry of that name when the catalog lists that config under another name or not at all, as for an environment's flavor file. Such a config is still selected by its path when no root lists the name, in the order before this PR, and --config <path> selects any file.
  • --benchmark and --environment now fail where gym list fails for their kind, with the same error naming the file: a name that two manifests in one root declare, or a manifest of that kind with the wrong kind or a missing config. Only that name fails to select; other names still select. Before, only gym list failed, and the selector picked one of the two configs or a missing path. No manifest in the repository has either problem.
  • New: --benchmark <name> selects a loose benchmarks/<name>.yaml, and --benchmark/--environment resources_servers/<server> select the config the catalog lists under that name. Both failed with "does not exist" before. --resources-server <server> is unchanged.
  • The private helper _path_identity is removed. Its one check, that a manifest sits inside a named folder rather than at the tree root, moved into _manifest_entry.

Validation

  • Rebased onto feat(environment): add selection fields to environment manifests #6098's head dda3e35fd1, which adds the review fixes to the selection fields; both commits applied cleanly and are unchanged apart from context lines. Before that, rebuilt on 6440d07090, which drops setups and protocols. The 13 commits of the earlier head (2345083b37) are now one commit without the parts about setup and protocol names: listed names as IDs, a shadowed manifest hiding its listed configs, one config per ID within a manifest, the configs/ folder recommendation for listed configs, and their tests. A test that a main manifest whose name is another config's path still selects what the catalog lists replaces the setup version of that test, and a test that two manifests can't share a config replaces the one for a listed config.
  • 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 at the current head: 1,720 passed; 1 failed, the memory-profiler CLI test, which fails the same way locally on feat(environment): add selection fields to environment manifests #6098's head.
  • Selectors on the catalog's lookup (f0476baa5c), with tests that each fail at the pushed head 83a8645868 (run there with the new test files):
    • two manifests declaring one name, in one tree or across both, fail to select as they fail to list;
    • a wrong-kind manifest and a manifest without its config fail to select as they fail to list;
    • an earlier root's loose benchmarks/demo.yaml wins over a later root's manifest demo;
    • an earlier root's resources-server config wins for --benchmark resources_servers/demo over a later root's manifest of that name;
    • with no listed name, a later root's suite/fast/config.yaml wins over an earlier root's suite/fast.yaml;
    • a selection reads no descriptions, --environment doesn't scan benchmark configs, and neither scans resources servers for an ordinary name;
    • validation refuses renaming a benchmark manifest to the name of a loose benchmarks/<name>.yaml.
  • One bad name stops only its own selection (the last commit, c30c1f46a6): with two manifests declaring one name, selecting that name fails naming both files, another name from the same root still selects, and gym list still fails. Checking the folder at the name's path first would be faster, but after a move it would run a copy left at the old folder, so the lookup still reads every manifest.
  • Same catalog and selections: compared with a2171580b6 (the pushed head's two commits on feat(environment): add selection fields to environment manifests #6098's dda3e35fd1), discover_environment_catalog() returns the same 545 entries (242 with manifests), and --benchmark/--environment select the same config for all 359 benchmark and environment names. All 186 resources_servers/... names now select the config the catalog lists.
  • Timings: cold, one fresh process each, on this laptop, after the catalog modules' import (about 0.5 s, which the pushed head also paid). Not measured on a shared filesystem.
    • --benchmark aime25: 0.70 s (pushed head 0.23 s).
    • --environment example_single_tool_call: 0.24 s (0.03 s).
    • --environment resources_servers/aalcr: 0.62 s (failed before).
    • gym list's catalog: 4.45 s, unchanged.
    • gym --help: 0.05 s; the catalog modules aren't imported.
    • test_every_listed_token_round_trips_through_the_benchmark_selector: 18.6 s under -n 8 (12.5 s at the pushed head, 9.0 s on feat(environment): add selection fields to environment manifests #6098's head). Of its 302 tokens, 12 are old path names that the catalog doesn't list, such as indic/aime_2026/config. Each reads the listing again (about 0.7 s), because a miss can be a name a manifest added during the process declares.
  • Names unique across both trees (the last commit), with one test per check, each failing with its check reverted to one tree: discovery refuses a benchmark manifest and an environment manifest of one name in one root; validation refuses it from either manifest; gym env init --environment sample refuses the name of an existing benchmark manifest. Two more tests pin what stays: across search roots, a benchmark manifest and an environment manifest of one name are both listed; and the cross-kind resolution test now pairs an environment manifest with a benchmark config without a manifest, since two manifests can no longer share the name. The catalog and all 359 selections are the same as at the commit before it. pre-commit run on the changed files: passed.
  • The new shared-config test fails with that check removed.
  • Two tests cover the kept listing: several selections read a tree once, and a manifest that changes, moves or is added during the process is still selected. The added manifest sits in a folder named differently from its ID, so that step fails if the listing is never read again.
  • Each validate_environment call reads every manifest in both trees of its root for the ID checks: here 235 benchmark manifests (about 210 ms) and 7 environment manifests (about 10 ms).
  • Tests, kept from the earlier head:
    • registry: a moved manifest is listed under its name; two manifests with one name fail discovery; an earlier root shadows by name; a shadowed manifest still claims its config; the Harbor walk test asserts on the listing instead of the old name error; the one-config name check agrees with the tree scan on this checkout.
    • validation: a renamed manifest validates; a duplicate name fails for both files; a renamed manifest can't take another config's path; a manifest at the root of a catalog tree fails.
    • selectors (tests/unit_tests/environment/test_assets.py), with two search roots: listing and selection agree for a moved entry in the earlier root; a folder claimed under another name doesn't shadow that name; an old folder path still selects when no entry has that name; a shadowed manifest's folder doesn't take a name a later root declares; an earlier root's flavor file, nested benchmark config, or manifest below a Harbor dataset or hidden folder doesn't shadow a later root's declared name; an absolute folder selects its config; the hint suggests simple and nested declared IDs and keeps the folder-path hints; --environment demo/fats suggests demo/fast.
    • CLI: gym env start --benchmark <name> finds a moved manifest by its name.
    • scaffold: after a move, gym env init refuses the moved manifest's name, and rerunning it in place still works.
  • pre-commit run on the changed files: passed (ruff, ruff-format, guardwords, import-linter).

Rollout evidence

N/A: this changes how manifests are named, found and validated. No server, agent or verifier behavior changes, and every existing name resolves to the same config.

🤖 Generated with Claude Code

@yuhezhang-ai yuhezhang-ai added feature New capabilities, enhancements, or enablement work area:env-infra Shared environment framework, lifecycle, registry, scaffolding, and validation labels Nov 13, 2026
@copy-pr-bot

copy-pr-bot Bot commented Nov 13, 2026

Copy link
Copy Markdown

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

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yuhezhang-ai
yuhezhang-ai added this pull request to stack #6130 November 13, 2026 14:53
@yuhezhang-ai
yuhezhang-ai force-pushed the yuhez/manifest-stable-name branch 5 times, most recently from cf8a82b to 6f9371a Compare November 13, 2026 16:55
@yuhezhang-ai
yuhezhang-ai force-pushed the yuhez/manifest-stable-name branch 2 times, most recently from 9fb7a5b to 8f35ca2 Compare November 13, 2026 17:10
@yuhezhang-ai

Copy link
Copy Markdown
Contributor Author

/ok to test 8f35ca2

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

@yuhezhang-ai
yuhezhang-ai force-pushed the yuhez/manifest-stable-name branch from 8f35ca2 to 8771a7a Compare November 13, 2026 17:23
@yuhezhang-ai

Copy link
Copy Markdown
Contributor Author

/ok to test 8771a7a

@yuhezhang-ai
yuhezhang-ai force-pushed the yuhez/manifest-stable-name branch from 8771a7a to 191e4f6 Compare November 13, 2026 17:54
@yuhezhang-ai

Copy link
Copy Markdown
Contributor Author

/ok to test 191e4f6

@yuhezhang-ai
yuhezhang-ai force-pushed the yuhez/manifest-stable-name branch 2 times, most recently from e4748ea to 5e0e09c Compare November 13, 2026 19:53
@yuhezhang-ai

Copy link
Copy Markdown
Contributor Author

/ok to test 5e0e09c

@yuhezhang-ai
yuhezhang-ai marked this pull request as ready for review November 13, 2026 20:00

@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

Three RISK findings affect catalog/selector agreement and manifest validation. One NOTE covers a lost typo hint. The RISK findings should be addressed or accepted deliberately before merging.

I inspected all 12 changed files and their directly affected discovery, CLI, validation, scaffold, and compatibility paths. This was a static review; I didn't execute tests or independently verify the reported test results.

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

Comment thread nemo_gym/environment/registry.py Resolved
Comment thread nemo_gym/environment/assets.py Resolved
f"Manifest identity name '{manifest.name}' does not match its catalog path '{catalog_name}'."
)

catalog_kind = catalog_directory.name if catalog_directory is not None else None

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.

RISK — Retain the catalog's named-directory requirement

Removing the name/path comparison also lets explicit validation accept an ordinary ID directly at the catalog-tree root. Starting with the existing _asset(tmp_path) fixture, move its manifest to environments/manifest.yaml, set config_path: demo/config.yaml, and retain name: demo. The kind check passes, uniqueness excludes the manifest itself, and the path-collision check sees its own config, so validate_environment() can succeed. However, catalog discovery rejects that same manifest because it isn't inside a named catalog directory. A successful validation therefore leaves a tree that makes gym list fail.

Could _validate_manifest_location() preserve this location constraint without restoring name-equals-folder? Immediately after assigning catalog_directory, add:

if catalog_directory is not None and manifest_path.parent == catalog_directory:
    raise EnvironmentValidationError(
        f"Manifest '{manifest_path}' must be inside a named catalog directory."
    )

A manifest accepted inside a catalog tree should meet discovery's location requirement. Preserve moved and nested manifests whose IDs differ from their folders, standalone manifests outside both trees, and the existing kind check.

Acceptance — proposed tests, not executed: The root-level fixture above must raise EnvironmentValidationError mentioning a named catalog directory. Retain name == 'renamed' for the moved-ID case, name == 'acme/demo' for the nested case, and rejection of a kind/tree mismatch in the validation tests. Inspect that catalog_directory is None bypasses the new guard. Verify the suggested code before adopting it.

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.

Confirmed and fixed in cc60385. A manifest moved to environments/manifest.yaml with config_path: demo/config.yaml validated. _validate_manifest_location() now raises "must be inside a named catalog directory" for a manifest directly in its catalog tree, the same message discovery gives. When catalog_directory is None the check is skipped, so standalone manifests are not affected. Test: test_environment_validation.py::test_a_manifest_at_the_root_of_a_catalog_tree_is_refused, which fails on the previous commit. The renamed, nested and kind-mismatch tests still pass.

if not tree.is_dir():
continue
config_names.update(manifest.name for _, manifest in declared_manifests(tree))
config_names.update(

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.

NOTE — Suggestion: retain environment-flavor typo hints

The common hint branch loses a diagnostic for a selector that still works. With environments/demo/config.yaml and environments/demo/fast.yaml, --environment demo/fast resolves, but --environment demo/fats no longer suggests fast: _legacy_config_paths(..., 'environment') contributes only demo. The base implementation searched the sibling YAML flavors for this case. This affects error recovery, not successful launches.

Could the hint set also include those environment flavor aliases, without adding them to the catalog? A small addition inside the root loop is:

if flag == "environment":
    config_names.update(
        f"{server_name}/{candidate.stem}"
        for candidate in (tree / server_name).glob("*.yaml")
        if candidate.name != "manifest.yaml"
    )

Preserve declared-ID hints across roots, bare folder aliases, nested benchmark hints, and the separate agent/model/resources-server hint behavior.

Acceptance — proposed test, not executed: Isolate one root with the two configs above. Assert that demo/fast resolves to fast.yaml and that demo/fats raises ValueError containing Did you mean \demo/fast`?`. Retain the simple/nested declared-ID and folder-alias assertions in the new hint tests. Verify the suggested addition before adopting it.

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.

Confirmed and fixed in cc60385 as you suggested. For --environment, the hint set now also includes <folder>/<flavor> for each YAML file in the folder typed, except manifest.yaml. These names are not added to the catalog. Test: test_assets.py::test_typo_suggestions_include_environment_flavors checks that demo/fast selects fast.yaml and that demo/fats suggests demo/fast. On the previous commit it suggested demo.

@yuhezhang-ai

Copy link
Copy Markdown
Contributor Author

/review

@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

LGTM — no remaining in-scope concerns found.

I verified all four prior findings against the current source and regression assertions:

This was a static follow-up review of the earlier failures, identifiable fixes, and directly affected catalog, selector, validation, and CLI paths. I inspected tests but didn't execute them. The previously reviewed tree wasn't available, so I couldn't independently compare the complete inter-review delta. No new regression meeting the follow-up introduction and impact-escalation requirements was established.

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

@yuhezhang-ai
yuhezhang-ai force-pushed the yuhez/manifest-stable-name branch 2 times, most recently from d865ae7 to c21f074 Compare November 17, 2026 02:27
@yuhezhang-ai

Copy link
Copy Markdown
Contributor Author

/ok to test c21f074

@yuhezhang-ai
yuhezhang-ai force-pushed the yuhez/manifest-stable-name branch from c21f074 to 4907561 Compare November 17, 2026 15:42
@yuhezhang-ai

Copy link
Copy Markdown
Contributor Author

/ok to test 4907561

@yuhezhang-ai
yuhezhang-ai force-pushed the yuhez/manifest-stable-name branch from 4907561 to 64e4c0c Compare November 18, 2026 22:38
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the risk:high Autobot PR risk: high label Nov 18, 2026
@yuhezhang-ai
yuhezhang-ai force-pushed the yuhez/manifest-stable-name branch from 64e4c0c to f85cee6 Compare November 19, 2026 03:47
@yuhezhang-ai

Copy link
Copy Markdown
Contributor Author

/ok to test f85cee6

@yuhezhang-ai
yuhezhang-ai force-pushed the yuhez/manifest-stable-name branch from f85cee6 to e35f078 Compare November 19, 2026 04:03
@yuhezhang-ai

Copy link
Copy Markdown
Contributor Author

/ok to test e35f078

@yuhezhang-ai

Copy link
Copy Markdown
Contributor Author

/ok to test 950dc5a

@yuhezhang-ai

Copy link
Copy Markdown
Contributor Author

/ok to test 2345083

@yuhezhang-ai
yuhezhang-ai force-pushed the yuhez/manifest-stable-name branch from 2345083 to 0712855 Compare November 23, 2026 16:35
@yuhezhang-ai

Copy link
Copy Markdown
Contributor Author

/ok to test 0712855

@yuhezhang-ai

Copy link
Copy Markdown
Contributor Author

/ok to test 83a8645

@yuhezhang-ai
yuhezhang-ai force-pushed the yuhez/manifest-stable-name branch from 83a8645 to c30c1f4 Compare November 23, 2026 21:57
@yuhezhang-ai
yuhezhang-ai marked this pull request as draft November 23, 2026 21:58
@github-actions github-actions Bot removed the sla:review-overdue Review response is over the one-business-day SLA label Nov 23, 2026
Base automatically changed from yuhez/manifest-setup-protocol-links to main November 24, 2026 00:37
yuhezhang-ai and others added 4 commits November 23, 2026 19:37
…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]>
…nd environments/

A manifest's name is meant to be the one ID that the catalog, the hub and run
records share, and benchmarks and environments are planned to be listed
together later. The catalog keys entries by kind and name, so until now a
benchmark manifest and an environment manifest in one search root could
declare the same name. No two manifests in the repository do, so tightening
the rule now forces no renames.

- Discovery shares one name table between a search root's benchmarks/ and
  environments/ trees, so the same manifest name in both raises
  RegistryError naming both files, as a duplicate within one tree does.
- Validation checks a manifest's name against the manifests of both trees of
  its root.
- `gym env init --benchmark/--environment` refuses a name that a manifest in
  either tree declares.

A config without a manifest keeps its folder path as its name, so a folder of
the same name may still exist in both trees, as labbench2_pdf does. Across
search roots, shadowing stays by kind and name. Ignoring the kind there would
also need --benchmark and --environment to read the other kind's trees and to
decide what a shadowed name falls back to.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
…'s own lookup

--benchmark and --environment had their own, simpler copy of the catalog's
rules, and a review found four cases where they picked a different config
than `gym list` shows. This splits catalog discovery into two steps and
has the selectors use the first one:

1. Listing (`_list_catalog`): which config each name selects, with all of
   discovery's rules: an earlier search root wins, a shadowed manifest
   still claims its config, and no two manifests in a root declare one
   name.
2. Details: the description and domain of each config without a manifest,
   which builds the whole config with its includes and is most of
   `gym list`'s time. Only `gym list` needs it.

A selection reads only what its flag and name can select: configs without
a manifest of that kind, and resources-server configs only for a
`resources_servers/...` name. It keeps the listing for the rest of the
process, rechecks the one file an answer came from, and reads the listing
again on a miss. The selector's per-tree name table is removed.

Fixed, each with a test that fails before this commit:
- A name that two manifests in one root declare (in one tree or across
  benchmarks/ and environments/) now fails to select with the catalog's
  error, instead of selecting the first folder in sorted order. So does a
  manifest the catalog refuses (wrong kind, missing config).
- A loose `benchmarks/<name>.yaml` and a resources server's runnable
  config, both listed by the catalog, now win over a later root's
  manifest of that name. Validation refuses renaming a manifest to a loose
  benchmark config's name, which would hide that config.
- When no root lists a name, a nested `<name>/config.yaml` in any root
  wins over a flavor file again, as before names were IDs.

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

A copied folder that keeps its manifest's name made the catalog's first
step raise, so every --benchmark and --environment selection from that
search root failed until the copy was renamed. Now the first step records
each name that the root supplying it cannot list (two manifests of that
root declare it, or the catalog refuses its manifest) and goes on:

- --benchmark/--environment <that name> fails with the catalog's error,
  naming both files;
- other names still select;
- `gym list` still fails, with the first problem, as before.

Checking the folder at the name's path first and stopping there would be
faster, but after a move it would silently run a copy placed at the old
folder, so the lookup still reads every manifest.

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

This branch has not been deployed

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

Labels

area:env-infra Shared environment framework, lifecycle, registry, scaffolding, and validation feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer risk:high Autobot PR risk: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants