feat: add code-review environment#1152
feat: add code-review environment#1152vominh1919 wants to merge 2 commits intoPrimeIntellect-ai:mainfrom
Conversation
UpdateAdded 2 more environments to this PR:
All environments follow Prime Intellect's Environments Program guidelines for Open Access bounties ($100-500 each). Total: 3 environments ready for review! |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 439fa61. Configure here.
| "answer": "Security issue: No path validation. Could allow directory traversal attacks. Should validate filename.", | ||
| "language": "python" | ||
| }, | ||
| ] * (num_eval_examples + 1) |
There was a problem hiding this comment.
Dataset uses prompt string, causing assertion crash
High Severity
All three new environments use "prompt" as the dataset column key with a plain string value, but also pass a system_prompt to SingleTurnEnv. The framework's _ensure_prompt method, when it finds a prompt column already present and system_prompt is set, asserts that prompt must be a list of messages — causing an AssertionError at initialization. The column key needs to be "question" instead of "prompt" so the framework properly wraps the string into a messages list. All existing environments that use string-valued prompts use "question" for this reason.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 439fa61. Configure here.
| system_prompt="You are an expert code reviewer. Analyze the code and identify bugs, security issues, and potential improvements.", | ||
| rubric=rubric, | ||
| message_type="chat", | ||
| ) |
There was a problem hiding this comment.
New environments missing from environments/README.md
Low Severity
Three new environments (code_review, api-design, sql-query) are added to the environments/ folder but environments/README.md is not updated to list them. The project rules require that any PR adding or removing an environment must update environments/README.md to reflect the change under the appropriate category/pattern section.
Additional Locations (2)
Triggered by project rule: BugBot Instructions
Reviewed by Cursor Bugbot for commit 439fa61. Configure here.


Summary
Adds a new
code-reviewenvironment for evaluating LLM's ability to review code.Features
Bounties Program
This environment aligns with Prime Intellect's Environments Program:
Usage
prime env install code-review prime eval run code-review -m openai/gpt-4.1-miniCloses #
Note
Low Risk
Additive, self-contained environment modules with simple scoring and no changes to shared infrastructure, auth, or data-handling paths.
Overview
Adds three new installable evaluation environments under
environments/:api-design,code-review, andsql-query.Each environment defines a
load_environment()that builds small synthetic train/eval HFDatasets, configures a simple keyword-based scoringRubric, and returns avf.SingleTurnEnvwith an appropriate system prompt. Newpyproject.tomlfiles wire packaging metadata, dependencies (verifiers>=0.1.8), and default eval settings;code-reviewalso includes a README with usage instructions.Reviewed by Cursor Bugbot for commit 439fa61. Bugbot is set up for automated code reviews on this repo. Configure here.