feat: Add intelligent auto-router and enhanced integrations

- Add intelligent-router.sh hook for automatic agent routing
- Add AUTO-TRIGGER-SUMMARY.md documentation
- Add FINAL-INTEGRATION-SUMMARY.md documentation
- Complete Prometheus integration (6 commands + 4 tools)
- Complete Dexto integration (12 commands + 5 tools)
- Enhanced Ralph with access to all agents
- Fix /clawd command (removed disable-model-invocation)
- Update hooks.json to v5 with intelligent routing
- 291 total skills now available
- All 21 commands with automatic routing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
admin
2026-01-28 00:27:56 +04:00
Unverified
parent 3b128ba3bd
commit b52318eeae
1724 changed files with 351216 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
## This log tracks our evaluation results and associated costs.
| Date | Executed by | Version | Dataset | #Instance | Model | Resolved Rate | API Cost | Notes |
|------------|-------------|----------------------|-----------------------------------|-----------|----------------------|---------------|----------|------------------------------------|
| 2025-07-08 | Yue Pan | v1.0 | SWE-Bench Lite | 300 | DeepSeek V3 | 28.67% | $70.05 | initial version |
| 2025-07-18 | Yue Pan | v1.0 | SWE-Bench Multilingual | 300 | DeepSeek V3 | 13.67% | $113.6 | initial version |
| 2025-07-31 | Yue Pan | v1.1 | SWE-Bench Lite | 300 | GPT-4o | 30.00% | $1569.73 | context retrieval improved version |
| 2025-08-09 | Zhaoyang | v1.0 | SWE-Bench Verified | 500 | Devstral Medium 2507 | 33.00% | - | |
| 2025-08-11 | Yue Pan | v1.1 | SWE-Bench Verified | 500 | Devstral Medium 2507 | 38.4% | - | |
| 2025-11-06 | Yue Pan | v1.3(with Athena) | dcloud347/SWE-bench_verified_lite | 50 | GPT-5 + gpt-4o | 70.00% | $200.79 | |
| 2025-11-06 | Yue Pan | v1.3(without Athena) | dcloud347/SWE-bench_verified_lite | 50 | GPT-5 + gpt-4o | 56.00% | $367.73 | |

View File

