Skip to content

feat(core): support task-owned evaluation subjects - #301

Merged
ethan-scitix merged 4 commits into
scitix:mainfrom
jack-scitix-ai:feat/eval-subject
Nov 23, 2026
Merged

ethan-scitix merged 4 commits into
scitix:mainfrom
jack-scitix-ai:feat/eval-subject

Conversation

@jack-scitix-ai

Copy link
Copy Markdown
Contributor

Type

  • feature — new benchmark, task, or capability

Summary

  • Allow plugins to evaluate external systems without a placeholder Model by declaring requires_model = False and providing an EvalSubject.
  • Define subject metadata, stable call identity, request arguments, and serving information. Existing Model tasks retain their identities and dialect execution paths.
  • Integrate external calls with request logs, stage metadata, token profiling, and persistence through subject_call() and RecordingAsyncClient.
  • Preserve strict resume behavior, request snapshots and explicit JSON nulls, deterministic concurrent-call ordering, and bounded retries.
  • Distinguish helper Model deployment facts from the measured subject and keep runner and public resume planning consistent.
  • Document the plugin contract and add unit and integration regression coverage. No provider-specific Decisions dialect is included.

Related Issues

Refs #299

Test Plan

Automated

  • Lint/format clean (ruff check && ruff format --check)
  • Type check clean (ty check or mypy --strict)
  • Unit tests pass (pdm run pytest)

Regression coverage includes model-less CLI execution, subjects resolved during setup, legacy Model identities, mutable request snapshots, nested mappings and JSON nulls, concurrent call ordering, grading-only resume, overflow retry budgets, helper-model identity isolation, and consistent resume planning.

External API verification uses deterministic mocked HTTP transports. Plugins remain responsible for provider protocols, authentication, response validation, and inference-relevant identity arguments.

Checklist

Required (all PRs)

  • PR title follows conventional format (type(scope): description)
  • No internal paths, credentials, or personal info in committed files
  • AI-generated code has AI-Generated Code - <model> (<provider>) in module docstring
  • No new upper-layer dependencies added to core/
  • Deleted code verified — no remaining call sites depend on it

Add the EvalSubject protocol and explicit model-less task configuration. Integrate external calls with request recording, token profiling, persistence, and strict stage-based resume. Preserve existing Model identities and distinguish helper model facts from the measured subject.

Add regression coverage for subject resolution, request snapshots, concurrent call ordering, retry budgets, and consistent resume planning.

Refs scitix#299

@ethan-scitix ethan-scitix left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes.

Most of the PR follows RFC #299: the EvalSubject protocol, requires_model = False, subject_call() / call.record(), and the out-of-scope items are all respected. Commit messages and identities are clean, CI is green, and the targeted suites pass locally (1534 passed). The blockers are a change to existing identities (1) and one design addition that goes beyond the RFC (2).

Blocking

  1. Bug: call_key() is no longer byte-identical for every Model. (sieval/core/models/subject.py:L84-L104, run_meta.py:L519) call_key now goes through subject_call_key, which can only encode mappings. canonical_json also handled sets, bytes and numpy values. With call_key({"model": "m", "extra": {"tags": {"x"}}}), main returns a key and this PR raises TypeError. The RFC makes identical identities for existing tasks an acceptance test. Please keep canonical_json's encoder for this key and add a regression test that compares against main.

  2. Question/design: the helper-Model + independent-subject case goes beyond the RFC and makes resume less strict. The RFC only covers model-less tasks. In this PR, a task that binds a helper Model and also overrides subject drops that helper's context window, recipe, numerics and parsers from the inference identity (subject_inference_inputs). model_args comes only from subject.request_args(). If the helper is used during infer, changing its parameters does not refuse the resume unless the plugin adds them to the identity itself. The guide documents this, but it conflicts with the strict-only reproducibility contract. Please either split this case into its own PR or fold the helper's request_args() into the identity automatically.

Non-blocking

  1. Question: the RFC says the overflow scope stays on task.model, but the PR applies it only when the subject is a Model (runner.py _infer, _collect_overflow_replays). As a result, a helper Model's context overflows are neither converted nor replayed. This follows from #2, so please settle it with that decision.
  2. Nit: an external subject's call_key() is folded into the inference digest, so changing the subject refuses the resume at inference. A Model switch instead goes through the weights/model comparison. The choice is reasonable, but please note it under Reproducibility in AGENTS.md.
  3. Nit: the RFC asks to check what meta.json readers (leaderboard, weights comparison) do when a subject has no weights. I couldn't find that check in the PR.
  4. Nit: Model.serving() is never called and repeats the first four fields of serving_fingerprint. Please have one build on the other. ServingFingerprint also lost its per-field docs in the move.
  5. Nit: the CONTRIBUTING section on "promoting plugin capabilities into core" is a policy change outside the RFC and would be better as its own PR.

🤖 Generated with Claude Code

@jack-scitix-ai

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review. I addressed the comments as follows.

  1. Model.call_key() compatibility: This was a real bug. subject_call_key() now uses the same extended-value encoding as the legacy canonical_json() path, including sets, bytes, tuples, NumPy values, and datetimes. A regression test now compares the EvalSubject bridge with the legacy Model identity.
  2. Helper Model with an independent subject: The helper Model's resolved request_args() is now included automatically in the inference identity. Both TaskRunner.plan_run() and task_resume_plan() apply the same rule, so changing helper request parameters refuses resume at inference.
  3. Overflow handling: Overflow conversion and replay continue to use the bound task.model when a task requires a Model. External subject HTTP overflows are excluded from helper-model replay unless the request log shows an actual helper-model overflow.
  4. External subject identity: The reproducibility contract is now documented in AGENTS.md. An external subject's call_key() and request_args() are part of the inference identity. Changes refuse resume at inference.
  5. Results without weights: Added test_external_subject_without_weights_falls_back_to_recorded_name to verify that an external subject's meta.json omits weights and the existing comparison falls back to the recorded and current model names.
  6. Model.serving() and serving_fingerprint(): serving_fingerprint() now builds on Model.serving() and only adds run-specific serving fields. The per-field ServingFingerprint documentation was restored.
  7. CONTRIBUTING policy: The plugin-capability promotion policy was removed from this PR because it is outside the EvalSubject RFC scope.

A helper Model bound beside an independent EvalSubject only contributed
its request arguments, so swapping it for another model or other weights
reused the recorded inference. The digest now carries its call key,
weights, request arguments, context window, numerics and parsers, on both
the runner and the public resume plan.

Drop the requests.jsonl scan that chose which recorded overflows to
replay for such a task: it read rotated logs whole on the event loop and
lost evidence on rotation. Those samples are inferred again instead.

Move the canonical JSON encoder to sieval.core.utils.canonical so call
keys and digests share one implementation instead of two copies that had
to stay byte-identical. Condense the guide, AGENTS.md and CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ethan-scitix
ethan-scitix merged commit 607cfde into scitix:main Nov 23, 2026
9 checks passed
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.

2 participants