Repository navigation
rubrics: reset child rubrics when a rubric is reset - #1535
Open
TheDeadcoder wants to merge 1 commit into
Open
TheDeadcoder wants to merge 1 commit into
TheDeadcoder wants to merge 1 commit into
Conversation
Rubric.reset() now resets every registered child, so stateful rubrics nested in Sequential, Gate, WeightedSum, RubricList and RubricDict (such as TrajectoryRubric) no longer keep the previous episode. TrajectoryRubric.reset() calls super().reset() to keep the same contract. Signed-off-by: TheDeadcoder <sakibbuet2k19@gmail.com>
TheDeadcoder
force-pushed
the
fix/rubric-reset-children
branch
from
October 30, 2026 10:07
d926e33 to
9cb55f4
Compare
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
Rubric.reset()now resets every registered child rubric, soEnvironment._reset_rubric()and directrubric.reset()calls clear stateful rubrics (such asTrajectoryRubric) nested inSequential,Gate,WeightedSum,RubricListandRubricDict.TrajectoryRubric.reset()callssuper().reset()to keep the same contract.Fixes #1533
Type of Change
Alignment Checklist
Before submitting, verify:
.claude/docs/PRINCIPLES.mdand this PR aligns with our principles.claude/docs/INVARIANTS.mdand no invariants are violated/pre-submit-pr(orbash .claude/hooks/lint.shand tests) and addressed all issuesRFC Status
The change implements the composition already documented in RFC 004. Composites that override
reset()(for exampleREPLRubric) are unchanged.Test Plan
New regression tests, all failing on
mainand passing with this change:tests/core/test_rubrics/test_containers.py::TestContainerReset(each container, and a nested composition)tests/core/test_rubrics/test_trajectory_rubric.py::TestTrajectoryRubricBasics::test_reset_resets_child_rubricstests/core/test_rubrics/test_environment_integration.py::TestEnvironmentRubricLifecycle::test_composed_rubric_resets_children_between_episodestests/core/test_rubrics/test_async_environment_integration.py::TestAsyncEnvironmentRubricIntegration::test_composed_rubric_resets_children_on_reset_asyncRubric suite: 191 passed. Full CI test command: 4253 passed, 137 skipped; 10
textarena_envtests failed only because NLTK word data could not be downloaded, and they fail the same way onmainwithout that data.usort check,ruff format --checkandruff checkpass on the changed files.Notes:
reset()is idempotent.reset_async()are still reached only as the root rubric (_reset_rubric_async()behavior unchanged).Claude Code Review
N/A
Note
Low Risk
Targeted lifecycle bug fix in rubric composition with broad regression tests; no auth, I/O, or API surface changes beyond correct reset propagation.
Overview
Rubric.reset()now walks registered children and callsreset()on each, so episode boundaries clear state on nested rubrics (especiallyTrajectoryRubric) insideSequential,Gate,WeightedSum,RubricList, andRubricDict. Previously only the root was reset, so trajectories could leak acrossEnvironment.reset()/reset_async()when the root was a container.TrajectoryRubric.reset()callssuper().reset()before clearing_trajectory, matching the documented override pattern. Subclasses with customreset()should still callsuper().reset()to propagate (unchanged for composites that fully override reset, e.g.REPLRubric).Regression coverage adds container, trajectory-child, sync/async env integration tests.
Reviewed by Cursor Bugbot for commit 9cb55f4. Bugbot is set up for automated code reviews on this repo. Configure here.