bugzero 0.0.63 → 0.0.64
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.
- package/README.md +2 -2
- package/dist/index.js +8 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ bugzero rescue
|
|
|
101
101
|
|
|
102
102
|
- **Backups on every patch.** Each file BugZero modifies gets a `.opspilot.bak` copy of its original content first. The backup is written once per run, so it always restores what you had, even if the fix took several attempts. A leftover backup from an earlier run is replaced.
|
|
103
103
|
- **Project boundary.** BugZero only reads and edits files inside the project you point it at. A patch whose path leaves the project (with `../`, an absolute path elsewhere, or a symlink or junction that points out) is refused before any file changes, and the model is told why. Files outside the project are never added to what is sent to the model, even if an error log mentions them.
|
|
104
|
-
- **Protected files.** BugZero never edits secrets (`.env`, `.env.*`, `*.pem`, `*.key`, `.npmrc`, `.netrc`, `.pypirc`), `.git/`, CI configuration (`.github/workflows/`, `.gitlab-ci.yml`, `.circleci/`, and similar), lockfiles (`package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`), `node_modules/`,
|
|
104
|
+
- **Protected files.** BugZero never edits secrets (`.env`, `.env.*`, `*.pem`, `*.key`, `.npmrc`, `.netrc`, `.pypirc`), `.git/`, CI configuration (`.github/workflows/`, `.gitlab-ci.yml`, `.circleci/`, and similar), lockfiles (`package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`), `node_modules/`, its own `.opspilot.bak` backups, or its settings file `.bugzerorc`. A patch to one of them is refused before any file changes, and the model is told to fix the problem elsewhere. Secret files are also never sent to the model, even if an error log names them. You can adjust the list in `.bugzerorc` (see Configuration), except that a fix can never edit `.bugzerorc` itself, so it cannot change these rules. Files you add with `protect` also cannot be read or searched by the model when you use `--tools`.
|
|
105
105
|
- **Dry-run mode.** `bugzero rescue --dry-run` runs validation and error analysis, but makes no fix attempts and never modifies your source files (it still writes a report that diagnoses the failures it found). It exits with code 1 if it found failures and 0 if everything already passes, so you can use it as a check in scripts.
|
|
106
106
|
- **Prompt size limits.** Very long error output and very large source files are shortened before being sent to the model (for logs, the start and end are kept), so a big failure can't exceed the model's context window or waste tokens.
|
|
107
107
|
- **Command timeouts.** `--timeout <seconds>` (available on both `hunt` and `rescue`) stops any build, lint, or test command that runs longer than that. It kills the whole process tree rather than just the shell, so a hung test run cannot linger in the background, and the step is reported as failed along with whatever output it produced. Without it, a command that hangs will hang BugZero too, so it is worth setting in CI.
|
|
@@ -337,7 +337,7 @@ BugZero reads a `.bugzerorc` JSON file in your target project directory to pick
|
|
|
337
337
|
|---|---|
|
|
338
338
|
| `model` | The OpenRouter model to use. Set it with `bugzero vibe`. |
|
|
339
339
|
| `protect` | Extra files BugZero must never edit, added to the built-in list (see Protected files above). With tools on, the model cannot read or search them either. |
|
|
340
|
-
| `allow` | Files from the built-in list that BugZero may edit and read after all, such as `.env.example`. A `protect` pattern still wins. |
|
|
340
|
+
| `allow` | Files from the built-in list that BugZero may edit and read after all, such as `.env.example`. A `protect` pattern still wins, and `.bugzerorc` is never editable. |
|
|
341
341
|
| `patience` | How many attempts in a row may make no progress before `rescue` stops early. Default 2, `0` turns it off. `--patience` overrides it. |
|
|
342
342
|
| `focusTests` | Set to `false` to always run the full pipeline, instead of re-running only the failing test files between attempts. Default `true`. `--no-focus-tests` overrides it. |
|
|
343
343
|
| `maxTokens` | The most AI tokens a `rescue` run may use, the report included. Not set or `0` means no limit. `--max-tokens` overrides it. |
|
package/dist/index.js
CHANGED
|
@@ -502,6 +502,7 @@ var require_dist2 = __commonJS({
|
|
|
502
502
|
DEFAULT_UNREADABLE_PATTERNS: () => DEFAULT_UNREADABLE_PATTERNS,
|
|
503
503
|
MAX_REPLY_TOKENS: () => MAX_REPLY_TOKENS,
|
|
504
504
|
MIN_REPLY_TOKENS: () => MIN_REPLY_TOKENS,
|
|
505
|
+
SETTINGS_PATTERNS: () => SETTINGS_PATTERNS,
|
|
505
506
|
checkBudget: () => checkBudget,
|
|
506
507
|
countCallTokens: () => countCallTokens,
|
|
507
508
|
createProtectedPathRules: () => createProtectedPathRules2,
|
|
@@ -595,6 +596,7 @@ var require_dist2 = __commonJS({
|
|
|
595
596
|
"*.opspilot.bak",
|
|
596
597
|
"*.opspilot.bak.sha"
|
|
597
598
|
];
|
|
599
|
+
var SETTINGS_PATTERNS = [".bugzerorc"];
|
|
598
600
|
function normalizePath(relPath) {
|
|
599
601
|
return relPath.replace(/\\/g, "/").replace(/^(\.\/)+/, "").replace(/^\/+/, "").toLowerCase();
|
|
600
602
|
}
|
|
@@ -639,6 +641,7 @@ var require_dist2 = __commonJS({
|
|
|
639
641
|
const defaults = compileAll(DEFAULT_PROTECTED_PATTERNS);
|
|
640
642
|
const secrets = compileAll(DEFAULT_SECRET_PATTERNS);
|
|
641
643
|
const unreadable = compileAll(DEFAULT_UNREADABLE_PATTERNS);
|
|
644
|
+
const settingsFiles = compileAll(SETTINGS_PATTERNS);
|
|
642
645
|
const extra = compileAll(settings.protect);
|
|
643
646
|
const allowed = compileAll(settings.allow);
|
|
644
647
|
const blockedUnlessAllowed = (matchers, relPath) => {
|
|
@@ -648,9 +651,10 @@ var require_dist2 = __commonJS({
|
|
|
648
651
|
};
|
|
649
652
|
const blockedOrProtected = (matchers, relPath) => firstMatch(extra, normalizePath(relPath))?.pattern ?? blockedUnlessAllowed(matchers, relPath);
|
|
650
653
|
return {
|
|
651
|
-
editBlockedBy: (relPath) => blockedOrProtected(defaults, relPath),
|
|
654
|
+
editBlockedBy: (relPath) => firstMatch(settingsFiles, normalizePath(relPath))?.pattern ?? blockedOrProtected(defaults, relPath),
|
|
652
655
|
secretBlockedBy: (relPath) => blockedUnlessAllowed(secrets, relPath),
|
|
653
|
-
readBlockedBy: (relPath) => blockedOrProtected(unreadable, relPath)
|
|
656
|
+
readBlockedBy: (relPath) => blockedOrProtected(unreadable, relPath),
|
|
657
|
+
restoreBlockedBy: (relPath) => blockedOrProtected(defaults, relPath)
|
|
654
658
|
};
|
|
655
659
|
}
|
|
656
660
|
function toRelative(root, target) {
|
|
@@ -1276,7 +1280,7 @@ var require_dist3 = __commonJS({
|
|
|
1276
1280
|
entries.push(entry("failed", "The file is outside the project."));
|
|
1277
1281
|
continue;
|
|
1278
1282
|
}
|
|
1279
|
-
const blockedBy = (0, import_shared32.projectRelativePaths)(root, target).map((relPath) => protection.
|
|
1283
|
+
const blockedBy = (0, import_shared32.projectRelativePaths)(root, target).map((relPath) => protection.restoreBlockedBy(relPath)).find((pattern) => pattern !== void 0);
|
|
1280
1284
|
if (blockedBy !== void 0) {
|
|
1281
1285
|
entries.push(entry("protected", `It is protected (it matches "${blockedBy}"), so BugZero does not write to it.`));
|
|
1282
1286
|
continue;
|
|
@@ -2053,7 +2057,7 @@ Reply with ONLY a valid JSON object in this exact shape \u2014 no markdown fence
|
|
|
2053
2057
|
Critical rules:
|
|
2054
2058
|
- "patches" must contain at least one entry. Only include more than one when the fix truly requires editing multiple files \u2014 most fixes need just one.
|
|
2055
2059
|
- Each "filePath" must be a relative path from the project root (no leading /).
|
|
2056
|
-
- Never change secret files (.env and key files), lockfiles, CI workflow files, .git or node_modules. Patches to them are rejected, so fix the problem in another file.
|
|
2060
|
+
- Never change secret files (.env and key files), lockfiles, CI workflow files, .bugzerorc, .git or node_modules. Patches to them are rejected, so fix the problem in another file.
|
|
2057
2061
|
- Each "search" must be an EXACT character-for-character substring of that file's current content.
|
|
2058
2062
|
- Each "replace" must be syntactically valid code.
|
|
2059
2063
|
- If two patches target the same file, list them in the order they should be applied, and make sure each "search" reflects the file's content *after* the previous patch in this list has been applied to it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bugzero",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.64",
|
|
4
4
|
"description": "Autonomous AI-powered CLI and GitHub Action that detects build, lint, and test failures, generates multi-file patches, applies them atomically with fuzzy matching, and re-verifies until your project is green.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Saksham Agarwal (https://github.com/Saksham1800t)",
|