bugpatrol 0.4.5 → 0.4.7

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 (2) hide show
  1. package/dist/bin.js +32 -4
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -36583,6 +36583,10 @@ async function startApp(app, opts) {
36583
36583
  }
36584
36584
  }
36585
36585
  report(`${phase}: ran \`${shell}\` (${((Date.now() - started) / 1e3).toFixed(1)}s)`);
36586
+ const said = output2.trim().split("\n").slice(-5).join("\n");
36587
+ if (phase === "Teardown" && said)
36588
+ report(`Teardown output:
36589
+ ${said}`);
36586
36590
  for (const name of Object.keys(command.capture)) {
36587
36591
  const length = opts.vars.has(name) && !command.public.includes(name) ? opts.vars.resolve(`{{${name}}}`).length : 0;
36588
36592
  if (length > 0 && length < SHORT_SECRET)
@@ -39999,6 +40003,8 @@ function goalGap(session, api, goal) {
39999
40003
  return `Goal not met: ${missed.length} of the ${goal.length} endpoint(s) that the goal names got no request: ${missed.map((endpoint) => endpoint.key).join(", ")}.`;
40000
40004
  }
40001
40005
  function wasBlocked(outcome2) {
40006
+ if (outcome2.stop === "error")
40007
+ return outcome2.steps === 0;
40002
40008
  return outcome2.stop === "done" && (outcome2.summary ?? "").startsWith(BLOCKED);
40003
40009
  }
40004
40010
  function stopOnCancellation(session, tool) {
@@ -40638,7 +40644,7 @@ async function runPublisher(root2, config, deps = {}) {
40638
40644
  const fixes = new Map((await workspace.listFixes()).map((fix) => [fix.issueId, fix]));
40639
40645
  const issues = (await workspace.listIssues()).filter((issue) => !deps.issueIds || deps.issueIds.includes(issue.id));
40640
40646
  let items = issues.flatMap((issue) => {
40641
- if (issue.status === "dismissed" || issue.fixRejected)
40647
+ if (issue.status === "dismissed" || issue.status === "fixed" || issue.fixRejected)
40642
40648
  return [];
40643
40649
  const found = fixes.get(issue.id);
40644
40650
  const fix = found?.external ? void 0 : found;
@@ -40650,7 +40656,7 @@ async function runPublisher(root2, config, deps = {}) {
40650
40656
  }
40651
40657
  if (issue.publishSkipped)
40652
40658
  return [];
40653
- if (!issue.github && !["fixed", "dismissed"].includes(issue.status) && rank2[issue.severity] >= rank2[config.agents.github.issueMinSeverity] && (!fix || ["declined", "failed"].includes(fix.status)))
40659
+ if (!issue.github && rank2[issue.severity] >= rank2[config.agents.github.issueMinSeverity] && (!fix || ["declined", "failed"].includes(fix.status)))
40654
40660
  return [{ kind: "issue", issue, fix }];
40655
40661
  return [];
40656
40662
  });
@@ -41007,6 +41013,20 @@ var schema5 = (properties = {}, required = []) => ({
41007
41013
  });
41008
41014
  var string5 = { type: "string" };
41009
41015
  var response2 = (value) => ({ content: [{ type: "text", text: value }] });
41016
+ function recordSetup(tool, targets, captured, setup) {
41017
+ return {
41018
+ ...tool,
41019
+ async run(input) {
41020
+ const result3 = await tool.run(input);
41021
+ const failure = result3.isError ? result3.content.flatMap((part) => part.type === "text" ? [part.text] : []).join(" ") : void 0;
41022
+ setup.set(input.id, failure);
41023
+ for (const target of targets)
41024
+ if (target.capture.routineId === input.id && !captured.has(target))
41025
+ target.capture.setupFailed = failure;
41026
+ return result3;
41027
+ }
41028
+ };
41029
+ }
41010
41030
  async function beforeParts(root2, target) {
41011
41031
  return target.reported ? evidenceParts(root2, target.reported) : captureParts(root2, target.capture.before);
41012
41032
  }
@@ -41023,6 +41043,7 @@ async function captureTargets(session, runtime, targets, task) {
41023
41043
  const selected = (input) => Number.isInteger(input.target) ? targets[Number(input.target) - 1] : void 0;
41024
41044
  let finishTried = false;
41025
41045
  const captured = /* @__PURE__ */ new Set();
41046
+ const setup = /* @__PURE__ */ new Map();
41026
41047
  let finishSummary = "";
41027
41048
  const allowed = /* @__PURE__ */ new Set([
41028
41049
  "look",
@@ -41037,7 +41058,7 @@ async function captureTargets(session, runtime, targets, task) {
41037
41058
  "switch_window",
41038
41059
  "save_lesson"
41039
41060
  ]);
41040
- const tools = explorerTools(session, { replay: task.replay }).filter((tool) => allowed.has(tool.name));
41061
+ const tools = explorerTools(session, { replay: task.replay }).filter((tool) => allowed.has(tool.name)).map((tool) => tool.name === "run_routine" ? recordSetup(tool, targets, captured, setup) : tool);
41041
41062
  tools.push({
41042
41063
  name: "replay_issue_steps",
41043
41064
  description: "Replay the target steps after the routine.",
@@ -41098,6 +41119,7 @@ async function captureTargets(session, runtime, targets, task) {
41098
41119
  target.capture.after = await session.capture(observation, `retest-after-${input.target}`);
41099
41120
  target.capture.afterTerminal = session.lastTerminal;
41100
41121
  target.capture.note = String(input.note ?? "");
41122
+ target.capture.setupFailed = target.capture.routineId ? setup.get(target.capture.routineId) : void 0;
41101
41123
  captured.add(target);
41102
41124
  target.capture.reached = input.reached === true && target.capture.after !== void 0;
41103
41125
  const kind = observation.capture.kind === "http" ? "exchange" : "screen";
@@ -41369,6 +41391,12 @@ ${targetLines(targets)}`
41369
41391
  retest.reason = retest.note ?? "The explorer did not reach the issue screen.";
41370
41392
  return retest;
41371
41393
  }
41394
+ const unset = targets.flatMap(({ capture }) => capture.setupFailed ? [capture.setupFailed] : []);
41395
+ if (unset.length) {
41396
+ retest.outcome = "unclear";
41397
+ retest.reason = `The retest never had the state the issue needs, because its setup failed: ${unset.join("; ")}`;
41398
+ return retest;
41399
+ }
41372
41400
  const record = await workspace.startSession("judge");
41373
41401
  retest.judgeSessionId = record.id;
41374
41402
  const session = new AgentSession(root2, config, vars, record.id, "judge", void 0, deps.onLog);
@@ -49393,7 +49421,7 @@ legacyEnv(process.env);
49393
49421
  var root = findProjectRoot(process.cwd());
49394
49422
  function version() {
49395
49423
  if (true)
49396
- return "0.4.5";
49424
+ return "0.4.7";
49397
49425
  try {
49398
49426
  return JSON.parse(readFileSync12(new URL("../package.json", import.meta.url), "utf8")).version;
49399
49427
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bugpatrol",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "description": "AI agents that explore your app, find bugs, and fix them.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",