Skip to content

fix: harden environment catalog discovery for manifest migration - #2622

Draft
Glorf wants to merge 1 commit into
mainfrom
mbien/environment-onboarding-followup
Draft

Glorf wants to merge 1 commit into
mainfrom
mbien/environment-onboarding-followup

Conversation

@Glorf

@Glorf Glorf commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Mixed manifest and legacy workload trees are intentional during the onboarding migration. This PR makes catalog discovery failure-isolated and truthful while preserving the existing compatibility API.

  • Exclude reserved manifest.yaml metadata from runnable benchmark discovery.
  • Add a structured catalog report around the existing registry while preserving the tuple-returning discover_environment_catalog() API.
  • Surface malformed, schema-invalid, and structurally invalid manifests without blocking unrelated entries or healthy lower-precedence roots.
  • Make exact selection and local publication reject only the affected unusable manifest-backed fallback.
  • Cover nested benchmark identities, manifest/config sibling association, root precedence, CLI JSON/stderr separation, and publication isolation.

Why

Before this change, manifest.yaml could be considered a runnable benchmark YAML candidate. Invalid manifests were also either hidden from broad discovery or handled inconsistently by exact selection and publication. That made mixed manifest/legacy trees unreliable precisely while the repository is migrating incrementally.

The implementation keeps catalog identity and precedence in the existing registry and resolver. Callers receive scoped diagnostics without introducing a second registry or changing healthy legacy discovery.

Scope

This PR contains catalog hardening only. It does not add workload manifests or verifier fixtures, add changed-workload reporting or CI enforcement, implement migration inventory/backfill, infer dependency impact, integrate Evergreen, certify workloads, or change any RFC requirement to complete.

Validation

  • 144 catalog-focused tests passed (143 in the sandbox plus the socket-binding test outside it)
  • Ruff check and format check
  • git diff --check

@copy-pr-bot

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

@Glorf
Glorf force-pushed the mbien/environment-onboarding-followup branch from 4754160 to f750aff Compare August 19, 2026 20:29
@Glorf Glorf changed the title fix: harden catalog diagnostics and add advisory workload reporting fix: harden environment catalog discovery for manifest migration Aug 19, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:env-infra Shared environment framework, lifecycle, registry, scaffolding, and validation bug Something isn't working labels Oct 20, 2026
yuhezhang-ai added a commit that referenced this pull request Nov 13, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- setup_of and protocol_of find their target by name, in the manifest's
  own root first and then in the other search roots, so a setup kept in
  another repository can name a benchmark that Gym ships.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 13, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- setup_of and protocol_of find their target by name, in the manifest's
  own root first and then in the other search roots, so a setup kept in
  another repository can name a benchmark that Gym ships.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 13, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- setup_of and protocol_of find their target by name, in the manifest's
  own root first and then in the other search roots, so a setup kept in
  another repository can name a benchmark that Gym ships.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 13, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- setup_of and protocol_of find their target by name, in the manifest's
  own root first and then in the other search roots, so a setup kept in
  another repository can name a benchmark that Gym ships.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 13, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- setup_of and protocol_of find their target by name, in the manifest's
  own root first and then in the other search roots, so a setup kept in
  another repository can name a benchmark that Gym ships.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 13, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- setup_of and protocol_of find their target by name, in the manifest's
  own root first and then in the other search roots, so a setup kept in
  another repository can name a benchmark that Gym ships.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 13, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- setup_of and protocol_of find their target by name, in the manifest's
  own root first and then in the other search roots, so a setup kept in
  another repository can name a benchmark that Gym ships.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 13, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- setup_of and protocol_of find their target by name, in the manifest's
  own root first and then in the other search roots, so a setup kept in
  another repository can name a benchmark that Gym ships.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 13, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- setup_of and protocol_of find their target by name, in the manifest's
  own root first and then in the other search roots, so a setup kept in
  another repository can name a benchmark that Gym ships.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 13, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- setup_of and protocol_of find their target by name, in the manifest's
  own root first and then in the other search roots, so a setup kept in
  another repository can name a benchmark that Gym ships.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 13, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- setup_of and protocol_of find their target by name, in the manifest's
  own root first and then in the other search roots, so a setup kept in
  another repository can name a benchmark that Gym ships.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 13, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- setup_of and protocol_of find their target by name, in the manifest's
  own root first and then in the other search roots, so a setup kept in
  another repository can name a benchmark that Gym ships.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 16, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- setup_of and protocol_of find their target by name, in the manifest's
  own root first and then in the other search roots, so a setup kept in
  another repository can name a benchmark that Gym ships.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 17, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- setup_of and protocol_of find their target by name, in the manifest's
  own root first and then in the other search roots, so a setup kept in
  another repository can name a benchmark that Gym ships.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 17, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- setup_of and protocol_of find their target by name, in the manifest's
  own root first and then in the other search roots, so a setup kept in
  another repository can name a benchmark that Gym ships.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 17, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- setup_of and protocol_of find their target by name, in the manifest's
  own root first and then in the other search roots, so a setup kept in
  another repository can name a benchmark that Gym ships.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 18, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

This covers main manifests. The setups and protocols a main manifest lists
still take the name of their config's path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 19, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

This covers main manifests. The setups and protocols a main manifest lists
still take the name of their config's path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 19, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

This covers main manifests. The setups and protocols a main manifest lists
still take the name of their config's path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[email protected]>
yuhezhang-ai added a commit that referenced this pull request Nov 19, 2026
…r path

A manifest's name had to equal its folder path under benchmarks/ or
environments/, so moving an environment, for example into a separate
environments repository, would change its ID and break every record that
refers to it.

The name is now the ID and need not match the folder:

- Catalog discovery keys manifest entries by name. Two manifests in one
  tree cannot declare the same name; an earlier search root still shadows
  a later one.
- Validation drops the name-equals-path rule and checks that no other
  manifest in the tree declares the name. A name that differs from its
  folder may not be another config's path, because --benchmark and
  --environment read a name as a path first.
- --benchmark and --environment fall back to the manifest that declares a
  name when no config sits at that path.

This covers main manifests. The setups and protocols a main manifest lists
still take the name of their config's path.

Every existing manifest's name equals its folder path, so the catalog and
name resolution are unchanged for the current repository.

Refs #1520
Supersedes #2622

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yuhe Zhang <[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 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants