Skip to content

[2/4] feat(environments): add static manifest validation - #2441

Merged
Glorf merged 2 commits into
mainfrom
mbien/environment-onboarding-validation
Aug 12, 2026
Merged

Glorf merged 2 commits into
mainfrom
mbien/environment-onboarding-validation

Conversation

@Glorf

@Glorf Glorf commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds service-free validation for manifest-backed environments and benchmarks. It checks the declaration against resolved Gym configuration before any service starts.

Stack

This PR contains one commit and is based on the 1/4 branch.

What this PR delivers

  • Offline resolution of Gym configuration and inheritance without endpoint probes, service startup, or model calls.
  • Manifest identity and catalog-path checks.
  • Config-authoritative component and dataset selection, including an actionable error when composition has more than one dataset-bearing agent.
  • Read-only comparison of manifest composition mirrors with resolved config, plus explicit atomic synchronization.
  • Advisory integration-profile inference with evidence, warnings for mismatches, and unknown when static source inspection is inconclusive.
  • Static parsing of preparation and rollout-driver hooks, plus streamed JSONL and prompt-contract validation.

Compatibility and scope

  • Gym config remains the runtime source of truth; manifest mirrors never select runtime composition.
  • Validation does not import workload components, execute preparation code, start services, provision compute, call a model, probe endpoints, or inspect output-directory writability.
  • Profile inference reports evidence and never dispatches or gates runtime behavior.
  • Existing manifest-free workloads continue to run unchanged.

Validation

  • Representative built-in and custom profile-inference cases.
  • Mirror repair, multi-agent ambiguity, hook parsing, prompt application, and malformed-data regressions.
  • Ruff and whitespace checks.

Next layer

The next PR adds non-destructive profile-aware scaffolding and reusable verifier fixtures.

@copy-pr-bot

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

@github-actions

Copy link
Copy Markdown
Contributor

@Glorf Glorf changed the title feat(environments): add static manifest validation [2/4] feat(environments): add static manifest validation Aug 10, 2026
@Glorf
Glorf marked this pull request as ready for review August 10, 2026 12:38
@Glorf
Glorf force-pushed the mbien/environment-onboarding-validation branch 3 times, most recently from ae953b8 to c67e180 Compare August 11, 2026 11:49
@Glorf
Glorf force-pushed the mbien/environment-onboarding-foundation branch 2 times, most recently from 8b78123 to d359fdd Compare August 11, 2026 12:04
@Glorf
Glorf force-pushed the mbien/environment-onboarding-validation branch from c67e180 to 92d757b Compare August 11, 2026 12:04
@Glorf
Glorf force-pushed the mbien/environment-onboarding-foundation branch from d359fdd to c191f82 Compare August 11, 2026 12:51
@Glorf
Glorf force-pushed the mbien/environment-onboarding-validation branch from 92d757b to c45df25 Compare August 11, 2026 12:51
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Aug 11, 2026
@ritaneves
ritaneves force-pushed the mbien/environment-onboarding-foundation branch from c191f82 to 14f6033 Compare August 11, 2026 15:58
@ritaneves
ritaneves force-pushed the mbien/environment-onboarding-validation branch from c45df25 to 2103fb7 Compare August 11, 2026 15:58
@Glorf
Glorf force-pushed the mbien/environment-onboarding-foundation branch from 14f6033 to fc34da5 Compare August 11, 2026 18:29
@Glorf
Glorf force-pushed the mbien/environment-onboarding-validation branch from 2103fb7 to 5b94cc3 Compare August 11, 2026 18:29
Base automatically changed from mbien/environment-onboarding-foundation to main August 11, 2026 18:32
@Glorf
Glorf requested a review from a team as a code owner August 11, 2026 18:32
Glorf added a commit that referenced this pull request Aug 11, 2026
## Summary

Defines an opt-in `manifest.yaml` contract for Gym environments and
benchmarks without changing how workloads run.

## Stack