@@ -0,0 +1,179 @@
# GitHub Issue Auto Debug Script Usage Guide
## Overview
`prometheus/script/github_issue_debug.py` is an automated script for:
1. Retrieving detailed information (title, body, comments, etc.) of a specified issue from the GitHub API.
2. Automatically uploading the GitHub repository to Prometheus.
3. Using Prometheus's AI analysis capabilities to debug the issue.
4. Returning analysis results, fix patches, etc.
## Prerequisites
### 1. Start Prometheus Service
Ensure the Prometheus service is running:
```bash
# Start using docker-compose
docker-compose up --build
```
### 2. Obtain GitHub Personal Access Token
1. Visit https://github.com/settings/tokens
2. Click "Generate new token (classic)"
3. Select the appropriate permission scope:
- `repo` (access private repositories)
- `public_repo` (access public repositories)
4. Generate and save the token.
## Basic Usage
### Simple Example
```bash
python github_issue_debug.py \
--github-token "your_token_here" \
--repo "owner/repository" \
--issue-number 42
```
### Full Parameter Example
```bash
python github_issue_debug.py \
--github-token "ghp_xxxxxxxxxxxxxxxxxxxx" \
--repo "microsoft/vscode" \
--issue-number 123 \
--prometheus-url "http://localhost:9002/v1.2" \
--output-file "debug_result.json" \
--run-build \
--run-test \
--run-reproduction-test \
--run-regression-test \
--push-to-remote \
--image-name "python:3.11-slim" \
--workdir "/app" \
--build-commands "pip install -r requirements.txt" "python setup.py build" \
--test-commands "pytest tests/" \
--candidate-patches 3
```
## Parameter Details
### Required Parameters
- `--github-token`: GitHub Personal Access Token
- `--repo`: GitHub repository name in the format `owner/repo`
- `--issue-number`: Issue number to process
### Optional Parameters
- `--prometheus-url`: Prometheus service address (default: http://localhost:8000)
- `--output-file`: Path to the result output file (if not specified, output to console)
### Validation Options
- `--run-build`: Run build validation for the generated patch
- `--run-test`: Run test validation for the generated patch
- `--run-reproduction-test`: Run reproduction test to verify if the issue can be reproduced
- `--run-regression-test`: Run regression test to ensure existing functionality is not broken
- `--push-to-remote`: Push the fix to a remote Git branch
### Docker Environment Configuration
- `--dockerfile-content`: Specify Dockerfile content directly
- `--image-name`: Use a predefined Docker image
- `--workdir`: Working directory inside the container (default: /app)
- `--build-commands`: List of build commands
- `--test-commands`: List of test commands
### Other Options
- `--candidate-patches`: Number of candidate patches (default: 6)
## Usage Scenarios
### Scenario 1: Simple Bug Report Analysis
```bash
# Analyze a simple bug report without running any validation
python github_issue_debug.py \
--github-token "your_token" \
--repo "pytorch/pytorch" \
--issue-number 89123
```
### Scenario 2: Python Project with Test Validation
```bash
# Perform a complete debug for a Python project, including build and test validation
python github_issue_debug.py \
--github-token "your_token" \
--repo "requests/requests" \
--issue-number 5678 \
--run-build \
--run-test \
--run-reproduction-test \
--run-regression-test \
--image-name "python:3.11-slim" \
--build-commands "pip install -e ." \
--test-commands "pytest tests/test_requests.py"
```
### Scenario 3: Node.js Project with Auto Push
```bash
# Process an issue for a Node.js project and automatically push the fix to a remote branch
python github_issue_debug.py \
--github-token "your_token" \
--repo "facebook/react" \
--issue-number 9876 \
--run-build \
--run-test \
--run-reproduction-test \
--run-regression-test \
--push-to-remote \
--image-name "node:18-slim" \
--build-commands "npm ci" "npm run build" \
--test-commands "npm test"
```
### Scenario 4: Custom Docker Environment
```bash
# Use a custom Dockerfile for debugging
python github_issue_debug.py \
--github-token "your_token" \
--repo "tensorflow/tensorflow" \
--issue-number 4321 \
--run-build \
--dockerfile-content "FROM tensorflow/tensorflow:latest-gpu
WORKDIR /app
COPY . /app
RUN pip install -r requirements.txt" \
--workdir "/app" \
--build-commands "python setup.py build_ext --inplace" \
--test-commands "python -m pytest tests/unit/"
```
## Output Result Explanation
After execution, the script outputs results in JSON format, including the following fields:
```json
{
"success": true,
"issue_info": {
"repo": "owner/repo",
"number": 123,
"title": "Issue Title",
"url": "https://github.com/owner/repo/issues/123",
"state": "open"
},
"prometheus_result": {
"patch": "Generated code patch",
"passed_reproducing_test": true,
"passed_existing_test": false,
"passed_regression_test": true,
"passed_reproduction_test": true,
"issue_response": "AI-generated issue response"
},
"created_branch_and_pushed": true,
"branch_name": "fix-issue-123"
}
```
### Result Field Description
- `success`: Whether the process was successful
- `issue_info`: Basic information about the GitHub issue
- `prometheus_result.patch`: Code fix patch generated by Prometheus
- `prometheus_result.passed_*`: Status of various validations
- `prometheus_result.issue_response`: AI-generated issue analysis and response

View File

@@ -0,0 +1,180 @@
# Multi-Agent Architecture
Prometheus uses a multi-agent system powered by LangGraph to intelligently process and resolve GitHub issues. Each agent is specialized for a specific task in the issue resolution pipeline.
## Agent Overview
### 1. Issue Classification Agent
**Purpose**: Automatically classifies GitHub issues into categories (bug, question, feature, documentation).
**Location**: `prometheus/lang_graph/subgraphs/issue_classification_subgraph.py`
**Workflow**:
- Retrieves relevant code context from the knowledge graph
- Uses LLM to analyze issue content and classify type
- Returns issue type for routing to appropriate handler
**When Used**: When `issue_type == "auto"` in the issue request
---
### 2. Environment Build Agent
**Status**: In Progress
**Purpose**: Automatically sets up and configures the development environment for testing and building.
**Planned Features**:
- Auto-detect project type (Python, Node.js, Java, etc.)
- Install dependencies
- Configure build tools
- Validate environment setup
---
### 3. Bug Reproduction Agent
**Purpose**: Attempts to reproduce reported bugs by writing and executing reproduction tests.
**Location**: `prometheus/lang_graph/subgraphs/bug_reproduction_subgraph.py`
**Workflow**:
1. Retrieves bug-related code context from knowledge graph
2. Generates reproduction test code using LLM
3. Edits necessary files to create the test
4. Executes the test in a Docker container
5. Evaluates whether the bug was successfully reproduced
6. Retries with feedback if reproduction fails
**Output**:
- `reproduced_bug`: Boolean indicating success
- `reproduced_bug_file`: Path to reproduction test
- `reproduced_bug_commands`: Commands to reproduce
- `reproduced_bug_patch`: Git patch with changes
**Key Features**:
- Iterative refinement with retry loops
- Docker-isolated execution
- Feedback-driven improvement
---
### 4. Context Retrieval Agent
**Purpose**: Retrieves relevant code and documentation context from the Neo4j knowledge graph.
**Location**: `prometheus/lang_graph/subgraphs/context_retrieval_subgraph.py`
**Workflow**:
1. Converts natural language query to knowledge graph query
2. Uses LLM with graph traversal tools to find relevant context
3. Selects and extracts useful code snippets
4. Optionally refines query and retries if context is insufficient
5. Returns structured context (code, AST nodes, documentation)
**Key Features**:
- Iterative query refinement (2-4 loops)
- Tool-augmented LLM with Neo4j access
- Traverses file hierarchy, AST structure, and text chunks
**Used By**: All other agents for context gathering
---
### 5. Issue Resolution Agent
**Purpose**: Generates and validates bug fix patches for verified bugs.
**Location**: `prometheus/lang_graph/subgraphs/issue_verified_bug_subgraph.py`
**Workflow**:
1. Retrieves fix-relevant code context
2. Analyzes bug root cause using LLM
3. Generates code patch to fix the bug
4. Applies patch and creates git diff
5. Validates patch against:
- Reproduction test (must pass)
- Regression tests (optional)
- Existing test suite (optional)
6. Generates multiple candidate patches
7. Selects best patch based on test results
8. Retries with error feedback if tests fail
**Output**:
- `edit_patch`: Final selected fix patch
- Test pass/fail results
**Key Features**:
- Multi-candidate patch generation
- Multi-level validation (reproduction, regression, existing tests)
- Feedback-driven iteration
- Best patch selection using LLM
---
## Agent Coordination
### Main Issue Processing Flow
```
User Issue -> Issue Classification Agent
|
[Route by issue type]
|
+-----+-----+
| |
BUG QUESTION
| |
v v
Bug Pipeline Question Pipeline
```
### Bug Resolution Pipeline
```
Bug Issue -> Context Retrieval Agent (select regression tests)
-> Bug Reproduction Agent (verify bug exists)
-> [If reproduced] -> Issue Resolution Agent (generate fix)
-> [If not reproduced] -> Direct resolution without reproduction
-> Response Generation
```
### Question Answering Pipeline
```
Question -> Context Retrieval Agent (gather relevant code/docs)
-> Question Analysis Agent (LLM with tools)
-> Response Generation
```
---
## Agent Communication
Agents communicate through **shared state** managed by LangGraph:
- Each subgraph has a typed state dictionary
- State flows through nodes and is updated progressively
- Parent states are inherited by child subgraphs
- Results are passed back through state returns
---
## Technology Stack
- **LangGraph**: State machine orchestration
- **LangChain**: LLM integration and tool calling
- **Neo4j**: Knowledge graph storage and retrieval
- **Docker**: Isolated test execution environment
- **Tree-sitter**: Code parsing and AST generation
- **Git**: Patch management and version control
---
## Future Enhancements
- **Environment Build Agent**: Complete implementation for automatic setup
- **Pull Request Review Agent**: Automated code review
- **Feature Implementation Agent**: Handle feature requests
- **Documentation Generation Agent**: Auto-generate docs from code

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg id="_图层_2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 734.6 182.7"><defs><style>.cls-1,.cls-2{fill:#000;stroke-width:0px;}.cls-2{fill-rule:evenodd;}</style></defs><g id="_图层_1-2"><path class="cls-2" d="M21.9,0l59.2,27v128.8l-59.2,27L0,169.8V13L21.9,0ZM18.8,9.3l-8,4.7,8,2.9v-7.6ZM18.8,23.7l-12.1-4.4v144.1l12.1-4.4V23.7ZM25.5,156.6V26.1l30,10.8v108.8l-30,10.8ZM18.8,165.8l-8,2.9,8,4.7v-7.6ZM25.5,174.1v-10.7l33.4-12.1,10,3.1-43.4,19.8h0ZM74.5,149.5l-12.4-3.8V37.2l12.4-3.8v116.1ZM68.9,28.4l-10,3-33.4-12.1v-10.7l43.3,19.7h0Z"/><path class="cls-1" d="M204.8,65.4c-4.3-7.5-10.4-13.3-18.3-17.3-7.9-4-17.2-6-27.6-6h-32.1v98.6h32.1c10.5,0,19.8-2,27.6-5.9,7.8-3.9,14-9.6,18.3-16.9,4.3-7.3,6.5-16.1,6.5-26.1s-2.2-18.8-6.5-26.3ZM185.9,118.7c-6.3,6.3-15.4,9.6-27,9.6h-16.6V54.6h16.6c11.7,0,20.8,3.3,27.1,9.9,6.2,6.5,9.4,15.7,9.4,27.3s-3.2,20.6-9.4,26.9Z"/><path class="cls-1" d="M279.3,66.4c-5.7-3.2-12.3-4.8-19.6-4.8s-14.4,1.7-20.3,4.9c-5.8,3.3-10.4,8-13.7,14-3.2,6-4.9,13.2-4.9,21.1s1.7,15.1,5,21.1c3.3,6,8,10.8,13.8,14.1,5.8,3.3,12.6,5,20,5s16.8-2.3,22.9-6.8c5.9-4.4,10.1-10.1,12.5-16.9h-16.5c-3.7,7.3-10.1,11-18.9,11s-11.5-2-15.8-5.9c-4.3-3.9-6.7-9.1-7.2-15.5v-.6s.5,0,.5,0h59.8c.3-2.2.5-4.8.5-7.5,0-7.5-1.6-14.2-4.8-20-3.2-5.7-7.7-10.3-13.4-13.5ZM281,95.3h-44.2v-.6c.8-6.2,3.3-11.2,7.4-14.8,4.1-3.6,9.1-5.5,14.8-5.5s11.7,1.9,15.9,5.6c4.3,3.7,6.5,8.7,6.6,14.8v.5s-.5,0-.5,0Z"/><rect class="cls-1" x="309.2" y="27.7" width="15.3" height="113"/><polygon class="cls-1" points="375.1 122.7 353 62.9 336 62.9 366.8 139.7 366.8 139.9 366.8 140.1 351 177.7 366.8 177.7 414.7 62.9 399 62.9 376.1 122.7 375.6 124 375.1 122.7"/><path class="cls-1" d="M468,100.6c-3.6-1.6-8.3-3.1-14-4.6-4.3-1.2-7.6-2.3-9.8-3.1-2.2-.8-4.2-2-5.8-3.5-1.6-1.5-2.5-3.4-2.5-5.7s1.2-5.1,3.7-6.9c2.4-1.7,5.8-2.5,10.2-2.5s8.1,1.1,10.8,3.3c2.6,2.1,4.1,4.9,4.4,8.3h15.3c-.5-7.4-3.4-13.3-8.6-17.6-5.4-4.4-12.5-6.7-21.3-6.7s-11.2,1-15.7,3c-4.5,2-8,4.7-10.4,8-2.4,3.4-3.6,7.1-3.6,11.2s1.3,9.1,3.9,12.1c2.7,3.1,5.8,5.4,9.5,6.9,3.7,1.5,8.5,3.1,14.4,4.7,6.1,1.7,10.6,3.3,13.5,4.8,3,1.5,4.5,3.9,4.5,7.1s-1.4,5.4-4,7.2c-2.6,1.8-6.3,2.7-11,2.7s-8.3-1.2-11.3-3.5c-2.9-2.2-4.5-5-4.9-8.3h-15.9c.3,4.4,1.8,8.5,4.4,12.1,2.8,3.8,6.7,6.8,11.5,9,4.8,2.2,10.4,3.3,16.4,3.3s11.3-1,15.7-3c4.4-2,7.9-4.7,10.3-8.1,2.4-3.4,3.6-7.4,3.6-11.7,0-4.9-1.4-8.9-4-11.8-2.6-3-5.7-5.3-9.3-6.8Z"/><path class="cls-1" d="M501.8,27.7c-2.8,0-5.2,1-7.1,2.8-1.9,1.9-2.8,4.3-2.8,7.1s1,5.2,2.8,7.1c1.9,1.9,4.3,2.8,7.1,2.8s5-1,6.9-2.8c1.9-1.9,2.8-4.3,2.8-7.1s-1-5.2-2.8-7.1c-1.9-1.9-4.2-2.8-6.9-2.8Z"/><rect class="cls-1" x="494.1" y="62.9" width="15.3" height="77.8"/><path class="cls-1" d="M543.6,122.9c-3.6-3.8-5.4-9.4-5.4-16.6v-43.4h-15.1v45.8c0,7,1.4,13.1,4.2,18.1,2.7,4.9,6.6,8.7,11.4,11.2,4.8,2.5,10.3,3.8,16.4,3.8s9-.9,13-2.7c4.1-1.8,7.4-4.3,9.9-7.5l.9-1.2v10.3h15.3V62.9h-15.3v43.4c0,7.2-1.9,12.7-5.5,16.6-3.7,3.9-8.7,5.8-14.9,5.8s-11.2-2-14.8-5.8Z"/><path class="cls-1" d="M719.1,65.4c-4.8-2.5-10.3-3.8-16.4-3.8s-11.1,1.4-16.1,4.2c-4.9,2.7-8.6,6.5-10.9,11.1l-.5.9-.5-.9c-2.6-4.9-6.4-8.8-11.2-11.4-4.9-2.6-10.5-3.9-16.6-3.9s-8.9.9-12.9,2.7c-4,1.8-7.4,4.3-10,7.4l-.9,1.1v-10h-15.3v77.8h15.3v-43.5c0-7.2,1.9-12.7,5.5-16.6,3.7-3.9,8.7-5.8,14.9-5.8s11.2,2,14.8,5.8c3.6,3.9,5.4,9.4,5.4,16.6v43.5h15.1v-43.5c0-7.2,1.9-12.7,5.5-16.6,3.7-3.9,8.7-5.8,14.9-5.8s11.2,2,14.8,5.8c3.6,3.9,5.4,9.4,5.4,16.6v43.5h15.1v-46c0-7-1.4-13.1-4.2-18.1-2.8-4.9-6.6-8.7-11.4-11.2Z"/></g></svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
prometheus/docs/static/images/icon.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB