RedisInRust
RedisInRust
A long-horizon OpenReward environment: the agent builds redis-clone — a real
Redis-compatible server (RESP2 over a Unix socket) — from scratch in Rust in
/workspace. The resp-producer harness boots the agent's server as an
unprivileged user in a bubblewrap jail and replays the public resp-compatibility
conformance corpus (329 command/reply cases) against it; grading happens SERVER-SIDE (the expected
replies are held in the env-server image, never on the sandbox) so a root agent
cannot bake a lookup table. The finished artifact is a docker pull-able cache
you can drive with redis-cli. Published as GeneralReasoning/RedisInRust.
See DESIGN.md for the full design and build/PROTOCOL.md for the artifact
invocation + grading contract.
Reward
Per-build delta: +1 per corpus case the current build passes
that the previous build did not, −1 per regression. Reward tracks the current
artifact, so the trajectory total telescopes to the pass count of the build the
agent finishes with. finished=True only when a single build passes every
case at once.
Layout
| File | Role |
|---|---|
redisinrust.py | the RedisInRust(Environment) class, tools, reward |
server.py | Server([RedisInRust]).run() |
Dockerfile | lightweight env-server image (built by OpenReward) |
sandbox.Dockerfile | heavyweight sandbox image (toolchain + corpus + harness); pushed to GHCR as ghcr.io/generalreasoning/redisinrust:sha-<12> |
harness/ | the resp-producer grading binary (Rust) |
build/filter_corpus.py | clones + filters the corpus at image-build time |
build/PROTOCOL.md | the artifact invocation + grading contract |
golden_tests.py | no-Docker invariant tests (reward telescoping, anti-cheat) |
test_agent.py | end-to-end smoke test against a running server |
reference_solution/ | known-good impl for Phase-4 reward validation |
Develop / test
# No-Docker invariant tests:
uv run python -m pytest golden_tests.py -v
# Sandbox image: built + pushed to GHCR by .github/workflows/build-sandbox.yml
# (`gh workflow run build-sandbox.yml --ref <branch>`); repin SANDBOX_IMAGE in
# redisinrust.py to the `:sha-<12>` tag it pushes.
# Local server smoke test:
uv run python server.py # in one shell
uv run python test_agent.py # in anotherUse it for real
After publishing, the same sandbox image runs a working server:
docker run --rm -d --name myredis redisinrust-sandbox:local sleep infinity # or the GHCR tag
# (build redis-clone inside, then:) redis-clone --port 6379 &
redis-cli -p 6379 set hi there && redis-cli -p 6379 get hi # -> "there"