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

report the findings a rolled-back arc/foundation repair threw away

[._.]/ Adam Eivy2861942fbb20
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 6cab3a0f8c..afa0741a5e 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -9,7 +9,7 @@
- **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. 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.
+- **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. Because that guard is deliberately blind to finding identity, it can fire on a round that genuinely closed the problem it was handed and merely exposed latent defects — so a pause that rewinds now also reports the discarded round's own findings, collapsed beneath the restored set, making the trade reviewable instead of leaving only a count behind. The same accounting covers the foundation structure repair, whose revert previously reduced the arc blockers that condemned the rewrite to a number in its pause message while the findings it listed were the unrelated dimension-level gaps.
- **Foundation repair distinguishes a deeper critique from a stalled rewrite.** When a harsh re-judge holds a dimension at the same coarse score but identifies a genuinely different underlying gap, that new layer receives its own bounded repair window. Fuzzy-matched paraphrases of the same problem still accrue toward the divergence guard, so the loop remains finite instead of pausing simply because one successful fix exposed the next weakness.
- **Foundation structure repairs cannot strand a newly contradictory arc.** Every judge-directed synopsis rewrite now snapshots the current plan, runs the specialized arc verifier, gives any new canon/location/timing blockers one bounded corrective pass, and restores the snapshot if that pass is still not clean or errors. The verifier uses the run's independent judge model while corrections stay on its creative model, and the extra calls are counted against the run's usage budget.
- **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.
diff --git a/client/src/components/pipeline/AutopilotPanel.jsx b/client/src/components/pipeline/AutopilotPanel.jsx
index 803485a051..b7906cd019 100644
--- a/client/src/components/pipeline/AutopilotPanel.jsx
+++ b/client/src/components/pipeline/AutopilotPanel.jsx
@@ -2,7 +2,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { Link } from 'react-router';
import {
Rocket, Loader2, X, Sliders, ShieldCheck, AlertCircle, CheckCircle2,
- PauseCircle, Play, ScanSearch, ChevronRight,
+ PauseCircle, Play, ScanSearch, ChevronRight, ChevronDown,
} from 'lucide-react';
import toast from '../ui/Toast';
import { usePipelineProgress } from '../../hooks/usePipelineProgress';
@@ -1156,6 +1156,19 @@ export default function AutopilotPanel({ series, onSeriesUpdate, onIssuesUpdate
</div>
) : null}
<Findings items={ap.residualFindings} />
+ {/* Collapsed: the restored set above is the actual work queue, while
+ these are what the rewound round produced — context for judging
+ whether the rollback was the right call, not tasks to act on. */}
+ {ap.discardedFindings?.length ? (
+ <details className="mt-2 group">
+ <summary className="cursor-pointer list-none flex items-center gap-1 text-[10px] uppercase tracking-wider text-gray-500 hover:text-gray-300">
+ <ChevronRight size={11} className="group-open:hidden" />
+ <ChevronDown size={11} className="hidden group-open:inline" />
+ Discarded — what the reverted round produced ({ap.discardedFindings.length})
+ </summary>
+ <Findings items={ap.discardedFindings} />
+ </details>
+ ) : null}
</div>
);
})() : null}
diff --git a/client/src/components/pipeline/AutopilotPanel.test.jsx b/client/src/components/pipeline/AutopilotPanel.test.jsx
index bbcc9a38d4..ee886a350c 100644
--- a/client/src/components/pipeline/AutopilotPanel.test.jsx
+++ b/client/src/components/pipeline/AutopilotPanel.test.jsx
@@ -440,6 +440,42 @@ describe('AutopilotPanel', () => {
expect(screen.getByRole('button', { name: /resume autopilot/i })).toBeInTheDocument();
});
+ it('offers the rolled-back round\'s findings alongside the preserved set on a regression pause', async () => {
+ renderPanel({
+ id: 's1',
+ targetFormat: 'comic',
+ autopilot: {
+ status: 'paused',
+ currentStep: 'verifyArc',
+ pauseKind: 'regression',
+ residualFindings: [{ severity: 'high', location: 'V1', problem: 'preserved plot hole' }],
+ discardedFindings: [{ severity: 'high', location: 'V3', problem: 'mentor subplot never pays off' }],
+ },
+ });
+ await waitFor(() => expect(getPipelineAutopilotStatus).toHaveBeenCalled());
+ // The restored (better) set is the work queue and stays open; the rejected
+ // candidate is collapsed behind a disclosure but reachable for comparison.
+ expect(screen.getByText(/preserved plot hole/i)).toBeInTheDocument();
+ fireEvent.click(screen.getByText(/what the reverted round produced/i));
+ expect(screen.getByText(/mentor subplot never pays off/i)).toBeInTheDocument();
+ });
+
+ it('omits the discarded disclosure when the pause traded nothing away', async () => {
+ renderPanel({
+ id: 's1',
+ targetFormat: 'comic',
+ autopilot: {
+ status: 'paused',
+ currentStep: 'verifyArc',
+ pauseKind: 'maxRounds',
+ residualFindings: [{ severity: 'high', location: 'V1', problem: 'plot hole' }],
+ discardedFindings: [],
+ },
+ });
+ await waitFor(() => expect(getPipelineAutopilotStatus).toHaveBeenCalled());
+ expect(screen.queryByText(/what the reverted round produced/i)).not.toBeInTheDocument();
+ });
+
it('restores run-local visual and gap choices when a paused run resumes', async () => {
renderPanel({
id: 's1',
diff --git a/server/services/pipeline/foundationJudge.js b/server/services/pipeline/foundationJudge.js
index 1399caaeb7..a9b54ebe37 100644
--- a/server/services/pipeline/foundationJudge.js
+++ b/server/services/pipeline/foundationJudge.js
@@ -1577,6 +1577,11 @@ export async function applyFoundationFix(seriesId, dimension, {
applied: false,
actions: correction?.applied === false ? 3 : 4,
reason: `structure repair left ${blockers.length} arc-verification blocker(s); reverted to the pre-repair plan`,
+ // The blockers that condemned the rewrite. Without them the revert is a
+ // bare count in prose, and the pause it raises reports dimension-level
+ // gaps instead — a different set entirely — so the user is never shown
+ // why a plausible rewrite was thrown away.
+ discarded: blockers,
};
};
// Any provider/parse failure after the first mutation must not strand the
diff --git a/server/services/pipeline/series.js b/server/services/pipeline/series.js
index 5dbc7a8a81..f802d96cb0 100644
--- a/server/services/pipeline/series.js
+++ b/server/services/pipeline/series.js
@@ -19,6 +19,7 @@ import { sanitizeCharacterArcList } from '../../lib/seriesCharacterArc.js';
import { sanitizeStyleGuide } from '../../lib/styleGuide.js';
import { sanitizeProseExportSettings } from '../../lib/proseExportSettings.js';
import { sanitizeSeverityWeights, sanitizeBlockingSeverities } from '../../lib/editorial/severityConfig.js';
+import { CHECK_SEVERITIES } from '../../lib/editorial/checkRegistry.js';
import { sanitizeOrigin } from '../../lib/sharingOrigin.js';
import { sanitizeSoftDeleteFields } from '../../lib/syncWire.js';
import { persistedRenderPinFields } from '../../lib/renderTargets.js';
@@ -121,7 +122,12 @@ export const ARC_LOCKABLE_FIELDS = Object.freeze([
export const AUTOPILOT_STATUSES = Object.freeze(['idle', 'running', 'paused', 'done', 'error']);
export const AUTOPILOT_STEP_MAX = 80;
export const AUTOPILOT_ERROR_MAX = 1000;
-const AUTOPILOT_FINDING_SEVERITIES = ['high', 'medium', 'low'];
+// The residual set is the user's work queue, so it holds the whole backlog; the
+// discarded set is diagnostic context for one decision and is capped tighter.
+// Exported because the arc loop bounds its own emission to the same number —
+// otherwise the live SSE frame would carry findings the record then drops.
+export const AUTOPILOT_RESIDUAL_MAX = 50;
+export const AUTOPILOT_DISCARDED_MAX = 20;
const sanitizeAutopilotLlmRoute = (raw) => {
if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return null;
@@ -179,29 +185,36 @@ export const AUTOPILOT_PAUSE_KINDS = Object.freeze([
'inapplicable', 'planningOscillation', 'budget', 'providerFailed',
]);
+// Bound a marker-borne finding list to the wire shape the UI renders.
+const sanitizeAutopilotFindings = (raw, limit) => (Array.isArray(raw)
+ ? raw
+ .map((f) => {
+ if (!f || typeof f !== 'object') return null;
+ const problem = trimTo(f.problem, 2000);
+ if (!problem) return null;
+ return {
+ ...(CHECK_SEVERITIES.includes(f.severity) ? { severity: f.severity } : {}),
+ location: trimTo(f.location, 200),
+ problem,
+ };
+ })
+ .filter(Boolean)
+ .slice(0, limit)
+ : []);
+
export const sanitizeAutopilot = (raw) => {
if (!raw || typeof raw !== 'object') return null;
const status = AUTOPILOT_STATUSES.includes(raw.status) ? raw.status : 'idle';
- const residualFindings = Array.isArray(raw.residualFindings)
- ? raw.residualFindings
- .map((f) => {
- if (!f || typeof f !== 'object') return null;
- const problem = trimTo(f.problem, 2000);
- if (!problem) return null;
- return {
- ...(AUTOPILOT_FINDING_SEVERITIES.includes(f.severity) ? { severity: f.severity } : {}),
- location: trimTo(f.location, 200),
- problem,
- };
- })
- .filter(Boolean)
- .slice(0, 50)
- : [];
+ const residualFindings = sanitizeAutopilotFindings(raw.residualFindings, AUTOPILOT_RESIDUAL_MAX);
return {
status,
runId: trimTo(raw.runId, 64) || null,
currentStep: trimTo(raw.currentStep, AUTOPILOT_STEP_MAX) || null,
residualFindings,
+ // The findings a rewound round produced, kept next to the (better) set that
+ // was restored so the trade is reviewable. Empty on any pause that threw
+ // nothing away. Same transient-marker posture as pauseKind: no schema gate.
+ discardedFindings: sanitizeAutopilotFindings(raw.discardedFindings, AUTOPILOT_DISCARDED_MAX),
lastError: trimTo(raw.lastError, AUTOPILOT_ERROR_MAX) || null,
// No `pipelineSeries` schema-gate bump for this (or any) autopilot field: the
// marker is transient, regenerated-every-run status, NOT durable creative
diff --git a/server/services/pipeline/series.test.js b/server/services/pipeline/series.test.js
index b13789db64..14adc27332 100644
--- a/server/services/pipeline/series.test.js
+++ b/server/services/pipeline/series.test.js
@@ -879,6 +879,34 @@ describe('pipeline series service', () => {
});
});
+ describe('sanitizeAutopilot discardedFindings', () => {
+ it('bounds the rolled-back candidate set the same way as residualFindings', () => {
+ const a = svc.sanitizeAutopilot({
+ status: 'paused',
+ pauseKind: 'regression',
+ discardedFindings: [
+ { severity: 'high', location: 'V3', problem: 'mentor subplot never pays off' },
+ { severity: 'bogus', location: 'V4', problem: 'finale hook unresolved' }, // severity dropped, finding kept
+ { severity: 'high', location: 'V5' }, // no problem → dropped entirely
+ ],
+ });
+ expect(a.discardedFindings).toEqual([
+ { severity: 'high', location: 'V3', problem: 'mentor subplot never pays off' },
+ { location: 'V4', problem: 'finale hook unresolved' },
+ ]);
+ });
+
+ it('caps the set so a runaway verifier round cannot bloat the marker', () => {
+ const many = Array.from({ length: 40 }, (_, i) => ({ severity: 'high', location: `V${i}`, problem: `hole ${i}` }));
+ expect(svc.sanitizeAutopilot({ status: 'paused', discardedFindings: many }).discardedFindings).toHaveLength(20);
+ });
+
+ it('is empty for a marker that carries none (non-regression pauses, older peers)', () => {
+ expect(svc.sanitizeAutopilot({ status: 'paused' }).discardedFindings).toEqual([]);
+ expect(svc.sanitizeAutopilot({ status: 'paused', discardedFindings: 'nope' }).discardedFindings).toEqual([]);
+ });
+ });
+
describe('sanitizeAutopilot resumeOptions', () => {
it('preserves only the paused run toggles that the UI can safely restore', () => {
expect(svc.sanitizeAutopilot({
diff --git a/server/services/pipeline/seriesAutopilot.test.js b/server/services/pipeline/seriesAutopilot.test.js
index d4553db81e..951068c4ab 100644
--- a/server/services/pipeline/seriesAutopilot.test.js
+++ b/server/services/pipeline/seriesAutopilot.test.js
@@ -1782,6 +1782,40 @@ describe('autopilot conductor', () => {
expect(applyFoundationFix).toHaveBeenCalledTimes(1);
});
+ it('foundation gate: a reverted structure repair surfaces the arc blockers it was judged on', async () => {
+ // The repair reverted itself because the arc verifier still found blockers.
+ // The pause's `residual` is the dimension-level gap list, so those blockers
+ // reach the user nowhere unless the revert reports them — leaving "left 2
+ // blocker(s)" in prose as the only trace of why a rewrite was thrown away.
+ const blockers = [
+ { severity: 'high', location: 'V2', problem: 'ration authority contradicts the founding charter' },
+ { severity: 'medium', location: 'V3', problem: 'the eclipse lands before the calendar allows it' },
+ ];
+ foundationScore = 3;
+ applyFoundationFix.mockImplementationOnce(async (_sId, dimension) => ({
+ dimension,
+ applied: false,
+ actions: 4,
+ reason: 'structure repair left 2 arc-verification blocker(s); reverted to the pre-repair plan',
+ discarded: blockers,
+ }));
+ const { seriesId } = await seedComplete();
+ await autopilot.startSeriesAutopilot(seriesId, { maxFoundationRounds: 3 });
+ await waitFor(runFinished(seriesId));
+ const last = autopilot.__testing.runs.get(seriesId)?.lastPayload;
+ expect(last?.pauseKind).toBe('inapplicable');
+ expect(last?.discardedFindings).toEqual(blockers);
+ });
+
+ it('foundation gate: an inapplicable fix with nothing reverted reports no discarded set', async () => {
+ foundationScore = 3;
+ foundationFixApplied = false;
+ const { seriesId } = await seedComplete();
+ await autopilot.startSeriesAutopilot(seriesId, { maxFoundationRounds: 3 });
+ await waitFor(runFinished(seriesId));
+ expect(autopilot.__testing.runs.get(seriesId)?.lastPayload?.discardedFindings).toEqual([]);
+ });
+
it('foundation gate: a repair that throws pauses the run instead of erroring it away', async () => {
foundationScore = 3;
applyFoundationFix.mockRejectedValueOnce(new Error('TUI run timed out after 600000ms'));
@@ -2120,6 +2154,35 @@ describe('autopilot conductor', () => {
expect(last?.pauseKind).toBe('regression');
expect(last?.reason).toMatch(/best verified 2-finding state/);
expect(last?.residualFindings).toEqual(rounds[1]);
+ // Both sides of the trade are reported: the count guard is deliberately
+ // blind to finding identity, so the rejected candidate's own findings ride
+ // along for the human deciding whether the pause was worth it.
+ expect(last?.discardedFindings).toEqual(rounds[2]);
+ });
+
+ it('a blocker increase reaches the regression guard even when it lands on the round cap', async () => {
+ // Guard-ordering check: the regression branch is evaluated before the
+ // maxRounds exit, so growth ON the final round still rolls back and reports
+ // the trade rather than reporting a plain "ran out of rounds" pause. This is
+ // also what makes the `!isNewBest` rewind at the bounded exits unreachable.
+ const holes = (n, prefix) => Array.from({ length: n }, (_, i) => ({
+ severity: 'high', problem: `${prefix} ${i}`, location: `V${i + 1}`,
+ }));
+ const rounds = [holes(2, 'best'), holes(3, 'worse')];
+ arcSpies.verifyArc.mockReset();
+ rounds.forEach((result) => arcSpies.verifyArc.mockImplementationOnce(async () => ({ issues: result })));
+ const bestSnapshot = { marker: 'best', arc: null, seasons: [], episodes: [] };
+ arcSpies.snapshotArcState.mockImplementationOnce(async () => bestSnapshot);
+
+ const { seriesId } = await seedComplete();
+ await autopilot.startSeriesAutopilot(seriesId, { maxArcVerifyRounds: 2 });
+ await waitFor(runFinished(seriesId));
+
+ const last = autopilot.__testing.runs.get(seriesId)?.lastPayload;
+ expect(last?.pauseKind).toBe('regression');
+ expect(arcSpies.restoreArcState).toHaveBeenCalledWith(seriesId, bestSnapshot);
+ expect(last?.residualFindings).toEqual(rounds[0]);
+ expect(last?.discardedFindings).toEqual(rounds[1]);
});
it('a default-cap arc run is unaffected by the divergence guard (maxRounds still wins)', async () => {
@@ -2134,8 +2197,10 @@ describe('autopilot conductor', () => {
expect(last?.type).toBe('paused');
expect(last?.pauseKind).toBe('maxRounds');
expect(arcSpies.verifyArc).toHaveBeenCalledTimes(3);
- // Round 3 verified the latest equal-count draft, so keep it in place.
+ // Round 3 verified the latest equal-count draft, so keep it in place — and
+ // with nothing rewound there is no discarded candidate to report.
expect(arcSpies.restoreArcState).not.toHaveBeenCalled();
+ expect(last?.discardedFindings).toEqual([]);
});
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 62e6393661..0312c7e3d1 100644
--- a/server/services/pipeline/seriesAutopilot/childRuns.js
+++ b/server/services/pipeline/seriesAutopilot/childRuns.js
@@ -6,7 +6,7 @@
import { sleep } from '../../../lib/fileUtils.js';
import { recordDomainUsage } from '../../domainUsage.js';
-import { getSeries } from '../series.js';
+import { getSeries, AUTOPILOT_DISCARDED_MAX } from '../series.js';
import { listIssues, getIssue, isStageReady } from '../issues.js';
import {
verifyArc, verifyVolume, resolveVerifyIssues, analyzeBeatContinuity, resolveBeatContinuity,
@@ -29,6 +29,15 @@ import { requiredScriptStages, textReady } from './stepResolver.js';
const MAX_PLANNING_GATE_HANDOFFS = 6;
+// A rewound round's own findings, reported alongside the (better) set that was
+// restored. The rollback guards compare blocking COUNTS and are deliberately
+// blind to finding identity, so they can fire on a round that genuinely closed
+// what it was handed and merely exposed latent defects — without both sets the
+// user sees only a number and cannot tell those cases apart. Bounded here, not
+// just in the marker sanitizer, so the live SSE frame carries the same set the
+// record keeps rather than every finding a many-volume verify produced.
+const discardedSet = (blocking) => blocking.slice(0, AUTOPILOT_DISCARDED_MAX);
+
function finishPlanningMutation(record, peerLatch) {
record.runState[peerLatch] = false;
record.runState.planningGateHandoffs = (record.runState.planningGateHandoffs || 0) + 1;
@@ -141,6 +150,7 @@ export async function runArcVerify(seriesId, record, { spineOnly = false } = {})
rollbackTarget.blocking.length,
),
residual: rollbackTarget.blocking,
+ discarded: discardedSet(blocking),
};
}
// Equal-count drafts may still represent real causal progress: a resolver
@@ -149,18 +159,28 @@ export async function runArcVerify(seriesId, record, { spineOnly = false } = {})
// 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;
+ // Shared exit for the two bounded stops below: rewind to the checkpoint when
+ // the round they landed on is worse than it, reporting the discarded set the
+ // same way the regression guard does. Defensive rather than reachable today
+ // — that guard returns on ANY count growth, so a round that survives to here
+ // is never worse than the best and `isNewBest` always holds. It stays because
+ // it is the correct behavior if the guard order ever changes, and one shared
+ // helper is how both exits keep agreeing on what a rewind owes the user.
+ const rewind = async () => {
+ if (isNewBest || !bestVerified) return { residual: blocking, discarded: [] };
+ await restoreArcState(seriesId, bestVerified.snapshot);
+ return { residual: bestVerified.blocking, discarded: discardedSet(blocking) };
+ };
if (round === maxRounds) {
- if (!isNewBest && bestVerified) await restoreArcState(seriesId, bestVerified.snapshot);
- const residual = !isNewBest && bestVerified ? bestVerified.blocking : blocking;
- return { pause: true, pauseKind: 'maxRounds', reason: convergencePauseReason('arc', maxRounds, residual.length), residual };
+ const { residual, discarded } = await rewind();
+ return { pause: true, pauseKind: 'maxRounds', reason: convergencePauseReason('arc', maxRounds, residual.length), residual, discarded };
}
// Divergence guard (#1571): if the resolve passes stop reducing blocking
// findings, bail now rather than burning the remaining rounds + budget.
convergence = trackConvergence(convergence, blocking.length);
if (convergence.sinceBest >= DIVERGENCE_PATIENCE) {
- if (!isNewBest && bestVerified) await restoreArcState(seriesId, bestVerified.snapshot);
- const residual = !isNewBest && bestVerified ? bestVerified.blocking : blocking;
- return { pause: true, pauseKind: 'divergence', reason: divergencePauseReason('arc', residual.length, DIVERGENCE_PATIENCE), residual };
+ const { residual, discarded } = await rewind();
+ return { pause: true, pauseKind: 'divergence', reason: divergencePauseReason('arc', residual.length, DIVERGENCE_PATIENCE), residual, discarded };
}
if (record.cancelRequested) return { canceled: true };
// resolveVerifyIssues bills another action — recheck the budget so a single
@@ -467,6 +487,10 @@ export async function runFoundationGate(seriesId, record) {
pauseKind: 'inapplicable',
reason: `Foundation gate can't auto-fix the weakest dimension (${weak.dimension}): ${fix?.reason || 'no change applied'}. Strengthen it manually, or lower the threshold, and resume.`,
residual: residualFindings(snap.dimensions),
+ // A structure repair that verified badly and reverted reports the arc
+ // blockers it was judged on — they are not in `residual`, which carries
+ // the dimension gaps, so this is the only place they reach the user.
+ discarded: Array.isArray(fix?.discarded) ? discardedSet(fix.discarded) : [],
};
}
changed = true;
diff --git a/server/services/pipeline/seriesAutopilot/orchestrator.js b/server/services/pipeline/seriesAutopilot/orchestrator.js
index 2b898f2d5d..bddcaa6f8b 100644
--- a/server/services/pipeline/seriesAutopilot/orchestrator.js
+++ b/server/services/pipeline/seriesAutopilot/orchestrator.js
@@ -380,8 +380,20 @@ export async function startSeriesAutopilot(sId, options = {}) {
// rides it (a client tears its stream down on `paused`). No-ops unless
// the run opted into self-improvement.
const pm = await postMortem('paused', `${step.kind}: ${result.reason}`);
- await persistMarker(sId, { status: 'paused', runId, currentStep: step.kind, residualFindings: result.residual || [], lastError: result.reason, pauseKind: result.pauseKind || null, healthBreakdown: result.healthBreakdown || null, ...pm });
- broadcast(sId, { type: 'paused', runId, scope: step.kind, reason: result.reason, residualFindings: result.residual || [], pauseKind: result.pauseKind || null, healthBreakdown: result.healthBreakdown || null, ...pm, completedAt: new Date().toISOString() });
+ // The marker and the frame report the same pause, so the shared terms
+ // live in one object — they only disagree on how they name the step
+ // and the reason. Keeping them in two literals is how a pause field
+ // ends up persisted but never broadcast (or the reverse).
+ const pausePayload = {
+ runId,
+ residualFindings: result.residual || [],
+ discardedFindings: result.discarded || [],
+ pauseKind: result.pauseKind || null,
+ healthBreakdown: result.healthBreakdown || null,
+ ...pm,
+ };
+ await persistMarker(sId, { status: 'paused', currentStep: step.kind, lastError: result.reason, ...pausePayload });
+ broadcast(sId, { type: 'paused', scope: step.kind, reason: result.reason, ...pausePayload, completedAt: new Date().toISOString() });
await notifyPause(record, sId, { reason: result.reason, pauseKind: result.pauseKind || null, currentStep: step.kind });
// Only file the generic stalled task when the step didn't already file
// a more specific gap (canon-undescribed, visual-no-pages, …) — else