@bivy/bivy 0.10.1-staging.145 → 0.10.1-staging.147

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/server.js +34 -8
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -5533,11 +5533,12 @@ async function runWorkItem(item, report) {
5533
5533
  // slash command has none, so it simply falls through to a fresh session.
5534
5534
  if (await continueCorrelatedSession(item, request, report))
5535
5535
  return;
5536
+ const sandbox = normalizeSandboxTier(item.sandbox);
5536
5537
  const sessionOpts = {
5537
5538
  makeActive: false,
5538
5539
  title: item.title,
5539
5540
  runtimeId: item.runtimeId,
5540
- sandbox: normalizeSandboxTier(item.sandbox),
5541
+ sandbox,
5541
5542
  };
5542
5543
  const record = parsedRepo
5543
5544
  ? await createRepoSession(parsedRepo, sessionOpts)
@@ -5566,20 +5567,45 @@ async function runWorkItem(item, report) {
5566
5567
  await maybePushWorktreeBranch(record);
5567
5568
  await maybeDetectPullRequest(record);
5568
5569
  }
5570
+ // Deterministic, privacy-safe checks — the same gate the GitHub-issue path
5571
+ // applies (reportIssueOutcome) — so a scheduled/Slack/webhook run reads as
5572
+ // success only when the repository's declared checks actually pass, not merely
5573
+ // because the agent claimed success or already opened a PR. Only a run that was
5574
+ // allowed to modify the workspace is verified; a read-only run (an
5575
+ // investigation) changes nothing, so there is nothing to check.
5576
+ const checks = record.worktree && sandbox !== "read-only"
5577
+ ? runRequiredAutomationChecks(record.worktree.path)
5578
+ : [];
5579
+ const failedChecks = checks.filter((check) => check.status === "failed");
5580
+ const now = new Date().toISOString();
5581
+ const events = [
5582
+ ...(record.prUrl
5583
+ ? [{ at: now, kind: "pull_request", summary: "Pull request opened.", ref: record.worktree?.branch, url: record.prUrl }]
5584
+ : []),
5585
+ ...(checks.length
5586
+ ? [{
5587
+ at: now,
5588
+ kind: "completed",
5589
+ summary: failedChecks.length ? `${failedChecks.length} deterministic check(s) failed.` : `${checks.length} deterministic check(s) passed.`,
5590
+ status: failedChecks.length ? "failed" : "passed",
5591
+ }]
5592
+ : []),
5593
+ ];
5569
5594
  await report({
5570
5595
  output: {
5571
5596
  sessionId: record.id,
5572
5597
  branch: record.worktree?.branch,
5573
5598
  prUrl: record.prUrl,
5574
5599
  },
5575
- events: record.prUrl ? [{
5576
- at: new Date().toISOString(),
5577
- kind: "pull_request",
5578
- summary: "Pull request opened.",
5579
- ref: record.worktree?.branch,
5580
- url: record.prUrl,
5581
- }] : undefined,
5600
+ checks: checks.length ? checks : undefined,
5601
+ events: events.length ? events : undefined,
5582
5602
  });
5603
+ // A failed required check fails the run even if the agent already opened a PR,
5604
+ // so its outcome reads "Checks failed", not silent success. The policy engine
5605
+ // decides retry/park from here.
5606
+ if (failedChecks.length) {
5607
+ throw new Error(`Required checks failed: ${failedChecks.map((check) => check.name).join(", ")}`);
5608
+ }
5583
5609
  }
5584
5610
  function startControlPlaneTasksIfConfigured() {
5585
5611
  // Backfill this node's GitHub App slug/name with the control plane. Apps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bivy/bivy",
3
- "version": "0.10.1-staging.145",
3
+ "version": "0.10.1-staging.147",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0-only",
6
6
  "description": "Run coding agents on machines you own. Open-source, self-hostable agent workspace.",