Repository navigation
feat: keep config logic inside prime_rl.configs - #4926
Closed
mikasenghaas wants to merge 2 commits into
Closed
mikasenghaas wants to merge 2 commits into
mikasenghaas wants to merge 2 commits into
Conversation
utils/validation.py held the rl shared-field propagation, and utils/config.py held config helpers next to the CLI helpers, so the package layout rules did not cover them. propagate_shared_fields moves into the rl entrypoint, dump_resolved_config and default_output_dir into configs.base, and resolve_client_roles into blocks.client. The unused rgetattr and rsetattr go. A new rule keeps prime_rl.utils free of config imports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1fb85cb. Configure here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
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
Why. The package layout rules (
test_config_package_follows_its_rules) cover onlyprime_rl/configs/. Two modules outside it held config logic:prime_rl/utils/validation.pyheldpropagate_shared_fields, the rl shared-field table (model.name→trainer.model.name, ...). It is the rl entrypoint's logic, but no import rule applied to it.prime_rl/utils/config.pymixed config helpers (dump_resolved_config,default_output_dir,resolve_client_roles) with CLI helpers (cli, themodechecks), plus two unused functions.Idea. Move config logic into
prime_rl.configs, and add a rule that keeps it there:prime_rl.utils.validation.propagate_shared_fieldsprime_rl.configs.entrypoints.rl.propagate_shared_fieldsprime_rl.utils.config.dump_resolved_configprime_rl.configs.base.dump_resolved_configprime_rl.utils.config.default_output_dirprime_rl.configs.base.default_output_dirprime_rl.utils.config.resolve_client_rolesprime_rl.configs.blocks.client.resolve_client_rolesprime_rl.utils.config.rgetattr,rsetattrprime_rl.utils.configkeepscli,MODES,config_files,config_mode,check_modeandfind_package_resource.prime_rl.utilsholds helpers that do not know any config and imports nothing fromprime_rl.configs.test_config_utils_hold_no_config_logicenforces it.Breaking
prime_rl.utils.validation, anddefault_output_dir,dump_resolved_config,resolve_client_roles,rgetattr,rsetattrfromprime_rl.utils.config. Migration: import from the paths in the table. Downstream: the prime CLI schema worker (main and fix(train): compile hosted runs with prime-rl's component builders prime#1284) imports only theprime_rl.utils.configmodule and looks updump_components/dump_rl_componentswithgetattr, and model-factory-iacmainimports none of these names. Neither breaks.Verification
On 1fb85cb, on macOS without torch or vllm. b75c993 adds only the CI import fix and a formatting fix:
from prime_rl.configs… importandfrom prime_rl.utils.config importin the repo, I imported the module and checked that each name exists: 0 missing. This also coversorchestrator.pyandeval/online.py, which need triton to import whole.utils/diff.pyimportsprime_rl.configs.base)test_config_utils_hold_no_config_logicfails:diff.py imports ['prime_rl.configs.base']Merge order
Stacked on #4925 (#4899 → #4905 → #4909 → #4919 → #4921 → #4922 → #4923 → #4924 → #4925 → this PR).
🤖 Generated with Claude Code
Note
Low Risk
Refactor with import-path breaks for downstream users; runtime config behavior is unchanged per verification and existing propagation tests still cover
propagate_shared_fields.Overview
Moves config-specific logic out of
prime_rl.utilsinto theprime_rl.configspackage so layout rules apply everywhere config behavior lives.Relocated symbols:
default_output_diranddump_resolved_config→prime_rl.configs.base;propagate_shared_fields→prime_rl.configs.entrypoints.rl(moduleprime_rl.utils.validationremoved);resolve_client_roles→prime_rl.configs.blocks.client. Unusedrgetattr/rsetattrare dropped fromprime_rl.utils.config, which now keeps CLI/mode helpers andfind_package_resourceonly.Documentation & CI: README rule 6 states utils must not import configs;
test_config_utils_hold_no_config_logicenforces it. The slim-install workflow imports the new paths.Call sites: Imports updated across configs, orchestrator, eval, dashboard, pathing, and tests — no intended behavior change. Breaking: old
prime_rl.utils.validationand the moved names onprime_rl.utils.configare gone without shims.Reviewed by Cursor Bugbot for commit b75c993. Bugbot is set up for automated code reviews on this repo. Configure here.