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: let resumed arc targets leave the avoid set

[._.]/ Adam Eivyfd9312a3512d
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 4bab99dc08..53c9bd8396 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -92,5 +92,5 @@
- **A character repair that objectively filled the blank cast fields is no longer thrown away because the judge scored it a tie.** The foundation gate holds each repair provisional until an independent re-judge proves it helped the dimension it was asked to fix, and reverts it otherwise — the right rule for editorial work that can only be assessed by reading it. But the character dimension's core complaint is frequently a countable one ("every core character has blank physicalDescription, visualNotes, silhouetteNotes, visualIdentity and colorPalette"), and answering it is a countable act. On the observed run the repair authored all five visual fields for all five leads — roughly five minutes of a max-effort ensemble pass — the judge came back holding character at the same 5 while unrelated worldbuilding drifted 8 → 7, and the gate reverted every sheet and paused the run for review with the cast blank again. The gate now takes a second, LLM-free opinion before it reverts a *tied* character repair: it counts the blank framework and visual fields across the exact cast the repair is allowed to write (the series roster, minus locked members) before and after, and keeps the work when that count went down. A repair whose target regressed is still reverted, every other dimension is unaffected, and a repair that changed nothing measurable is still rejected — what changed is that a fact on disk now outranks a tied score.
- **A local video render now tells you how long it has left, once your machine has rendered something comparable.** Local renders run 15–40+ minutes and the only progress the UI could show was a step counter — "20%" on a job that might finish in four minutes or forty, with no way to tell which. Each completed render now records its wall-clock time alongside the shape it rendered (model, resolution, frames, steps), and a new job estimates itself from that history: a run of the same shape uses the median of your own measured runs outright, a different shape is placed on a least-squares fit of cost against pixels × frames × steps, and the fit's intercept — the fixed per-render cost of loading weights and decoding — is what lets a chained multi-chunk render be estimated as N renders rather than one long one. The estimate rides the render's started/progress events through to the client, where the progress bar reads "20% · ~18m 30s left". An install that has never measured a comparable render reports no estimate at all rather than a fabricated one, and the progress bar simply shows the percentage as before.
- **A video LoRA in the wrong key layout is now refused with the reason instead of quietly rendering an un-LoRA'd clip.** Downloaded LoRAs ship in several incompatible safetensors key conventions, and the LTX-2 loader fuses exactly one of them: `lora_A`/`lora_B` rank pairs, optionally under a `diffusion_model.` prefix. A kohya/LyCORIS file (`lora_down`/`lora_up` + `alpha`) or a diffusers/PEFT-prefixed file matches nothing in the transformer — so the render burned its full GPU time and came back looking like the LoRA had never been selected, with no error anywhere to explain it. Confusingly, kohya files are commonly published *with* the ComfyUI `diffusion_model.` prefix, so the prefix alone was never a reliable signal. PortOS now classifies the layout from the safetensors header (`bare` / `comfyui` / `diffusers` / `kohya` / `not_a_lora`) at install time, records it in the LoRA's sidecar, and backfills it on the next listing for LoRAs installed earlier. A render that selects an un-fusable one fails up front with a 400 naming the layout and what to use instead. A file whose header can't be read stays "undetermined" and is still allowed through — unreadable is not the same as unusable.
-- **A resumed arc verification no longer forgets why its last rewrite was rejected.** When Series Autopilot restored a safe checkpoint after a regressive rewrite, it persisted both the standing blockers and the rejected candidate's new blockers — but a fresh Resume discarded the latter before calling the resolver. That made the new run liable to repeat the same bad trade from the same checkpoint. A resumed arc gate now carries the bounded discarded set into every normal, corrective, and isolated resolve attempt as explicit avoid evidence, while non-arc and non-regression pauses start clean as before.
- **A generated Three.js model is now checked for parts modelled inside each other.** Every existing gate reads one part at a time — the schema proves each geometry is well formed, the coverage gate proves the assembly backs the inventory, and the cross-section gate proves the identity parts have real depth — so nothing ever compared two parts to each other, and the whole class of defect where sibling parts occupy the *same* space was invisible: a greeble modelled at the wrong scale and swallowed whole by the hull it was meant to sit on, a limb rooted a full radius inside a torso, an eye socket punched clean through the back of a skull. All of those render perfectly from the hero camera the model generated for itself and only read as broken once you orbit or explode the assembly. A new cross-part penetration gate reconstructs each part's world placement (the same rotation/scale composition the preview applies), derives an analytic solid per geometry type — a torus is measured as a ring rather than a filled disc, a hollow lathe as hollow, an extrude's hole as empty space — and samples one part's interior against another's, flagging a part that is entirely inside an unrelated one as an error and a pair that shares most of the smaller part's volume as a warning. It reports rather than rejects, and it is deliberately quiet where it cannot be sure: parts parented together or declared as attachments are exempt (embedding is what those relationships are *for*), and a shallow seated joint or anything inside a transparent part comes back as an undecided note that a refinement pass is never told to "fix". Findings land on the record, show up in a new panel on the model detail page, and an unsteered refinement now asks for each part to get its own volume alongside the existing coverage and depth feedback.
+- **A resumed arc verification no longer forgets why its last rewrite was rejected.** When Series Autopilot restored a safe checkpoint after a regressive rewrite, it persisted both the standing blockers and the rejected candidate's new blockers — but a fresh Resume discarded the latter before calling the resolver. That made the new run liable to repeat the same bad trade from the same checkpoint. A resumed arc gate now carries the bounded discarded set into every normal, corrective, and isolated resolve attempt as explicit avoid evidence, while non-arc and non-regression pauses start clean as before. If a discarded latent defect is later found in the checkpoint itself, it is removed from the avoid set while it is the active repair target, so the resolver never receives contradictory "fix this" and "avoid this" instructions.
diff --git a/server/services/pipeline/seriesAutopilot.test.js b/server/services/pipeline/seriesAutopilot.test.js
index 9bc3aaa070..00e0225609 100644
--- a/server/services/pipeline/seriesAutopilot.test.js
+++ b/server/services/pipeline/seriesAutopilot.test.js
@@ -2588,6 +2588,37 @@ describe('autopilot conductor', () => {
expect(autopilot.__testing.runs.get(seriesId)?.lastPayload?.type).toBe('complete');
});
+ it('does not tell a resumed resolver to avoid a discarded finding that is now its active target', async () => {
+ const active = {
+ severity: 'medium', problem: 'the sacrifice beat is missing from the volume', location: 'V1 issue 10',
+ };
+ const unrelated = {
+ severity: 'medium', problem: 'the rejected rewrite dropped a consent choice', location: 'V1 issue 9',
+ };
+ arcSpies.verifyArc.mockReset();
+ arcSpies.verifyArc
+ .mockImplementationOnce(async () => ({ issues: [active] }))
+ .mockImplementationOnce(async () => ({ issues: [] }));
+
+ const { seriesId } = await seedComplete();
+ await seriesSvc.updateSeries(seriesId, {
+ autopilot: {
+ status: 'paused',
+ currentStep: 'verifyArcSpine',
+ pauseKind: 'regression',
+ residualFindings: [],
+ discardedFindings: [active, unrelated],
+ },
+ });
+ await autopilot.startSeriesAutopilot(seriesId, { maxArcVerifyRounds: 2 });
+ await waitFor(runFinished(seriesId));
+
+ expect(arcSpies.resolveVerifyIssues).toHaveBeenCalledWith(
+ seriesId,
+ expect.objectContaining({ findings: [active], avoid: [unrelated], spineOnly: true }),
+ );
+ });
+
it('reverts an equal-count arc candidate whose findings escalated in severity', async () => {
const before = [
{ severity: 'high', problem: 'recovery clock is contradictory', location: 'V1 issues 8-9' },
diff --git a/server/services/pipeline/seriesAutopilot/childRuns.js b/server/services/pipeline/seriesAutopilot/childRuns.js
index 160385234e..1ce95aeef2 100644
--- a/server/services/pipeline/seriesAutopilot/childRuns.js
+++ b/server/services/pipeline/seriesAutopilot/childRuns.js
@@ -273,7 +273,18 @@ export async function runArcVerify(seriesId, record, { spineOnly = false } = {})
// Preserve rejected-candidate evidence across Resume, then layer any newer
// regression from this run on top. `discardedSet` keeps the provider prompt
// bounded exactly like the persisted marker.
- const avoidFindings = (current = []) => discardedSet([...priorAvoid, ...current]);
+ const avoidFindings = (current = [], active = []) => discardedSet(
+ [
+ // A latent defect from a rejected candidate can later be found in the
+ // restored checkpoint itself. Once it is a CURRENT target, telling the
+ // resumed resolver both "fix this" and "avoid this" is contradictory;
+ // filter only the stale cross-run evidence. The current transaction's
+ // discarded set stays whole because its restatements describe the exact
+ // candidate that was just rejected and are intentional retry evidence.
+ ...priorAvoid.filter((candidate) => !active.some((target) => sameFinding(candidate, target))),
+ ...current,
+ ],
+ );
let convergence = { best: null, sinceBest: 0 };
let changed = false;
// Lowest verified blocker set seen in this gate, paired with the exact arc /
@@ -379,7 +390,9 @@ export async function runArcVerify(seriesId, record, { spineOnly = false } = {})
const beforeRetry = await budgetPause();
if (beforeRetry) return beforeRetry;
const retried = await resolveArcFindings(seriesId, record, {
- findings: rollbackTarget.blocking, avoid: avoidFindings(discarded), spineOnly,
+ findings: rollbackTarget.blocking,
+ avoid: avoidFindings(discarded, rollbackTarget.blocking),
+ spineOnly,
});
if (retried?.applied !== false) changed = true;
// The restored state is what the retry has to beat, so the next round
@@ -399,7 +412,7 @@ export async function runArcVerify(seriesId, record, { spineOnly = false } = {})
const isolated = await isolateArcFindings(seriesId, record, {
scope, round, spineOnly,
baseline: rollbackTarget.blocking,
- avoid: avoidFindings(discarded),
+ avoid: avoidFindings(discarded, rollbackTarget.blocking),
attemptsLeft: isolationLeft,
});
isolationLeft -= isolated.attempts;
@@ -481,7 +494,7 @@ export async function runArcVerify(seriesId, record, { spineOnly = false } = {})
// only place they can actually close a finding.
const resolved = await resolveArcFindings(seriesId, record, {
findings: blocking,
- avoid: avoidFindings(),
+ avoid: avoidFindings([], blocking),
spineOnly,
});
if (resolved?.applied !== false) changed = true;