Feat/fresh grid world - #318
Conversation
|
@burtenshaw, thank you for the detailed review. I have addressed all the feedback provided in the previous review cycle. Summary of Changes: Directory Structure: Moved the environment from src/envs/ to envs/grid_world_env/ to match the repo standard. Architecture: Switched to EnvClient (WebSocket) and create_app factory pattern as requested. Imports: Fixed all import paths to use openenv.core with try/except blocks for standalone support. Standards: Converted data models to Pydantic, added Meta license headers, and removed debug print statements. Testing: Added tests/envs/test_grid_world.py (pytest) and verified the Docker integration script works with the corrected paths. All local and Docker integration tests are passing. Ready for re-review! |
Greptile SummaryThis PR adds Key Changes:
Issues Found:
Alignment Status:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client as GridWorldEnv (Client)
participant Server as FastAPI Server
participant Env as GridWorldEnvironment
participant State as Internal State
Note over Client,State: Environment Initialization
Client->>Server: WebSocket Connect
Server->>Env: Create Environment Instance
Env->>State: Initialize State (episode_id, step_count=0)
Env->>Env: Set agent position (0,0) and goal (4,4)
Note over Client,State: Reset Episode
Client->>Server: POST /reset
Server->>Env: reset()
Env->>State: Reset step_count=0, new episode_id
Env->>Env: Reset agent_x=0, agent_y=0
Env-->>Server: GridWorldObservation(x=0, y=0, reward=0.0, done=False)
Server-->>Client: Observation response
Note over Client,State: Step Action
Client->>Client: Create GridWorldAction(action=MoveAction.DOWN)
Client->>Server: POST /step {action: "DOWN"}
Server->>Env: step(GridWorldAction)
Env->>State: Increment step_count
Env->>Env: Update position based on action
Env->>Env: Clamp to grid boundaries [0,4]
Env->>Env: Check if goal reached
Env->>Env: Calculate reward (-0.1 or +1.0)
Env-->>Server: GridWorldObservation(x, y, reward, done)
Server-->>Client: StepResult with observation
Note over Client,State: Query State
Client->>Server: GET /state
Server->>Env: state property
Env->>State: Return State(episode_id, step_count)
State-->>Server: State object
Server-->>Client: State response
|
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Added a new environment card for 'Grid World' with descriptions and links.
|
@burtenshaw, I have updated The Hugging Face deployment is verified and running (Green). This PR now includes:
Ready for final review! |
Summary
This PR introduces
grid_world_env, a canonical 5x5 Grid World environment. It serves two primary purposes:[0,0], Goal:[4,4]) for verifying agent logic and server-client communication.pyproject.tomlconfiguration anduvdependency management, while retaining full Docker compatibility for deployment.Type of Change
Alignment Checklist
Before submitting, verify:
.claude/docs/PRINCIPLES.mdand this PR aligns with our principles.claude/docs/INVARIANTS.mdand no invariants are violated/pre-submit-pr(orbash .claude/hooks/lint.shand tests) and addressed all issuesRFC Status
Test Plan
This environment supports multi-mode testing. I have verified it using the following methods:
1. Local Server (
uv)Verified the server starts and responds to API requests locally: