baro-ai 0.89.1 → 0.89.2

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/dist/cli.mjs CHANGED
@@ -43715,15 +43715,9 @@ var DEP_DIR_BY_MANIFEST = {
43715
43715
  "requirements.txt": ".venv",
43716
43716
  "setup.py": ".venv",
43717
43717
  Pipfile: ".venv",
43718
- "composer.json": "vendor",
43719
- // Measured on this repository: an unshared target costs 594MB and 38s of
43720
- // compilation per story, so a seven-story run spent four gigabytes and
43721
- // seven full rebuilds on the same crate. Cargo locks the directory, so
43722
- // sharing serializes the builds — which is what we want, since they were
43723
- // competing for the same cores anyway.
43724
- "Cargo.toml": "target"
43718
+ "composer.json": "vendor"
43725
43719
  };
43726
- var DEP_DIR_NAMES = /* @__PURE__ */ new Set(["node_modules", ".venv", "vendor", "target"]);
43720
+ var DEP_DIR_NAMES = /* @__PURE__ */ new Set(["node_modules", ".venv", "vendor"]);
43727
43721
  var SCAN_SKIP = /* @__PURE__ */ new Set(["node_modules", ".git", ".venv", "vendor", "dist", "build", "target", ".next", "out", "coverage"]);
43728
43722
  var SCAN_DEPTH = 3;
43729
43723
  var WorktreeManager = class {
@@ -53232,7 +53226,11 @@ var OperationalRecoveryPolicy = class {
53232
53226
  pendingStories = /* @__PURE__ */ new Set();
53233
53227
  routeExclusions = /* @__PURE__ */ new Map();
53234
53228
  notBefore = /* @__PURE__ */ new Map();
53235
- /** Returns false when the independent retry budget is exhausted. */
53229
+ lastSignature = /* @__PURE__ */ new Map();
53230
+ /**
53231
+ * Returns false when the independent retry budget is exhausted, or when a
53232
+ * retry would repeat identical work in an unchanged environment.
53233
+ */
53236
53234
  prepare(storyId, options = {}) {
53237
53235
  const attempts = this.retryAttempts.get(storyId) ?? 0;
53238
53236
  if (attempts >= this.opts.maxRetriesPerStory) {
@@ -53241,6 +53239,11 @@ var OperationalRecoveryPolicy = class {
53241
53239
  return false;
53242
53240
  }
53243
53241
  const failedRouteId = options.failedRouteId;
53242
+ const repeatsLastFailure = options.signature !== void 0 && this.lastSignature.get(storyId) === options.signature;
53243
+ if (options.signature !== void 0) {
53244
+ this.lastSignature.set(storyId, options.signature);
53245
+ }
53246
+ let movesToAnotherRoute = false;
53244
53247
  if (options.excludeFailedRoute !== false && failedRouteId && this.opts.marketRouteIds.has(failedRouteId)) {
53245
53248
  let excluded = this.routeExclusions.get(storyId);
53246
53249
  if (!excluded) {
@@ -53252,8 +53255,14 @@ var OperationalRecoveryPolicy = class {
53252
53255
  (routeId) => !this.opts.isRouteUnavailable(routeId) && !excluded.has(routeId)
53253
53256
  );
53254
53257
  if (!hasAlternate) excluded.clear();
53258
+ movesToAnotherRoute = hasAlternate;
53255
53259
  }
53256
53260
  const retryAfterMs = finiteNonNegative(options.retryAfterMs);
53261
+ if (repeatsLastFailure && !movesToAnotherRoute && retryAfterMs === 0) {
53262
+ this.pendingStories.delete(storyId);
53263
+ this.notBefore.delete(storyId);
53264
+ return false;
53265
+ }
53257
53266
  if (retryAfterMs > 0) {
53258
53267
  const candidate = (options.now ?? Date.now()) + retryAfterMs;
53259
53268
  this.notBefore.set(
@@ -54007,6 +54016,12 @@ var CollectiveBoard = class extends SerializedObserver {
54007
54016
  totalAttempts = 0;
54008
54017
  completed = [];
54009
54018
  failed = /* @__PURE__ */ new Set();
54019
+ // A run that ends with stories incomplete used to list only their ids, so
54020
+ // the one thing a reader needs — what stopped them — lived solely in the
54021
+ // event log. Run 47 ended as "incomplete stories: S1, S2, S3, S4, S5, S6"
54022
+ // while the board already knew all six were waiting on one infrastructure
54023
+ // timeout.
54024
+ lastFailureByStory = /* @__PURE__ */ new Map();
54010
54025
  dropped = /* @__PURE__ */ new Set();
54011
54026
  pendingDependencyBlocks = /* @__PURE__ */ new Map();
54012
54027
  /** Run-local decision ledger. RuntimeReplanCoordinator durably protects
@@ -54794,6 +54809,10 @@ var CollectiveBoard = class extends SerializedObserver {
54794
54809
  }
54795
54810
  failStory(storyId, error, cleanup, recoveryKind) {
54796
54811
  if (this.phase !== "running" || !this.wave?.pending.has(storyId)) return;
54812
+ this.lastFailureByStory.set(
54813
+ storyId,
54814
+ recoveryKind ? `${error} [${recoveryKind}]` : error
54815
+ );
54797
54816
  const lease = this.leases.get(storyId);
54798
54817
  if (recoveryKind) {
54799
54818
  const previousBranch = this.recoveryContext.get(storyId)?.branch;
@@ -54876,7 +54895,8 @@ var CollectiveBoard = class extends SerializedObserver {
54876
54895
  if (!this.operationalRecovery.prepare(storyId, {
54877
54896
  ...routeId ? { failedRouteId: routeId } : {},
54878
54897
  excludeFailedRoute: failureImplicatesWorkerRoute(failure),
54879
- ...failure.retryAfterMs === void 0 ? {} : { retryAfterMs: failure.retryAfterMs }
54898
+ ...failure.retryAfterMs === void 0 ? {} : { retryAfterMs: failure.retryAfterMs },
54899
+ signature: `${failure.kind}:${failure.code ?? ""}`
54880
54900
  })) {
54881
54901
  this.recoveryAborted.add(storyId);
54882
54902
  return;
@@ -55714,7 +55734,7 @@ var CollectiveBoard = class extends SerializedObserver {
55714
55734
  const incomplete2 = this.prd.userStories.filter((story) => !story.passes);
55715
55735
  if (incomplete2.length > 0 || this.dropped.size > 0) {
55716
55736
  this.requestPush(
55717
- `collective run stopped with incomplete stories: ${incomplete2.map((story) => story.id).join(", ") || "dropped work"}`
55737
+ `collective run stopped with incomplete stories: ${this.describeIncomplete(incomplete2)}`
55718
55738
  );
55719
55739
  return;
55720
55740
  }
@@ -55841,9 +55861,16 @@ var CollectiveBoard = class extends SerializedObserver {
55841
55861
  const incomplete2 = this.prd.userStories.filter((story) => !story.passes);
55842
55862
  const goalCompletionFailure2 = this.goalCompletionFailureReason();
55843
55863
  const success = this.stopReason === null && incomplete2.length === 0 && this.dropped.size === 0 && goalCompletionFailure2 === null;
55844
- const reason = this.stopReason ?? goalCompletionFailure2 ?? (success ? null : `collective run stopped with incomplete stories: ${incomplete2.map((story) => story.id).join(", ") || "dropped work"}`);
55864
+ const reason = this.stopReason ?? goalCompletionFailure2 ?? (success ? null : `collective run stopped with incomplete stories: ${this.describeIncomplete(incomplete2)}`);
55845
55865
  this.terminate(success, reason);
55846
55866
  }
55867
+ describeIncomplete(incomplete2) {
55868
+ const described = incomplete2.map((story) => {
55869
+ const reason = this.lastFailureByStory.get(story.id);
55870
+ return reason ? `${story.id} (${reason})` : story.id;
55871
+ });
55872
+ return described.join(", ") || "dropped work";
55873
+ }
55847
55874
  goalCompletionFailureReason() {
55848
55875
  return goalCompletionFailure(this.prd);
55849
55876
  }