Skip to content

refactor(eval): move the recovery planner out of orchestration - #5596

Closed
AdamRajfer wants to merge 26 commits into
mainfrom
arajfer/eval-recovery-move
Closed

AdamRajfer wants to merge 26 commits into
mainfrom
arajfer/eval-recovery-move

Conversation

@AdamRajfer

@AdamRajfer AdamRajfer commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Draft. All three commit groups below are done, and each is verified on its own: the unit suite and the read-only inspect comparison ran at every group head.

Why

#5343 put the evaluation recovery policy inside nemo_gym/orchestration. That policy covers what a run's saved evidence means, whether a run may be queued again, the budgets and the acceptance gate. Review of #5343 pointed out that much of it does not belong there: orchestration should submit, run and observe jobs. This PR moves the policy to nemo_gym/eval/recovery/, gives it a structure a reader can follow, and removes what is duplicated, all without changing behaviour. The commit groups can be reviewed in order.

1. Relocation (done)

Before After
nemo_gym/orchestration/recovery.py nemo_gym/eval/recovery/planner.py (then split, see 2)
nemo_gym/orchestration/collect_evidence.py nemo_gym/eval/recovery/evidence.py
9 chain-marker constants in orchestration/executors/resume_script.py nemo_gym/eval/recovery/markers.py
27 test modules that test only these modules tests/unit_tests/eval/recovery/
  • History follows the files. The first commit is pure renames.
  • Import direction. In the import-linter layers, nemo_gym.eval sits above nemo_gym.orchestration, and the executors call the planner. So the eval layer is split into its children, and nemo_gym.eval.recovery becomes a layer of its own below orchestration. The contract now forbids the recovery package from importing orchestration, with no new ignore entry.
  • Old import paths are recorded in nemo_gym/_moved_paths.py and in the import-surface fixture, like the package's other moves. They resolve to the same objects and warn on use.
  • Pinned installs. Two scripts run inside a run's pinned install: the remote Store reader and the follow-up's continuation admission. A pinned install can predate this move, so each imports the new module first and falls back to the old path.

2. Structure and duplication (done)

The 5,800-line planner is split by the question each part answers. Every definition moves unchanged, with its comments and in its original order:

Module Question Lines
evidence What did the collector read from the job directory, and what does the run's Store select? 1,308
decision Identity states, run-level actions, and the decision and outcome records 302
budgets Retry, attempt and walltime budgets 138
policy Which saved failure the outcome policy retries, and on which kind 364
grading Is a saved row's grade recorded? Why is it re-verified? 522
rows What is the state of every expected identity? 763
trials Was each expected trial observed, and what failed? 1,743
gate Health, metric coverage, MLflow delivery, gate summary 1,153
planner decide_from_collected: evidence to one decision 482
continuation The chain's continuation admission and allocation accounting 418
markers The strings and file names the chain scripts write 48
  • One direction. Each module imports only modules above it in this list. The package docstring names the entry points, and callers import each name from the module that defines it.
  • Old path. Every name the old module had still resolves there, through the moved-path registry.
  • One home per constant. The planner's second copies of the failure-row keys, the identity keys and the chain's accounting file names now import their single definition. The rendered job scripts are byte-identical to main.
  • Recorded-run fixtures. Five fixtures that were full copies of a recorded healthy run are now patches naming their base and the values they change: 2,220 lines become 142. Each patched run equals the file it replaces exactly.
  • What was examined and kept:
    • The unit suite reaches all but 87 of the lines feat(eval): recover from saved evidence with explicit gate results #5343 added to the planner, outside the paths that run in job-script subprocesses. Those 87 are refusals and integrity checks on malformed or inconsistent evidence, each turning bad input into a named stop, so removing them would change behaviour. They are listed as a test follow-up.
    • NEMO_GYM_SUBMIT_NO_REF_CHECK is the documented escape from the remote ref check: the error message offers it, and tests use it.

3. The Slurm executor (done)

The 2,945-line executors/slurm.py becomes the executors/slurm/ package. Its import path does not change, and the package exports SlurmExecutor.

