bugzero 0.0.57 → 0.0.59

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.
Files changed (3) hide show
  1. package/README.md +22 -2
  2. package/dist/index.js +1430 -1178
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -212,7 +212,7 @@ bugzero hunt --no-ai-report
212
212
  ### `bugzero rescue`
213
213
  Run the full AI-powered repair loop. Detects build failures, generates precise code patches, applies them, and verifies the result.
214
214
 
215
- When it fixes your project, `rescue` prints a diff of exactly what changed in each file, so you can review it at once. The original of every edited file is kept next to it as `<file>.opspilot.bak`.
215
+ When it fixes your project, `rescue` prints a diff of exactly what changed in each file, so you can review it at once. The original of every edited file is kept next to it as `<file>.opspilot.bak`, and `bugzero undo` puts everything back.
216
216
 
217
217
  ```bash
218
218
  bugzero rescue --path /path/to/your/project
@@ -226,6 +226,8 @@ Apply this change? [y] yes [n] no [m] no, and leave a note for the AI (Enter
226
226
 
227
227
  The whole proposed fix is shown at once, because a fix that spans several files is applied together or not at all. Answer `y` to apply it. Answer `n` (or just press Enter) to decline: nothing is changed, and the AI is told you declined and asked for a different fix, which uses up one attempt. Answer `m` to decline and type a short note that is sent to the AI, such as "leave the config file alone". `--approve` needs an interactive terminal; without one (in CI, or with piped input) it stops immediately, before running anything. It has no effect with `--dry-run` or `--print-prompt`, which never write.
228
228
 
229
+ **Stuck runs stop early.** After each attempt BugZero compares what is still failing with the best result so far. It counts as progress when there are fewer errors, or when a later step is now the one failing (the build passes and lint fails, or lint passes and the tests fail), even if that step shows more errors. If 2 attempts in a row make no progress, it stops and says why, instead of paying for the remaining attempts. Output BugZero cannot count only stops a run when it is exactly the same as before. Attempts whose patch could not be applied, or that you declined, do not count. Change the limit with `--patience <n>` or `patience` in `.bugzerorc`; `0` turns it off.
230
+
229
231
  <details>
230
232
  <summary><strong>Options for <code>rescue</code></strong></summary>
231
233
 
@@ -234,6 +236,7 @@ The whole proposed fix is shown at once, because a fix that spans several files
234
236
  | `--path <dir>` | `-p` | `.` | Path to the target project |
235
237
  | `--max-attempts <n>` | `-n` | `3` | Maximum AI fix iterations before giving up |
236
238
  | `--timeout <seconds>` | `-t` | none | Stop any build, lint, or test command that runs longer than this many seconds |
239
+ | `--patience <n>` | | `2` | Stop early after this many attempts in a row make no progress. `0` turns it off |
237
240
  | `--dry-run` | | `false` | Analyze only — no files will be written |
238
241
  | `--approve` | | `false` | Show each proposed fix as a diff and ask before writing it. Needs an interactive terminal |
239
242
  | `--print-prompt` | | `false` | Print the exact prompt that would be sent to the AI model, then stop. Nothing is sent and no files are written |
@@ -241,6 +244,21 @@ The whole proposed fix is shown at once, because a fix that spans several files
241
244
 
242
245
  </details>
243
246
 
247
+ ### `bugzero undo`
248
+ Puts back every file BugZero changed, from the backups saved next to them, and removes those backups.
249
+
250
+ ```bash
251
+ bugzero undo --path /path/to/your/project
252
+ ```
253
+
254
+ `rescue` tells you to run it after it changes files, including when it changes files and still fails. A file you edited after BugZero fixed it is left alone and reported, with its backup kept, so your own work is not lost; add `--force` to restore it anyway. Use `--dry-run` to see what would be restored without changing anything. Backups inside `node_modules` and `.git` are ignored. `undo` exits with 1 if any file was left as it was.
255
+
256
+ | Flag | Short | Default | Description |
257
+ |---|---|---|---|
258
+ | `--path <dir>` | `-p` | `.` | Path to the target project |
259
+ | `--dry-run` | | `false` | Show what would be restored without changing anything |
260
+ | `--force` | | `false` | Also restore files edited after BugZero fixed them (those edits are lost) |
261
+
244
262
  ### `bugzero vibe`
245
263
  Interactively select which AI model to use. Fetches the current model list from OpenRouter, lets you pick one, and saves the selection to a local `.bugzerorc` config file.
246
264
 
@@ -296,7 +314,8 @@ BugZero reads a `.bugzerorc` JSON file in your target project directory to pick
296
314
  {
297
315
  "model": "deepseek/deepseek-chat",
298
316
  "protect": ["config/prod.json", "migrations/**"],
299
- "allow": [".env.example"]
317
+ "allow": [".env.example"],
318
+ "patience": 2
300
319
  }
301
320
  ```
302
321
 
@@ -305,6 +324,7 @@ BugZero reads a `.bugzerorc` JSON file in your target project directory to pick
305
324
  | `model` | The OpenRouter model to use. Set it with `bugzero vibe`. |
306
325
  | `protect` | Extra files BugZero must never edit, added to the built-in list (see Protected files above). |
307
326
  | `allow` | Files from the built-in list that BugZero may edit and read after all, such as `.env.example`. A `protect` pattern still wins. |
327
+ | `patience` | How many attempts in a row may make no progress before `rescue` stops early. Default 2, `0` turns it off. `--patience` overrides it. |
308
328
 
309
329
  Patterns are relative to the project and ignore case. `*` matches within a folder, `**` matches across folders, `?` matches one character, and a trailing `/` means a folder and everything in it. A pattern with no `/` matches that name at any depth, so `.env.*` also covers `apps/web/.env.local`; a pattern with a `/` is anchored to the project root. All keys are optional.
310
330