revhive-ai 0.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- revhive_ai-0.3.3/LICENSE +79 -0
- revhive_ai-0.3.3/PKG-INFO +350 -0
- revhive_ai-0.3.3/README.md +305 -0
- revhive_ai-0.3.3/pyproject.toml +77 -0
- revhive_ai-0.3.3/revhive_ai.egg-info/PKG-INFO +350 -0
- revhive_ai-0.3.3/revhive_ai.egg-info/SOURCES.txt +41 -0
- revhive_ai-0.3.3/revhive_ai.egg-info/dependency_links.txt +1 -0
- revhive_ai-0.3.3/revhive_ai.egg-info/entry_points.txt +2 -0
- revhive_ai-0.3.3/revhive_ai.egg-info/requires.txt +24 -0
- revhive_ai-0.3.3/revhive_ai.egg-info/top_level.txt +1 -0
- revhive_ai-0.3.3/setup.cfg +4 -0
- revhive_ai-0.3.3/src/revhive/__init__.py +7 -0
- revhive_ai-0.3.3/src/revhive/agents/__init__.py +27 -0
- revhive_ai-0.3.3/src/revhive/agents/base.py +327 -0
- revhive_ai-0.3.3/src/revhive/agents/conversation_reviewer.py +180 -0
- revhive_ai-0.3.3/src/revhive/agents/coordinator.py +270 -0
- revhive_ai-0.3.3/src/revhive/agents/doc_agent.py +47 -0
- revhive_ai-0.3.3/src/revhive/agents/fix_agent.py +38 -0
- revhive_ai-0.3.3/src/revhive/agents/logic_agent.py +37 -0
- revhive_ai-0.3.3/src/revhive/agents/performance_agent.py +43 -0
- revhive_ai-0.3.3/src/revhive/agents/refactor_agent.py +36 -0
- revhive_ai-0.3.3/src/revhive/agents/repo_agent.py +37 -0
- revhive_ai-0.3.3/src/revhive/agents/security_agent.py +44 -0
- revhive_ai-0.3.3/src/revhive/agents/style_agent.py +36 -0
- revhive_ai-0.3.3/src/revhive/agents/test_agent.py +52 -0
- revhive_ai-0.3.3/src/revhive/analysis/__init__.py +1 -0
- revhive_ai-0.3.3/src/revhive/analysis/trend.py +109 -0
- revhive_ai-0.3.3/src/revhive/config.py +196 -0
- revhive_ai-0.3.3/src/revhive/demo.py +325 -0
- revhive_ai-0.3.3/src/revhive/graph/__init__.py +1 -0
- revhive_ai-0.3.3/src/revhive/graph/workflow.py +300 -0
- revhive_ai-0.3.3/src/revhive/main.py +197 -0
- revhive_ai-0.3.3/src/revhive/models/__init__.py +0 -0
- revhive_ai-0.3.3/src/revhive/models/schemas.py +49 -0
- revhive_ai-0.3.3/src/revhive/team/__init__.py +1 -0
- revhive_ai-0.3.3/src/revhive/team/batch_processor.py +213 -0
- revhive_ai-0.3.3/src/revhive/utils/__init__.py +1 -0
- revhive_ai-0.3.3/src/revhive/utils/dedup.py +113 -0
- revhive_ai-0.3.3/src/revhive/utils/llm_client.py +73 -0
- revhive_ai-0.3.3/src/revhive/utils/parser.py +199 -0
- revhive_ai-0.3.3/tests/test_agents.py +366 -0
- revhive_ai-0.3.3/tests/test_demo.py +150 -0
- revhive_ai-0.3.3/tests/test_workflow.py +186 -0
revhive_ai-0.3.3/LICENSE
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
Licensor: RevHive
|
|
4
|
+
|
|
5
|
+
Licensed Work: RevHive
|
|
6
|
+
The Licensed Work is (c) 2026 RevHive
|
|
7
|
+
|
|
8
|
+
Additional Use Grant: You may use the Licensed Work for any purpose
|
|
9
|
+
except providing a competing code review service or a substantially
|
|
10
|
+
similar product that offers automated code review as a hosted or
|
|
11
|
+
managed service.
|
|
12
|
+
|
|
13
|
+
Change Date: 2030-05-12
|
|
14
|
+
|
|
15
|
+
Change License: Apache License, Version 2.0
|
|
16
|
+
|
|
17
|
+
For information about alternative licensing arrangements for the
|
|
18
|
+
Licensed Work, please contact the Licensor.
|
|
19
|
+
|
|
20
|
+
Notice
|
|
21
|
+
|
|
22
|
+
The Business Source License (this document, or the "License") is not
|
|
23
|
+
an Open Source license. However, the Licensed Work will eventually be
|
|
24
|
+
made available under an Open Source License, as stated in this License.
|
|
25
|
+
|
|
26
|
+
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights
|
|
27
|
+
Reserved. "Business Source License" is a trademark of MariaDB
|
|
28
|
+
Corporation Ab.
|
|
29
|
+
|
|
30
|
+
Terms
|
|
31
|
+
|
|
32
|
+
The Licensor hereby grants you the right to copy, modify, create
|
|
33
|
+
derivative works, redistribute, and make non-production use of the
|
|
34
|
+
Licensed Work. The Licensor may make an Additional Use Grant, above,
|
|
35
|
+
permitting limited production use.
|
|
36
|
+
|
|
37
|
+
Effective on the Change Date, or the fourth anniversary of the first
|
|
38
|
+
publicly available distribution of a specific version of the Licensed
|
|
39
|
+
Work under this License, whichever comes first, the Licensor hereby
|
|
40
|
+
grants you rights under the terms of the Change License, and the
|
|
41
|
+
rights granted in the paragraph above terminate.
|
|
42
|
+
|
|
43
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
44
|
+
currently in effect as described in this License, you must purchase a
|
|
45
|
+
commercial license from the Licensor, its affiliated entities, or
|
|
46
|
+
authorized resellers, or you must refrain from using the Licensed Work.
|
|
47
|
+
|
|
48
|
+
All copies of the original and modified Licensed Work, and derivative
|
|
49
|
+
works of the Licensed Work, are subject to this License. This License
|
|
50
|
+
applies separately for each version of the Licensed Work and the
|
|
51
|
+
Change Date may vary for each version of the Licensed Work released by
|
|
52
|
+
the Licensor.
|
|
53
|
+
|
|
54
|
+
You must conspicuously display this License on each original or
|
|
55
|
+
modified copy of the Licensed Work. If you receive the Licensed Work
|
|
56
|
+
in original or modified form from a third party, the terms and
|
|
57
|
+
conditions set forth in this License apply to your use of that work.
|
|
58
|
+
|
|
59
|
+
Any use of the Licensed Work in violation of this License will
|
|
60
|
+
automatically terminate your rights under this License for the current
|
|
61
|
+
and all other versions of the Licensed Work.
|
|
62
|
+
|
|
63
|
+
This License does not grant you any right in any trademark or service
|
|
64
|
+
mark of the Licensor or its affiliates (the "Licensor Marks").
|
|
65
|
+
|
|
66
|
+
DISCLAIMER
|
|
67
|
+
|
|
68
|
+
THE LICENSED WORK IS PROVIDED ON AN "AS IS" BASIS. LICENSOR HEREBY
|
|
69
|
+
DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED,
|
|
70
|
+
INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY,
|
|
71
|
+
FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE.
|
|
72
|
+
|
|
73
|
+
LIMITATION OF LIABILITY
|
|
74
|
+
|
|
75
|
+
LICENSOR SHALL NOT BE LIABLE FOR ANY DAMAGES ARISING FROM OR RELATED
|
|
76
|
+
TO THIS LICENSE, INCLUDING INDIRECT, INCIDENTAL, CONSEQUENTIAL,
|
|
77
|
+
PUNITIVE, OR SPECIAL DAMAGES, WHETHER ON A CONTRACT, TORT, OR OTHER
|
|
78
|
+
LEGAL BASIS, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
79
|
+
SUCH DAMAGES.
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: revhive-ai
|
|
3
|
+
Version: 0.3.3
|
|
4
|
+
Summary: AI code review tool with 10 parallel agents. Security scanning, performance analysis, and logic review. Supports MiMo, OpenAI, DeepSeek, Qwen, GLM, Kimi, Anthropic.
|
|
5
|
+
Author: RevHive Team
|
|
6
|
+
License: BSL-1.1
|
|
7
|
+
Project-URL: Homepage, https://github.com/Jansen003/RevHive
|
|
8
|
+
Project-URL: Documentation, https://jansen003.github.io/RevHive
|
|
9
|
+
Project-URL: Repository, https://github.com/Jansen003/RevHive
|
|
10
|
+
Project-URL: Issues, https://github.com/Jansen003/RevHive/issues
|
|
11
|
+
Keywords: code-review,multi-agent,langgraph,ai,security,mimo,xiaomi,code-quality,static-analysis,linting,code-scanning,devsecops,sast,pull-request,ci-cd
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: Other/Proprietary License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
20
|
+
Classifier: Topic :: Security
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: langgraph>=0.2.0
|
|
25
|
+
Requires-Dist: langchain>=0.3.0
|
|
26
|
+
Requires-Dist: langchain-core>=0.3.0
|
|
27
|
+
Requires-Dist: langchain-openai>=0.2.0
|
|
28
|
+
Requires-Dist: openai>=1.30.0
|
|
29
|
+
Requires-Dist: click>=8.1.0
|
|
30
|
+
Requires-Dist: pydantic>=2.0.0
|
|
31
|
+
Requires-Dist: pyyaml>=6.0
|
|
32
|
+
Requires-Dist: rich>=13.0.0
|
|
33
|
+
Provides-Extra: anthropic
|
|
34
|
+
Requires-Dist: langchain-anthropic>=0.1.0; extra == "anthropic"
|
|
35
|
+
Provides-Extra: tree-sitter
|
|
36
|
+
Requires-Dist: tree-sitter>=0.22.0; extra == "tree-sitter"
|
|
37
|
+
Requires-Dist: tree-sitter-python>=0.23.0; extra == "tree-sitter"
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
40
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
|
|
41
|
+
Requires-Dist: ruff>=0.4.0; extra == "dev"
|
|
42
|
+
Provides-Extra: all
|
|
43
|
+
Requires-Dist: revhive-ai[anthropic,dev,tree-sitter]; extra == "all"
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
|
|
46
|
+
# RevHive
|
|
47
|
+
|
|
48
|
+
[](https://www.python.org/)
|
|
49
|
+
[](LICENSE)
|
|
50
|
+
[](https://langchain-ai.github.io/langgraph/)
|
|
51
|
+
[](https://platform.xiaomimimo.com)
|
|
52
|
+
[]()
|
|
53
|
+
[](https://github.com/Jansen003/RevHive/actions)
|
|
54
|
+
|
|
55
|
+
**AI-Powered Multi-Agent Code Review & Security Scanning System**
|
|
56
|
+
|
|
57
|
+
RevHive deploys 10 specialized AI agents — 9 reviewing in parallel, 1 synthesizing results — to catch security vulnerabilities, performance bottlenecks, logic bugs, and style issues before they reach production.
|
|
58
|
+
|
|
59
|
+
- **Structured Output** — Agents return structured JSON via Pydantic schemas, with regex fallback for unsupported LLMs
|
|
60
|
+
- **Semantic Deduplication** — Title matching + keyword Jaccard similarity prevents duplicate findings across agents
|
|
61
|
+
- **LLM Conflict Resolution** — Coordinator uses AI to resolve contradictory assessments between agents
|
|
62
|
+
|
|
63
|
+
### Risk Score
|
|
64
|
+
|
|
65
|
+
Every review outputs a risk score (0-100) so you know at a glance whether it's safe to merge:
|
|
66
|
+
|
|
67
|
+
| Score | Level | Meaning |
|
|
68
|
+
|-------|-------|---------|
|
|
69
|
+
| 0-20 | ✅ LOW | Safe to merge |
|
|
70
|
+
| 21-50 | ⚠️ MEDIUM | Review recommended before merge |
|
|
71
|
+
| 51-80 | 🔴 HIGH | Fix before merge |
|
|
72
|
+
| 81-100 | 🚨 CRITICAL | Do not merge |
|
|
73
|
+
|
|
74
|
+
Example output:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
🚨 Risk Score: CRITICAL (92/100)
|
|
78
|
+
|
|
79
|
+
1 Critical · 1 High · 8 Medium · 12 Low
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Why RevHive?
|
|
83
|
+
|
|
84
|
+
| Pain Point | RevHive Solution |
|
|
85
|
+
|---|---|
|
|
86
|
+
| Manual CR takes 1-2 hours/day | 9 agents review in parallel in under 30 seconds |
|
|
87
|
+
| Human reviewers miss subtle bugs | Each agent is a domain expert (security, perf, logic...) |
|
|
88
|
+
| "LGTM" culture devalues review | Every PR gets a thorough, objective audit |
|
|
89
|
+
| No team-wide quality visibility | Trend analysis tracks code health over time |
|
|
90
|
+
|
|
91
|
+
## RevHive vs Others
|
|
92
|
+
|
|
93
|
+
| Feature | RevHive | CodeRabbit | Sourcery | SonarQube | Copilot Review |
|
|
94
|
+
|---------|:---:|:---:|:---:|:---:|:---:|
|
|
95
|
+
| AI-driven review | ✅ | ✅ | ✅ | ❌ | ✅ |
|
|
96
|
+
| Multi-agent parallel | ✅ 10 | ❌ | ❌ | ❌ | ❌ |
|
|
97
|
+
| Chinese LLM support | ✅ 5 providers | ❌ | ❌ | ❌ | ❌ |
|
|
98
|
+
| Risk score (0-100) | ✅ | ✅ | ❌ | ✅ | ❌ |
|
|
99
|
+
| CLI local-first | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
100
|
+
| Demo mode (no API key) | ✅ | ❌ | ❌ | N/A | ❌ |
|
|
101
|
+
| PR inline comments | 🔜 | ✅ | ✅ | ✅ | ✅ |
|
|
102
|
+
| Quality gate (status check) | 🔜 | ❌ | ❌ | ✅ | ❌ |
|
|
103
|
+
| IDE integration | 🔜 | ❌ | ✅ | ✅ | ✅ |
|
|
104
|
+
| Open source | ✅ BSL | Partial | ❌ | ✅ | ❌ |
|
|
105
|
+
| Self-hosted | ✅ | ❌ | ❌ | ✅ | ❌ |
|
|
106
|
+
|
|
107
|
+
> 🔜 = Coming soon
|
|
108
|
+
|
|
109
|
+
## Architecture
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
┌─────────────┐
|
|
113
|
+
│ Coordinator │ ← Synthesizes findings, resolves conflicts
|
|
114
|
+
└──────┬──────┘
|
|
115
|
+
│ collects results from 9 parallel agents
|
|
116
|
+
▼
|
|
117
|
+
Style Security Perf Logic Repo Refactor Fix Test Doc
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**ConversationReviewer** runs on-demand multi-turn deep review of individual findings — challenging assumptions, exploring alternative fixes, and testing edge cases through 5 rounds of dialogue. Used for critical/high severity findings in team batch mode.
|
|
121
|
+
|
|
122
|
+
### All 10 Agents
|
|
123
|
+
|
|
124
|
+
| Agent | Role |
|
|
125
|
+
|---|---|
|
|
126
|
+
| **StyleAgent** | Naming conventions, formatting, documentation |
|
|
127
|
+
| **SecurityAgent** | SQL injection, XSS, secrets, weak crypto, auth flaws |
|
|
128
|
+
| **PerformanceAgent** | N+1 queries, memory leaks, algorithmic complexity |
|
|
129
|
+
| **LogicAgent** | Edge cases, error handling, race conditions, type safety |
|
|
130
|
+
| **RepoAgent** | Architecture review, cross-file dependencies, tech debt |
|
|
131
|
+
| **RefactorAgent** | Design patterns, code transformation, incremental migration |
|
|
132
|
+
| **FixAgent** | Generates complete corrected code with root cause analysis |
|
|
133
|
+
| **TestAgent** | Unit tests, edge case tests, security regression tests |
|
|
134
|
+
| **DocAgent** | API docs, architecture docs, usage examples |
|
|
135
|
+
| **Coordinator** | Deduplicates (semantic), resolves conflicts via LLM, calculates risk score, generates report |
|
|
136
|
+
|
|
137
|
+
## Quick Start
|
|
138
|
+
|
|
139
|
+
**Option A: CLI (30 seconds)**
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
pip install revhive-ai
|
|
143
|
+
revhive demo # no API key needed
|
|
144
|
+
export LLM_API_KEY=your-api-key
|
|
145
|
+
revhive review --file src/main.py # real review
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Option B: Docker**
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
docker build -t revhive .
|
|
152
|
+
docker run --rm -e LLM_API_KEY=your-api-key -v $(pwd):/code revhive review --file /code/src/main.py
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Option C: GitHub App (automatic PR reviews)**
|
|
156
|
+
|
|
157
|
+
[Install the GitHub App](https://github.com/apps/revhive-bot) → every PR gets reviewed automatically, no CLI needed.
|
|
158
|
+
|
|
159
|
+
## Demo Mode
|
|
160
|
+
|
|
161
|
+
RevHive ships with a fully functional **demo mode** that runs the complete multi-agent pipeline with mock responses. No API key, no network, no cost — perfect for evaluation.
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
python examples/sample_review.py
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
This produces a realistic review report identical in structure to a live MiMo-backed run, including:
|
|
168
|
+
- 20+ simulated findings across all 9 review agents
|
|
169
|
+
- Severity-ordered report (CRITICAL / HIGH / MEDIUM / LOW)
|
|
170
|
+
- Markdown and JSON output formats
|
|
171
|
+
|
|
172
|
+
## Supported LLM Backends
|
|
173
|
+
|
|
174
|
+
| Provider | Model | Setup |
|
|
175
|
+
|---|---|---|
|
|
176
|
+
| **MiMo (Xiaomi)** | `mimo-v2.5-pro` | `LLM_BASE_URL=https://api.xiaomimimo.com/v1` |
|
|
177
|
+
| OpenAI | `gpt-4o` | `LLM_BASE_URL=https://api.openai.com/v1` |
|
|
178
|
+
| DeepSeek | `deepseek-chat` | `LLM_BASE_URL=https://api.deepseek.com/v1` |
|
|
179
|
+
| Qwen (Alibaba) | `qwen-plus` | `LLM_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1` |
|
|
180
|
+
| GLM (Zhipu) | `glm-4` | `LLM_BASE_URL=https://open.bigmodel.cn/api/paas/v4` |
|
|
181
|
+
| Kimi | `kimi` | `LLM_BASE_URL=https://api.moonshot.cn/v1` |
|
|
182
|
+
| **Anthropic** | `claude-sonnet-4-20250514` | `pip install -e ".[anthropic]"`, set `ANTHROPIC_API_KEY` |
|
|
183
|
+
|
|
184
|
+
**Quick preset:** Set `LLM_MODEL` to a preset name (e.g., `openai`, `deepseek`, `qwen`) and RevHive auto-configures the base URL. Explicit `LLM_BASE_URL` takes priority.
|
|
185
|
+
|
|
186
|
+
MiMo is the **default and recommended backend**. RevHive is optimized for MiMo's token economics and model capabilities.
|
|
187
|
+
|
|
188
|
+
## Supported Languages
|
|
189
|
+
|
|
190
|
+
RevHive's LLM-powered agents can review code in any language. Currently optimized for:
|
|
191
|
+
|
|
192
|
+
| Language | Extensions | Security Patterns | Performance Patterns |
|
|
193
|
+
|----------|-----------|-------------------|---------------------|
|
|
194
|
+
| Python | .py | ✅ Full | ✅ Full |
|
|
195
|
+
| JavaScript/TypeScript | .js .jsx .mjs .ts .tsx | ✅ Full | ✅ Full |
|
|
196
|
+
| Go | .go | ✅ Full | ✅ Full |
|
|
197
|
+
| Rust | .rs | ✅ Full | ✅ Full |
|
|
198
|
+
| Java | .java | ✅ Full | ✅ Full |
|
|
199
|
+
| C/C++ | .c .cpp .h .hpp | ✅ Core | ⚠️ Basic |
|
|
200
|
+
| Ruby | .rb | ✅ Core | ⚠️ Basic |
|
|
201
|
+
| PHP | .php | ✅ Full | ⚠️ Basic |
|
|
202
|
+
| Swift | .swift | ✅ Core | ⚠️ Basic |
|
|
203
|
+
| Kotlin | .kt | ✅ Core | ⚠️ Basic |
|
|
204
|
+
|
|
205
|
+
Other languages are supported via LLM understanding but may have fewer specialized patterns.
|
|
206
|
+
|
|
207
|
+
## Environment Variables
|
|
208
|
+
|
|
209
|
+
| Variable | Required | Default | Description |
|
|
210
|
+
|---|---|---|---|
|
|
211
|
+
| `LLM_API_KEY` | **Yes** | — | API key for the LLM provider |
|
|
212
|
+
| `LLM_BASE_URL` | No | `https://api.xiaomimimo.com/v1` | LLM API endpoint |
|
|
213
|
+
| `LLM_MODEL` | No | `mimo-v2.5-pro` | Model name |
|
|
214
|
+
|
|
215
|
+
## Configuration
|
|
216
|
+
|
|
217
|
+
Create `.revhive.yml` in your project root:
|
|
218
|
+
|
|
219
|
+
```yaml
|
|
220
|
+
model: mimo-v2.5-pro
|
|
221
|
+
|
|
222
|
+
agents:
|
|
223
|
+
style:
|
|
224
|
+
enabled: true
|
|
225
|
+
security:
|
|
226
|
+
enabled: true
|
|
227
|
+
severity_threshold: medium # only report medium and above
|
|
228
|
+
performance:
|
|
229
|
+
enabled: true
|
|
230
|
+
logic:
|
|
231
|
+
enabled: true
|
|
232
|
+
repo:
|
|
233
|
+
enabled: true
|
|
234
|
+
refactor:
|
|
235
|
+
enabled: true
|
|
236
|
+
fix:
|
|
237
|
+
enabled: true
|
|
238
|
+
test:
|
|
239
|
+
enabled: true
|
|
240
|
+
doc:
|
|
241
|
+
enabled: false # disable documentation agent
|
|
242
|
+
|
|
243
|
+
ignore: # glob patterns — ** matches any depth
|
|
244
|
+
- "*.min.js"
|
|
245
|
+
- "*.min.css"
|
|
246
|
+
- "vendor/**"
|
|
247
|
+
- "node_modules/**"
|
|
248
|
+
- "migrations/**"
|
|
249
|
+
- "__pycache__/**"
|
|
250
|
+
- ".git/**"
|
|
251
|
+
- ".venv/**"
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## GitHub App Integration
|
|
255
|
+
|
|
256
|
+
[Install the GitHub App](https://github.com/apps/revhive-bot) for automatic PR reviews. Every PR gets reviewed with inline comments — no CLI needed.
|
|
257
|
+
|
|
258
|
+
```yaml
|
|
259
|
+
# .github/workflows/code-review.yml
|
|
260
|
+
name: AI Code Review
|
|
261
|
+
on:
|
|
262
|
+
pull_request:
|
|
263
|
+
types: [opened, synchronize]
|
|
264
|
+
jobs:
|
|
265
|
+
review:
|
|
266
|
+
runs-on: ubuntu-latest
|
|
267
|
+
permissions:
|
|
268
|
+
contents: read
|
|
269
|
+
pull-requests: write
|
|
270
|
+
steps:
|
|
271
|
+
- uses: actions/checkout@v4
|
|
272
|
+
with:
|
|
273
|
+
fetch-depth: 0
|
|
274
|
+
- uses: actions/setup-python@v5
|
|
275
|
+
with:
|
|
276
|
+
python-version: "3.12"
|
|
277
|
+
- run: pip install revhive-ai
|
|
278
|
+
- name: Run RevHive Review
|
|
279
|
+
env:
|
|
280
|
+
LLM_API_KEY: ${{ secrets.MIMO_API_KEY }}
|
|
281
|
+
LLM_BASE_URL: https://api.xiaomimimo.com/v1
|
|
282
|
+
LLM_MODEL: mimo-v2.5-pro
|
|
283
|
+
run: |
|
|
284
|
+
revhive review --diff HEAD~1 --format markdown --output review_report.md
|
|
285
|
+
- name: Post Review Comment
|
|
286
|
+
uses: actions/github-script@v7
|
|
287
|
+
with:
|
|
288
|
+
script: |
|
|
289
|
+
const fs = require('fs');
|
|
290
|
+
const report = fs.readFileSync('review_report.md', 'utf8');
|
|
291
|
+
github.rest.issues.createComment({
|
|
292
|
+
issue_number: context.issue.number,
|
|
293
|
+
owner: context.repo.owner,
|
|
294
|
+
repo: context.repo.repo,
|
|
295
|
+
body: report
|
|
296
|
+
});
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## Token Consumption
|
|
300
|
+
|
|
301
|
+
| Mode | Tokens / Event | Use Case |
|
|
302
|
+
|---|---|---|
|
|
303
|
+
| Single file 9-agent review | ~35,000 | Per-PR or on-demand |
|
|
304
|
+
| Auto-fix generation | ~50,000 | Post-review fix |
|
|
305
|
+
| Test suite generation | ~40,000 | Coverage gap fill |
|
|
306
|
+
| Multi-turn deep review | ~120,000 | Critical security findings |
|
|
307
|
+
|
|
308
|
+
## Project Structure
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
src/revhive/
|
|
312
|
+
agents/ # 10 specialized review agents
|
|
313
|
+
graph/ # LangGraph workflow orchestration
|
|
314
|
+
utils/ # Utility modules
|
|
315
|
+
team/ # Batch processing engine
|
|
316
|
+
analysis/ # Historical trend analysis
|
|
317
|
+
demo.py # Demo mode (no API key required)
|
|
318
|
+
main.py # CLI entry point
|
|
319
|
+
tests/ # 37 tests covering agents, workflow, demo
|
|
320
|
+
examples/ # Ready-to-run examples
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
## Security
|
|
324
|
+
|
|
325
|
+
RevHive takes its own security seriously:
|
|
326
|
+
|
|
327
|
+
- **Dependency scanning** — `pip-audit` runs in CI on every push and PR to catch known CVEs in dependencies.
|
|
328
|
+
- **Static analysis** — `bandit` scans the source code for common security issues (hardcoded secrets, unsafe deserialization, injection risks).
|
|
329
|
+
- **Docker hardening** — the container runs as a non-root user (`appuser`). Sensitive files (`.env`, `*.pem`, `.git/`) are excluded via `.dockerignore`.
|
|
330
|
+
|
|
331
|
+
To run security checks locally:
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
pip install pip-audit bandit
|
|
335
|
+
pip-audit
|
|
336
|
+
bandit -r src/ -ll --skip B101
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
## Contributing
|
|
340
|
+
|
|
341
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). All contributions welcome!
|
|
342
|
+
|
|
343
|
+
## License
|
|
344
|
+
|
|
345
|
+
BSL 1.1 — see [LICENSE](LICENSE). Converts to Apache 2.0 on 2030-05-12.
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|