Repository navigation
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
8dd6a1a to
897a942
Compare
6a3f5e5 to
ac754d4
Compare
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
I found a false rejection for absolute-path manifests whose task contracts import a schema from the same component root. The validation guide also needs to describe the newly imported contracts.
I inspected both changed files and their affected runtime paths. This was static review; I did not execute tests.
Inline comments (escaped v1):
-
nemo_gym/environment/validation.pyline 864: RISK: Make the manifest's component root importable before loading its contractFailure: From outside
/plugin, rungym env validate --manifest /plugin/benchmarks/demo/manifest.yaml. Route a valid materialized row to a custom environment server whose contract importsfrom resources_servers.plugin_rs.task_data import TaskData as TaskInput, with both components beneath/plugin. For example, letTaskDatarequirequestion: strand supply{"task_id":{"taskset":"demo","task_id":"1"},"task_input":{"question":"q"}}._with_component_rootadds/pluginto file-search roots but notsys.path. This lookup finds the contract, thenload_task_input_moduleexecutes its ordinary import, which fails because the schema's root is not importable. Validation should accept this valid row. The base implementation accepted it through envelope validation.Correction: Could you align imports with the effective component-search roots during validation? One small correction is to add
import sysand import the existing_augment_sys_path, then replace_with_component_root's currenttry/finallywith:original_sys_path = sys.path[:] try: _augment_sys_path() yield finally: sys.path[:] = original_sys_path if original is None: os.environ.pop(NEMO_GYM_EXTRA_ROOTS_ENV_VAR_NAME, None) else: os.environ[NEMO_GYM_EXTRA_ROOTS_ENV_VAR_NAME] = original
This makes the selected root importable without leaving the path change behind. Keep the loader's cross-root rejection guard, including for already-imported foreign modules; do not hide a mismatch by accepting the cached model. Keep missing-module envelope fallback and malformed-module errors unchanged.
Proposed acceptance: Create the uniquely named components above under a temporary manifest root absent from
sys.path, change to another directory, and validate the absolute manifest path. The valid row should report one row; removingquestionshould raiseEnvironmentValidationErrorfor the required field, not an import failure. Check path and environment restoration on success and failure. Retain the two-row success assertion for both single-agent-turn servers in the existing compatibility test, and theTaskInputModuleErrorassertion for a genuinely foreign schema in the cross-root test. The patch and checks are suggested, not executed. -
fern/versions/latest/pages/contribute/environments/new-environment.mdxline 479: NOTE: Suggest documenting the task-contract import exceptionThe statement that validation “does not import components” is no longer accurate. For a routed materialized row, the new contract lookup reaches module execution. Contributors relying on this paragraph should know that the task contract loads, even though validation does not start its server.
Could you replace this paragraph with the following, keeping the distinction that preparation and rollout-driver hooks are parsed without execution?
It imports routed servers' dependency-light `task_input.py` contracts when validating materialized tasks, but does not import their `app.py` entrypoints, start services, execute preparation code, call a model, run an evaluation, probe model or resources endpoints, or check evaluation-output writability. Runtime pre-run readiness is a separate validation layer. Component versions and capabilities, profile pinning, and `adopted_from` source resolution are deferred from this initial static validation. Scorer behavior and grading quality require the later validation layers.Static acceptance: the guide should distinguish executed task-input contracts from unexecuted application entrypoints and preparation hooks, matching the inspected lookup. No runtime change or new test is needed.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
ac754d4 to
c49fdee
Compare
897a942 to
4dd7f30
Compare
|
Both review points are addressed in c49fdee.
|
c49fdee to
d76011e
Compare
4dd7f30 to
5caad12
Compare
d76011e to
9e05799
Compare
5caad12 to
569a391
Compare
…kInput gym env validate checked a task row against SingleAgentTurnTaskInput for two hardcoded servers and only as an envelope for every other server. It now loads the routed environment server's task input module and validates MaterializedTask[TaskInput], so swe_together and Harbor rows are checked against their own models. A task row routed to a relay is refused. A row with no route, or routed to a server without a module, keeps the envelope check, because a manifest can be validated without the run config that routes it. The authoring checks apply where the model requires responses_create_params, as before for single-agent-turn rows. Signed-off-by: Ananth Subramaniam <[email protected]>
569a391 to
972fa94
Compare
9e05799 to
3e8049f
Compare
Before and after
Before:
gym env validatechecks a task row againstSingleAgentTurnTaskInputonly when its taskset routes to one of two hardcoded servers. Every other server, includingswe_togetherand Harbor, gets only an envelope check, so a badswe_togetherrow passes.After: it validates a task row against the
TaskInputof the server its taskset routes to, loaded from that server's task input module (#6447).flowchart LR R["Task row"] --> S{"Routed server's task_input.py"} S -->|"TaskInput type"| V["Validate MaterializedTask[TaskInput]"] S -->|"TaskInput = None, a relay"| X["Refused: a relay takes no task rows"] S -->|"no module, or no route"| E["Envelope check, as before"] classDef good fill:#dff5e3,stroke:#1e8449,color:#000 class V,X goodswe_togetherrow withtask_datamissingimageandimage_digesttask_input.task_datalegacy_agentSingleAgentTurnTaskInputWhat changed and why
SINGLE_AGENT_TURN_ENVIRONMENT_SERVERSandTaskInputObjectare removed. The routed server's contract is looked up once per dataset.responses_create_paramsbesidetask_inputand for prepared prompts, apply where the model requiresresponses_create_params. That keeps them for single-agent-turn rows and leavesswe_together's placeholder rows and Harbor multi-step rows alone.Issue
None filed. Part of checking rows against the model of the server that receives them.
Validation
New tests check a
swe_togetherrow against its model and refuse a task row routed to a relay. The existing tests still cover single-agent-turn rows, the authoring checks, and broken envelopes on any server.Rollout evidence
N/A.
gym env validateonly; no server behavior changes.Compatibility
A manifest with task rows that fail their server's model now fails
gym env validate. Those rows fail at dispatch today.SINGLE_AGENT_TURN_ENVIRONMENT_SERVERSandTaskInputObjecthad no users outsidevalidation.py, in Gym or NeMo RL main.