bugzero 0.0.61 → 0.0.62
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 +47 -7
- 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`), `.git/`, CI configuration (`.github/workflows/`, `.gitlab-ci.yml`, `.circleci/`, and similar), lockfiles (`package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`), `node_modules/`, or its own `.opspilot.bak` backups. 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).
|
|
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/`, or its own `.opspilot.bak` backups. 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).
|
|
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.
|
|
@@ -303,7 +303,7 @@ bugzero rescue --json --dry-run | jq -r '.outcome'
|
|
|
303
303
|
BugZero runs your build, lint and tests on your own machine. The only time your code can leave it is when BugZero asks an AI model for help, through [OpenRouter](https://openrouter.ai) with your own API key.
|
|
304
304
|
|
|
305
305
|
- **What is sent:** the error output of the failing command and the contents of the project's source files that output mentions (each shortened to a size limit), plus your project folder's path. Nothing is sent when your project already passes.
|
|
306
|
-
- **What is never sent:** files outside your project, secret files (`.env`, `.env.*`, `*.pem`, `*.key`), `node_modules`, build output and `.git`. BugZero cannot recognise a secret by its content, so a password that your build prints is sent like any other text.
|
|
306
|
+
- **What is never sent:** files outside your project, secret files (`.env`, `.env.*`, `*.pem`, `*.key`, `.npmrc`, `.netrc`, `.pypirc`), `node_modules`, build output and `.git`. BugZero cannot recognise a secret by its content, so a password that your build prints is sent like any other text.
|
|
307
307
|
- **See it first:** `bugzero rescue --print-prompt` prints the exact prompt and sends nothing.
|
|
308
308
|
- **Stay offline:** `bugzero hunt --no-ai-report` makes no network call.
|
|
309
309
|
- There is no telemetry, analytics or update check.
|
package/dist/index.js
CHANGED
|
@@ -499,6 +499,7 @@ var require_dist2 = __commonJS({
|
|
|
499
499
|
__export(index_exports, {
|
|
500
500
|
DEFAULT_PROTECTED_PATTERNS: () => DEFAULT_PROTECTED_PATTERNS,
|
|
501
501
|
DEFAULT_SECRET_PATTERNS: () => DEFAULT_SECRET_PATTERNS,
|
|
502
|
+
DEFAULT_UNREADABLE_PATTERNS: () => DEFAULT_UNREADABLE_PATTERNS,
|
|
502
503
|
MAX_REPLY_TOKENS: () => MAX_REPLY_TOKENS,
|
|
503
504
|
MIN_REPLY_TOKENS: () => MIN_REPLY_TOKENS,
|
|
504
505
|
checkBudget: () => checkBudget,
|
|
@@ -558,7 +559,23 @@ var require_dist2 = __commonJS({
|
|
|
558
559
|
}
|
|
559
560
|
var import_fs22 = __toESM2(require("fs"));
|
|
560
561
|
var import_path22 = __toESM2(require("path"));
|
|
561
|
-
var DEFAULT_SECRET_PATTERNS = [
|
|
562
|
+
var DEFAULT_SECRET_PATTERNS = [
|
|
563
|
+
".env",
|
|
564
|
+
".env.*",
|
|
565
|
+
"*.pem",
|
|
566
|
+
"*.key",
|
|
567
|
+
// These can hold registry or login tokens.
|
|
568
|
+
".npmrc",
|
|
569
|
+
".netrc",
|
|
570
|
+
".pypirc"
|
|
571
|
+
];
|
|
572
|
+
var DEFAULT_UNREADABLE_PATTERNS = [
|
|
573
|
+
...DEFAULT_SECRET_PATTERNS,
|
|
574
|
+
".git/",
|
|
575
|
+
"node_modules/",
|
|
576
|
+
"*.opspilot.bak",
|
|
577
|
+
"*.opspilot.bak.sha"
|
|
578
|
+
];
|
|
562
579
|
var DEFAULT_PROTECTED_PATTERNS = [
|
|
563
580
|
...DEFAULT_SECRET_PATTERNS,
|
|
564
581
|
".git/",
|
|
@@ -619,8 +636,14 @@ var require_dist2 = __commonJS({
|
|
|
619
636
|
function createProtectedPathRules2(settings = {}) {
|
|
620
637
|
const defaults = compileAll(DEFAULT_PROTECTED_PATTERNS);
|
|
621
638
|
const secrets = compileAll(DEFAULT_SECRET_PATTERNS);
|
|
639
|
+
const unreadable = compileAll(DEFAULT_UNREADABLE_PATTERNS);
|
|
622
640
|
const extra = compileAll(settings.protect);
|
|
623
641
|
const allowed = compileAll(settings.allow);
|
|
642
|
+
const blockedUnlessAllowed = (matchers, relPath) => {
|
|
643
|
+
const normalized = normalizePath(relPath);
|
|
644
|
+
if (firstMatch(allowed, normalized)) return void 0;
|
|
645
|
+
return firstMatch(matchers, normalized)?.pattern;
|
|
646
|
+
};
|
|
624
647
|
return {
|
|
625
648
|
editBlockedBy(relPath) {
|
|
626
649
|
const normalized = normalizePath(relPath);
|
|
@@ -629,11 +652,8 @@ var require_dist2 = __commonJS({
|
|
|
629
652
|
if (firstMatch(allowed, normalized)) return void 0;
|
|
630
653
|
return firstMatch(defaults, normalized)?.pattern;
|
|
631
654
|
},
|
|
632
|
-
secretBlockedBy(relPath)
|
|
633
|
-
|
|
634
|
-
if (firstMatch(allowed, normalized)) return void 0;
|
|
635
|
-
return firstMatch(secrets, normalized)?.pattern;
|
|
636
|
-
}
|
|
655
|
+
secretBlockedBy: (relPath) => blockedUnlessAllowed(secrets, relPath),
|
|
656
|
+
readBlockedBy: (relPath) => blockedUnlessAllowed(unreadable, relPath)
|
|
637
657
|
};
|
|
638
658
|
}
|
|
639
659
|
function toRelative(root, target) {
|
|
@@ -1792,13 +1812,30 @@ var require_dist6 = __commonJS({
|
|
|
1792
1812
|
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1793
1813
|
var index_exports = {};
|
|
1794
1814
|
__export(index_exports, {
|
|
1815
|
+
FILE_REQUEST_EXAMPLE: () => FILE_REQUEST_EXAMPLE,
|
|
1816
|
+
MAX_FILES_PER_REQUEST: () => MAX_FILES_PER_REQUEST,
|
|
1817
|
+
MAX_REQUESTED_FILE_CHARS: () => MAX_REQUESTED_FILE_CHARS,
|
|
1818
|
+
MAX_REQUEST_CHARS: () => MAX_REQUEST_CHARS,
|
|
1795
1819
|
buildAnalysisPrompt: () => buildAnalysisPrompt,
|
|
1820
|
+
fileRequestInstructions: () => fileRequestInstructions,
|
|
1796
1821
|
truncateLogs: () => truncateLogs
|
|
1797
1822
|
});
|
|
1798
1823
|
module2.exports = __toCommonJS(index_exports);
|
|
1799
1824
|
var import_shared4 = require_dist2();
|
|
1800
1825
|
var import_fs2 = __toESM2(require("fs"));
|
|
1801
1826
|
var import_path3 = __toESM2(require("path"));
|
|
1827
|
+
var MAX_FILES_PER_REQUEST = 5;
|
|
1828
|
+
var MAX_REQUESTED_FILE_CHARS = 2e4;
|
|
1829
|
+
var MAX_REQUEST_CHARS = 6e4;
|
|
1830
|
+
var FILE_REQUEST_EXAMPLE = '{"tool": "read_file", "files": [{"path": "src/types.ts"}, {"path": "src/server.ts", "startLine": 200, "endLine": 320}]}';
|
|
1831
|
+
function fileRequestInstructions() {
|
|
1832
|
+
return `### Asking for files
|
|
1833
|
+
If you cannot write a correct fix without seeing a file that is not shown above, reply with ONLY a request like this instead of a fix:
|
|
1834
|
+
${FILE_REQUEST_EXAMPLE}
|
|
1835
|
+
- "path" is relative to the project root. "startLine" and "endLine" are optional.
|
|
1836
|
+
- One request may ask for at most ${MAX_FILES_PER_REQUEST} files. At most ${MAX_REQUESTED_FILE_CHARS} characters of each file, and ${MAX_REQUEST_CHARS} in total, are returned; use line ranges to see the rest.
|
|
1837
|
+
- Secret files, .git and node_modules are never shown.`;
|
|
1838
|
+
}
|
|
1802
1839
|
var MAX_LOG_CHARS = 2e4;
|
|
1803
1840
|
var MAX_FILE_CHARS = 2e4;
|
|
1804
1841
|
var MAX_CONTEXT_CHARS = 6e4;
|
|
@@ -1971,6 +2008,9 @@ ${w}`).join("\n\n")}
|
|
|
1971
2008
|
}
|
|
1972
2009
|
compilerLogs = truncateLogs(compilerLogs);
|
|
1973
2010
|
const contextSection = getContextFiles(compilerLogs, cwd, options.rules ?? (0, import_shared4.createProtectedPathRules)());
|
|
2011
|
+
const fileRequestSection = options.fileRequests ? `
|
|
2012
|
+
|
|
2013
|
+
${fileRequestInstructions()}` : "";
|
|
1974
2014
|
return `You are an expert software engineer specialising in fixing build, lint, and test failures.
|
|
1975
2015
|
|
|
1976
2016
|
A project located at "${cwd}" failed to build. Here is the error output (very long output is shortened in the middle):
|
|
@@ -2004,7 +2044,7 @@ Critical rules:
|
|
|
2004
2044
|
- Each "search" must be an EXACT character-for-character substring of that file's current content.
|
|
2005
2045
|
- Each "replace" must be syntactically valid code.
|
|
2006
2046
|
- 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.
|
|
2007
|
-
- Do NOT add backticks, markdown, or any text outside the JSON object
|
|
2047
|
+
- Do NOT add backticks, markdown, or any text outside the JSON object.${fileRequestSection}`;
|
|
2008
2048
|
}
|
|
2009
2049
|
}
|
|
2010
2050
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bugzero",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.62",
|
|
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)",
|