Module Part Lines
executor.py SlurmExecutor: render a run's job scripts, submit them with sbatch, record the submission 353
chain.py Recovery of a run's auto-resume chain: recovery_evidence, resubmit, walltime_plan, and the journaled extension, raise, repin and operator-continuation steps (ChainRecovery) 1,273
judge_job.py Judge-only jobs that grade saved answers again (JudgeJobs) 539
judge_profile.py A judge-only job's execution profile (moved from executors/) 374
reader.py The remote Store reader 837
scheduler.py The Slurm commands the parts share: sbatch and its reply, partition limits, live checks, the duration format 202
  • Bodies unchanged. The moved methods form the ChainRecovery and JudgeJobs mixins, and SlurmExecutor inherits them, so no method body changes.
  • Two duplicates go. The Slurm duration format, defined twice, and a closure defined twice in the judge-only job path.
  • Old names. Every name the old module exported is still served through the moved-path registry.
  • No scheduler-agnostic interface on purpose. Only Slurm implements resubmit today, and an interface with one implementation would be a guess. The seam arrives as feat(orchestration): add job-management interfaces and types #5295's Resubmittable capability when a second scheduler needs it.

Size against main before #5343

Area #5343 added (net) After this PR (net)
nemo_gym/orchestration/ 11,873 5,391: executors 4,526 (now mostly the slurm/ package, which keeps its chain recovery), submit 657, jobs 107, server supervisor 71, api 30
nemo_gym/eval/recovery/ 0 7,271 (moved and split)
tests and fixtures 33,751 31,903

Net change of each group:

Group Code Tests and fixtures
Relocation +69 +10
Split +600 (module headers, imports, moved-path entries) +106
One home per constant +14 0
Fixture patches 0 −2,064
Slurm executor package +366 (module headers, imports, moved-path entries) +105

Validation

  • Unit suite. The full unit suite passes with no failures at each group head (19,508 passed) and at the main it is based on (19,502 passed). Both sides collect the same 19,533 test ids, counting each moved test file as the same file.
  • Lint. ruff check and format are clean. import-linter keeps its one contract, with no new ignore entry.
  • Recovery decisions are unchanged on real runs. Read-only gym eval resubmit --recover --inspect ran on four finished evaluation runs (one complete run, three stopped at a typed stop: a walltime-budget stop and two infra-retry-budget stops), each with and without gate score flags. It ran at each group head and at main. Only two fields differ: the installed launcher commit and a per-call reader token. Every decision, count, gate verdict and exit code is identical:
Run Decision Counts Gate
Single-turn chat, complete noop 100 scored FAILED; UNVERIFIED with a score key
Agentic skills benchmark, stopped stop 22 scored, 2 retryable FAILED
Agentic terminal benchmark, stopped stop 6 scored, 1 retryable, 1 missing FAILED
Multiple-choice QA, stopped stop 55 scored, 9 retryable FAILED
  • CLI. gym eval resubmit --help and gym eval reverify --help are unchanged.

Follow-ups (not in this PR)

  • Tests for the 87 refusal paths listed above.
  • The run directory keeps several .jsonl journals. One journal with a kind field would be simpler, but tooling outside this package reads the current files, so their formats stay.
  • Names: public helpers that sibling modules now import (some still start with _) get public names once reviewers have the mapping.

AdamRajfer and others added 2 commits November 4, 2026 14:21
…m/eval/recovery

Pure renames, so history follows the files: the planner (orchestration/recovery.py) becomes
eval/recovery/planner.py, the evidence collector (orchestration/collect_evidence.py) becomes
eval/recovery/evidence.py, and the 27 test modules that test only these two move to
tests/unit_tests/eval/recovery/. The next commit updates the imports; this one alone does not import.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
No behaviour change. This commit touches only imports, one constants module, two moved-path
entries and the layer contract.

- The planner reads nine chain-marker strings that the chain scripts write. They move unchanged
  from orchestration/executors/resume_script.py to eval/recovery/markers.py. resume_script imports
  them from there, so the planner no longer imports orchestration at all.
- import-linter: the eval layer is split into its children, and the recovery package is a layer of
  its own below orchestration. The executors keep calling the planner, and the contract now
  forbids the planner from importing orchestration.
- The old paths nemo_gym.orchestration.recovery and .collect_evidence are recorded in
  nemo_gym/_moved_paths.py, since 0.8.0 like the other moves there, and in the import-surface
  fixture. They are the same module objects and warn on use.
- Two scripts run inside a run's pinned install: the remote Store reader and the follow-up's
  continuation admission. That install may predate the move, so they import the new path and fall
  back to the old one.
- Every other import of the two modules, in code, tests and the skills, uses the new path.

Signed-off-by: Adam Rajfer <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AdamRajfer AdamRajfer self-assigned this Nov 4, 2026
@copy-pr-bot

copy-pr-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown

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.

AdamRajfer and others added 9 commits November 4, 2026 16:12
…answers

No behaviour change. Every top-level definition moves unchanged, with the comment lines above it and in its
original order, from the 5,800-line planner into the module that answers its question:

- evidence: the collected-evidence model and the Store selection, beside the collector script;
- decision: identity states, run-level actions, the decision and outcome records;
- budgets: retry, attempt and walltime budgets;
- policy: the recovery outcome policy and the failure kind it selects on;
- grading: saved grading artifacts and the re-verification cause;
- rows: per-identity classification;
- trials: trial observations and fault classes;
- gate: health, metric coverage, MLflow delivery and the gate summary;
- planner: decide_from_collected;
- continuation: the chain's continuation admission and allocation accounting.

The modules import in that order and no module imports a later one. The package docstring names the entry points.
Callers import each name from the module that defines it.

The old path nemo_gym.orchestration.recovery keeps serving every name it had: the moved-path registry lists each
split name under it, and the planner's __getattr__ serves them with a deprecation warning. The scripts that run
inside a run's pinned install now import the module that holds their function (evidence for the Store reader,
continuation for the admission), still falling back to the old path on an older install.

Tests that patch a function now patch the module whose code calls it; no assertion changes.

Signed-off-by: Adam Rajfer <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
No behaviour change. The recovery planner had defined values a second time that already had a home elsewhere:

- the failure-row keys (_ng_failure_class, _ng_failure_terminal, _ng_failure_counts_as_zero,
  _ng_failure_max_attempts) now all live in artifacts/rollout_rows.py, beside the failure class key that
  was already there. rollout_collection imports them from there. The planner's short names bind to them.
- _ng_failure_events and _ng_failure_id come from FailureReportRow, which owns the failure report keys.
- _ng_task_index and _ng_rollout_index come from config/global_config.
- the chain's accounting file names (.gym_infra_retries, .gym_infra_retry_extension and
  .gym_accumulated_walltime) live in eval/recovery/markers.py, which the chain scripts and the recovery
  reader both import. They keep resume_script's existing names. The job script's walltime file is now
  rendered from the constant: the rendered prologue and epilogue are byte-identical.

The planner's three duplicate names stay importable from the old module path through the moved-path registry.

Signed-off-by: Adam Rajfer <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…althy run

Five fixtures were full copies of a recorded healthy run that differ from it only in the values their case
changes: the reward, the grading binding, and the ids and digests that follow from them. Each is now a
patch file that names its base and lists the values it sets, one per line (2,220 lines down to 142).
`recorded_run` rebuilds the run. A patched run equals the file it replaces exactly; this was checked for
each one before the files were removed. The repeats and verifier-error runs differ from the base in whole
subtrees, so they stay full files.

The detect-secrets baseline moves the entries of the removed files to their patch files. Its other
entries are unchanged.

Signed-off-by: Adam Rajfer <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…urm package

Pure renames, so history follows: executors/slurm.py becomes executors/slurm/executor.py and executors/judge_profile.py moves beside it. The next commit splits the executor by part and keeps the import path nemo_gym.orchestration.executors.slurm; this one alone does not import.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
No behaviour change. The 2,945-line executor becomes the executors/slurm package, keeping its import path
nemo_gym.orchestration.executors.slurm (the package exports SlurmExecutor):

- executor.py: SlurmExecutor itself, which renders a run's job scripts, submits them with sbatch and records
  the submission (run, stage, dry run, export);
- chain.py: recovery of a run's auto-resume chain (recovery_evidence, resubmit, walltime_plan and the
  journaled extension, raise, repin and operator-continuation steps), as the ChainRecovery mixin;
- judge_job.py: judge-only jobs (reverify_judge_failures) as the JudgeJobs mixin, with judge_profile.py
  beside it;
- reader.py: the remote Store reader;
- scheduler.py: the Slurm commands these parts share (sbatch and its reply, partition limits, live checks).

Every definition and method keeps its text, comments and order. The moved methods form the two mixins, and
SlurmExecutor inherits them, so no method body changes. No scheduler-agnostic interface is added: only
Slurm implements resubmit today. The executor capabilities give resubmit its seam when a second scheduler
needs one.

Names the old one-file module exported stay importable from the package through the moved-path registry,
and executors.judge_profile is recorded as moved. Tests that patched a name on the old module now patch it
on each package module that uses it; no assertion changes.

Signed-off-by: Adam Rajfer <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
No behaviour change. chain.py and judge_profile.py each defined the same HH:MM:SS formatter; scheduler.py, which holds the Slurm formats the executor parts share, now defines it once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
…queued

No behaviour change. reverify_judge_failures and _queue_judge_job each defined the same closure that stops the decision with a reason; a module-level _stopped(decision, reason) replaces both, called with the decision each closure read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
Brings in the recovery accounting fix (#5594) and the managed-environment locks (#4837).

Resolutions:
- The planner split is regenerated from the merged planner with the same mechanical split. The only change to
  the split modules is #5594's: RecoveryDecision.accounting_unknown, set on the two unknown-accounting stops,
  and the operator continuation keying on it instead of on the reason text.
- import-linter layers: main's new orchestration layer entry (the two locked-environment CLI modules) keeps
  its place, and the recovery layer stays below it.
- The test #5594 added imports OperatorBudget from its new module.
- The old module path keeps serving the two unknown-accounting reasons, which the planner no longer imports.

Signed-off-by: Adam Rajfer <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings in the Store-backed run records and run-folder shards (#5443).

#5443 does not touch the recovery planner, so the planner split is unchanged. Its edits to
executors/judge_profile.py are carried into executors/slurm/judge_profile.py, where that module now lives.
Its rollout_collection changes are untouched.

Signed-off-by: Adam Rajfer <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@AdamRajfer

Copy link
Copy Markdown
Contributor Author

/ok to test 5b7def1

AdamRajfer and others added 2 commits November 4, 2026 23:15
Brings in the unit test tree that mirrors the nemo_gym packages (#5589), with the rest of main.

Resolutions, following the layout #5589 adds to AGENTS.md (a test sits with the package of the module it is
named for):
- The 24 recovery test modules that #5589 placed in tests/unit_tests/orchestration/ go to
  tests/unit_tests/eval/recovery/, beside the package they now test. The export receipt, grading result
  binding and saved-judge rejudge tests stay where #5589 put them (artifacts/, trajectory/, eval/): each is
  named for a module outside the recovery package. They keep this branch's imports.
- Test-to-test imports follow both moves, and the moved tests keep #5589's path changes.
- The five recorded-run fixtures this branch keeps as patches are removed from
  tests/unit_tests/orchestration/fixtures/, where #5589 moved them, and their patches move there, beside
  their healthy base and the loader that reads them. The secrets baseline follows: main's entries, without
  the five full fixtures, with the patch files at their new paths.
- No moved test has an entry in the core shard durations.

Signed-off-by: Adam Rajfer <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
main changed two files this branch moves (#5601). Its hunks are carried
to their new homes:
- the failed-judge-job progress rule (_judge_job_unsettled) to
  nemo_gym/eval/recovery/decision.py
- the failed judge job note (judge_job_note) to
  nemo_gym/eval/recovery/gate.py
- the host-collected unresolved_rejudgments field to
  nemo_gym/orchestration/executors/slurm/reader.py

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
@AdamRajfer

Copy link
Copy Markdown
Contributor Author

/ok to test b90c25c

Comment on lines +262 to +264
def installed_commit(self) -> str | None:
"""The Gym commit this launcher runs; the same value the judge-only job and a repin are checked against."""
return installed_gym_commit()

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.

That's redundant

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.

You're right, the wrapper only forwards to installed_gym_commit(). I'll drop it and call the function where the judge-only job and the repin check need it.

Comment on lines 146 to 157
def export_tracking(
self, record: SubmissionRecord, benchmark: str, evidence: CollectedEvidence | None
) -> dict[str, Any]:
"""Send a complete run without an MLflow export receipt to MLflow with Gym's post-run export, and report
what happened: ``state`` (``succeeded``, ``skipped``, ``failed`` or ``unsupported``), ``run_id`` and ``error``.
"""
return {
"exporter": "mlflow",
"state": "unsupported",
"error": f"{type(self).__name__} cannot export a saved run; run `gym eval export mlflow "
"+rollouts_jsonl_fpath=<job dir>/artifacts/rollouts.jsonl` with the run's MLflow settings",
}

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.

Why is it ML-flow specific? Seems like it (possibly) patches some corner case for when live-exporter failed to leave a receipt?

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.

Fair point, it's a shortcut from the recovery PR. The one case it covers is a complete run whose driver died before the live exporter wrote its receipt, and the gate only knows about the MLflow receipt. I'll generalize it: exporters taken from the run's saved config, one receipt check per exporter, no "mlflow" in the names.

Comment on lines +196 to +207
def export_tracking(
self, record: SubmissionRecord, benchmark: str, evidence: CollectedEvidence | None
) -> dict[str, Any]:
"""Run `gym eval export mlflow` on the run's saved artifacts from the login host, and report its result.

The export runs where the remote Store reader runs, with the run's saved pinned Gym install (and its MLflow
extra) in a temporary checkout: it only reads the saved artifacts and talks to the tracking server, so it needs
no allocation. It takes the benchmark's saved `mlflow_*` and `upload_rollouts` run settings, and its
credentials as the driver did: the submission's forwarded environment and the driver's env. Gym's export takes
the run lock, prepares the health metrics and writes the receipt bound to the artifact digests, and skips a run
that already has one. The resubmit lock is held and no job of the chain may be live meanwhile.
"""

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.

Let me re-iterate from the base.py - this should be executor agnostic. In general we have a mechanism to keep track fo what is exported, what failed exporting etc. Seems like a parallel path that we should remove alltogether. We should also not scrape stdout.. If some output from gym eval export is needed, let's design it together either via JSON-formatted stdout, return code or something different

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.

Agreed on both. One post-run export path, driven by the exporter tracking we already have, and gym eval export returning a JSON result plus an exit code instead of us parsing its stdout. I'll write up a proposal for the output shape and we design it together before I change it.

"""The Gym commit this launcher runs; the same value the judge-only job and a repin are checked against."""
return installed_gym_commit()

def gym_pin(self, record: SubmissionRecord) -> str | 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.

This should be abstracted away to a method that calls _saved_config() <- executor-specific or possible get_file() <- executor-specific and does the extraction in the same way. Method signature TBD

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.

Furthermore, with landed-to-be job management PR, we have each capability expressed as a capability mixin (compare: https://github.com/NVIDIA-NeMo/Gym/pull/5295/changes#diff-770394fdd167afaa6a369aef99657627f8138f6056787752154a4a0750e5532f). This is FYI on how this might change.

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.

Yes. One method in the base that reads the saved config and does the extraction, with only the file read executor-specific. I'll shape it so it fits the capability mixins from #5295, thanks for the pointer.

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.

Why is it SLURM specific?

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.

It isn't, by design, only by history: it was cut out of the Slurm executor, so the sbatch submission and the planning ended up in one file. The admission and journal logic already lives in eval.recovery and has nothing Slurm in it. I'll move the planning there and leave only the submission in the slurm package.

job = record.benchmark_job(benchmark)
job_dir = Path(job.job_dir)
with get_connection(record.hostname) as conn:
config = self._saved_config(conn, Path(record.run_dir))

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.

there are multiple hidden dependencies here. JudgeJobs was only extracted from previous executor class state but it still assumes access to the executor methods

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.

True. It still reaches into the executor (recovery_evidence, _saved_config, _queue_judge_job) as if it were part of it. I'll give it those as explicit collaborators, a small protocol for reading the saved config, collecting evidence and submitting, so the dependencies are visible and the thing is testable on its own.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added feature New capabilities, enhancements, or enablement work area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters labels Nov 7, 2026
…asses and can only shrink

Signed-off-by: Tomasz Grzegorzek <[email protected]>
… H2 ping sidecar out of orchestration

Signed-off-by: Tomasz Grzegorzek <[email protected]>
…importing orchestration

Signed-off-by: Tomasz Grzegorzek <[email protected]>
… slurm executor package

Signed-off-by: Tomasz Grzegorzek <[email protected]>
Brings in tgrzegorzek/orchestration-boundary-moves (the boundary test and the moves of the
supervisor, server_venv, sidecar, installed_gym_commit, eval status lookup and the failure
kind writer), which includes current main.

Conflict resolution:
- main's changes to orchestration/recovery.py and collect_evidence.py are ported into the
  eval/recovery modules, symbol by symbol (28 changed, 9 added, 2 removed).
- eval/recovery/markers.py keeps the chain markers and gains DRIVER_FAILURE_ENV and
  record_failure_kind; eval/recovery/__init__.py keeps the longer docstring.
- the slurm executor modules import installed_gym_commit from utils.gym_commit.
- the server tests that imported nemo_gym.orchestration.recovery import from the modules
  that define the names, so KNOWN_VIOLATIONS in the boundary test is empty.

Signed-off-by: Tomasz Grzegorzek <[email protected]>
…yout

main's new recovery tests patch and call names that now live in gate and evidence, and the
old-path tables in _moved_paths.py and the import-surface fixture still listed names main moved
or removed (installed_gym_commit, GRADING_WITHOUT_VERDICT, fault_class).

Signed-off-by: Tomasz Grzegorzek <[email protected]>
@prokotg
prokotg changed the base branch from main to tgrzegorzek/orchestration-boundary-moves November 10, 2026 07:59
@prokotg
prokotg added this pull request to stack #5884 November 10, 2026 07:59
prokotg added a commit that referenced this pull request Nov 10, 2026
…/recovery/markers

This belongs in the recovery relocation (#5596), which creates eval/recovery and owns its
contract. The cli/utils.py -> resume_script import returns to KNOWN_VIOLATIONS until then.
When this branch is merged into #5596, those two commits must be re-applied there.

Signed-off-by: Tomasz Grzegorzek <[email protected]>
marta-sd pushed a commit that referenced this pull request Nov 10, 2026
…/recovery/markers

This belongs in the recovery relocation (#5596), which creates eval/recovery and owns its
contract. The cli/utils.py -> resume_script import returns to KNOWN_VIOLATIONS until then.
When this branch is merged into #5596, those two commits must be re-applied there.

Signed-off-by: Tomasz Grzegorzek <[email protected]>
@marta-sd
marta-sd force-pushed the tgrzegorzek/orchestration-boundary-moves branch from e85aae2 to e4867f1 Compare November 10, 2026 13:26
Base automatically changed from tgrzegorzek/orchestration-boundary-moves to main November 10, 2026 14:37
nemo-autobot-origin Bot pushed a commit to svcnemo-autobot/Gym that referenced this pull request Nov 10, 2026
…NeMo#5882)

* refactor(utils): move installed_gym_commit out of orchestration into utils/gym_commit

Signed-off-by: Tomasz Grzegorzek <[email protected]>

* refactor(server_runtime): move the server supervisor, server venv and H2 ping sidecar out of orchestration

Signed-off-by: Tomasz Grzegorzek <[email protected]>

* refactor(cli): let gym eval status take its job-ID lookup instead of importing orchestration

Signed-off-by: Tomasz Grzegorzek <[email protected]>

* refactor(eval): move record_failure_kind and DRIVER_FAILURE_ENV to eval/recovery/markers

Signed-off-by: Tomasz Grzegorzek <[email protected]>

* Merge the updated boundary test branch (with main) into the orchestration moves

Conflicts: cli/env.py, environment/in_process.py, server_runtime/__init__.py and
test_in_process.py keep both main's new code and the moved server_runtime imports.
agentic_if_realworld takes installed_gym_commit from nemo_gym.utils (now exported there), and
KNOWN_VIOLATIONS lists only the 11 recovery importers that the recovery relocation removes.

Signed-off-by: Tomasz Grzegorzek <[email protected]>

* test(environment): import DRIVER_FAILURE_ENV from eval/recovery/markers in the new chain-guard test

Signed-off-by: Tomasz Grzegorzek <[email protected]>

* fix(compat): keep installed_gym_commit importable from nemo_gym.orchestration.jobs

It shipped in v0.7.0 under that path, so the old import now resolves to nemo_gym.utils.gym_commit
with a deprecation warning, and the import-surface fixture lists the name again.

Signed-off-by: Tomasz Grzegorzek <[email protected]>

* fix(compat): key the sidecar key-name entry under the released module path

A caller of the released nemo_gym.h2_ping_sidecar.config now gets one warning that names
nemo_gym.config.global_config, and scripts/migrate_imports.py rewrites to it.

Signed-off-by: Tomasz Grzegorzek <[email protected]>

* refactor(cli): make eval_status's job_artifact_dirs a required keyword

cli/main.py is the only caller; a default would let a new caller silently lose the Gym job ID lookup.

Signed-off-by: Tomasz Grzegorzek <[email protected]>

* docs: redirect the old orchestration library pages of the moved modules

The server supervisor, server venv and sidecar pages published from main under
nemo_gym/orchestration now redirect to their server_runtime pages (plain and :version), and the
section comment names server_runtime.

Signed-off-by: Tomasz Grzegorzek <[email protected]>

* Revert the move of record_failure_kind and DRIVER_FAILURE_ENV to eval/recovery/markers

This belongs in the recovery relocation (NVIDIA-NeMo#5596), which creates eval/recovery and owns its
contract. The cli/utils.py -> resume_script import returns to KNOWN_VIOLATIONS until then.
When this branch is merged into NVIDIA-NeMo#5596, those two commits must be re-applied there.

Signed-off-by: Tomasz Grzegorzek <[email protected]>

* refactor(server_runtime): put the server startup code in server_runtime/supervisor/

The server supervisor, server venv, HTTP/2 ping sidecar (with its Go sources) and the two scripts the
venv runs (_locked_env, _prepare_worker, moved from cli/) become one subpackage, so server_venv finds
_locked_env.py beside itself and nothing runs it by a path into cli/.

- The subpackage has its own public API (get_venv_path, run_command, setup_env_command,
  sync_environment); nemo_gym.server_runtime exports none of them and its docstring is back to what
  runs inside a server.
- The layering contract puts server_runtime.supervisor above the rest of server_runtime, so nothing
  that runs inside a server can import it, and drops _locked_env/_prepare_worker from the
  orchestration layer.
- Old nemo_gym.cli._locked_env and _prepare_worker paths get MOVED_MODULES entries; the docs
  redirects, the tests (now under tests/unit_tests/server_runtime/supervisor/) and the CI durations
  keys follow.

Signed-off-by: Tomasz Grzegorzek <[email protected]>

* test(telemetry): the active-servers gauge writer is now server_supervisor.py

The supervisor module is server_runtime/supervisor/server_supervisor.py; the test, which the
telemetry extra gates, still expected supervisor.py.

Signed-off-by: Tomasz Grzegorzek <[email protected]>

---------

Signed-off-by: Tomasz Grzegorzek <[email protected]>
@AdamRajfer AdamRajfer closed this Nov 14, 2026
@prokotg
prokotg removed this pull request from stack #5884 November 16, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters feature New capabilities, enhancements, or enablement work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants