Add ART and Verifiers trajectory interop helpers#692
Conversation
b29167d to
bb90893
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb90893ea5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| steps = state.get("trajectory") or [] | ||
| if isinstance(steps, list) and steps: | ||
| return _steps_to_messages_and_choices(steps, choice_factory=choice_factory) |
There was a problem hiding this comment.
Preserve completion tail when rebuilding from trajectory steps
When state["trajectory"] is non-empty, this branch returns _steps_to_messages_and_choices(...) and never merges state["completion"]. In states that include completion messages after the last recorded step (for example, environment/tool turns appended at rollout end), those tail messages are silently dropped on import, so ART↔Verifiers round-trips lose transcript content.
Useful? React with 👍 / 👎.
| "is_completed": True, | ||
| "is_truncated": False, | ||
| "stop_condition": "art_trajectory_imported", |
There was a problem hiding this comment.
Propagate truncation status to state-level flag
This sets is_truncated to False unconditionally, even when imported choices mark a truncated finish (e.g., finish_reason == "length" on the final step). Consumers that read only the state-level truncation flag will misclassify truncated rollouts as complete, which can affect filtering and reward/metrics analysis.
Useful? React with 👍 / 👎.
bb90893 to
759ce24
Compare
|
Updated after the automated review feedback. The conversion now propagates state-level |
Summary
Trajectoryobjects into Verifiers-style rollout state with per-choice trajectory stepsTrajectory/TrajectoryGroupobjects, with an optionalchoice_factoryfor preserving trainable assistant choices when callers have the original response payloadBounty fit
This targets the hard scope from the Algora ART-E / ART bounty: two-way portability between ART and Verifiers tasks.
Bounty: https://algora.io/PrimeIntellect-ai/bounties/cxptwFoEv2up9Qjm
Verification
PYTHONPATH=src /tmp/art-interop-venv/bin/python -m pytest tests/unit/test_verifiers_interop.py -q/tmp/art-interop-venv/bin/ruff format src/art/verifiers.py tests/unit/test_verifiers_interop.py/tmp/art-interop-venv/bin/ruff check src/art/verifiers.py tests/unit/test_verifiers_interop.pygit diff --checkNote: I used a minimal local venv for this pure-Python adapter test because the repo's current
uvconfig attempted to resolve/build heavy optional GPU dependencies in this environment.