Repository navigation
Conversation
ruler_score_group rebuilt the group from its trajectories alone. It dropped the group's exceptions, metadata, metrics and logs, and each trajectory's policy versions, policy token counts and start time. So exception_rate, scenario_id and group metrics were lost after RULER scoring, and trajectory policy age was reset. Copy those fields onto the scored group, which stays a new object. Closes OpenPipe#1142 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Summary
Closes #1142
ruler_score_groupcopies the group before scoring it, but the copy kept only the trajectories' messages, tools, reward, metrics, metadata and logs. Every RULER-scored group therefore lost itsexceptions,metadata,metricsandlogs. Each trajectory lostinitial_policy_version,final_policy_versionand_policy_token_counts, and had itsstart_timereset. Downstream,model.logderivesexception_ratefromgroup.exceptionsand the metrics taxonomy readsscenario_idfrom group metadata, so both went silent for RULER users.PipelineTrainer's policy-age accounting lost the trajectory versions.Changes
src/art/rewards/ruler.py: the copied trajectories also carry the policy versions, start time and a copy of_policy_token_counts. The returned group is built with the originalexceptionsand copies ofmetadata,metricsandlogs.independent_reward,ruler_scoreand the explanation log line are unchanged.tests/unit/test_ruler_score_group_preserves_group.py: stubs the judge and checks the group fields, the per-trajectory provenance, the new rewards, and that the input group is untouched.Test plan
main(assert [] == ['third rollout failed']) and passes here.[] {} {}/None Noneonmain, and the exception, metadata, metrics and3 5with this change.test_ruler_metrics,test_auto_trajectory,test_metrics_builder,test_trajectory_copy,test_metrics_taxonomy+ the new test: 72 passed.ruff format/ruff check(0.15.11) clean.prek run --all-files/tynot run (no CUDA backend deps on macOS).Found and fixed with Claude Code. The checks above were executed locally.
🤖 Generated with Claude Code