Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: preserve progress across tied arc findings

[._.]/ Adam Eivye742df781e96
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 272ad8c35f..1a765f4a83 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -9,6 +9,6 @@
- **Stopping Series Autopilot now stops the active AI run.** Direct arc, episode, foundation, correction, and fallback runs publish their concrete run ids to the conductor, so Stop no longer waits for a long provider call to finish. Runs History also exposes Stop for active rows.
- **Runs History safely displays structured model output.** Prompt and output endpoints are read as plain text, preventing valid JSON completions from crashing React when a run is expanded.
- **Arc auto-resolve keeps corrections field-scoped and within storage limits.** A resolver fixing one synopsis now omits unrelated volume fields instead of paraphrasing them, and its prompt carries explicit headroom below every persisted arc/volume string cap so a well-intended rewrite cannot be silently clipped into the next verification failure.
-- **Arc verification preserves its best demonstrated draft.** Any auto-resolve pass that raises the total blocking-finding count now pauses immediately and restores the lowest-blocker arc snapshot seen in that gate, even when the verifier describes the added problems as newly surfaced findings. Divergence and max-round exits likewise return the best verified state instead of whichever rewrite happened to run last.
+- **Arc verification preserves its best demonstrated draft.** Any auto-resolve pass that raises the total blocking-finding count now pauses immediately and restores the lowest-blocker arc snapshot seen in that gate, even when the verifier describes the added problems as newly surfaced findings. Equal-count rounds advance the checkpoint because narrower replacement findings can reflect real causal repairs; divergence and max-round exits therefore keep the latest verified best state instead of rewinding useful work or preserving whichever unverified rewrite happened to run last.
- **Continuing a video carries its prompt forward.** Continuing or extending a clip we generated now prefills the Video Gen prompt (and negative prompt) with the one that produced the source, instead of dropping you into an empty box. This covers both entry points: the **Continue** action on a video card/lightbox, and picking a prior render in Extend mode. Text you typed yourself is never overwritten — only a blank box or a value an earlier pick filled — and a clip we didn't generate (an import, or a legacy render with no stored prompt) leaves the field alone rather than clearing it. The style preset is dropped along with the prefill, since history stores the already-composed prompt and re-applying a preset would prefix it twice.
- **Subscription Usage cards now lay out in four quadrants.** The provider quota grid orders Claude, Antigravity, Codex, Grok — and because Codex and Grok typically report only a single weekly meter, they now share one grid cell stacked vertically instead of each stretching to a full-height card. Cards render at their natural height, so the Image Gen card floats into the fourth quadrant and the whole section fits above the fold on desktop.
diff --git a/server/services/pipeline/seriesAutopilot.test.js b/server/services/pipeline/seriesAutopilot.test.js
index 4adbe7668c..27cb80d12d 100644
--- a/server/services/pipeline/seriesAutopilot.test.js
+++ b/server/services/pipeline/seriesAutopilot.test.js
@@ -1922,10 +1922,10 @@ describe('autopilot conductor', () => {
// Bailed at round 3 — NOT all 6 rounds (the whole point: budget saved).
expect(arcSpies.verifyArc).toHaveBeenCalledTimes(3);
expect(arcSpies.resolveVerifyIssues).toHaveBeenCalledTimes(2);
- expect(arcSpies.restoreArcState).toHaveBeenCalledWith(
- seriesId,
- await arcSpies.snapshotArcState.mock.results[0].value,
- );
+ // A tied blocker count can still contain newer, narrower findings. Round 3
+ // verified the latest draft, so keep it in place rather than rewinding to
+ // either earlier three-finding snapshot.
+ expect(arcSpies.restoreArcState).not.toHaveBeenCalled();
const series = await seriesSvc.getSeries(seriesId);
expect(series.autopilot?.status).toBe('paused');
// Persisted through sanitizeAutopilot so the resume banner survives a reload.
@@ -2092,10 +2092,8 @@ describe('autopilot conductor', () => {
expect(last?.type).toBe('paused');
expect(last?.pauseKind).toBe('maxRounds');
expect(arcSpies.verifyArc).toHaveBeenCalledTimes(3);
- expect(arcSpies.restoreArcState).toHaveBeenCalledWith(
- seriesId,
- await arcSpies.snapshotArcState.mock.results[0].value,
- );
+ // Round 3 verified the latest equal-count draft, so keep it in place.
+ expect(arcSpies.restoreArcState).not.toHaveBeenCalled();
});
it('a per-run override beats the persisted maxArcVerifyRounds setting', async () => {
diff --git a/server/services/pipeline/seriesAutopilot/childRuns.js b/server/services/pipeline/seriesAutopilot/childRuns.js
index e2e0f60c66..cffe0cdc09 100644
--- a/server/services/pipeline/seriesAutopilot/childRuns.js
+++ b/server/services/pipeline/seriesAutopilot/childRuns.js
@@ -143,7 +143,12 @@ export async function runArcVerify(seriesId, record, { spineOnly = false } = {})
residual: rollbackTarget.blocking,
};
}
- const isNewBest = !bestVerified || blocking.length < bestVerified.blocking.length;
+ // Equal-count drafts may still represent real causal progress: a resolver
+ // can close broad structural findings and expose the same number of narrower
+ // handoff problems. Treat the latest verified tie as the checkpoint so a
+ // later stall never rewinds those repairs. Count growth is still rejected
+ // above, so this cannot promote a demonstrably worse state.
+ const isNewBest = !bestVerified || blocking.length <= bestVerified.blocking.length;
if (round === maxRounds) {
if (!isNewBest && bestVerified) await restoreArcState(seriesId, bestVerified.snapshot);
const residual = !isNewBest && bestVerified ? bestVerified.blocking : blocking;
@@ -163,8 +168,9 @@ export async function runArcVerify(seriesId, record, { spineOnly = false } = {})
const beforeResolve = await budgetPause();
if (beforeResolve) return beforeResolve;
// Snapshot before the rewrite lands (two record reads, no LLM spend) so the
- // regression guard at the top of the next round can undo it. A strictly
- // lower blocker count also promotes this snapshot to the gate-wide best.
+ // regression guard at the top of the next round can undo it. A lower or
+ // equal blocker count promotes the latest verified draft to the checkpoint;
+ // equal counts can reflect different, narrower findings after real repairs.
const snapshot = await snapshotArcState(seriesId);
if (isNewBest) bestVerified = { blocking, snapshot };
const resolved = await resolveVerifyIssues(seriesId, {