feat(v1): record run provenance on the episode - #2409
Draft
hallerite wants to merge 1 commit into
Draft
Conversation
hallerite
force-pushed
the
feat/episode-provenance
branch
2 times, most recently
from
August 20, 2026 14:54
89b4fc5 to
798157b
Compare
Episodes gain consumer-stamped provenance: task_key and task_hash, group_id, policy_version, and a run identity set via Episode.record_run (which also records the run on each trace). EnvInfo gains the consumer-facing name next to the package id. All fields default to None/unset, so wire and record shapes are unchanged until a consumer stamps them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hallerite
force-pushed
the
feat/episode-provenance
branch
from
August 20, 2026 15:11
798157b to
13c68bc
Compare
| """Consumer-assigned rollout-group identity.""" | ||
| policy_version: int | None = None | ||
| """Version of the policy weights the episode was generated with.""" | ||
| run: RunInfo | None = None |
Member
There was a problem hiding this comment.
should we remove run info from Trace then?
Comment on lines
+37
to
+40
| task_key: str | None = None | ||
| """Stable identity of the task the episode ran (``Task.key``), consumer-stamped.""" | ||
| task_hash: str | None = None | ||
| """Content hash of the task's data (``Task.hash``), consumer-stamped.""" |
Member
There was a problem hiding this comment.
can we re-use the task info obj which trace uses, ie task.{key,hash,data} (i think)
Comment on lines
+41
to
+43
| group_id: str | None = None | ||
| """Consumer-assigned rollout-group identity.""" | ||
| policy_version: int | None = None |
Member
There was a problem hiding this comment.
i wonder if this should not be in a TrainRunInfo so that its not on eval traces, so basically a discriminated union of TrainRunInfo and EvalRunInfo
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.
Companion to PrimeIntellect-ai/prime-rl#3297. (prime-rl temporarily pins
feat/episode-provenance-pin— this same commit rebased onto its current submodule pin — until this merges.)Episodes gain consumer-stamped provenance, so an orchestrator can place an episode without wrapping it or synthesizing traces:
Episode.task_key/Episode.task_hash— stable identity and content hash of the task the episode ran, recorded at dispatchEpisode.group_id: str | None— consumer-assigned rollout-group identityEpisode.policy_version: int | None— policy weights version that generated the episodeEpisode.run: RunInfo | NoneplusEpisode.record_run(run), which also records the run on each traceEnvInfo.name: str | None— the name the consumer runs the env under, next to the packageidEnvInfois exported fromverifiers.v1All fields default to None/unset: wire and record shapes are unchanged until a consumer stamps them (
to_recordalready drops unset fields viaexclude_none).🤖 Generated with Claude Code
Note
Add run provenance fields and
record_runmethod toEpisodetask,group_id,policy_version, andrunfields to theEpisodemodel in episode.py, carrying run metadata alongside the episode.Episode.record_run(run)which setsself.runand stamps every contained trace viatrace.record_run(run).namefield toEnvInfoand exportsEnvInfofrom init.py so it is reachable viafrom verifiers.v1 import EnvInfo.EpisodeandEnvInfogain new optional fields; existing consumers that do not set them are unaffected, but deserialization now accepts the extra keys.📊 Macroscope summarized 798157b. 7 files reviewed, 2 issues evaluated, 1 issue filtered, 1 comment posted
🗂️ Filtered Issues
verifiers/v1/serve/client.py — 0 comments posted, 1 evaluated, 1 filtered
CancelledErroraroundasyncio.wait_for;await self.socket.send_multipart(...)occurs before thattry. If the caller is cancelled while the send is suspended (including after ZeroMQ has accepted the multipart message but before the await resumes),_send_cancelis never scheduled and_pending[request_id]is never removed. The server-side rollout can therefore continue consuming resources after the client run was abandoned, while the client also retains a stale pending future. Include the send in the cancellation-protected region or otherwise clean up/cancel from an outertry. [ Out of scope ]