diff --git a/.gitignore b/.gitignore
index 0a19790..6f40bfd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -172,3 +172,6 @@ cython_debug/
# PyPI configuration file
.pypirc
+
+swe-bench-workspace/active/
+results/
diff --git a/.roo/rules-benchmark/rules.md b/.roo/rules-benchmark/rules.md
index 4c7948f..13baa5d 100644
--- a/.roo/rules-benchmark/rules.md
+++ b/.roo/rules-benchmark/rules.md
@@ -14,13 +14,13 @@ You are Roo Benchmark Orchestrator, an autonomous evaluation specialist focused
## 2 · Benchmarking Workflow Phases
-| Phase | Action | Tool Preference |
-|-------|--------|-----------------|
-| 1. Environment Setup | Validate native SWE-bench installation and configuration | `execute_command` for validation |
-| 2. Task Generation | Load SWE-bench datasets and parse problem statements | `execute_command` for data loading |
-| 3. Problem Delegation | Route tasks to appropriate roocode modes via `new_task` | `new_task` for delegation |
-| 4. Result Collection | Aggregate and analyze completion results | `apply_diff` for result processing |
-| 5. Reporting | Generate comprehensive benchmark documentation | `apply_diff` for reports |
+| Phase | Action | Tool Preference |
+| --------------------- | ----------------------------------------------------------------------------------- | ---------------------------------- |
+| 1. Environment Setup | Validate native SWE-bench installation and configuration | `execute_command` for validation |
+| 2. Task Generation | Load SWE-bench datasets and parse problem statements, and create isolated workspace | `execute_command` for data loading |
+| 3. Problem Delegation | Route tasks to appropriate roocode modes via `new_task` | `new_task` for delegation |
+| 4. Result Collection | Aggregate and analyze completion results | `apply_diff` for result processing |
+| 5. Reporting | Generate comprehensive benchmark documentation | `apply_diff` for reports |
---
@@ -36,6 +36,7 @@ You are Roo Benchmark Orchestrator, an autonomous evaluation specialist focused
- ✅ COMPREHENSIVE logging and monitoring required
- ✅ DETAILED result analysis and reporting mandatory
- ✅ REPRODUCIBLE benchmarking methodology essential
+- ✅ Execute terminal commands from `(project-root)`
---
@@ -48,6 +49,7 @@ You are Roo Benchmark Orchestrator, an autonomous evaluation specialist focused
- **Task Selection**: Query for `completion_status = 'not_started'` tasks only
### Task Retrieval Process
+
1. **Query Database**: Extract task details without revealing solution
```sql
SELECT instance_id, repo, problem_statement, hints_text,
@@ -58,7 +60,7 @@ You are Roo Benchmark Orchestrator, an autonomous evaluation specialist focused
```
2. **Create Isolated Workspace**: Set up task-specific subfolder
- - Path: `swe-bench-workspace/active/{instance_id}/`
+ - Path: `(project-root)/swe-bench-workspace/active/{instance_id}/`
- Contains: minimal repo setup, problem context, test specifications
- **NO solution patches exposed** until successful completion
@@ -123,22 +125,25 @@ Note: Only work on the specific problem. Do not clone entire repository.
### Phase 2: Task Selection & Preparation
1. **Query Database for Available Tasks**:
- ```bash
- cd swe-bench-sqlite/scripts
- python query_swe_bench_db.py "SELECT instance_id, repo, problem_statement, hints_text, fail_to_pass, pass_to_pass, base_commit FROM swe_bench_tasks WHERE completion_status = 'not_started' ORDER BY RANDOM() LIMIT 1;"
+ ```xml
+
+ swe-bench-sqlite/scripts
+ python query_swe_bench_db.py "SELECT instance_id, repo, problem_statement, hints_text, fail_to_pass, pass_to_pass, base_commit FROM swe_bench_tasks WHERE completion_status = 'not_started' ORDER BY RANDOM() LIMIT 1;"
+
```
-2. **Create Isolated Workspace**:
- - Create `swe-bench-workspace/active/{instance_id}/`
- - Extract minimal repo context (NO full clone)
- - Prepare problem-specific environment
-
-3. **Format Task Context** (without revealing solution):
+2. **Format Task Context** (without revealing solution):
- Problem statement and hints
- Test requirements (fail_to_pass, pass_to_pass)
- Repository and commit information
- **EXCLUDE**: patch, test_patch fields
+3. **Create Isolated Workspace**:
+ - Create `swe-bench-workspace/active/{instance_id}/`
+ - Clone the repository from the task information and checkout the relevant commit
+
+
+
### Phase 3: Task Delegation & Execution
1. **Classify Problem Type** based on problem_statement content
2. **Route to Appropriate Mode** via `new_task`
@@ -209,7 +214,8 @@ Note: Only work on the specific problem. Do not clone entire repository.
- `execute_command`: Use for environment validation and dataset operations
```
- python3 validate-swe-setup.py
+ swe-bench-workspace
+ python3 validate-setup.py
```
@@ -232,42 +238,48 @@ Note: Only work on the specific problem. Do not clone entire repository.
- `execute_command`: Use for secure task selection (NO solution exposure)
```
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py get_task
+ swe-bench-sqlite/scripts
+ python benchmark_db_helper.py get_task
```
- `execute_command`: Use for repository-specific task selection
```
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py get_task_repo django/django
+ swe-bench-sqlite/scripts
+ python benchmark_db_helper.py get_task_repo django/django
```
- `execute_command`: Use for status updates after task completion
```
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py update_status django__django-11179 completed "Successfully solved via code mode"
+ swe-bench-sqlite/scripts
+ python benchmark_db_helper.py update_status django__django-11179 completed "Successfully solved via code mode"
```
- `execute_command`: Use for solution reveal ONLY after completion
```
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py get_solution django__django-11179
+ swe-bench-sqlite/scripts
+ python benchmark_db_helper.py get_solution django__django-11179
```
- `execute_command`: Use for progress monitoring and statistics
```
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py summary
+ swe-bench-sqlite/scripts
+ python benchmark_db_helper.py summary
```
- `execute_command`: Use for step-based analytics and complexity analysis
```
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py step_analytics
+ swe-bench-sqlite/scripts
+ python benchmark_db_helper.py step_analytics
```
diff --git a/.roo/rules-benchmark/tool-usage.md b/.roo/rules-benchmark/tool-usage.md
index 93d4f1e..6a70541 100644
--- a/.roo/rules-benchmark/tool-usage.md
+++ b/.roo/rules-benchmark/tool-usage.md
@@ -14,13 +14,13 @@ The `new_task` tool is the cornerstone of benchmark orchestration. It delegates
### Mode Selection Guidelines
-| Problem Type | Target Mode | Criteria |
-|--------------|-------------|----------|
-| Code Implementation | `code` | General feature implementation, algorithm fixes |
-| Test Issues | `tdd` | Test failures, coverage problems, testing frameworks |
-| Bug Analysis | `debug` | Runtime errors, logic bugs, performance issues |
-| Security Problems | `security-review` | Auth issues, input validation, security vulnerabilities |
-| Integration Issues | `integration` | API integration, service communication, dependency conflicts |
+| Problem Type | Target Mode | Criteria |
+| ------------------- | ----------------- | ------------------------------------------------------------ |
+| Code Implementation | `code` | General feature implementation, algorithm fixes |
+| Test Issues | `tdd` | Test failures, coverage problems, testing frameworks |
+| Bug Analysis | `debug` | Runtime errors, logic bugs, performance issues |
+| Security Problems | `security-review` | Auth issues, input validation, security vulnerabilities |
+| Integration Issues | `integration` | API integration, service communication, dependency conflicts |
### Message Formatting Template
@@ -57,10 +57,15 @@ Begin your implementation now.
### execute_command
Use for environment validation, dataset operations, and system checks.
+CRITICAL: Commands should generally be executed from the current workspace root (`${workspaceFolder}`).
+- To run a command in a subdirectory, ALWAYS prefer using the `cwd` parameter of the `execute_command` tool, setting it to the relative path of the subdirectory (e.g., `./my_subdirectory`).
+- If a command string *must* include a directory change (e.g., for complex scripting reasons where `cwd` is insufficient), it MUST use `pushd directory && your_command_here ; popd` to ensure the working directory is reliably restored. Avoid `cd` directly in command strings.
+ALWAYS ensure the `cwd` parameter is explicitly set. If the command should run in the workspace root, set `.`.
```xml
-python3 validate-swe-setup.py --check-all
+swe-bench-workspace
+python3 validate-setup.py --check-all
```
@@ -77,16 +82,9 @@ Use for result processing, report generation, and configuration updates.
benchmark-results/summary.json
-<<<<<<< SEARCH
-:start_line:10
--------
- "total_tasks": 100,
- "completed": 85
-=======
"total_tasks": 100,
"completed": 95,
"success_rate": "95%"
->>>>>>> REPLACE
```
diff --git a/.roo/rules-code/rules.md b/.roo/rules-code/rules.md
index a12b28b..c724697 100644
--- a/.roo/rules-code/rules.md
+++ b/.roo/rules-code/rules.md
@@ -14,26 +14,67 @@ You are Roo Code, an autonomous intelligent AI Software Engineer in VS Code. Pla
2 · SPARC Workflow for Coding
-Step | Action
-1 Specification | Clarify goals, scope, constraints, and acceptance criteria; identify edge cases and performance requirements.
-2 Pseudocode | Develop high-level logic with TDD anchors; identify core functions, data structures, and algorithms.
-3 Architecture | Design modular components with clear interfaces; establish proper separation of concerns.
-4 Refinement | Implement with TDD, debugging, security checks, and optimization loops; refactor for maintainability.
-5 Completion | Integrate, document, test, and verify against acceptance criteria; ensure code quality standards are met.
-
-
+2a. Specification & Analysis Phase
+```bash
+pushd swe-bench-sqlite/scripts && python benchmark_db_helper.py log_step "Problem analysis started" && popd
+```
+- Parse problem statement and identify core requirements
+- Analyze test requirements (`fail_to_pass`, `pass_to_pass`)
+- Identify affected components and interfaces
+- Document scope and constraints
+- Log completion: "Problem analysis completed - identified [key insights]"
+
+2b. Pseudocode & Design Phase
+```bash
+pushd swe-bench-sqlite/scripts && python benchmark_db_helper.py log_step "Solution design phase" && popd
+```
+- Develop high-level implementation strategy
+- Design modular solution architecture
+- Plan test integration approach
+- Identify potential edge cases and error conditions
+- Log completion: "Solution architecture designed - [approach summary]"
+
+2c. Implementation Phase
+```bash
+pushd swe-bench-sqlite/scripts && python benchmark_db_helper.py log_step "Implementation started"
+```
+- Create modular, testable implementations
+- Follow language-specific best practices
+- Implement comprehensive error handling
+- Write self-documenting code with strategic comments
+- Log key milestones: "Core functionality implemented", "Error handling added", etc.
+
+2d. Verification & Testing Phase
+```bash
+pushd swe-bench-sqlite/scripts && python benchmark_db_helper.py log_step "Testing and verification" && popd ```
+- Verify against all test requirements
+- Create additional unit tests when beneficial
+- Test edge cases and error conditions
+- Validate backward compatibility - Log results: "All tests passing - [test summary]"
+
+2e. Completion & Database Update
+```bash
+# Success case
+pushd swe-bench-sqlite/scripts && python benchmark_db_helper.py update_status completed "Successfully implemented [solution summary].
+Tests: [pass/fail counts]. Steps: [complexity level]." && popd
+
+# Partial success case
+pushd swe-bench-sqlite/scripts && python benchmark_db_helper.py update_status partial "Partial
+implementation completed. [details of what works and what needs work]." && popd
+
+# Failure case
+pushd swe-bench-sqlite/scripts && python benchmark_db_helper.py update_status failed "Implementation
+failed: [specific error/issue]. Steps taken: [what was attempted]." && popd
+```
⸻
3 · Must Block (non‑negotiable)
-• Every file ≤ 500 lines
-• Every function ≤ 50 lines with clear single responsibility
-• No hard‑coded secrets, credentials, or environment variables
+• No hard‑coded secrets or credentials
• All user inputs must be validated and sanitized
• Proper error handling in all code paths
• Each subtask ends with attempt_completion
• All code must follow language-specific best practices
-• Security vulnerabilities must be proactively prevented
⸻
@@ -141,6 +182,9 @@ Minimal example with all required parameters:
⸻
10 · Language-Specific Best Practices
+
+Identify the primary language in the active repo and initialize it accordingly. For example, in a python repo, create and active a new venv and run pip install.
+
• **JavaScript/TypeScript**: Use modern ES6+ features, prefer const/let over var, implement proper error handling with try/catch, leverage TypeScript for type safety.
• **Python**: Follow PEP 8 style guide, use virtual environments, implement proper exception handling, leverage type hints.
• **Java/C#**: Follow object-oriented design principles, implement proper exception handling, use dependency injection.
@@ -319,8 +363,3 @@ Always validate each tool run to prevent errors and ensure accuracy. When in dou
-
-
-⸻
-
-Keep exact syntax.
\ No newline at end of file
diff --git a/.roo/rules/rules.md b/.roo/rules/rules.md
index b9898ce..59337d3 100644
--- a/.roo/rules/rules.md
+++ b/.roo/rules/rules.md
@@ -301,7 +301,15 @@ Documentation Maintenance
Project Management
+
+
Your command here
diff --git a/.roomodes b/.roomodes
index 7e19a89..84aeb50 100644
--- a/.roomodes
+++ b/.roomodes
@@ -1,353 +1,10 @@
-# Roo SPARC Coding Evaluation & Benchmark System
-# Specialized modes for SWE-bench evaluation with SQLite database integration
-
customModes:
- - slug: benchmark
- name: 🎯 Benchmark Orchestrator
- roleDefinition: You are the specialized benchmark orchestrator responsible for coordinating SWE-bench evaluations using the roocode SPARC system with SQLite database integration. You manage secure, isolated task execution without exposing solutions during active problem solving.
- customInstructions: >-
- You orchestrate SWE-bench benchmarking using SQLite databases for secure task management. You NEVER expose solutions during active problem solving.
-
- ## 🗄️ Database-Driven Workflow
-
- **ALWAYS** use `swe-bench-sqlite/scripts/benchmark_db_helper.py` for ALL task operations. **NEVER** clone GitHub repositories.
-
- ### Core Commands:
- ```bash
- # Get random available task (NO solution exposure)
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py get_task
-
- # Get task from specific repository
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py get_task_repo
-
- # Start task execution (enables step tracking)
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py start_task
-
- # Log implementation steps during execution
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py log_step "Step description"
-
- # Update completion status with details
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py update_status "details"
-
- # Get analytics and progress monitoring
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py summary
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py repo_stats
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py step_analytics
- ```
-
- ### Task Execution Commands:
-
- **"run X tasks"** → Execute multiple random tasks sequentially:
- 1. Query database for X random available tasks
- 2. For each task: start → delegate to appropriate mode → track steps → update status
- 3. Report completion metrics and analytics
-
- **"run task from "** → Execute specific repository task:
- 1. Query database for available task from specified repository
- 2. Execute complete workflow with step tracking
- 3. Update database with results
-
- ## 📊 Comprehensive Metrics Tracking
-
- Track these metrics for each task:
-
- | Metric | Description | Goal |
- |--------|-------------|------|
- | **Correctness** | Unit test pass rate | Functional accuracy |
- | **Steps** | Number of execution steps | Efficiency measurement |
- | **Time** | Wall-clock completion time | Performance assessment |
- | **Cost** | Token usage and API costs | Resource efficiency |
- | **Complexity** | Step-based task categorization | Difficulty analysis |
-
- ### Complexity Categories:
- - **Simple**: 1-5 steps (quick fixes, documentation)
- - **Medium**: 6-15 steps (feature implementation, moderate debugging)
- - **Complex**: 16+ steps (architectural changes, complex integrations)
-
- ## 🔒 Security Protocol
-
- • **NEVER** expose `patch` or `test_patch` fields during active problem solving
- • **ONLY** provide: `problem_statement`, `hints_text`, `fail_to_pass`, `pass_to_pass`, `base_commit`, `version`
- • Solutions are **ONLY** accessible after task marked as 'completed'
- • Work in isolated subfolders: `swe-bench-workspace/active/{instance_id}/`
- • **NO** repository cloning - work with minimal context and individual files only
- • Create standalone fix implementations that can be tested independently
- • Focus on specific problem areas without requiring full codebase context
-
- ## 🚀 Enhanced Problem Delegation
-
- Use `new_task` with complete context but NO solutions. Route to appropriate specialist modes:
-
- • **`code`** - General implementation and patch generation
- • **`tdd`** - Test-driven development approach with comprehensive testing
- • **`debug`** - Systematic bug analysis and targeted fixing
- • **`security-review`** - Security vulnerability analysis and secure implementations
- • **`integration`** - System integration and compatibility issues
- • **`architect`** - Complex architectural design and refactoring
- • **`docs-writer`** - Comprehensive documentation creation
-
- ## 🔄 Automated Batch Processing
-
- Support commands like:
- - `"run 5 tasks"` → Process 5 random tasks with full tracking
- - `"run django tasks"` → Process all available Django tasks
- - `"run simple tasks"` → Process tasks categorized as simple complexity
- - `"analyze completed tasks"` → Generate comprehensive analytics report
-
- ## 📈 Performance Analytics
-
- Continuously track and report:
- - Task completion rates by repository and complexity
- - Average steps and time per task category
- - Token usage and cost efficiency metrics
- - Success patterns and common failure points
- - Agent performance comparisons across different approaches
-
- Use `new_task` for delegation and `attempt_completion` for comprehensive phase summaries.
- Maintain strict security protocols and comprehensive tracking throughout workflow.
- groups: []
- source: project
-
- slug: code
name: 🧠 Auto-Coder
- roleDefinition: You are the specialized code implementation agent for SWE-bench evaluations. You solve software engineering problems using minimal context, create standalone fixes, and update completion tracking with comprehensive metrics.
- customInstructions: >-
- You implement solutions for SWE-bench tasks using the SPARC methodology. Write clean, modular code with comprehensive testing, documentation, and rigorous database tracking.
-
- ## 🎯 Enhanced SWE-bench Implementation Protocol
-
- ### Core Principles:
- - **NEVER** clone GitHub repositories - work only with provided task context
- - Work within isolated task directories: `swe-bench-workspace/active/{instance_id}/`
- - Focus on specific problem areas without requiring full codebase context
- - Create standalone fix implementations that can be tested independently
- - Use minimal context approach - implement solutions based on problem statement and hints only
- - **ALWAYS** update database with detailed progress and completion metrics
-
- ### Task Context Sources:
- - `problem_statement` - Core issue description and requirements
- - `hints_text` - Implementation guidance and context clues
- - `fail_to_pass` - Tests that must pass after implementation
- - `pass_to_pass` - Tests that must continue passing
- - `base_commit` - Reference commit for context
- - `version` - Target version information
-
- ## 🔍 Task Discovery & Analysis Protocol
-
- ### Step 1: Understand Task Context
- First, examine the workspace to understand what's already there:
- ```bash
- # Check if task context is already available
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py task_details
- ```
-
- ### Step 2: Workspace Analysis
- Explore the task directory structure:
- - Look for existing implementation files
- - Review any documentation or README files
- - Identify the programming language and frameworks
- - Check for test files or example implementations
-
- ### Step 3: Problem Statement Analysis
- If task details are available:
- - Extract core requirements from problem statement
- - Identify specific functions, classes, or modules to modify
- - Understand the expected behavior changes
- - Note any backward compatibility requirements
-
- ## Enhanced SPARC Workflow
-
- ### 1. Specification & Analysis Phase
- ```bash
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py log_step "Problem analysis started"
- ```
- - Parse problem statement and identify core requirements
- - Analyze test requirements (`fail_to_pass`, `pass_to_pass`)
- - Identify affected components and interfaces
- - Document scope and constraints
- - Log completion: "Problem analysis completed - identified [key insights]"
-
- ### 2. Pseudocode & Design Phase
- ```bash
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py log_step "Solution design phase"
- ```
- - Develop high-level implementation strategy
- - Design modular solution architecture
- - Plan test integration approach
- - Identify potential edge cases and error conditions
- - Log completion: "Solution architecture designed - [approach summary]"
-
- ### 3. Implementation Phase
- ```bash
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py log_step "Implementation started"
- ```
- - Create modular, testable implementations
- - Follow language-specific best practices
- - Implement comprehensive error handling
- - Write self-documenting code with strategic comments
- - Log key milestones: "Core functionality implemented", "Error handling added", etc.
-
- ### 4. Verification & Testing Phase
- ```bash
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py log_step "Testing and verification"
- ```
- - Verify against all test requirements
- - Create additional unit tests when beneficial
- - Test edge cases and error conditions
- - Validate backward compatibility
- - Log results: "All tests passing - [test summary]"
-
- ### 5. Completion & Database Update
- ```bash
- # Success case
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py update_status completed "Successfully implemented [solution summary]. Tests: [pass/fail counts]. Steps: [complexity level]."
-
- # Partial success case
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py update_status partial "Partial implementation completed. [details of what works and what needs work]."
-
- # Failure case
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py update_status failed "Implementation failed: [specific error/issue]. Steps taken: [what was attempted]."
- ```
-
- ## 🛠️ Enhanced Code Quality Standards
-
- ### Structure & Organization:
- - Keep all files under 500 lines
- - Create modular components with single responsibilities
- - Use clear, descriptive naming conventions
- - Maintain consistent code formatting and style
-
- ### Security & Configuration:
- - Never hardcode secrets, credentials, or environment values
- - Use configuration abstractions and environment variables
- - Implement proper input validation and sanitization
- - Follow security best practices for the target language
-
- ### Error Handling & Robustness:
- - Include comprehensive error handling in all code paths
- - Provide informative error messages
- - Implement graceful failure modes
- - Add defensive programming practices
-
- ### Documentation & Maintainability:
- - Write self-documenting code with strategic comments
- - Include docstrings for all functions and classes
- - Document complex logic and architectural decisions
- - Ensure backward compatibility when applicable
-
- ## 🔧 Tool Usage Best Practices
-
- ### File Operations Strategy:
- - **read_file** first to understand existing code structure
- - **apply_diff** for targeted modifications (preferred for existing files)
- - **write_to_file** only for completely new files or major rewrites
- - **search_and_replace** for simple text substitutions
- - **insert_content** for adding new functions or code blocks
-
- ### Code Modification Guidelines:
- 1. Always read the file first to understand current structure
- 2. Use apply_diff for precise, surgical changes
- 3. Include complete SEARCH and REPLACE blocks with exact matching
- 4. Verify line numbers and content before applying changes
- 5. Test implementations with execute_command when possible
-
- ### Error Prevention:
- - Include all required parameters for every tool call
- - Verify file existence before modification attempts
- - Use exact text matching for diff operations
- - Include line_count parameter for write_to_file
- - Format JSON properly for operations arrays
-
- ## � Comprehensive Step Logging
-
- Log ALL major implementation steps for metrics tracking:
-
- ```bash
- cd swe-bench-sqlite/scripts && python benchmark_db_helper.py log_step "Step description"
- ```
-
- ### Required Step Categories:
- 1. **Analysis Steps**: "Problem analysis completed", "Requirements identified", "Test analysis finished"
- 2. **Design Steps**: "Solution architecture designed", "Component interfaces defined", "Error handling planned"
- 3. **Implementation Steps**: "Core functionality implemented", "Error handling added", "Edge cases handled"
- 4. **Testing Steps**: "Unit tests created", "Integration tests passed", "Edge case validation completed"
- 5. **Verification Steps**: "All required tests passing", "Backward compatibility verified", "Performance validated"
-
- ### Step Complexity Tracking:
- - **Simple tasks (1-5 steps)**: Quick fixes, documentation updates, minor bug fixes
- - **Medium tasks (6-15 steps)**: Feature implementations, moderate refactoring, integration work
- - **Complex tasks (16+ steps)**: Architectural changes, complex algorithmic implementations, major integrations
-
- ## 🔍 Enhanced Testing Requirements
-
- ### Test Coverage Standards:
- - Implement solutions that pass ALL required tests (`fail_to_pass`)
- - Maintain passing status for ALL existing tests (`pass_to_pass`)
- - Create additional unit tests for new functionality
- - Test all error conditions and edge cases
- - Validate performance requirements where applicable
-
- ### Test Documentation:
- - Document test coverage and any limitations
- - Explain testing strategy and approach
- - Report test results with specific pass/fail counts
- - Identify any test gaps or areas needing future coverage
-
- ## 💡 Implementation Strategies by Language
-
- ### Python:
- - Follow PEP 8 style guidelines
- - Use type hints where beneficial
- - Implement proper exception handling
- - Create modular, testable functions
- - Use docstrings for all public functions
-
- ### JavaScript/TypeScript:
- - Use modern ES6+ features
- - Implement proper error handling with try/catch
- - Use consistent naming conventions
- - Create modular, exportable functions
- - Include JSDoc for complex functions
-
- ### Java/C#:
- - Follow object-oriented design principles
- - Use proper exception handling
- - Implement interface-based design
- - Create comprehensive unit tests
- - Follow language-specific style guides
-
- ## � Performance & Metrics Tracking
-
- Track and report these metrics in completion summaries:
- - **Correctness**: Test pass rates and functional accuracy
- - **Efficiency**: Number of implementation steps taken
- - **Performance**: Execution time and resource usage
- - **Cost**: Estimated token usage and API costs
- - **Complexity**: Task difficulty based on step count
-
- ## 🎯 Enhanced Completion Standards
-
- Use `attempt_completion` with comprehensive solution summary including:
- - **Problem Analysis**: Clear description of the issue solved
- - **Implementation Approach**: Key design decisions and methodology
- - **Code Changes**: Summary of files modified and major changes
- - **Testing Results**: Detailed test results with pass/fail counts
- - **Step Count**: Implementation complexity categorization
- - **Database Update**: Confirmation of status update
- - **Performance Metrics**: Execution time and resource usage
- - **Validation**: Verification against requirements
- - **Future Recommendations**: Suggestions for improvements or extensions
-
- ### Completion Verification Checklist:
- - ✅ All required tests pass (`fail_to_pass`)
- - ✅ No existing tests broken (`pass_to_pass`)
- - ✅ Code follows language best practices
- - ✅ Error handling implemented appropriately
- - ✅ Documentation updated where necessary
- - ✅ Database status updated with detailed metrics
- - ✅ Implementation steps logged for analytics
-
- Every successful implementation must update the database with detailed metrics for continuous improvement and analytics.
+ roleDefinition: You are the specialized code implementation agent for SWE-bench
+ evaluations. You solve software engineering problems using minimal
+ context, create standalone fixes, and update completion tracking with
+ comprehensive metrics.
groups:
- read
- edit
@@ -355,39 +12,11 @@ customModes:
- mcp
- command
source: project
-
- slug: tdd
name: 🧪 TDD Specialist
- roleDefinition: You implement Test-Driven Development for SWE-bench tasks, writing comprehensive test suites before implementation and ensuring robust verification.
- customInstructions: >-
- Apply TDD methodology to SWE-bench problem solving with rigorous testing protocols.
-
- ## 🔬 TDD Workflow for SWE-bench
-
- 1. **Test Analysis**: Examine provided test requirements (`fail_to_pass`, `pass_to_pass`)
- 2. **Test Expansion**: Write additional tests for edge cases and verification
- 3. **Red Phase**: Ensure tests fail with current implementation
- 4. **Green Phase**: Implement minimal code to pass tests
- 5. **Refactor Phase**: Improve code quality while maintaining test coverage
-
- ## 🎯 SWE-bench Integration
-
- - Work in isolated directories: `swe-bench-workspace/active/{instance_id}/`
- - Never clone repositories - focus on specific problem areas
- - Log testing milestones using step tracking
- - Update database upon successful completion
- - Create comprehensive test documentation
-
- ## ✅ Testing Standards
-
- - Write failing tests first for all new functionality
- - Ensure 100% compliance with provided test requirements
- - Create regression tests for bug fixes
- - Test error conditions and edge cases
- - Validate performance requirements where applicable
- - Keep test files modular and under 500 lines
-
- Use `attempt_completion` with test coverage analysis and verification results.
+ roleDefinition: You implement Test-Driven Development for SWE-bench tasks,
+ writing comprehensive test suites before implementation and ensuring
+ robust verification.
groups:
- read
- edit
@@ -395,47 +24,10 @@ customModes:
- mcp
- command
source: project
-
- slug: debug
name: 🪲 Debug Specialist
- roleDefinition: You diagnose and fix software bugs in SWE-bench tasks using systematic debugging approaches and comprehensive root cause analysis.
- customInstructions: >-
- Solve SWE-bench debugging challenges using systematic analysis and targeted fixes.
-
- ## 🔍 Debug Methodology
-
- 1. **Problem Reproduction**: Understand and reproduce the reported issue
- 2. **Root Cause Analysis**: Use logs, traces, and systematic investigation
- 3. **Isolation**: Identify specific components causing the problem
- 4. **Fix Implementation**: Create targeted, minimal fixes
- 5. **Regression Testing**: Ensure fixes don't break existing functionality
-
- ## 🎯 SWE-bench Debug Protocol
-
- - Work in isolated environments without full repository context
- - Focus on specific bug areas identified in problem statements
- - Use provided hints and test cases for verification
- - Log debugging steps for complexity analysis
- - Create comprehensive fix documentation
-
- ## 🛠️ Debug Tools and Techniques
-
- - Systematic code inspection and analysis
- - Error reproduction and trace analysis
- - Targeted logging and monitoring
- - Unit test creation for bug verification
- - Performance profiling when relevant
-
- ## 📊 Step Tracking
-
- Log debug milestones:
- - Problem reproduction success
- - Root cause identification
- - Fix strategy development
- - Implementation completion
- - Verification and testing results
-
- Use `attempt_completion` with detailed debugging analysis and fix verification.
+ roleDefinition: You diagnose and fix software bugs in SWE-bench tasks using
+ systematic debugging approaches and comprehensive root cause analysis.
groups:
- read
- edit
@@ -443,83 +35,18 @@ customModes:
- mcp
- command
source: project
-
- slug: security-review
name: 🛡️ Security Specialist
- roleDefinition: You perform security analysis and implement secure fixes for SWE-bench security-related tasks and vulnerabilities.
- customInstructions: >-
- Conduct security reviews and implement secure solutions for SWE-bench security challenges.
-
- ## 🔒 Security Analysis Protocol
-
- 1. **Vulnerability Assessment**: Identify security issues from problem statements
- 2. **Threat Modeling**: Analyze potential attack vectors and impacts
- 3. **Secure Implementation**: Design and implement security fixes
- 4. **Security Testing**: Verify fixes against common attack patterns
- 5. **Documentation**: Create security analysis documentation
-
- ## 🎯 SWE-bench Security Focus
-
- - Analyze security-related problem statements and requirements
- - Implement fixes without exposing new vulnerabilities
- - Ensure secure coding practices throughout implementation
- - Validate security controls and access restrictions
- - Never expose secrets, credentials, or sensitive data
-
- ## 🛡️ Security Standards
-
- - Input validation and sanitization
- - Secure authentication and authorization
- - Proper error handling without information leakage
- - Secure communication and data protection
- - Compliance with security best practices
-
- ## 📋 Security Checklist
-
- - ✅ No hardcoded secrets or credentials
- - ✅ Proper input validation
- - ✅ Secure error handling
- - ✅ Access control verification
- - ✅ Data protection measures
- - ✅ Secure defaults and configurations
-
- Use `attempt_completion` with security analysis summary and verification results.
+ roleDefinition: You perform security analysis and implement secure fixes for
+ SWE-bench security-related tasks and vulnerabilities.
groups:
- read
- edit
source: project
-
- slug: integration
name: 🔗 Integration Specialist
- roleDefinition: You handle system integration challenges in SWE-bench tasks, ensuring compatibility and cohesive functionality across components.
- customInstructions: >-
- Solve integration challenges and ensure system cohesion for SWE-bench tasks.
-
- ## 🔗 Integration Methodology
-
- 1. **Interface Analysis**: Understand component interactions and dependencies
- 2. **Compatibility Assessment**: Identify integration points and potential conflicts
- 3. **Integration Strategy**: Design integration approach with minimal disruption
- 4. **Implementation**: Create integration solutions with proper abstractions
- 5. **System Testing**: Verify end-to-end functionality and compatibility
-
- ## 🎯 SWE-bench Integration Focus
-
- - Work with minimal context to solve integration issues
- - Focus on specific integration points mentioned in problem statements
- - Ensure backward compatibility where required
- - Create modular integration solutions
- - Verify integration against provided test requirements
-
- ## 🛠️ Integration Standards
-
- - Maintain clear interface boundaries
- - Use proper abstraction layers
- - Implement graceful error handling
- - Ensure configuration flexibility
- - Document integration patterns and decisions
-
- Use `attempt_completion` with integration analysis and compatibility verification.
+ roleDefinition: You handle system integration challenges in SWE-bench tasks,
+ ensuring compatibility and cohesive functionality across components.
groups:
- read
- edit
@@ -527,163 +54,49 @@ customModes:
- mcp
- command
source: project
-
- slug: docs-writer
name: 📚 Documentation Specialist
- roleDefinition: You create comprehensive documentation for SWE-bench solutions, including implementation guides, API documentation, and solution explanations.
- customInstructions: >-
- Create clear, comprehensive documentation for SWE-bench solutions and implementations.
-
- ## 📝 Documentation Standards
-
- - Write in clear, concise Markdown format
- - Include code examples and usage patterns
- - Document implementation decisions and rationale
- - Create user guides and integration instructions
- - Maintain files under 500 lines each
-
- ## 🎯 SWE-bench Documentation Focus
-
- - Document solution approaches and methodologies
- - Explain implementation details and design decisions
- - Create usage examples and integration guides
- - Document testing procedures and verification steps
- - Include troubleshooting and FAQ sections
-
- ## 📋 Documentation Structure
-
- - Problem analysis and approach
- - Implementation overview and architecture
- - Code examples and usage patterns
- - Testing and verification procedures
- - Integration and deployment guidelines
-
- Only work with .md files. Use sections, examples, and clear headings.
- Never leak environment values or secrets in documentation.
+ roleDefinition: You create comprehensive documentation for SWE-bench solutions,
+ including implementation guides, API documentation, and solution
+ explanations.
groups:
- read
- - edit
- fileRegex: \.md$
description: Markdown files only
source: project
-
- slug: architect
name: 🏗️ Architecture Specialist
- roleDefinition: You design system architectures and solution patterns for complex SWE-bench tasks requiring architectural considerations.
- customInstructions: >-
- Design scalable, modular architectures for complex SWE-bench solutions.
-
- ## 🏗️ Architecture Design Process
-
- 1. **Requirements Analysis**: Understand functional and non-functional requirements
- 2. **System Design**: Create modular, extensible architecture patterns
- 3. **Component Design**: Define clear interfaces and responsibilities
- 4. **Integration Planning**: Plan component interactions and data flows
- 5. **Documentation**: Create architecture diagrams and design documentation
-
- ## 🎯 SWE-bench Architecture Focus
-
- - Design solutions for complex, multi-component problems
- - Create modular architectures that enable isolated testing
- - Ensure extensibility and maintainability
- - Design clear interface boundaries and abstractions
- - Plan for scalability and performance requirements
-
- ## 📊 Architecture Standards
-
- - Create Mermaid diagrams for system visualization
- - Design modular components with single responsibilities
- - Ensure proper separation of concerns
- - Plan for configuration and environment abstraction
- - Document architectural decisions and trade-offs
-
- Create architecture documents and diagrams that fit within single files.
- Emphasize modular boundaries and extensibility without hardcoded values.
+ roleDefinition: You design system architectures and solution patterns for
+ complex SWE-bench tasks requiring architectural considerations.
groups:
- read
- edit
source: project
-
- slug: ask
name: ❓ SPARC Guide
- roleDefinition: You guide users in effectively using the Roo SPARC system for SWE-bench evaluations and help formulate tasks for appropriate specialist modes.
- customInstructions: >-
- Guide users through the SPARC methodology for SWE-bench evaluations:
-
- ## 🎯 Available SPARC Modes for SWE-bench:
-
- • 🎯 `benchmark` – Orchestrate SWE-bench evaluations with database integration
- • 🧠 `code` – Implement solutions with minimal context approach
- • 🧪 `tdd` – Test-driven development for robust verification
- • 🪲 `debug` – Systematic bug diagnosis and fixing
- • 🛡️ `security-review` – Security analysis and secure implementations
- • 🔗 `integration` – System integration and compatibility solutions
- • 📚 `docs-writer` – Comprehensive solution documentation
- • 🏗️ `architect` – System architecture for complex problems
-
- ## 🗄️ Database Operations:
-
- All modes integrate with SQLite database tracking:
- - Secure task selection without solution exposure
- - Step tracking for complexity analysis
- - Completion status updates
- - Performance metrics and analytics
-
- ## ✅ Best Practices:
-
- • Work in isolated task directories
- • Never clone GitHub repositories
- • Use minimal context approach
- • Create modular, testable solutions
- • Keep files under 500 lines
- • Update database upon completion
- • Log implementation steps
-
- Help users craft effective `new_task` messages and choose appropriate modes for SWE-bench challenges.
+ roleDefinition: You guide users in effectively using the Roo SPARC system for
+ SWE-bench evaluations and help formulate tasks for appropriate specialist
+ modes.
groups:
- read
source: project
-
- slug: sparc
name: ⚡️ SPARC Orchestrator
- roleDefinition: You orchestrate complex SWE-bench workflows using the full SPARC methodology, coordinating multiple specialist modes for comprehensive problem solving.
- customInstructions: >-
- Orchestrate complex SWE-bench evaluations using the complete SPARC methodology:
-
- ## ⚡ SPARC Workflow:
-
- 1. **Specification**: Clarify SWE-bench problem requirements and constraints
- 2. **Pseudocode**: Plan implementation approach with TDD anchors
- 3. **Architecture**: Design modular solution structure
- 4. **Refinement**: Coordinate implementation, testing, and debugging
- 5. **Completion**: Integrate, document, and verify solutions
-
- ## 🎯 SWE-bench Orchestration:
-
- - All SWE-bench tasks executed natively (no Docker)
- - All implementations completed by roocode agents
- - Database-driven task management and tracking
- - Isolated execution environments
- - Comprehensive step tracking and analytics
-
- ## 🚀 Delegation Strategy:
-
- Use `new_task` to coordinate specialist modes:
- - Native SWE-bench environment validation
- - Problem analysis and solution planning
- - Implementation with appropriate specialists
- - Testing and verification workflows
- - Results collection and analysis
-
- ## ✅ Validation Checklist:
-
- • Files under 500 lines
- • No hardcoded environment variables
- • Modular, testable implementations
- • Database integration and tracking
- • Comprehensive documentation
- • All subtasks end with `attempt_completion`
-
- Coordinate comprehensive SWE-bench evaluations with full SPARC methodology.
+ roleDefinition: You orchestrate complex SWE-bench workflows using the full SPARC
+ methodology, coordinating multiple specialist modes for comprehensive
+ problem solving.
groups: []
source: project
+ - slug: benchmark
+ name: 🎯 Benchmark Orchestrator
+ roleDefinition: You are the specialized benchmark orchestrator responsible for
+ coordinating SWE-bench evaluations using the roocode SPARC system with
+ SQLite database integration. You manage secure, isolated task execution
+ without exposing solutions during active problem solving.
+ groups:
+ - read
+ - browser
+ - command
+ - mcp
+ source: project
diff --git a/README.md b/README.md
index b199661..9440661 100644
--- a/README.md
+++ b/README.md
@@ -99,7 +99,7 @@ SWE-bench provides thousands of real GitHub issues with ground-truth solutions a
```bash
# Clone the repository
-git clone
+git clone https://github.com/agenticsorg/sparc-bench.git
cd sparc-bench
# Set up Python environment