refactor: unify Scene/Role/Turn types into _types.py (ENG-47)#262
Merged
devin-ai-integration[bot] merged 1 commit intoMay 16, 2026
Merged
Conversation
Create src/benchflow/_types.py as the single canonical source for the declarative Role, Scene, and Turn dataclasses. Changes: - New _types.py with Role (adds timeout_sec, idle_timeout_sec, skills_dir), Scene (adds parallel_group), and Turn - trial.py imports from _types.py instead of defining its own copies - _scene.py renames its internal Role to SceneRole (different fields: instruction, tools) with backward-compat alias - __init__.py re-exports canonical types from _types.py; adds TrialRole/TrialScene backward-compat aliases - runtime.py and trial_yaml.py updated to import from _types.py New fields default to None — no runtime behavior changes.
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
Author
Test Report: ENG-47 — Unified Scene/Role/Turn TypesAll 4 tests passed. Shell-based testing (no browser UI). Results
Integration test outputFull pipeline ran: CI noteThe |
Contributor
Author
|
Closing — this is now included in the combined refactor branch: #272 ( |
Merged
5 tasks
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
Phase 1 of the v0.4 type refactor (ENG-47). Creates one canonical set of
Role,Scene, andTurndataclasses insrc/benchflow/_types.py, replacing the duplicate definitions that lived intrial.pyand_scene.py.New fields (all default to
None— no runtime behavior changes):Role.timeout_sec/Role.idle_timeout_sec— per-role timeout supportRole.skills_dir— per-role skills directoryScene.parallel_group— scenes with the same group will execute concurrentlyImport changes:
trial.pyimportsRole,Scene,Turnfrom_types.py(re-exports for backward compat)_scene.pyrenames its internalRole→SceneRole(has different fields:instruction,tools); keeps backward-compat aliasRole = SceneRole__init__.pyre-exports canonical types from_types.py; addsTrialRole = RoleandTrialScene = Scenealiasesruntime.pyandtrial_yaml.pyimport from_types.pyNot touched (per ENG-47 scope):
sdk.py,runtime.pylogic,trial.pylogic, sandbox/reward/verifier code.Review & Testing Checklist for Human
from benchflow import Role, Scene, Turnresolves to the_types.pyversions (canonical types)from benchflow.trial import Role, Scene, Turnstill works (re-export)from benchflow._scene import Rolestill works (backward-compat alias forSceneRole)uv run bench run --source-repo benchflow-ai/skillsbench --source-path tasks/jax-computing-basics --agent gemini --model gemini-3.1-flash-lite-preview -e daytonaNotes
_scene.py::SceneRoleis intentionally kept separate from the canonicalRolebecause it carries runtime-specific fields (instruction,tools) that don't belong on the declarative type.Link to Devin session: https://app.devin.ai/sessions/6d33e83b375c4c16976a11b9805c0e13
Requested by: @xdotli