@ancha-labs/cli 0.4.11 → 0.4.12

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/lib/ancha.mjs CHANGED
@@ -210668,6 +210668,17 @@ async function evaluateJudges(scene2, capture4, options4) {
210668
210668
  });
210669
210669
  } catch (failure6) {
210670
210670
  const error65 = options4.signal?.aborted ? "Judge evaluation cancelled." : options4.relay && failure6 instanceof AnchaError ? `Judge evaluation failed: ${failure6.message.replace(/\.+$/, "")}.` : "Judge evaluation failed: provider request or structured grade was invalid.";
210671
+ if (!base3.required && !options4.signal?.aborted) {
210672
+ evaluated.set(check4.id, {
210673
+ ...base3,
210674
+ status: "skipped",
210675
+ actual: "judge skipped",
210676
+ explanation: error65,
210677
+ warning: `Optional judge skipped: ${error65.replace(/^Judge evaluation failed: /, "")}`,
210678
+ judge: { model: model2, ...cut2 }
210679
+ });
210680
+ continue;
210681
+ }
210671
210682
  evaluated.set(check4.id, {
210672
210683
  ...base3,
210673
210684
  ...options4.relay ? {} : { status: "failed" },
@@ -212198,7 +212209,7 @@ var init_reproduction_text = __esm({
212198
212209
  matches: "this run matches production, which passed these checks",
212199
212210
  differs: "checks production passed failed here",
212200
212211
  unknown: "set OPENROUTER_API_KEY and run again: a model grades these checks on production's record and on this run",
212201
- ungraded: "no check production failed could be graded in this run, so it says nothing about production's failure yet"
212212
+ ungraded: "the checks that compare with production could not be graded in this run, so it says nothing about production yet"
212202
212213
  };
212203
212214
  }
212204
212215
  });
@@ -216177,9 +216188,11 @@ async function reproductionOf(summary, scenePaths, cwd, runDir, scenes = [], pro
216177
216188
  });
216178
216189
  const failedInProduction = checks2.filter((c) => c.production === "failed"), failedThere = failedInProduction.filter((c) => c.total > 0);
216179
216190
  const ungraded = failedInProduction.length > 0 && failedThere.length === 0;
216191
+ const passedThere = checks2.filter((c) => c.production === "passed" && c.total > 0);
216192
+ const invalid35 = Object.values(scene2.checks).some((c) => c.invalid);
216180
216193
  const detail3 = scene2.trialsDetail ?? [];
216181
216194
  const crashed = detail3.length > 0 && detail3.every((t) => t.exit === "exited" && t.exitCode !== 0 || t.exit === "spawn_failed" || t.exit === "invalid" && t.originalExit === "spawn_failed");
216182
- const verdict = crashed ? "crashed" : ungraded ? Object.values(scene2.checks).some((c) => c.invalid) ? "ungraded" : "unknown" : failedThere.length > 0 ? failedThere.every((c) => c.failed * 2 > c.total) ? "reproduced" : failedThere.some((c) => c.failed > 0) ? "partly" : "not-reproduced" : checks2.some((c) => c.production === "passed" && c.failed > 0) ? "differs" : checks2.some((c) => c.production === "passed") ? "matches" : "unknown";
216195
+ const verdict = crashed ? "crashed" : ungraded ? invalid35 ? "ungraded" : "unknown" : failedThere.length > 0 ? failedThere.every((c) => c.failed * 2 > c.total) ? "reproduced" : failedThere.some((c) => c.failed > 0) ? "partly" : "not-reproduced" : passedThere.some((c) => c.failed > 0) ? "differs" : passedThere.length > 0 ? "matches" : checks2.some((c) => c.production === "passed") && invalid35 ? "ungraded" : "unknown";
216183
216196
  const added = Object.keys(scene2.checks).filter((check4) => !(check4 in production3.checks));
216184
216197
  const counts = runDir === void 0 ? {} : await answerSources(runDir, scene2);
216185
216198
  const defined = scenes.find((s2) => s2.id === scene2.sceneId);
@@ -229789,7 +229802,8 @@ async function uploadAgent(ctx, opts, command = "ancha agent upload") {
229789
229802
  let exitCode = 0, fix;
229790
229803
  if (state3 !== "failed" && evidence !== null && probe !== null) {
229791
229804
  const ready3 = probe.startedAt !== null && probe.readyAt !== null ? ` in ${((Date.parse(probe.readyAt) - Date.parse(probe.startedAt)) / 1e3).toFixed(1)}s` : "";
229792
- checks2.push({ name: "agent", status: "pass", message: `installed in ${seconds3(evidence.install.durationMs)}; ${state3 === "ready" ? "started and took a task" : state3 === "connected" ? `started and answered its readiness check${ready3}` : "its command resolves in the cloud machine, and it starts once per event"}` });
229805
+ const took = probe.durationMs === void 0 ? "started with a task" : probe.exitCode === null ? `started with a task and ran for ${elapsed(probe.durationMs)}` : `started with a task and exited with code ${probe.exitCode} after ${elapsed(probe.durationMs)}`;
229806
+ checks2.push({ name: "agent", status: "pass", message: `installed in ${seconds3(evidence.install.durationMs)}; ${state3 === "ready" ? took : state3 === "connected" ? `started and answered its readiness check${ready3}` : "its command resolves in the cloud machine, and it starts once per event"}` });
229793
229807
  } else {
229794
229808
  exitCode = detail3.job.exitCode !== null && detail3.job.exitCode !== 0 ? detail3.job.exitCode : 3;
229795
229809
  const started = evidence?.install.passed && evidence.probe !== null && evidence.probe.startedAt !== null && evidence.probe.durationMs !== void 0 && evidence.probe.kind !== "http";
package/lib/worker.mjs CHANGED
@@ -202050,6 +202050,17 @@ async function evaluateJudges(scene2, capture3, options4) {
202050
202050
  });
202051
202051
  } catch (failure5) {
202052
202052
  const error64 = options4.signal?.aborted ? "Judge evaluation cancelled." : options4.relay && failure5 instanceof AnchaError ? `Judge evaluation failed: ${failure5.message.replace(/\.+$/, "")}.` : "Judge evaluation failed: provider request or structured grade was invalid.";
202053
+ if (!base3.required && !options4.signal?.aborted) {
202054
+ evaluated.set(check3.id, {
202055
+ ...base3,
202056
+ status: "skipped",
202057
+ actual: "judge skipped",
202058
+ explanation: error64,
202059
+ warning: `Optional judge skipped: ${error64.replace(/^Judge evaluation failed: /, "")}`,
202060
+ judge: { model, ...cut }
202061
+ });
202062
+ continue;
202063
+ }
202053
202064
  evaluated.set(check3.id, {
202054
202065
  ...base3,
202055
202066
  ...options4.relay ? {} : { status: "failed" },
@@ -202159,7 +202170,7 @@ var init_reproduction_text = __esm({
202159
202170
  matches: "this run matches production, which passed these checks",
202160
202171
  differs: "checks production passed failed here",
202161
202172
  unknown: "set OPENROUTER_API_KEY and run again: a model grades these checks on production's record and on this run",
202162
- ungraded: "no check production failed could be graded in this run, so it says nothing about production's failure yet"
202173
+ ungraded: "the checks that compare with production could not be graded in this run, so it says nothing about production yet"
202163
202174
  };
202164
202175
  }
202165
202176
  });
@@ -202182,9 +202193,11 @@ async function reproductionOf(summary, scenePaths, cwd, runDir, scenes = [], pro
202182
202193
  });
202183
202194
  const failedInProduction = checks2.filter((c) => c.production === "failed"), failedThere = failedInProduction.filter((c) => c.total > 0);
202184
202195
  const ungraded = failedInProduction.length > 0 && failedThere.length === 0;
202196
+ const passedThere = checks2.filter((c) => c.production === "passed" && c.total > 0);
202197
+ const invalid30 = Object.values(scene2.checks).some((c) => c.invalid);
202185
202198
  const detail3 = scene2.trialsDetail ?? [];
202186
202199
  const crashed = detail3.length > 0 && detail3.every((t) => t.exit === "exited" && t.exitCode !== 0 || t.exit === "spawn_failed" || t.exit === "invalid" && t.originalExit === "spawn_failed");
202187
- const verdict = crashed ? "crashed" : ungraded ? Object.values(scene2.checks).some((c) => c.invalid) ? "ungraded" : "unknown" : failedThere.length > 0 ? failedThere.every((c) => c.failed * 2 > c.total) ? "reproduced" : failedThere.some((c) => c.failed > 0) ? "partly" : "not-reproduced" : checks2.some((c) => c.production === "passed" && c.failed > 0) ? "differs" : checks2.some((c) => c.production === "passed") ? "matches" : "unknown";
202200
+ const verdict = crashed ? "crashed" : ungraded ? invalid30 ? "ungraded" : "unknown" : failedThere.length > 0 ? failedThere.every((c) => c.failed * 2 > c.total) ? "reproduced" : failedThere.some((c) => c.failed > 0) ? "partly" : "not-reproduced" : passedThere.some((c) => c.failed > 0) ? "differs" : passedThere.length > 0 ? "matches" : checks2.some((c) => c.production === "passed") && invalid30 ? "ungraded" : "unknown";
202188
202201
  const added = Object.keys(scene2.checks).filter((check3) => !(check3 in production2.checks));
202189
202202
  const counts = runDir === void 0 ? {} : await answerSources(runDir, scene2);
202190
202203
  const defined = scenes.find((s2) => s2.id === scene2.sceneId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancha-labs/cli",
3
- "version": "0.4.11",
3
+ "version": "0.4.12",
4
4
  "type": "module",
5
5
  "description": "Simulation playgrounds for agents: run your agent against stateful replicas of Slack, GitHub, Datadog and more, each attempt on a fresh cloud machine in your app.ancha.io workspace, or on your computer.",
6
6
  "bugs": {