prime-runs - #2415
Draft
kcoopermiller wants to merge 17 commits into
Draft
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RpNehr64sniVfqKo62GKPw
`run_config()` now carries what the dashboard reads unconditionally — `model`, `num_examples` (the selected task count, passed in by the runner; -1 for "all" when unknown) and `rollouts_per_example` — alongside the `exclude_unset` dump, which drops defaults and so left the evals list showing "Unknown Model" and "0 examples". Credentials are stripped producer-side, so nothing sensitive reaches `metadata`: every value under a `headers` table and any value whose key names a credential (`api_key`, `Authorization`, `hf_token`; references such as `api_key_var` are kept) is masked in the structured dump, and the launched config file is uploaded verbatim only when parsing it (TOML/JSON) finds no credential-holding key — otherwise, or when it cannot be inspected, it is left out with a warning naming the offending paths. `open_run` honours `PRIME_RUNS_MODE=disabled`, which the explicit `mode="online"` used to override. A run that stays local keeps its own uuid instead of adopting the SDK's `disabled-…` placeholder. The E2E fixture sets `push=False`: `run_eval` opens a platform run before the first rollout when a key is present, and CI has one. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CyW4j57juAg5cheTX8PmUR
The only places an eval config can carry a credential are a client's `headers` table and a seat's `harness.env` table: the API key itself is `api_key_var` (an env-var name) and `forward_env` exists so harness secrets need not be written down. Mask everything under those two tables and skip the verbatim `config_source` when the file sets either, instead of guessing from key names. Drops the credential-key regex, its reference-key exemption list and the dotted-path scan. Also widen `_close(summary=)` to `Mapping` so `metrics.RunSummary` (a TypedDict) type-checks. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VDrFiuDUjdJrv8Qu4oud8C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wip!!!
Why
The eval CLI hand-rolled its own platform client.
verifiers/v1/utils/platform.pywas 317 lines of resolve env → create → post samples → finalize over raw httpx. PrimeIntellect-ai/prime#856 moves that lifecycle intoprime-runs, a leaf SDK (httpx+prime-traces) where a run is an object held for the length of the run rather than three stateless calls at the end of it.What
What is left in
platform.pyis wiring rather than transport:Gone:
push_traces,credentials,json_bytes,run_metrics, the batching loop, the payload ceiling, the in-memory buffer.trace_to_sampleandbuild_samplesmoved toprime_runs.projection— that is knowledge about a platform wire format, not about an eval framework.build_samplesstays here as a re-export because prime-rl imports it across the repo boundary (prime_rl/monitors/prime.py) against a released verifiers, so dropping the name would break its next upgrade; nothing importstrace_to_sample, so that one is gone.utils/platform.pyopen_run/finish_run/abort_run+PushState;run_configbuilds what is uploaded (see below); the SDK owns the restcli/eval/runner.pycli/eval/main.py@ file.tomlthe run was launched fromconfigs/cli/eval.pyRunConfig.adopt_id()andrecord_source(), both private attrscli/resolve.pyconfig_file_ref(argv)— the root-level@ <path>cli/dashboard/eval.pytests/v1/conftest.pypush=FalseWhat the run carries
run_config()uploads, as the evaluation'smetadata:model_dump(exclude_unset=True)), with the credential tables masked: every value under a client'sheaderstable and under a seat'sharness.envtable. Those are the two free-form string tables in the config and the only places a credential can land — the API key itself never enters the config (api_key_varnames an env var), andforward_envexists so harness secrets need not be written down either. Masked by location, whatever the key is called: no key-name heuristics to keep in sync with the dashboard;model,num_examples(the runner passes the selected task count;-1= "all" when unknown) androllouts_per_example— whichexclude_unsetwould otherwise drop, leaving the environment evals list showing "Unknown Model" / "0 examples × 1 rollouts";@ eval.tomlitself byte for byte undermetadata.config_source— but only if parsing it (TOML/JSON) finds neither table set. Otherwise, or when the file cannot be inspected, it is left out with a warning naming the table (never the values). A non-secret header in the file costs the verbatim copy, not the upload: the structured dump still goes up with the table masked.This is the producer-side counterpart of the Config-tab work in platform#4740, which renders
config_sourceverbatim (TOML highlighting) and falls back to the structured projection — now aware of the verifiers v1 keys — when there is no file.Modes
--no-pushkeeps the run local. So doesPRIME_RUNS_MODE=disabled— the SDK's own switch, honoured explicitly becauseopen_runpassesmode="online"and would otherwise override it. A run that stays local keeps its own uuid rather than adopting the SDK'sdisabled-…placeholder id. A run that cannot be opened (no API key, hub resolution failure) falls back to local with the reason in the dashboard footer; the eval itself never fails because of the platform.Blocked on
prime-runsmust be on PyPI (prime#872 → prime#856) before the[tool.uv.sources]git pin can go. Until then published verifiers wheels are uninstallable withpip, and the sandbox-side installs in the live E2E cannot resolveprime-runs>=0.1.0— which is what the current red E2E job is.