Skip to content

chore(experimentalist): mark result models as deprecated contracts - #1006

Open
ngoncharenko wants to merge 2 commits into
ngoncharenko/aalgo-312-wire-eval-into-optimizerfrom
ngoncharenko/aalgo-312-wire-eval-into-optimizer-deprecation
Open

chore(experimentalist): mark result models as deprecated contracts#1006
ngoncharenko wants to merge 2 commits into
ngoncharenko/aalgo-312-wire-eval-into-optimizerfrom
ngoncharenko/aalgo-312-wire-eval-into-optimizer-deprecation

Conversation

@ngoncharenko

@ngoncharenko ngoncharenko commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Background

This is a follow up to these threads to "deprecate" the existing experimentalist models that have corresponding replacements in the evaluator sdk.

Solution: add metadata to models and tests.

Alternative (stronger lock): require approval in CI from codeowner on change or runtime warning

What changed

  • Mark TrialResult and EvaluationResult as deprecated compatibility contracts through static Pydantic JSON Schema metadata, with explicit SDK migration targets and blockers.
  • Add CI coverage that locks the models' public shape, required fields, serialization, warning-free runtime behavior, and persisted candidate details.
  • Document why both result contracts remain required today and distinguish the AgentEvalTrial adapter migration from end-to-end AgentEvalResult convergence.

Why

  • Preserve identical behavior across native-Harbor and SDK-backed evaluator paths while making contract changes deliberate and reviewer-visible.
  • Avoid runtime warning noise and premature conversion to SDK result types before their data and consumer gaps are closed.
  • Follow up on the model-duplication discussion in #955.

Validation

  • uv run --frozen pytest plugins/nemo-experimentalist/tests -q — 628 passed.
  • Live plain-Harbor vs SDK-backed Harbor A/B — passed.
  • Scoped Ruff lint/format, ty, and git diff --check — passed.

@github-actions github-actions Bot added the chore label Jul 30, 2026
@ngoncharenko
ngoncharenko marked this pull request as ready for review July 30, 2026 22:53
@ngoncharenko
ngoncharenko requested review from a team as code owners July 30, 2026 22:53
@ngoncharenko
ngoncharenko force-pushed the ngoncharenko/aalgo-312-wire-eval-into-optimizer branch from 503ca31 to 20813e3 Compare July 31, 2026 04:30
Signed-off-by: Nick Goncharenko <ngoncharenko@nvidia.com>
@ngoncharenko
ngoncharenko force-pushed the ngoncharenko/aalgo-312-wire-eval-into-optimizer-deprecation branch from bf606af to d54f655 Compare July 31, 2026 16:13
…t OSError

CodeRabbit flagged a bare `task_dir.resolve()` in `_cache_stamp` and suggested
routing it through `_safe_resolve` like `_task_dirs_for` does. Investigating that
turned up a larger problem: `_safe_resolve` would not have fixed it.

On CPython 3.12 -- the floor this package targets -- `Path.resolve()` translates
ELOOP into `RuntimeError("Symlink loop from ...")`, which is not an `OSError`.
`_safe_resolve` caught only `OSError`, so a symlink loop propagated straight
through the very helper written to absorb it, killing a run over a best-effort
cache fingerprint. It raises deterministically, not as a race. Verified across
interpreters: 3.12 raises RuntimeError; 3.14 resolves a loop without raising at
all, so the hazard is live only on the supported range.

The loop is reached through `_digest_directory`'s walk, which already routes every
path through `_safe_resolve` -- so this was live regardless of the flagged line.

`_cache_stamp`'s three resolve calls now use `_safe_resolve` too. Being precise
about why: that is consistency, not a demonstrated fix. `_task_dirs_for` filters
candidates with `is_dir()`, which returns False for a loop, so a looping path
never reaches them. Reverting those three lines alone does not fail the new test;
reverting the exception set does.

Regression test uses a self-referential symlink and asserts the stamp still
fingerprints the task. Mutation-checked against CodeRabbit's exact suggestion
(`_safe_resolve` with `except OSError`), which still fails.

Refs AALGO-312.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Nick Goncharenko <ngoncharenko@nvidia.com>

@SandyChapman SandyChapman 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants