Skip to content

fix: resolve ruler function/module name collision in art.rewards (#339)#660

Open
robrui wants to merge 1 commit intoOpenPipe:mainfrom
robrui:main
Open

fix: resolve ruler function/module name collision in art.rewards (#339)#660
robrui wants to merge 1 commit intoOpenPipe:mainfrom
robrui:main

Conversation

@robrui
Copy link
Copy Markdown

@robrui robrui commented Apr 24, 2026

Problem

The import from .ruler import ruler in art.rewards.__init__ shadowed the art.rewards.ruler module name with the ruler() function, making the module-level constants (DEFAULT_RUBRIC, Response, TrajectoryScore, etc.) inaccessible via import art.rewards.ruler or from art.rewards import ruler as art_ruler.

Attempting to access DEFAULT_RUBRIC through the module raised:

AttributeError: function object has no attribute DEFAULT_RUBRIC

Fix

Changed the import pattern from:

from .ruler import ruler, ruler_score_group

to:

from . import ruler as _ruler
ruler = _ruler.ruler
ruler_score_group = _ruler.ruler_score_group

This keeps both the module accessible (via _ruler internals) and the existing public API (art.rewards.ruler(), art.rewards.ruler_score_group()) intact — no breaking changes.

Fixes #339

The import 'from .ruler import ruler' in art.rewards.__init__ shadowed the
art.rewards.ruler module name with the ruler() function, making the module's
constants (DEFAULT_RUBRIC, Response, TrajectoryScore, etc.) inaccessible via
art.rewards.ruler.

Changed to 'from . import ruler as _ruler' pattern, then aliased ruler and
ruler_score_group at the module level. The _ruler name keeps the module
accessible for those who need DEFAULT_RUBRIC or other module-level attributes.

Fixes OpenPipe#339
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: art.rewards.ruler function and module collision

1 participant