fixfleet 0.3.0__py3-none-any.whl
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.
- bugfixer/__init__.py +6 -0
- bugfixer/backends/__init__.py +1 -0
- bugfixer/backends/_subprocess.py +82 -0
- bugfixer/backends/api/__init__.py +1 -0
- bugfixer/backends/api/openai_compat.py +183 -0
- bugfixer/backends/base.py +52 -0
- bugfixer/backends/cli/__init__.py +1 -0
- bugfixer/backends/cli/aider.py +25 -0
- bugfixer/backends/cli/claude.py +22 -0
- bugfixer/backends/cli/codex.py +20 -0
- bugfixer/backends/cli/cursor.py +19 -0
- bugfixer/backends/cli/gemini.py +20 -0
- bugfixer/backends/cli/qwen.py +19 -0
- bugfixer/backends/registry.py +87 -0
- bugfixer/budget.py +119 -0
- bugfixer/cli.py +649 -0
- bugfixer/confidence.py +232 -0
- bugfixer/config.py +59 -0
- bugfixer/gitlab.py +158 -0
- bugfixer/locator.py +273 -0
- bugfixer/parser.py +181 -0
- bugfixer/prompt.py +155 -0
- bugfixer/state.py +71 -0
- bugfixer/ui.py +90 -0
- fixfleet-0.3.0.dist-info/METADATA +349 -0
- fixfleet-0.3.0.dist-info/RECORD +30 -0
- fixfleet-0.3.0.dist-info/WHEEL +5 -0
- fixfleet-0.3.0.dist-info/entry_points.txt +3 -0
- fixfleet-0.3.0.dist-info/licenses/LICENSE +21 -0
- fixfleet-0.3.0.dist-info/top_level.txt +1 -0
bugfixer/ui.py
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""Terminal UI — colors, print helpers, prompts."""
|
|
2
|
+
|
|
3
|
+
import getpass
|
|
4
|
+
|
|
5
|
+
BOLD = "\033[1m"
|
|
6
|
+
DIM = "\033[2m"
|
|
7
|
+
RED = "\033[91m"
|
|
8
|
+
GREEN = "\033[92m"
|
|
9
|
+
YELLOW = "\033[93m"
|
|
10
|
+
BLUE = "\033[94m"
|
|
11
|
+
MAGENTA = "\033[95m"
|
|
12
|
+
CYAN = "\033[96m"
|
|
13
|
+
WHITE = "\033[97m"
|
|
14
|
+
RESET = "\033[0m"
|
|
15
|
+
|
|
16
|
+
PRIORITY_COLORS = {"High": RED, "Medium": YELLOW, "Low": GREEN}
|
|
17
|
+
PRIORITY_LABELS = ("High", "Medium", "Low")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def print_banner():
|
|
21
|
+
print()
|
|
22
|
+
print(f" {BOLD}{CYAN}╔══════════════════════════════════════════════════════╗{RESET}")
|
|
23
|
+
print(f" {BOLD}{CYAN}║ ║{RESET}")
|
|
24
|
+
print(f" {BOLD}{CYAN}║ {WHITE}🚀 F I X F L E E T{CYAN} ║{RESET}")
|
|
25
|
+
print(f" {BOLD}{CYAN}║ {DIM}{WHITE}Fleet of AI agents fixing GitLab bugs{CYAN}{RESET}{BOLD}{CYAN} ║{RESET}")
|
|
26
|
+
print(f" {BOLD}{CYAN}║ ║{RESET}")
|
|
27
|
+
print(f" {BOLD}{CYAN}║ {DIM}{WHITE}Multi-CLI · Multi-API · Token-Aware{CYAN}{RESET}{BOLD}{CYAN} ║{RESET}")
|
|
28
|
+
print(f" {BOLD}{CYAN}║ {DIM}{WHITE}Built by Yash Koladiya{CYAN}{RESET}{BOLD}{CYAN} ║{RESET}")
|
|
29
|
+
print(f" {BOLD}{CYAN}║ ║{RESET}")
|
|
30
|
+
print(f" {BOLD}{CYAN}╚══════════════════════════════════════════════════════╝{RESET}")
|
|
31
|
+
print()
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def print_section(title):
|
|
35
|
+
print(f"\n {BOLD}{BLUE}┌─ {WHITE}{title}{RESET}")
|
|
36
|
+
print(f" {BLUE}│{RESET}")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def print_info(msg):
|
|
40
|
+
print(f" {BLUE}│ {WHITE}{msg}{RESET}")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def print_success(msg):
|
|
44
|
+
print(f" {GREEN}│ ✓ {msg}{RESET}")
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def print_error(msg):
|
|
48
|
+
print(f" {RED}│ ✗ {msg}{RESET}")
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def print_warning(msg):
|
|
52
|
+
print(f" {YELLOW}│ ! {msg}{RESET}")
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def print_divider():
|
|
56
|
+
print(f" {DIM}{BLUE}│{'─' * 54}{RESET}")
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def print_end():
|
|
60
|
+
print(f" {BLUE}│{RESET}")
|
|
61
|
+
print(f" {BLUE}└{'─' * 54}{RESET}")
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def print_summary(fixed: int, failed: int, total: int):
|
|
65
|
+
print()
|
|
66
|
+
print(f" {BOLD}{GREEN}╔══════════════════════════════════════════════════════╗{RESET}")
|
|
67
|
+
print(f" {BOLD}{GREEN}║ ║{RESET}")
|
|
68
|
+
print(f" {BOLD}{GREEN}║ {WHITE}All Done! Review your changes:{GREEN} ║{RESET}")
|
|
69
|
+
print(f" {BOLD}{GREEN}║ ║{RESET}")
|
|
70
|
+
print(f" {BOLD}{GREEN}║ {CYAN} git status {DIM}{WHITE} - see changed files{GREEN} ║{RESET}")
|
|
71
|
+
print(f" {BOLD}{GREEN}║ {CYAN} git diff {DIM}{WHITE} - see what changed{GREEN} ║{RESET}")
|
|
72
|
+
print(f" {BOLD}{GREEN}║ ║{RESET}")
|
|
73
|
+
print(f" {BOLD}{GREEN}╚══════════════════════════════════════════════════════╝{RESET}")
|
|
74
|
+
print(f"\n {BOLD}Fixed:{RESET} {GREEN}{fixed}{RESET} {BOLD}Failed:{RESET} {RED}{failed}{RESET} {BOLD}Total:{RESET} {total}\n")
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def ask_input(prompt_text: str) -> str:
|
|
78
|
+
return input(f" {BLUE}│ {MAGENTA}> {WHITE}{prompt_text}: {RESET}").strip()
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def ask_secret(prompt_text: str) -> str:
|
|
82
|
+
return getpass.getpass(f" {BLUE}│ {MAGENTA}> {WHITE}{prompt_text}: {RESET}").strip()
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def get_priority(labels: list) -> tuple:
|
|
86
|
+
"""Return (priority_name, color) for given labels."""
|
|
87
|
+
for lbl in PRIORITY_LABELS:
|
|
88
|
+
if lbl in labels:
|
|
89
|
+
return lbl, PRIORITY_COLORS[lbl]
|
|
90
|
+
return "None", WHITE
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fixfleet
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Auto-fix GitLab bugs with AI agents — bring your own CLI or free API.
|
|
5
|
+
Author: Yash Koladiya
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Yash Koladiya
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/Yash-Koladiya30/fixfleet
|
|
29
|
+
Project-URL: Repository, https://github.com/Yash-Koladiya30/fixfleet
|
|
30
|
+
Project-URL: Issues, https://github.com/Yash-Koladiya30/fixfleet/issues
|
|
31
|
+
Keywords: gitlab,ai-agent,bug-fixer,claude-code,codex,gemini,cursor,aider,ollama,groq,openrouter,agentic-ai,automation,cli-tool,developer-tools
|
|
32
|
+
Classifier: Development Status :: 4 - Beta
|
|
33
|
+
Classifier: Environment :: Console
|
|
34
|
+
Classifier: Intended Audience :: Developers
|
|
35
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
36
|
+
Classifier: Operating System :: OS Independent
|
|
37
|
+
Classifier: Programming Language :: Python :: 3
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
43
|
+
Classifier: Topic :: Software Development :: Bug Tracking
|
|
44
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
45
|
+
Classifier: Topic :: Utilities
|
|
46
|
+
Requires-Python: >=3.9
|
|
47
|
+
Description-Content-Type: text/markdown
|
|
48
|
+
License-File: LICENSE
|
|
49
|
+
Dynamic: license-file
|
|
50
|
+
|
|
51
|
+
<div align="center">
|
|
52
|
+
|
|
53
|
+
# 🚀 FixFleet
|
|
54
|
+
|
|
55
|
+
### **Auto-fix GitLab bugs with AI agents — bring your own CLI or free API.**
|
|
56
|
+
|
|
57
|
+
*Reads open `Bug` issues from GitLab → parses stack traces and steps → pre-narrows the search to relevant files → dispatches to your AI agent of choice → scores the fix's confidence. All locally. No commits. No lock-in.*
|
|
58
|
+
|
|
59
|
+
[](https://opensource.org/licenses/MIT)
|
|
60
|
+
[](https://www.python.org/downloads/)
|
|
61
|
+
[](#-testing)
|
|
62
|
+
[](#-quick-start)
|
|
63
|
+
[](#-contributing)
|
|
64
|
+
|
|
65
|
+
**One command. Any AI. Zero waste.**
|
|
66
|
+
|
|
67
|
+
`Claude Code` · `Codex` · `Gemini CLI` · `Cursor Agent` · `Aider` · `Qwen Code` · `Groq` · `Gemini API` · `OpenRouter` · `Cerebras` · `Ollama` · `LM Studio`
|
|
68
|
+
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
> 🎯 **What this tool does in one sentence:**
|
|
74
|
+
> *Pulls open bug tickets from GitLab, hands each one to an AI coding agent with the right context already pre-loaded, and scores how confident the fix is — so you only review the ones worth reviewing.*
|
|
75
|
+
|
|
76
|
+
Built by **Yash Koladiya**.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## ✨ What it does
|
|
81
|
+
|
|
82
|
+
1. Fetches **open issues with the `Bug` label** from any GitLab project (gitlab.com or self-hosted).
|
|
83
|
+
2. Parses each issue body — pulling out **Description, Steps to Reproduce, Expected/Actual behavior, Logs, Stack Traces** automatically.
|
|
84
|
+
3. Pre-narrows the search space: extracts file paths, stack frames, symbols → **ranks candidate files in your local repo** so the AI doesn't waste tokens hunting.
|
|
85
|
+
4. Dispatches the structured prompt to your chosen AI agent (CLI or API).
|
|
86
|
+
5. Computes a **confidence score** for the fix using diff metrics + model self-rating + hedge-density.
|
|
87
|
+
6. Tracks **token usage per backend per day** so you don't blow through paid quotas.
|
|
88
|
+
7. **Never commits or pushes** — leaves the working tree dirty for human review.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 🚀 Quick start
|
|
93
|
+
|
|
94
|
+
### Install (pick one)
|
|
95
|
+
|
|
96
|
+
**Option A — `pipx` (recommended, isolated)**
|
|
97
|
+
```bash
|
|
98
|
+
pipx install git+https://github.com/Yash-Koladiya30/fixfleet.git
|
|
99
|
+
fixfleet
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Option B — `uv tool`**
|
|
103
|
+
```bash
|
|
104
|
+
uv tool install git+https://github.com/Yash-Koladiya30/fixfleet.git
|
|
105
|
+
fixfleet
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Option C — one-shot run via `uvx` (no install)**
|
|
109
|
+
```bash
|
|
110
|
+
uvx --from git+https://github.com/Yash-Koladiya30/fixfleet.git fixfleet
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Option D — plain `pip`**
|
|
114
|
+
```bash
|
|
115
|
+
pip install git+https://github.com/Yash-Koladiya30/fixfleet.git
|
|
116
|
+
fixfleet
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Option E — clone + run (for hacking on the code)**
|
|
120
|
+
```bash
|
|
121
|
+
git clone https://github.com/Yash-Koladiya30/fixfleet.git
|
|
122
|
+
cd fixfleet
|
|
123
|
+
python3 fix_bugs.py
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Pure stdlib — **no runtime dependencies**. Works on Python 3.9+.
|
|
127
|
+
|
|
128
|
+
### Upgrade
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
pipx upgrade fixfleet # if installed with pipx
|
|
132
|
+
uv tool upgrade fixfleet # if installed with uv
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Uninstall
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
pipx uninstall fixfleet
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 🔌 Backend options
|
|
144
|
+
|
|
145
|
+
You need **at least one** of these. Mix and match per session.
|
|
146
|
+
|
|
147
|
+
### CLI backends (use existing paid plans)
|
|
148
|
+
|
|
149
|
+
| CLI | Install | Login | Plan source |
|
|
150
|
+
|---|---|---|---|
|
|
151
|
+
| **Claude Code** | `npm i -g @anthropic-ai/claude-code` | `claude login` | Claude Pro/Max |
|
|
152
|
+
| **Codex** | `npm i -g @openai/codex` | `codex login` | ChatGPT Plus/Pro |
|
|
153
|
+
| **Gemini CLI** | `npm i -g @google/gemini-cli` | `gemini auth` | Google account (free tier) |
|
|
154
|
+
| **Cursor Agent** | install from cursor.sh | `cursor-agent login` | Cursor Pro |
|
|
155
|
+
| **Aider** | `pip install aider-chat` | API key | Bring your own |
|
|
156
|
+
| **Qwen Code** | `npm i -g @qwen-code/qwen-code` | OAuth or key | Free tier |
|
|
157
|
+
|
|
158
|
+
### API backends (free tier-friendly)
|
|
159
|
+
|
|
160
|
+
Single OpenAI-compatible client serves all of these:
|
|
161
|
+
|
|
162
|
+
| Provider | Free? | Get key |
|
|
163
|
+
|---|---|---|
|
|
164
|
+
| **Groq** | ✅ Free, fast (~500 tok/s) | https://console.groq.com/keys |
|
|
165
|
+
| **Google Gemini** | ✅ Free tier, big quota | https://aistudio.google.com/apikey |
|
|
166
|
+
| **OpenRouter** | ✅ Many free models | https://openrouter.ai/keys |
|
|
167
|
+
| **Cerebras** | ✅ Free tier | https://cloud.cerebras.ai |
|
|
168
|
+
| **Ollama** | ✅ Local, no key, offline | https://ollama.com |
|
|
169
|
+
| **LM Studio** | ✅ Local, no key | https://lmstudio.ai |
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## 🔑 Generating a GitLab token
|
|
174
|
+
|
|
175
|
+
1. Go to **gitlab.com → top-right avatar → Edit profile → Access Tokens**.
|
|
176
|
+
2. Create a Personal Access Token with scope: **`api`** or **`read_api`**.
|
|
177
|
+
3. Copy the `glpat-...` token. GitLab shows it **once**.
|
|
178
|
+
4. Paste when FixFleet asks. Typing is hidden via `getpass`.
|
|
179
|
+
|
|
180
|
+
> ⚠️ **Never commit tokens.** This repo's `.gitignore` already excludes `.env`, `*.token`, `secrets.*`, and the local config files (`~/.bugfixer.json`, `~/.bugfixer-state.json` are stored in your home dir, NOT in the repo).
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## 🧭 Flow
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
Step 0 Choose Backend → pick installed CLI or configure API
|
|
188
|
+
Step 1 GitLab Token → paste glpat-...
|
|
189
|
+
Step 2 GitLab Project → paste full URL (or short path / numeric ID)
|
|
190
|
+
Step 3 Local Project Dir → path to cloned repo on your Mac
|
|
191
|
+
Step 4 Date Filter → YYYY-MM-DD or Enter for all
|
|
192
|
+
Step 5 Fetching Issues → auto-paginated
|
|
193
|
+
Step 6 Select Issues → 1,3,5 | all | unfixed | q
|
|
194
|
+
→ fixes each, shows budget + confidence per issue
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
After Step 0/2/3, defaults save to `~/.bugfixer.json` — next run press Enter to reuse.
|
|
198
|
+
|
|
199
|
+
### Inputs accepted at Step 2
|
|
200
|
+
|
|
201
|
+
| Input | Auto-extracts |
|
|
202
|
+
|---|---|
|
|
203
|
+
| `https://gitlab.com/group/project` | gitlab.com host + path |
|
|
204
|
+
| `https://gitlab.com/group/project.git` | strips `.git` |
|
|
205
|
+
| `https://gitlab.com/g/p/-/issues` | strips UI suffix |
|
|
206
|
+
| `git@gitlab.com:group/project.git` | SSH form |
|
|
207
|
+
| `https://gitlab.example.com/team/repo` | self-hosted host |
|
|
208
|
+
| `group/project` | short form |
|
|
209
|
+
| `12345` | numeric ID |
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 🎯 Confidence + Semantic Scoring
|
|
214
|
+
|
|
215
|
+
Every fix gets graded:
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
Confidence Report
|
|
219
|
+
Final score: 0.84 ████████████████░░░░ (High)
|
|
220
|
+
Self-rating: 8/10
|
|
221
|
+
Root cause: Missing null check in handleSubmit
|
|
222
|
+
Diff focus: 0.92
|
|
223
|
+
File relevance: 0.85
|
|
224
|
+
Hedge density: 1.2%
|
|
225
|
+
Tests run: no
|
|
226
|
+
Files changed: 1 (12 lines)
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Sources: model self-rating from the structured `FIX REPORT` block, `git diff` metrics, hedge-word density, file-relevance vs candidate list.
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## 💰 Token optimization
|
|
234
|
+
|
|
235
|
+
- **Locator** pre-greps the repo for candidate files → top file inlined directly into prompt
|
|
236
|
+
- **Section caps** trim long descriptions/logs before sending
|
|
237
|
+
- **Budget enforcement** — per-issue, session, daily caps in config
|
|
238
|
+
- **State persistence** — skips already-fixed issues, tracks daily usage per backend
|
|
239
|
+
|
|
240
|
+
Typical savings vs naive prompt: **60–80% tokens** for bugs with file/trace hints.
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## ⚙️ Configuration
|
|
245
|
+
|
|
246
|
+
Local config: `~/.bugfixer.json`
|
|
247
|
+
|
|
248
|
+
```json
|
|
249
|
+
{
|
|
250
|
+
"default_backend": "claude",
|
|
251
|
+
"default_project_id": "group/project",
|
|
252
|
+
"default_project_host": "gitlab.com",
|
|
253
|
+
"default_project_dir": "/Users/you/work/project",
|
|
254
|
+
"api": {
|
|
255
|
+
"preset": "groq",
|
|
256
|
+
"base_url": "https://api.groq.com/openai/v1",
|
|
257
|
+
"api_key": "gsk_...",
|
|
258
|
+
"model": "llama-3.3-70b-versatile"
|
|
259
|
+
},
|
|
260
|
+
"budgets": {
|
|
261
|
+
"session_max_tokens": 200000,
|
|
262
|
+
"per_issue_max_tokens": 30000,
|
|
263
|
+
"daily_max_tokens": 500000
|
|
264
|
+
},
|
|
265
|
+
"skip_already_fixed": true
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
> 🔒 Lives in your home directory, **NOT** the repo. The `.gitignore` excludes it from git regardless.
|
|
270
|
+
|
|
271
|
+
Override the backend per run with an env var:
|
|
272
|
+
```bash
|
|
273
|
+
BUGFIXER_BACKEND=codex python3 fix_bugs.py
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## 🧪 Testing
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
python3 -m unittest tests.test_all -v
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
54+ unit tests cover parser, locator, budget, confidence, prompt, registry, diff-apply, state, config, URL parsing, path sanitization.
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## 📂 Project layout
|
|
289
|
+
|
|
290
|
+
```
|
|
291
|
+
fixfleet/
|
|
292
|
+
├── bugfixer/
|
|
293
|
+
│ ├── ui.py terminal styling
|
|
294
|
+
│ ├── gitlab.py API client + URL parser
|
|
295
|
+
│ ├── parser.py issue-body section extractor
|
|
296
|
+
│ ├── locator.py signal extraction + file ranking + inlining
|
|
297
|
+
│ ├── prompt.py structured prompt builder
|
|
298
|
+
│ ├── budget.py token slimming + estimation + caps
|
|
299
|
+
│ ├── confidence.py diff metrics + self-rating + hedge density
|
|
300
|
+
│ ├── state.py ~/.bugfixer-state.json
|
|
301
|
+
│ ├── config.py ~/.bugfixer.json
|
|
302
|
+
│ ├── cli.py interactive flow orchestration
|
|
303
|
+
│ └── backends/
|
|
304
|
+
│ ├── base.py Backend ABC
|
|
305
|
+
│ ├── _subprocess.py tee runner
|
|
306
|
+
│ ├── registry.py detect installed CLIs + API presets
|
|
307
|
+
│ ├── cli/ claude · codex · gemini · cursor · aider · qwen
|
|
308
|
+
│ └── api/openai_compat.py
|
|
309
|
+
├── fix_bugs.py entry shim
|
|
310
|
+
└── tests/test_all.py
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
## 🛡️ Security notes
|
|
316
|
+
|
|
317
|
+
- Tokens / API keys typed via `getpass` — never echoed to terminal, never written to repo.
|
|
318
|
+
- All issue body content is **fenced** in the prompt with adaptive fence length to prevent prompt-injection from malicious issue authors.
|
|
319
|
+
- The `.gitignore` excludes config + state files, common secret files (`.env`, `*.token`, `*.key`).
|
|
320
|
+
- The tool **never** commits or pushes — manual review required before sharing fixes.
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## 🐞 Troubleshooting
|
|
325
|
+
|
|
326
|
+
| Symptom | Fix |
|
|
327
|
+
|---|---|
|
|
328
|
+
| `claude command not found` | Install one CLI or pick the API option in Step 0 |
|
|
329
|
+
| `HTTP 401` from GitLab | Token expired or wrong scope (`read_api`/`api` needed) |
|
|
330
|
+
| `HTTP 404` | Wrong project URL/ID format |
|
|
331
|
+
| "No bugs found" | GitLab issues need exact `Bug` label (case-sensitive) |
|
|
332
|
+
| Path with spaces fails | Drag-drop folder from Finder works (auto-unescapes) |
|
|
333
|
+
| Want to reset config | `rm ~/.bugfixer.json ~/.bugfixer-state.json` |
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## 🤝 Contributing
|
|
338
|
+
|
|
339
|
+
Issues / PRs welcome. Guidelines:
|
|
340
|
+
|
|
341
|
+
- Pure stdlib — no `requirements.txt` dependencies in core
|
|
342
|
+
- All new code paths need unit tests
|
|
343
|
+
- Run `python3 -m unittest tests.test_all` before submitting
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
## 📄 License
|
|
348
|
+
|
|
349
|
+
MIT — see [LICENSE](LICENSE). Built by **Yash Koladiya**.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
bugfixer/__init__.py,sha256=dGXIH1tmQ9D2v-hm5fVO7UoKLH228gyqYynsGezzvwM,193
|
|
2
|
+
bugfixer/budget.py,sha256=0wL_T7VFLOE8I07ksUjwWlHlJjHY77Ow_cyLH-pZnwI,3681
|
|
3
|
+
bugfixer/cli.py,sha256=pYWuOFFuWWQZvBVwvaZlMvo6MQs8SrbiAeGk5m8cfcI,25247
|
|
4
|
+
bugfixer/confidence.py,sha256=vpQyZKmGWVQMbXQb3FzcJCXD8F0sqIy3YY4Z_kKaZHc,7747
|
|
5
|
+
bugfixer/config.py,sha256=hh1aURRhCi_KoVD4BjmSCHj3WkOQjyU8Z3miZ70ikxs,1364
|
|
6
|
+
bugfixer/gitlab.py,sha256=oEA-RZT5EP4iPzxF0EVI94xR7NXwS8Y0KTN2W8nLZRE,5593
|
|
7
|
+
bugfixer/locator.py,sha256=l6dBqsbeDD2TTOoFvqG4bIL1MDchWr3sFekmBrgbIic,10156
|
|
8
|
+
bugfixer/parser.py,sha256=-GMk24r4ZBvoPX7F2uDpYzioe6xnEmpyH1RJjHDUsCw,5433
|
|
9
|
+
bugfixer/prompt.py,sha256=Uo4cYwNM5vxB4XXC_2loI5Qda2RDR4yuXO2bXCEBuXs,5791
|
|
10
|
+
bugfixer/state.py,sha256=fokbdauTnHbKrUiaNLfdOs8lkw96pkRCv5aO106Xf9k,1980
|
|
11
|
+
bugfixer/ui.py,sha256=dT49_uq9LCdiwyx94ypXI65iBPxblJgmRpiZBi8ReNA,3938
|
|
12
|
+
bugfixer/backends/__init__.py,sha256=pv8n5Q2ZuQnVR0xT8sut69wo1WN6m-8T5j5LvU2Sw44,70
|
|
13
|
+
bugfixer/backends/_subprocess.py,sha256=GkneksPWSoHnWOIvEZhovn96ZFJSY_fC1KeCy0v0Z84,2303
|
|
14
|
+
bugfixer/backends/base.py,sha256=dtmKiRNwTi7txJiexmYAV7HyCdgxl5nL0vdvLcQ-dK8,1602
|
|
15
|
+
bugfixer/backends/registry.py,sha256=wA6AbjGx10Fq1Rk6vJSZKEh-AjNJt7PnBA4e7lvDNe4,2864
|
|
16
|
+
bugfixer/backends/api/__init__.py,sha256=fzhaWAKG5Xae2ORFpl2Bye-Cg5S4hZNtCGnzpHufEjI,58
|
|
17
|
+
bugfixer/backends/api/openai_compat.py,sha256=USd5LeC2s6s0ugoTHBKds7G6-BDJigRRD-9bdEnECww,6655
|
|
18
|
+
bugfixer/backends/cli/__init__.py,sha256=AWZfnMdP2qVGEcKegc_dJ0wHAd45grxBcOi4qkY-O_E,75
|
|
19
|
+
bugfixer/backends/cli/aider.py,sha256=2_4Tc9f2jEdml2pIY7GOq2oh7QFIuEbotbQKg81mnaQ,808
|
|
20
|
+
bugfixer/backends/cli/claude.py,sha256=2gbsp0rF2jfwE_MjymR_vq47NAzWdOwTqqQEVR9imn8,614
|
|
21
|
+
bugfixer/backends/cli/codex.py,sha256=WsCl0KUVzR3hfuno-UEqHb9_xOqM_g0Co8iK5SI8xgI,594
|
|
22
|
+
bugfixer/backends/cli/cursor.py,sha256=oqSwMDt5kF2cmsJ5KmJPI_fmflfbPqG9JoGD89U3-1E,537
|
|
23
|
+
bugfixer/backends/cli/gemini.py,sha256=EZ2u8LXKbKqoqFrPpaTHYmbfv3xRDP_CeyxCGOUFDyU,544
|
|
24
|
+
bugfixer/backends/cli/qwen.py,sha256=BwiIxKxff35LZ2WahS63eTj3YfMrGUhHnHhPETIfFSI,510
|
|
25
|
+
fixfleet-0.3.0.dist-info/licenses/LICENSE,sha256=yCI2xbVTHBVV85XrzkTnF73H-BQ3JNhqYGog5asLWnY,1070
|
|
26
|
+
fixfleet-0.3.0.dist-info/METADATA,sha256=SEOdjRBfuwfheWeYKi1tFl4cMsqOolZ02DrMWd_nCXc,12727
|
|
27
|
+
fixfleet-0.3.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
28
|
+
fixfleet-0.3.0.dist-info/entry_points.txt,sha256=DqFAeOzG-7VYkkDCyer-FQYNg5lb8Y46EDy7llTyGdc,76
|
|
29
|
+
fixfleet-0.3.0.dist-info/top_level.txt,sha256=WSkUib1GUdgUfOdEyERSuHP5cGHR44u2jOAuOnKzhs8,9
|
|
30
|
+
fixfleet-0.3.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Yash Koladiya
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bugfixer
|