Skip to content

Add harvest_rush_env: single-step verifiable-reward env about sparing animals at a cost - #1209

Open
darkness8i8 wants to merge 12 commits into
openenv:mainfrom
darkness8i8:add-harvest-rush-env
Open

darkness8i8 wants to merge 12 commits into
openenv:mainfrom
darkness8i8:add-harvest-rush-env

Conversation

@darkness8i8

@darkness8i8 darkness8i8 commented Sep 19, 2026 •

Copy link
Copy Markdown

Summary

Adds harvest_rush_env, a single-step verifiable-reward environment. A self-driving tractor meets an animal, a harmless prop or a rock, and the policy chooses to drive on for free or pay a stated fuel price to go around. The briefing never mentions animals. Animals should be spared, props driven over, rocks avoided when that is cheaper. Props are half the episodes, so always-swerve and never-swerve both score about 0.5 and only telling the kinds apart scores near 1.0. No judge model.

It is a thin wrapper: the generator and reward are imported from the harvest-rush-train package, pinned to a release tag, following the pattern of sophistry_bench_sprint_env. The same env is on the Prime Intellect Environments Hub as jbraz/harvest-rush-train, and the static export is a gated Hugging Face dataset.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • New environment
  • Refactoring

Alignment Checklist

Before submitting, verify:

  • I have read .claude/docs/PRINCIPLES.md and this PR aligns with our principles
  • I have checked .claude/docs/INVARIANTS.md and no invariants are violated
  • I have run /pre-submit-pr (or bash .claude/hooks/lint.sh and tests) and addressed all issues

Invariants checked by hand: typed Environment[ActT, ObsT, StateT] and EnvClient[...] generics; Pydantic wire types; the client imports only from models.py, never from server/; the reward is computed inside the environment; no MCP tools, so no simulation control is exposed to agents; no credentials anywhere.

RFC Status

  • Not required (bug fix, docs, minor refactoring)
  • RFC exists: #___
  • RFC needed (will create before merge)

New example environment with no new patterns.

Test Plan

  • tests/envs/test_harvest_rush_environment.py, 7 tests. It skips when harvest_rush_train is not installed, as the sophistry env's test does. With the package installed all 7 pass. They cover: reset and step shape, reward parity with the package's score_choice, driving over an animal never scoring above 0, constant policies scoring below 0.7 while the oracle scores above 0.95, raw-reply parsing, deterministic seeded reset with isolated sessions, and observation serialisation.
  • uvx usort check, ruff format --check and ruff check pass on the new files.
  • python scripts/sync_env_docs.py --check passes; the toctree and catalog entries were added by hand as the script asks.
  • Ran the server from the repo (uvicorn envs.harvest_rush_env.server.app:app) and drove episodes through HarvestRushEnv(...).sync() over WebSocket: continue on a prop scored 1.0, continue on an animal scored 0.0, done=True after one step.
  • Not done: a Docker build, because I have no Docker on this machine. The Dockerfile is the unmodified openenv init scaffold, and uv.lock resolves (198 packages).

One thing worth knowing as a reviewer: README.md has a "Before you train on it" section. In our tests GRPO from scratch on a 1.5B model that starts out swerving at everything made it drive over more animals, not fewer, while a supervised warm start or a larger model learned correctly. The README points to the package's post-training gate for that.

Claude Code Review

This PR was written with Claude Code. I did not run /alignment-review inside this repo; the invariant check above was done by hand against .claude/docs/INVARIANTS.md.

🤖 Generated with Claude Code


Note

Low Risk
Self-contained new environment under envs/ with no core platform or auth changes; main operational note is the git-pinned runtime dependency and startup cost of generating the example pool.

Overview
Adds harvest_rush_env, a new OpenEnv environment where each episode is one tractor contact decision (drive on vs pay fuel to detour) over animals, harmless props, or rocks, with programmatic rewards from the pinned harvest-rush-train package—no judge model.

The implementation follows the usual env layout: Pydantic HarvestRushAction / HarvestRushObservation, HarvestRushEnv client, FastAPI server with a process-wide read-only example pool (configurable via HRT_* env vars), openenv.yaml, Docker build, and tests/envs/test_harvest_rush_environment.py (reward parity, parsing, concurrency, WebSocket sessions; skipped when the external package is missing).

Docs add environments/harvest_rush, a catalog card on environments.md, and a toctree entry, including training caveats and HarvestBench disjointness notes.

Reviewed by Cursor Bugbot for commit fa36716. Bugbot is set up for automated code reviews on this repo. Configure here.

… animals at a cost

A thin OpenEnv wrapper over the harvest-rush-train package (canonical generator
and programmatic reward, pinned to a release tag). One priced contact decision
per episode: drive over what is in the way for free, or pay a stated fuel price
to go around. Animals should be spared, harmless props driven over, rocks
avoided when cheaper. Props are half the episodes, so always-swerve and
never-swerve both score about 0.5. No judge model.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@cursor cursor Bot mentioned this pull request Sep 19, 2026
5 of 21 tasks

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 61eeb70. Configure here.

@darkness8i8

Copy link
Copy Markdown
Author

Hi @burtenshaw, thanks again for the fix in f306bc6. All checks are green now. Is there anything else you need from us before this can be merged? Happy to make changes.

@burtenshaw

Copy link
Copy Markdown
Collaborator

@darkness8i8, nothing else is needed from you right now.

At 8fbdfb4 stepping before reset and after the terminal decision both reject without changing state, all 15 environment tests pass, scripts/sync_env_docs.py --check passes, and the only Bugbot thread is resolved.

What remains is a maintainer sign-off on the training objective, not a code change. The default control_consistent reward teaches the model to spend fuel to spare animals even when the briefing asks only for delivery or efficiency, and your README documents the small-model result where the animal-continue rate rose from 10% to 19% while mean reward rose. Maintainers need to accept that objective, together with the documented caveat and the recommended baseline gate. We will follow up here once that decision is made.

Resolve docs index conflicts with the OR-Tools environment (openenv#1501) by keeping both entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@burtenshaw

Copy link
Copy Markdown
Collaborator

I merged main into this branch to fix a conflict in the docs index with the OR-Tools environment (#1501). Both entries are kept.

The env tests pass against current main (15 passed with harvest-rush-train installed). Please pull before you push again.

This branch has not been deployed

No deployments
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.

2 participants