- **1/4 — Manifest contract** (this PR)
- 2/4 — [Static manifest
validation](#2441)
- 3/4 — [Profile-aware
scaffolding](#2442)
- 4/4 — [Onboarding catalog and
commands](#2443)

Each PR contains one commit and is based on the preceding branch.

## What this PR delivers

- A strict manifest model for identity, catalog metadata, reward
semantics, determinism, integration shape, and config-owned composition
mirrors.
- Four integration profiles matching Gym's existing extension points:
`custom-gym-verifier`, `custom-gym-agent-loop`, `external-agent-loop`,
and `external-rollout-driver`.
- A Pydantic contract that can emit Draft 2020-12 JSON Schema on demand.
- SPDX expression validation through `packaging`, including `LicenseRef`
values and Gym's private-license labels.
- A neutral example, focused contract tests, and contributor
documentation.

The manifest is the single place to read a workload declaration. Gym
configuration remains the authoritative place to write runtime
composition. Names and versions must be non-empty; Semantic Versioning
is documented guidance, while immutable-version enforcement is staged
work.

## Compatibility and scope

- Existing environments and benchmarks continue to run without a
manifest.
- No runtime dispatch, wire protocol, server route, or existing workload
changes.
- The manifest remains opt-in until later stack layers consume it.
- Capabilities, concrete version resolution, pinning, swap enforcement,
and certificate-backed validation remain follow-ups.

## Validation

- Manifest parsing, invariants, SPDX expressions, serialization, and
schema tests.
- Independent Draft 2020-12 validation of the generated representation.
- Ruff and whitespace checks.

Signed-off-by: Michal Bien <[email protected]>
@Glorf
Glorf force-pushed the mbien/environment-onboarding-validation branch from 5b94cc3 to 03e2231 Compare August 11, 2026 19:36
Comment thread nemo_gym/global_config.py Resolved
@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Aug 12, 2026
@Glorf
Glorf force-pushed the mbien/environment-onboarding-validation branch from 03e2231 to ab88cfd Compare August 12, 2026 08:02
@Glorf
Glorf requested a review from a team as a code owner August 12, 2026 08:02
@Glorf
Glorf requested review from a team as code owners August 12, 2026 08:02
@Glorf
Glorf requested a review from bxyu-nvidia August 12, 2026 08:09
@Glorf

Glorf commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test aa7847f

@Glorf
Glorf merged commit 99a21de into main Aug 12, 2026
31 checks passed
@Glorf
Glorf deleted the mbien/environment-onboarding-validation branch August 12, 2026 08:21
Glorf added a commit that referenced this pull request Aug 12, 2026
## Summary

Adds non-destructive scaffolding for all four integration profiles and a
reusable, in-process verifier-fixture contract.

## Stack

- 1/4 — [Manifest
contract](#2417)
- 2/4 — [Static manifest
validation](#2441)
- **3/4 — Profile-aware scaffolding** (this PR)
- 4/4 — [Onboarding catalog and
commands](#2443)

This PR contains one commit and is based on the 2/4 branch.

## What this PR delivers

- Runnable starting points for environments and benchmarks across
`custom-gym-verifier`, `custom-gym-agent-loop`, `external-agent-loop`,
and `external-rollout-driver`.
- The appropriate authored extension point for each non-default profile
while runtime wiring remains config-driven.
- Conservative profile reporting: generated delegation placeholders
infer as `unknown` until their authored behavior is implemented.
- Benchmark source data, prompt configuration, and a typed `prepare()`
hook.
- A resources-server-owned verifier fixture covering full reward, zero
reward, malformed input, and seeded determinism.
- `--reuse-verifier` support across all profiles for compatible existing
scorers with an explicit reward contract.
- One canonical resource-component renderer shared with the existing
`gym env init --resources-server` path; the legacy command keeps its
combined runnable config.
- Conflict-free reruns, atomic fixture updates, and rejection of unsafe
paths, invalid Python names, or unsupported reused compositions.

## Compatibility and scope

- Profiles classify authoring boundaries; they do not change runtime
dispatch.
- Existing workloads do not need manifests or fixtures to keep running.
- No existing environment or resources-server implementation is
modified.
- Identical scaffold reruns are no-ops, and any conflict aborts the
complete write set.

## Validation

- Both workload kinds across all four profiles.
- Generated-code lint and format checks.
- Reused scorer contracts, reward direction, malformed input,
determinism, path safety, and atomic-update regressions.

## Next layer

The final PR exposes the stack through discovery and the four-command
onboarding journey.

Signed-off-by: Michal Bien <[email protected]>
Glorf added a commit that referenced this pull request Aug 12, 2026
## Summary

Completes the user-facing onboarding MVP with a local registry and four
commands:

```bash
gym env init --environment my_eval --profile custom-gym-verifier
gym env validate my_eval
gym env test my_eval
gym env publish my_eval
```

## Stack

- 1/4 — [Manifest
contract](#2417)
- 2/4 — [Static manifest
validation](#2441)
- 3/4 — [Profile-aware
scaffolding](#2442)
- **4/4 — Onboarding catalog and commands** (this PR)

This PR contains one commit and is based on the 3/4 branch.

## What this PR delivers

- A unified local workload registry for manifest-backed and legacy
environments and benchmarks.
- Transition visibility for runnable compositions still colocated under
`resources_servers/`; reusable scorer, tool, and state components
without agent datasets remain component entries.
- Kind-filtered list, search, inspect, status, profile, domain, and JSON
views.
- Environment and benchmark targets for `gym env init`.
- Static checks, advisory profile evidence, warnings, and mirror
synchronization through `gym env validate`.
- Verifier execution in the resources server's managed dependency
environment through `gym env test`.
- A local structural `gym env publish` check that reruns validation and
fixtures, rejects manifest metadata placeholders, and confirms exact
catalog discovery as `experimental`.
- Public documentation for terminology, ownership, profiles, migration
behavior, and all four commands.

`publish` does not assess implementation quality, run a full evaluation,
deploy, commit, push, or claim certificate-backed validation.

## Compatibility

- Existing runtime configuration and execution remain unchanged.
- Existing init, config validation, resources-server test, list, and
search forms remain available.
- Manifest-free runnable workloads remain visible with `no-manifest`
status and continue to run as before.
- Malformed manifests are isolated during global discovery and remain
directly diagnosable with `gym env validate --manifest ...`.

## Validation

- 510 sandbox-safe onboarding and affected CLI tests pass; the
socket-binding case also passes outside the sandbox.
- CI-version Ruff and whitespace checks pass.

## Staged follow-ups

- Capability declarations, concrete component-version resolution,
pinning, and swap refusal.
- Runtime readiness probes as a separate pre-run validation layer.
- In-place manifest backfill and phased CI enforcement for legacy
runnable compositions.
- Repository publication automation, ownership updates, and immutable
version enforcement.
- Certificate-backed `validated` status and a hosted catalog index.
- A session-stateful onboarding sentinel and stored-trajectory replay
coverage.

These follow-ups strengthen runtime readiness, governance, and
migration. They do not change the manifest contract, guided authoring
path, local checks, or transition registry delivered here.

Signed-off-by: Michal Bien <[email protected]>

This branch was previously deployed

1 inactive deployment
public — aa7847f1 Deployed Aug 12, 2026 by copy-pr-bot[bot] via release / finalize / notify #1360
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants