Skip to content

feat(harbor): per-run summary and verbose tracing on the Harbor path (M26) - #4861

Merged
adil-a merged 1 commit into
mainfrom
adasif/harbor-m26-trust-inspection
Oct 27, 2026
Merged

adil-a merged 1 commit into
mainfrom
adasif/harbor-m26-trust-inspection

Conversation

@adil-a

@adil-a adil-a commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Summary

M26 (trust and inspection) on the Harbor task path, built as extensions of what main already ships rather than a parallel report: a per-run summary file beside the rollouts, the input each task ran echoed per task, and the Harbor environment server and oracle agent tracing their work under the existing --verbose.

What changes

  • Per-run summary: every gym dataset validate and gym eval run <task target> writes <rollouts stem>_run_summary.json next to the rollouts (nemo_gym/tasks/harbor/run_summary.py, nemo_gym.path_utils.run_summary_path_for). It records the command, target, taskset and agent; the dataset's folder, source (manifest.toml's [dataset].source, new PreparedTaskset.dataset_source) and digests; the task_source the run config declares for the taskset (known before dispatch) and the value the result rows carry as a cross-check (rows_task_source); the files of the run (rollouts, failures, materialized inputs, aggregate metrics, the health check's quality_summary.json and rollout_verdicts.jsonl, the rows with the data processor's _prepare.jsonl and _metrics.json, the collated collector input under <stem>/preprocessed_datasets/, run config, skipped.json, images.json, the verifier root; null for one the run did not write, and the aggregate metrics and health reports, which follow a completed collection, are listed only when at least as new as the rollouts file, so a stopped run does not pass off an earlier run's as its own; and a fresh start, resume_from_cache=false, the default, records what sits under its rollouts, failures and materialized-inputs names before it dispatches, since the collector clears those only once the servers are up, so a run that dies before that, such as on servers that fail to start, reports them under stale_files instead, with its tasks missing and rows_task_source null, while a resumed run's cached rows stay its own); and, per selected task and repeat, its status (result / failed / missing), reward, mask and failure_kind, the verifier's mode, wall time, network, return code and rewards, the paths of its verifier log folder, test-stdout.txt, trajectory.json, entrypoint-stdout.txt and collected artifacts/ (per turn for a multi-step task), and the input the row carried (task and dataset digests, responses_create_params metadata). All paths are relative to the summary's folder; a folder a row names that is missing on disk is listed under missing_paths. The file is written after collection whatever it did (try/finally), and also when a validate finds no task with a solution/ and dispatches nothing (beside the requested --output, resolved through the same parser as a dispatching run); atomically, and a writer failure is logged without changing the run's outcome. A fresh gym eval run reads its selected rows for the summary only after the collector ran, inside that guard; a resumed run reads them first for the resume-conflict check, as before.
  • Verbosity: no new key. -v / --verbose (verbose) already reaches spun-up servers; the Harbor server now logs at DEBUG when an episode is seeded, when test.sh exits (code, seconds, rewards, log folder) and the final score, and the oracle logs its solve.sh budget, user (or the sandbox default user) and exit. Both stay quiet below WARNING without it.
  • Judge trajectories: not added. No judge runs on the Harbor path outside a task's own test.sh; whatever a sandboxed judge writes under /logs/verifier is in the verifier log folder the summary names. The README says so.
  • Docs: harbor README (Configuration and artifacts), data/harbor-tasks.mdx (Run summary and verbosity), observability/index.mdx.

Test plan

  • tests/unit_tests/test_harbor_run_summary.py (new, 16 tests): relative paths that resolve, the full files map, schema_version, summary_dir, the skipped-task map, missing_paths on results and failures, superseded failures and counts, post-collection files listed only when newer than the rollouts (and named under stale_files otherwise), a fresh start through the real collector that dies before clearing an earlier run's rollouts/failures/materialized inputs (all null, stale_files names them, the task missing, the files untouched) against the same failure on a resumed run (cached rows kept) and a fresh start that reaches the collector (files rewritten and owned), the same three cases through gym eval run --agent hermes_agent (a model run, dispatch stubbed) so the model-run path's pre-dispatch snapshot is covered too, a validate that dispatches nothing beside an earlier run's rollouts, the collator files named after a +split=train override, the empty-selection summary beside --output from the flag, an override and a config overlay, input echo and the rows-file fallback, --output outside the results folder, the task_source cross-check, multi-turn rows, the CLI writing the summary when collection raises, on the resumed run and when no task has a solution, gym eval run reading its rows only after dispatch and inside the summary guard, writer failure never hiding the run.
  • environment_servers/harbor/tests/test_logging.py (new) and the oracle's test_verbose_logging_traces_the_solve_run_at_debug_level_only: the traces are emitted at DEBUG only and absent at INFO.
  • Env server suite 410 passed (-k "not partial_eval and not buildah and not validate_ and not real_image"), oracle suite 23 passed.
  • Harbor CLI unit tests in one session (test_harbor_run_summary, test_harbor_validation, test_harbor_validation_report, test_harbor_tasks, test_cli_main): 602 passed.
  • ruff check, ruff format --check, pre-commit run --files <changed>: clean.
  • Live: gym dataset validate <terminal-bench-2-1> --only-tasks kv-store-grpc,largest-eigenval,fix-git --sandbox opensandbox --output ... -v on OpenSandbox: 3/3 oracle solved (reward 1.0, verify 13.1-17.7 s, exit 0); the summary names 25 paths, all exist from its folder, none absolute, the aggregate metrics and both health reports among them, stale_files empty; DEBUG traces from the server and the oracle in the log. Then, beside a copy of those output files, a fresh start that dies inside the collector before the servers start: every one of the six files null under files and named under stale_files, all three tasks missing, rows_task_source null.

🤖 Generated with Claude Code

@adil-a

adil-a commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 9029f11

@copy-pr-bot

copy-pr-bot Bot commented Oct 21, 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.

@adil-a
adil-a added this pull request to stack #4793 October 21, 2026 16:26
@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer labels Oct 21, 2026
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team October 21, 2026 16:35
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

@adil-a

adil-a commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test c9cfb96

@adil-a

adil-a commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 272070d

@adil-a

adil-a commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 985a960

@adil-a

adil-a commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test aef0090

@adil-a

adil-a commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 2fa9ac4

@adil-a

adil-a commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test cc77494

@adil-a

adil-a commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 8e07306

@adil-a

adil-a commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 8e8b284

ffrujeri
ffrujeri previously approved these changes Oct 24, 2026

@ffrujeri ffrujeri 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.

Thanks, the run summary is a clear improvement for checking a Harbor run after the fact. The fresh-start snapshot that sends an earlier run's files to stale_files instead of passing them off as this run's is a nice touch, and the tests cover resumed, fresh-fail and fresh-success runs through the real collector. The DEBUG traces look safe: they don't log the task env, solution env or credentials, and stay quiet below --verbose. I left one optional question about memory on very large rollouts files. Approving.

Comment thread nemo_gym/tasks/harbor/run_summary.py Resolved
@adil-a

adil-a commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 7674e28

@adil-a

adil-a commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 2267d82

@adil-a

adil-a commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 5234164

@adil-a

adil-a commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test aa7d8bd

@adil-a

adil-a commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test f3b0fdd

@adil-a

adil-a commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 9e36b06

ffrujeri
ffrujeri previously approved these changes Oct 26, 2026

@ffrujeri ffrujeri 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.

LGTM, thanks.

@adil-a

adil-a commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 5529c2f

ffrujeri
ffrujeri previously approved these changes Oct 26, 2026

@ffrujeri ffrujeri 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.

LGTM.

@adil-a

adil-a commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test e045243

@adil-a

adil-a commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test a6740b2

@yuhezhang-ai yuhezhang-ai 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.

Thanks for adding the run summary. I would address the three P2 summary-correctness issues before merging: the dataset label, the saved schedule used by resumed runs, and health-report ownership when startup fails. The remaining three comments are non-blocking inspection improvements.

Comment thread nemo_gym/tasks/harbor/run_summary.py Resolved
Comment thread nemo_gym/tasks/harbor/cli.py Resolved
Comment thread nemo_gym/tasks/harbor/run_summary.py Resolved
Comment thread nemo_gym/tasks/harbor/cli.py Resolved
Comment thread environment_servers/harbor/app.py Resolved
@adil-a

adil-a commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 1fc9b3f

…(M26)

Every `gym dataset validate` and `gym eval run <task target>` now writes one
per-run summary beside its rollouts, `<rollouts stem>_run_summary.json`
(`nemo_gym.tasks.harbor.run_summary`): the command, target, taskset and
agent; the dataset's folder, source and digests; the `task_source` the run
config declares for the taskset (known before dispatch) with the value the
result rows carry as a cross-check (`rows_task_source`); the files of the run
(rollouts and sidecars, the health check's reports, the rows with the data
processor's `_prepare.jsonl` and `_metrics.json`, the collated collector input
under `<stem>/preprocessed_datasets/`, run config, skipped.json, images.json,
the verifier root), each null when the run did not write it: the aggregate
metrics and the health reports, which follow a completed collection, are listed
only when at least as new as the rollouts file, so an earlier run's file by the
same name (the health reports keep one name per folder whatever the `--output`
stem) is not passed off as this run's, and a fresh start (`resume_from_cache`
off, the default) records what sits under its rollouts, failures and
materialized-inputs names before it dispatches, since the collector clears them
only once the servers are up, so a run that dies before that (servers that fail
to start) reports those files as `stale_files`, not its own, with its tasks
`missing`, while a resumed run's cached rows stay its own; and, per selected
task and repeat, the
outcome, the verifier's mode, wall time, network and
return code, the relative paths of its verifier log folder, test-stdout.txt,
trajectory.json, entrypoint-stdout.txt and collected artifacts/ (per turn for
multi-step tasks), and the input the row carried (task and dataset digests, the
responses_create_params metadata). Paths are relative to the summary's folder;
a folder a row names that is gone is listed under `missing_paths`. The summary
is written after collection whatever it did, and also when a validate finds no
task with a solution/ and dispatches nothing (beside the `--output` the command
asked for, resolved through the same parser as a dispatching run); a writer
failure is logged
without touching the run's outcome. A fresh `gym eval run` reads its selected
rows for the summary only after the collector ran, inside that same guard; a
resumed run still reads them first for the resume-conflict check, as before.

`--verbose` is unchanged (main's `verbose` key reaches every spun-up server);
the Harbor environment server and the oracle agent now trace the episode at
DEBUG (seeded, test.sh exit and rewards with the log folder, final score;
solve.sh budget, user or "the sandbox default user", and exit) and stay quiet
below WARNING otherwise.

No judge runs on the Harbor path outside the task's own test.sh, so there are
no judge trajectories to put in the row; whatever a sandboxed judge writes
under /logs/verifier is in the verifier log folder the summary names.

Docs: harbor README outputs section, the Harbor Tasks page and the
observability index.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
@adil-a

adil-a commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ac7d19d

@ffrujeri ffrujeri 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.

LGTM.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40531740574

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40540765528

This branch was previously deployed

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

Labels

area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer QA_verified

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants