baro-ai 0.70.8 → 0.70.9
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 +74 -20
- package/dist/cli.mjs.map +1 -1
- package/dist/runner.mjs +1 -1
- package/dist/runner.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -42791,19 +42791,6 @@ var Finalizer = class extends BaseObserver {
|
|
|
42791
42791
|
}
|
|
42792
42792
|
async finalize(run) {
|
|
42793
42793
|
if (!this.opts.createPr) return;
|
|
42794
|
-
if (!run.success) {
|
|
42795
|
-
this.log(
|
|
42796
|
-
`[finalizer] run did not complete successfully (${run.abortReason ?? "no reason"}); skipping PR`
|
|
42797
|
-
);
|
|
42798
|
-
this.emit(
|
|
42799
|
-
PrCreated.create({
|
|
42800
|
-
url: null,
|
|
42801
|
-
branch: this.branchName ?? "",
|
|
42802
|
-
baseBranch: ""
|
|
42803
|
-
})
|
|
42804
|
-
);
|
|
42805
|
-
return;
|
|
42806
|
-
}
|
|
42807
42794
|
if (!await this.hasGhBinary()) {
|
|
42808
42795
|
this.log("[finalizer] `gh` not found on PATH; skipping PR creation");
|
|
42809
42796
|
this.emit(
|
|
@@ -42835,6 +42822,21 @@ var Finalizer = class extends BaseObserver {
|
|
|
42835
42822
|
return;
|
|
42836
42823
|
}
|
|
42837
42824
|
this.emit(FinalizeStarted.create({ branch }));
|
|
42825
|
+
const preAdrCommits = await this.collectCommitsSinceBase();
|
|
42826
|
+
const preAdrStats = await this.collectFileStats();
|
|
42827
|
+
const hasRunChanges = preAdrCommits.length > 0 || preAdrStats.created + preAdrStats.modified > 0;
|
|
42828
|
+
if (!run.success && !hasRunChanges) {
|
|
42829
|
+
this.log(
|
|
42830
|
+
`[finalizer] run failed with no branch changes (${run.abortReason ?? "no reason"}); skipping PR`
|
|
42831
|
+
);
|
|
42832
|
+
this.emit(PrCreated.create({ url: null, branch, baseBranch }));
|
|
42833
|
+
return;
|
|
42834
|
+
}
|
|
42835
|
+
if (!run.success) {
|
|
42836
|
+
this.log(
|
|
42837
|
+
`[finalizer] run failed after producing changes; opening checkpoint PR (${run.abortReason ?? "no reason"})`
|
|
42838
|
+
);
|
|
42839
|
+
}
|
|
42838
42840
|
const prd = this.safeLoadPrd();
|
|
42839
42841
|
if (prd) {
|
|
42840
42842
|
for (const s2 of prd.userStories) {
|
|
@@ -42848,10 +42850,12 @@ var Finalizer = class extends BaseObserver {
|
|
|
42848
42850
|
const { passed, failed } = this.partition(orderedStories);
|
|
42849
42851
|
const filesStats = await this.collectFileStats();
|
|
42850
42852
|
const totalSecs = run.totalDurationSecs;
|
|
42851
|
-
const
|
|
42853
|
+
const checkpoint = !run.success;
|
|
42854
|
+
const title = this.buildPrTitle(prd, passed.length, orderedStories.length, checkpoint);
|
|
42852
42855
|
const body = this.buildPrBody({
|
|
42853
42856
|
prd,
|
|
42854
42857
|
run,
|
|
42858
|
+
checkpoint,
|
|
42855
42859
|
orderedStories,
|
|
42856
42860
|
passed,
|
|
42857
42861
|
failed,
|
|
@@ -42861,7 +42865,7 @@ var Finalizer = class extends BaseObserver {
|
|
|
42861
42865
|
sequentialSecs: this.sequentialSeconds()
|
|
42862
42866
|
});
|
|
42863
42867
|
await this.pushBranch(branch);
|
|
42864
|
-
this.log(`[finalizer] opening PR on ${baseBranch} \u2190 ${branch}`);
|
|
42868
|
+
this.log(`[finalizer] opening ${checkpoint ? "checkpoint " : ""}PR on ${baseBranch} \u2190 ${branch}`);
|
|
42865
42869
|
const url = await this.openPr({ title, body, baseBranch, branch });
|
|
42866
42870
|
if (url) {
|
|
42867
42871
|
this.log(`[finalizer] PR opened: ${url}`);
|
|
@@ -43038,12 +43042,13 @@ ${BARO_COAUTHOR_TRAILER}`],
|
|
|
43038
43042
|
return "main";
|
|
43039
43043
|
}
|
|
43040
43044
|
// ─── PR body composition ────────────────────────────────────────
|
|
43041
|
-
buildPrTitle(prd, passed, total) {
|
|
43045
|
+
buildPrTitle(prd, passed, total, checkpoint = false) {
|
|
43042
43046
|
const project = prd?.project ?? "baro run";
|
|
43047
|
+
const prefix = checkpoint ? "Checkpoint: " : "";
|
|
43043
43048
|
if (passed === total) {
|
|
43044
|
-
return `${project} (${total} ${total === 1 ? "story" : "stories"})`;
|
|
43049
|
+
return `${prefix}${project} (${total} ${total === 1 ? "story" : "stories"})`;
|
|
43045
43050
|
}
|
|
43046
|
-
return `${project} (${passed}/${total} stories)`;
|
|
43051
|
+
return `${prefix}${project} (${passed}/${total} stories)`;
|
|
43047
43052
|
}
|
|
43048
43053
|
buildPrBody(args) {
|
|
43049
43054
|
const { prd, run, orderedStories, passed, failed, commits, filesStats } = args;
|
|
@@ -43052,6 +43057,10 @@ ${BARO_COAUTHOR_TRAILER}`],
|
|
|
43052
43057
|
`> Opened by [baro](https://baro.rs) \u2014 Mozaik-orchestrated parallel coding agents.`
|
|
43053
43058
|
);
|
|
43054
43059
|
lines.push("");
|
|
43060
|
+
if (args.checkpoint) {
|
|
43061
|
+
lines.push("> **Checkpoint PR:** baro produced branch changes, but the run failed during verification/retry/replan. Review this as a candidate fix, not a fully verified completion.");
|
|
43062
|
+
lines.push("");
|
|
43063
|
+
}
|
|
43055
43064
|
if (prd?.description) {
|
|
43056
43065
|
lines.push("## Goal");
|
|
43057
43066
|
lines.push("");
|
|
@@ -43368,8 +43377,20 @@ var FinalizationForwarder = class extends BaseObserver {
|
|
|
43368
43377
|
// ../baro-orchestrator/src/participants/forwarders/progress.ts
|
|
43369
43378
|
var ProgressForwarder = class extends BaseObserver {
|
|
43370
43379
|
async onExternalEvent(_source, event) {
|
|
43371
|
-
if (
|
|
43372
|
-
|
|
43380
|
+
if (ConductorState.is(event)) {
|
|
43381
|
+
this.handleConductorState(event.data);
|
|
43382
|
+
return;
|
|
43383
|
+
}
|
|
43384
|
+
if (Replan.is(event)) {
|
|
43385
|
+
this.handleReplan(event.data);
|
|
43386
|
+
return;
|
|
43387
|
+
}
|
|
43388
|
+
if (Critique.is(event)) {
|
|
43389
|
+
this.handleCritique(event.data);
|
|
43390
|
+
return;
|
|
43391
|
+
}
|
|
43392
|
+
}
|
|
43393
|
+
handleConductorState(item) {
|
|
43373
43394
|
if (item.phase === "running_level" && item.currentLevel != null && item.totalLevels != null) {
|
|
43374
43395
|
emit({
|
|
43375
43396
|
type: "progress",
|
|
@@ -43380,6 +43401,33 @@ var ProgressForwarder = class extends BaseObserver {
|
|
|
43380
43401
|
)
|
|
43381
43402
|
});
|
|
43382
43403
|
}
|
|
43404
|
+
if (item.detail) {
|
|
43405
|
+
emit({
|
|
43406
|
+
type: "activity",
|
|
43407
|
+
id: "plan",
|
|
43408
|
+
kind: item.phase === "failed" ? "error" : "warn",
|
|
43409
|
+
text: item.detail
|
|
43410
|
+
});
|
|
43411
|
+
}
|
|
43412
|
+
}
|
|
43413
|
+
handleReplan(item) {
|
|
43414
|
+
const added = item.addedStories.length;
|
|
43415
|
+
const removed = item.removedStoryIds.length;
|
|
43416
|
+
emit({
|
|
43417
|
+
type: "activity",
|
|
43418
|
+
id: "plan",
|
|
43419
|
+
kind: "warn",
|
|
43420
|
+
text: `Replanned (${item.source}): +${added}/-${removed} \u2014 ${item.reason}`
|
|
43421
|
+
});
|
|
43422
|
+
}
|
|
43423
|
+
handleCritique(item) {
|
|
43424
|
+
emit({
|
|
43425
|
+
type: "activity",
|
|
43426
|
+
id: item.agentId,
|
|
43427
|
+
kind: "verdict",
|
|
43428
|
+
ok: item.verdict === "pass",
|
|
43429
|
+
text: item.verdict === "pass" ? `Critic accepted ${item.agentId}` : `Critic rejected ${item.agentId}: ${item.reasoning}`
|
|
43430
|
+
});
|
|
43383
43431
|
}
|
|
43384
43432
|
};
|
|
43385
43433
|
|
|
@@ -48754,6 +48802,12 @@ async function orchestrate(config) {
|
|
|
48754
48802
|
const aborted = storyFactory.abort(storyId);
|
|
48755
48803
|
if (aborted && emitTui) {
|
|
48756
48804
|
emit({ type: "story_log", id: storyId, line: `\u26A0 ${reason} \u2014 aborting so it can be split/escalated` });
|
|
48805
|
+
emit({
|
|
48806
|
+
type: "activity",
|
|
48807
|
+
id: storyId,
|
|
48808
|
+
kind: "warn",
|
|
48809
|
+
text: `Supervisor paused ${storyId}: ${reason}. It will be retried or replanned.`
|
|
48810
|
+
});
|
|
48757
48811
|
}
|
|
48758
48812
|
}
|
|
48759
48813
|
});
|