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

carry discarded arc-rewrite evidence across the pause and into isolation

[._.]/ Adam Eivy21262a1caff2
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 2f425fa533..cf64a4b64c 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -103,3 +103,4 @@
- **Stitched and re-encoded video renders now carry BT.709 color tags, so they stop decoding washed-out.** Every ffmpeg re-encode in video-gen — the chained render's chunk stitch, the frame-exact trim behind its context window, and the 2× upscale export — wrote H.264 with no color metadata at all, leaving each player to guess a color space (and the common guess for HD content differs from the one for SD). The three `-color_primaries/-color_trc/-colorspace` container flags alone do not fix this on ffmpeg 8: the encoder reads its color properties off the *frames* coming down the filter graph, which inherit the decoded input's unspecified values and silently override the flags — verified locally on ffmpeg 8.1.1, where a flags-only output came back `color_primaries=unknown, color_transfer=unknown`. All three sites now emit the container flags *and* a trailing `setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709` on the video chain, which makes all three properties stick. The `setparams` filter only landed in ffmpeg 4.3 and an older build aborts the whole run on an unknown filter, so its availability is probed once per process from `-filters` and the tag is dropped (container flags only) when it isn't there — a probe that could not run is left uncached rather than remembered as "unsupported", so one transient failure can't disable tagging for the life of the server.
- **The Digital Twin's 19 sections are grouped now, instead of one 19-wide tab strip you had to read end to end.** The strip carried every section in a single flat row with no ordering a user could infer — setup, content, output and archival tasks interleaved, `Import` sitting between `Interview` and `Avatar Bio`, and `Export`, `Legacy` and `Time Capsule` as three adjacent tabs that all mean "get data out" — so every visit started by scanning 19 labels, several of which (`Enrich` vs `Taste` vs `Personality` vs `Personas`) only tell you apart if you already know the feature. They now collapse into five groups named for what you're doing to the twin: **Profile** (who it is), **Sources** (where its material comes from), **Assessment** (whether it's actually you), **Presence** (how it shows up) and **Legacy** (how you get it out). Above `sm` that's a group row over the active group's sections — at most six at a time; on a phone the whole thing becomes one `<select>` with `<optgroup>` headers, which is the measured fix for a 375x812 screen where the strip plus the health header pushed **Analyze Traits**, **Recalculate** and **Check for Contradictions** below the fold. Nothing about addressing changed: the section id is still the route param, so every deep link, ⌘K entry and voice `ui_navigate` target resolves exactly as before, and the group is derived from the section rather than stored. The nav manifest carries the grouping as a keyword tag per section plus a `twin-<group>` alias, so "twin sources" lands somewhere sensible without inventing a group path no route serves.
- **An arc verification no longer forgets a rejected rewrite one round after it reverted it.** The gate already carried a reverted candidate's own blockers into the corrective retry that follows the rollback, as "do not author these" evidence — but only that one call. If the retry landed on a state that was no better than the checkpoint yet still blocked, the next ordinary resolve rebuilt its avoid list from scratch, so the resolver was free to re-author the exact rewrite the gate had just thrown away. That is what a paused run showed: 2 blockers resolved down to 1, a rewrite back up to 5 (reverted), the retry back to 1, then straight back to 2 with no retries left and a pause for review. Every blocker set discarded during a run is now accumulated and passed to every later resolve in that gate — ordinary, corrective, and per-finding isolated alike — bounded by the same limit the persisted marker uses, newest evidence first so it is never the part that gets trimmed. Anything that has since become an active repair target is filtered out, so the resolver is never told to both fix and avoid the same finding, and the cross-Resume evidence from a previous run still layers in underneath.
+- **That rejected-rewrite evidence now survives the pause, and the isolation pass banks its own.** Accumulating a run's discarded blocker sets fixed the gate mid-run, but two boundaries still threw the evidence away — both the same failure one level out. A run that reverted two *different* rewrites before pausing persisted only the newest set, so a Resume inherited the last rollback alone and its resolver could re-author the first; the whole history now rides a separate `runDiscardedFindings` on the paused marker, which leaves the panel's "Discarded — what the reverted round produced" copy true of the field it renders and hands the resumed gate everything. And the per-finding isolation pass — the escalation that resolves a residual one finding at a time once the whole-set retries are spent — computed its avoid list once for the whole pass and never recorded its own rejected patches, so a rewrite rejected on target 1 could be re-proposed verbatim on target 3, and nothing it learned reached the ordinary resolve that follows a successful isolation. Each rejected patch's verified consequence is now banked like a whole-set rollback's, and the avoid list is rebuilt per target. It is still filtered against everything the pass is currently repairing, so no attempt is told to both fix and avoid the same finding, and a marker written before the new field exists resumes on what it has.
diff --git a/server/services/pipeline/series.js b/server/services/pipeline/series.js
index 2a2348a51e..e880296bbf 100644
--- a/server/services/pipeline/series.js
+++ b/server/services/pipeline/series.js
@@ -255,6 +255,21 @@ export const sanitizeAutopilot = (raw) => {
// 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),
+ // Every rewrite the paused gate reverted, newest first — a superset of
+ // `discardedFindings`, which stays scoped to the round that was reverted
+ // last so the panel's copy stays true. Not rendered: this is the resume
+ // evidence, so a run that reverted two different rewrites hands the next
+ // one both instead of only the second (#3829).
+ //
+ // A marker persisted before the field existed (or written by an older peer)
+ // falls back to the one set it does have, so the compat lives HERE — where
+ // this shape is owned — instead of every consumer re-deriving "absent" from
+ // an empty array. Safe because the gate banks each discarded set as it
+ // reverts it, so the history can never be empty while the last round isn't.
+ runDiscardedFindings: sanitizeAutopilotFindings(
+ raw.runDiscardedFindings ?? 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 70c5cee171..1595358778 100644
--- a/server/services/pipeline/series.test.js
+++ b/server/services/pipeline/series.test.js
@@ -905,6 +905,30 @@ describe('pipeline series service', () => {
expect(svc.sanitizeAutopilot({ status: 'paused' }).discardedFindings).toEqual([]);
expect(svc.sanitizeAutopilot({ status: 'paused', discardedFindings: 'nope' }).discardedFindings).toEqual([]);
});
+
+ it('bounds runDiscardedFindings — the whole gate\'s history — the same way (#3829)', () => {
+ const many = Array.from({ length: 40 }, (_, i) => ({ severity: 'high', location: `V${i}`, problem: `hole ${i}` }));
+ const a = svc.sanitizeAutopilot({ status: 'paused', runDiscardedFindings: many });
+ expect(a.runDiscardedFindings).toHaveLength(20);
+ // Newest first, so the bound trims the oldest evidence rather than the set
+ // the gate just reverted.
+ expect(a.runDiscardedFindings[0]).toEqual(many[0]);
+ expect(svc.sanitizeAutopilot({ status: 'paused' }).runDiscardedFindings).toEqual([]);
+ });
+
+ it('falls back to discardedFindings for a marker written before the field existed', () => {
+ // The compat lives in the sanitizer so a resume reads one field with no
+ // branch — an older peer's paused marker still carries its evidence.
+ const older = { severity: 'high', location: 'V3', problem: 'mentor subplot never pays off' };
+ const a = svc.sanitizeAutopilot({ status: 'paused', discardedFindings: [older] });
+ expect(a.runDiscardedFindings).toEqual([older]);
+ // A current marker's own history wins, empty included: the gate banks each
+ // set as it reverts it, so an empty history means nothing was reverted.
+ const b = svc.sanitizeAutopilot({
+ status: 'paused', discardedFindings: [older], runDiscardedFindings: [],
+ });
+ expect(b.runDiscardedFindings).toEqual([]);
+ });
});
describe('sanitizeAutopilot resumeOptions', () => {
diff --git a/server/services/pipeline/seriesAutopilot.test.js b/server/services/pipeline/seriesAutopilot.test.js
index 58d8aea9e8..ce5b37b045 100644
--- a/server/services/pipeline/seriesAutopilot.test.js
+++ b/server/services/pipeline/seriesAutopilot.test.js
@@ -2598,6 +2598,56 @@ describe('autopilot conductor', () => {
expect(series.autopilot?.pauseKind).not.toBe('regression');
});
+ it('hands a resumed resolver every rewrite the paused gate reverted, not just the last one', async () => {
+ // Two DIFFERENT rewrites reverted before the pause. The marker's
+ // `discardedFindings` is scoped to the round that was reverted last (the
+ // panel renders it under that copy), so a resume that read only that field
+ // let the resolver re-author the first rejected rewrite for free. The gate's
+ // whole history rides `runDiscardedFindings` instead (#3829).
+ const standing = { severity: 'high', problem: 'the succession vow is never paid off', location: 'V1' };
+ const first = [
+ { severity: 'high', problem: 'the coronation is moved off-page into a letter', location: 'V2' },
+ { severity: 'high', problem: 'the regent loses her veto with no scene to spend it', location: 'V3' },
+ ];
+ const second = [
+ { severity: 'high', problem: 'the siege ends in a timeskip nobody witnesses', location: 'V4' },
+ { severity: 'high', problem: 'the heir swears a second, contradictory oath', location: 'V5' },
+ ];
+ arcSpies.verifyArc.mockReset();
+ [
+ [standing], // round 1 — the checkpoint; resolve #1
+ [standing, ...first], // round 2 — regressed, reverted, corrective retry (#2)
+ [standing, ...second], // round 3 — regressed again, retries spent → pause
+ ].forEach((issues) => arcSpies.verifyArc.mockImplementationOnce(async () => ({ issues })));
+
+ const { seriesId } = await seedComplete();
+ await autopilot.startSeriesAutopilot(seriesId, { maxArcVerifyRounds: 6 });
+ await waitFor(runFinished(seriesId));
+
+ const paused = await seriesSvc.getSeries(seriesId);
+ expect(paused.autopilot?.pauseKind).toBe('regression');
+ // The panel's field keeps meaning "what the reverted round produced"…
+ expect(paused.autopilot?.discardedFindings).toEqual([standing, ...second]);
+ // …while the resume evidence carries both rewrites, newest first.
+ expect(paused.autopilot?.runDiscardedFindings).toEqual([...second, standing, ...first]);
+
+ // Resume: the gate clears, and its first resolve is told to avoid BOTH
+ // rejected rewrites — minus `standing`, which it is being asked to fix.
+ arcSpies.resolveVerifyIssues.mockClear();
+ arcSpies.verifyArc.mockReset();
+ arcSpies.verifyArc
+ .mockImplementationOnce(async () => ({ issues: [standing] }))
+ .mockImplementationOnce(async () => ({ issues: [] }));
+ await autopilot.startSeriesAutopilot(seriesId, { maxArcVerifyRounds: 2 });
+ await waitFor(runFinished(seriesId));
+
+ expect(arcSpies.resolveVerifyIssues.mock.calls[0][1]).toMatchObject({
+ findings: [standing],
+ avoid: [...second, ...first],
+ spineOnly: true,
+ });
+ });
+
it('honors maxArcResolveRetries: 0 by pausing on the first regression', async () => {
// The pre-#3781 behavior stays reachable per run: no corrective pass, so the
// first reverted candidate ends the gate without spending a second resolve.
@@ -2886,10 +2936,14 @@ describe('autopilot conductor', () => {
autopilot.autopilotEvents.off(seriesId, handler);
// Each isolated attempt resolves exactly one finding, and carries the
- // rejected whole-set candidate's findings as the failure mode to avoid.
+ // rejected whole-set candidates' findings as the failure mode to avoid —
+ // minus the two the restored checkpoint still has as active repair targets
+ // for this pass (#3829). Telling the resolver to avoid `eclipse` while
+ // handing it `eclipse` to fix is the contradiction the accumulator filters.
expect(arcSpies.resolveVerifyIssues.mock.calls[2][1]).toMatchObject({
findings: [eclipse],
- avoid: [eclipse, mentor, finale, motive],
+ // Newest evidence first, so it is never the part trimmed at the bound.
+ avoid: [motive, finale],
});
expect(arcSpies.resolveVerifyIssues.mock.calls[3][1]).toMatchObject({ findings: [mentor] });
// The rejected attempt is reverted on its own — the kept one is not.
@@ -2922,6 +2976,41 @@ describe('autopilot conductor', () => {
expect(series.autopilot?.pauseKind).not.toBe('regression');
});
+ it('banks an isolated patch\'s rejection so the next target in the same pass avoids it (#3829)', async () => {
+ // The isolation pass used to compute `avoid` once for the whole pass and
+ // throw its own rejections away, so a rewrite rejected on target 1 was free
+ // to be re-proposed on target 2 — the gate paid a resolve + a verify to
+ // learn something nothing downstream ever heard.
+ const eclipse = { severity: 'high', problem: 'volume 1 and volume 2 both stage the first eclipse', location: 'V1' };
+ const mentor = { severity: 'high', problem: 'mentor subplot never pays off', location: 'V3' };
+ const finale = { severity: 'high', problem: 'finale hook contradicts prologue promise', location: 'V4' };
+ const motive = { severity: 'high', problem: 'antagonist motive changes without cause', location: 'V5' };
+ const siege = { severity: 'high', problem: 'timeline of the siege runs backwards', location: 'V6' };
+ arcSpies.verifyArc.mockReset();
+ [
+ [eclipse, mentor], // round 1 — the checkpoint
+ [eclipse, mentor, finale], // round 2 — regressed, reverted + retried
+ [eclipse, mentor, finale, motive], // round 3 — regressed again, retries spent
+ [eclipse, mentor, siege], // isolate #1 (eclipse) — grew the set, reverted
+ [eclipse], // isolate #2 (mentor) — closed it, kept
+ [], // round 5 — clean
+ ].forEach((issues) => arcSpies.verifyArc.mockImplementationOnce(async () => ({ issues })));
+
+ const { seriesId } = await seedComplete();
+ await autopilot.startSeriesAutopilot(seriesId, { maxArcVerifyRounds: 6 });
+ await waitFor(runFinished(seriesId));
+
+ // Isolate #1 carries only what the two whole-set rollbacks discarded.
+ expect(arcSpies.resolveVerifyIssues.mock.calls[2][1]).toMatchObject({
+ findings: [eclipse], avoid: [motive, finale],
+ });
+ // Isolate #2 carries its predecessor's verified failure on top of those, and
+ // still never sees a finding it is being asked to fix.
+ expect(arcSpies.resolveVerifyIssues.mock.calls[3][1]).toMatchObject({
+ findings: [mentor], avoid: [siege, motive, finale],
+ });
+ });
+
it('does not isolate a single-finding residual (that is the corrective pass again)', async () => {
// Isolating a one-finding residual re-issues the exact call the corrective
// pass just made — same finding, same avoid list — so the gate pauses rather
diff --git a/server/services/pipeline/seriesAutopilot/childRuns.js b/server/services/pipeline/seriesAutopilot/childRuns.js
index a9d4370ca7..54ed345231 100644
--- a/server/services/pipeline/seriesAutopilot/childRuns.js
+++ b/server/services/pipeline/seriesAutopilot/childRuns.js
@@ -196,8 +196,14 @@ async function verifyArcBlocking(seriesId, record, { spineOnly }) {
* full verification of the state now standing in the store, which the caller
* hands to its next round instead of re-billing the identical call — plus
* `outcome` when the run ended mid-pass.
+ *
+ * The pass banks its own rejections (#3829). `evidence` is the gate's
+ * accumulator: read per target rather than once for the whole pass, so a patch
+ * rejected on target 1 is evidence target 3 gets — and evidence the ordinary
+ * resolve after a successful isolation gets too. Computing it once up front
+ * made every attempt repeat the prompt the previous one had just failed with.
*/
-async function isolateArcFindings(seriesId, record, { scope, round, spineOnly, baseline, avoid, attemptsLeft }) {
+async function isolateArcFindings(seriesId, record, { scope, round, spineOnly, baseline, avoidFindings, bankDiscarded, attemptsLeft }) {
// The last verification that DESCRIBES THE STORE: it advances only on an
// accepted patch, because a rejected one is rolled straight back to the state
// its predecessor verified. So later targets are judged against what the
@@ -219,6 +225,12 @@ async function isolateArcFindings(seriesId, record, { scope, round, spineOnly, b
attempts += 1;
const before = blocking().length;
const snapshot = await snapshotArcState(seriesId);
+ // Recomputed per target: earlier attempts in this same pass have banked
+ // their rejections by now. Everything still standing is an active repair
+ // target for this pass, so the whole set — not just `target` — is what the
+ // avoid list is filtered against; the resolver is never told to both fix
+ // and avoid the same finding.
+ const avoid = avoidFindings([], blocking());
const resolved = await resolveArcFindings(seriesId, record, { findings: [target], avoid, spineOnly });
const verified = await verifyArcBlocking(seriesId, record, { spineOnly });
if (verified.outcome) {
@@ -243,6 +255,11 @@ async function isolateArcFindings(seriesId, record, { scope, round, spineOnly, b
standing = verified;
} else {
await restoreArcState(seriesId, snapshot);
+ // The verified consequence of a rewrite the gate just threw away — the
+ // same evidence a whole-set rollback banks, at single-finding grain.
+ // Without this the pass paid a resolve + a verify to learn something no
+ // later attempt (or the round that follows) ever hears about.
+ bankDiscarded(discardedSet(verified.blocking));
}
broadcast(seriesId, {
type: 'resolve:isolate', scope, round, attempt: attempts,
@@ -253,7 +270,27 @@ async function isolateArcFindings(seriesId, record, { scope, round, spineOnly, b
return { accepted, attempts, verified: standing };
}
-export async function runArcVerify(seriesId, record, { spineOnly = false } = {}) {
+/**
+ * The arc-verify gate. Thin wrapper over the round loop so the accumulator has
+ * exactly ONE exit to be stamped onto (#3829): every pause the loop can produce
+ * — regression, maxRounds, divergence, manual, and the budget/provider ones it
+ * merely forwards — owes the next run the whole gate's history, not just the set
+ * the final rollback threw away. Stamping it at each `return` instead put the
+ * invariant in six places and missed the forwarded ones.
+ *
+ * It rides its own `runDiscarded` rather than widening `discarded`, because the
+ * panel labels that field "what the reverted round produced" and it stops being
+ * true once it carries the run. A run that reverted two different rewrites used
+ * to hand its resume only the second, so the resumed resolver could re-author
+ * the first.
+ */
+export async function runArcVerify(seriesId, record, opts = {}) {
+ const runDiscarded = [];
+ const outcome = await runArcVerifyRounds(seriesId, record, { ...opts, runDiscarded });
+ return outcome?.pause ? { ...outcome, runDiscarded: discardedSet(runDiscarded) } : outcome;
+}
+
+async function runArcVerifyRounds(seriesId, record, { spineOnly = false, runDiscarded }) {
const maxRounds = Number.isInteger(record.options.maxArcVerifyRounds)
? record.options.maxArcVerifyRounds
: MAX_ARC_VERIFY_ROUNDS;
@@ -276,13 +313,18 @@ export async function runArcVerify(seriesId, record, { spineOnly = false } = {})
// so once a retry landed on a non-worse but still-blocked state the resolver
// was free to re-author the exact rewrite the gate had just reverted — the
// observed 2 → 1 → 5 (revert) → 1 → 2 (revert, out of retries) stall.
- const runDiscarded = [];
+ // Records a discarded blocker set as this gate's newest evidence. Called at
+ // the moment a rewrite is thrown away — the rollback, the rewind, an isolated
+ // patch's revert — so no exit has to remember to do it on that path's behalf.
+ const bankDiscarded = (current = []) => {
+ runDiscarded.unshift(...current.filter((finding) => !containsFinding(runDiscarded, finding)));
+ };
// Builds the avoid list for ONE resolve call and banks that call's own newest
- // evidence into the history above, so this is where a rejected candidate stops
- // being the retry's private knowledge. Preserves cross-Resume evidence and this
- // run's earlier rollbacks underneath. `discardedSet` keeps the provider prompt
- // bounded exactly like the persisted marker — `current` leads so the newest
- // evidence is never the part that gets cut at that bound.
+ // evidence into the history, so this is where a rejected candidate stops being
+ // the retry's private knowledge. Preserves cross-Resume evidence and this run's
+ // earlier rollbacks underneath. `discardedSet` keeps the provider prompt bounded
+ // exactly like the persisted marker — `current` leads so the newest evidence is
+ // never the part that gets cut at that bound.
const avoidFindings = (current = [], active = []) => {
const avoid = discardedSet([
// The caller's own discarded set stays whole because its restatements
@@ -299,7 +341,7 @@ export async function runArcVerify(seriesId, record, { spineOnly = false } = {})
!containsFinding(active, candidate) && !containsFinding(current, candidate)
)),
]);
- runDiscarded.unshift(...current.filter((finding) => !containsFinding(runDiscarded, finding)));
+ bankDiscarded(current);
return avoid;
};
let convergence = { best: null, sinceBest: 0 };
@@ -370,6 +412,7 @@ export async function runArcVerify(seriesId, record, { spineOnly = false } = {})
const rollbackTarget = bestVerified || lastResolve;
const rollback = await restoreArcState(seriesId, rollbackTarget.snapshot);
const discarded = discardedSet(blocking);
+ bankDiscarded(discarded);
// Neither second chance is worth its LLM call without a round left to
// VERIFY what it wrote: spending one on the final round would bill a
// rewrite nothing ever checks, and would fall out of the loop past every
@@ -442,7 +485,8 @@ export async function runArcVerify(seriesId, record, { spineOnly = false } = {})
const isolated = await isolateArcFindings(seriesId, record, {
scope, round, spineOnly,
baseline: rollbackTarget.blocking,
- avoid: avoidFindings(discarded, rollbackTarget.blocking),
+ avoidFindings,
+ bankDiscarded,
attemptsLeft: isolationLeft,
});
isolationLeft -= isolated.attempts;
@@ -505,7 +549,9 @@ export async function runArcVerify(seriesId, record, { spineOnly = false } = {})
const rewind = async () => {
if (isNewBest || !bestVerified) return { residual: blocking, discarded: [] };
await restoreArcState(seriesId, bestVerified.snapshot);
- return { residual: bestVerified.blocking, discarded: discardedSet(blocking) };
+ const discarded = discardedSet(blocking);
+ bankDiscarded(discarded);
+ return { residual: bestVerified.blocking, discarded };
};
if (round === maxRounds) {
const { residual, discarded } = await rewind();
diff --git a/server/services/pipeline/seriesAutopilot/orchestrator.js b/server/services/pipeline/seriesAutopilot/orchestrator.js
index 36f3cebc76..b3b6da2874 100644
--- a/server/services/pipeline/seriesAutopilot/orchestrator.js
+++ b/server/services/pipeline/seriesAutopilot/orchestrator.js
@@ -11,7 +11,7 @@ import { mergeSeverityWeights, resolveBlockingSet } from '../../../lib/editorial
import { loadState } from '../../cosState.js';
import { getDomainBudgetStatus } from '../../domainUsage.js';
import { getSettings } from '../../settings.js';
-import { getSeries, updateSeries, AUTOPILOT_DISCARDED_MAX } from '../series.js';
+import { getSeries, updateSeries } from '../series.js';
import { listIssues } from '../issues.js';
import { buildEditorialCheckPlan } from '../editorial/checkRunner.js';
import { runs } from './state.js';
@@ -71,11 +71,17 @@ export async function startSeriesAutopilot(sId, options = {}) {
// to forget that evidence and could immediately regenerate the same bad trade
// from the same checkpoint. Carry it into the next arc gate as an internal
// avoid-list only when the prior pause came from an arc verification step.
- const priorArcAvoidFindings = seriesRecord?.autopilot?.status === 'paused'
+ //
+ // The gate's WHOLE history, not just the round it reverted last: a run that
+ // reverted more than one rewrite holds the earlier ones only here (#3829), so
+ // resuming off `discardedFindings` let the resolver re-author the first one
+ // for free. `sanitizeAutopilot` owns the shape — bounded, array-typed, and
+ // already falling back for a marker written before the field existed.
+ const arcPause = seriesRecord?.autopilot?.status === 'paused'
&& ['verifyArcSpine', 'verifyArc'].includes(seriesRecord.autopilot.currentStep)
- && Array.isArray(seriesRecord.autopilot.discardedFindings)
- ? seriesRecord.autopilot.discardedFindings.slice(0, AUTOPILOT_DISCARDED_MAX)
- : [];
+ ? seriesRecord.autopilot
+ : null;
+ const priorArcAvoidFindings = arcPause?.runDiscardedFindings || [];
const autoSelectModels = resolveAutopilotAutoSelectModels(options, settings);
const modelPerformance = autoSelectModels
? await getModelPerformanceReport().catch((err) => {
@@ -430,6 +436,10 @@ export async function startSeriesAutopilot(sId, options = {}) {
runId,
residualFindings: result.residual || [],
discardedFindings: result.discarded || [],
+ // The arc gate's whole rollback history (see `runArcVerify`); only
+ // that gate emits it. `discardedFindings` above stays scoped to the
+ // round that was reverted last, which is what the panel renders.
+ runDiscardedFindings: result.runDiscarded || [],
pauseKind: result.pauseKind || null,
healthBreakdown: result.healthBreakdown || null,
...pm,