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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: Keep displayed autopilot defaults aligned with runtime (#8296)
[._.]/ Adam Eivyd9cb8e329e4e
diff --git a/client/src/components/pipeline/AutopilotPanel.jsx b/client/src/components/pipeline/AutopilotPanel.jsxindex 6612c685ab..6907110251 100644--- a/client/src/components/pipeline/AutopilotPanel.jsx+++ b/client/src/components/pipeline/AutopilotPanel.jsx@@ -29,49 +29,11 @@ import CanonReadinessPanel from './CanonReadinessPanel';import SeriesAutopilotSchedule from './SeriesAutopilotSchedule';import { severityColor } from './constants.js';import { READINESS_GATE_LABELS, READINESS_GATE_ORDER } from '../../lib/editorialHealth.js';+import { SERIES_AUTOPILOT_DEFAULTS } from '../../../../server/lib/seriesAutopilotDefaults.js';-// Convergence-round bounds — mirror the server (seriesAutopilot.js + the-// pipelineEditorialChecks settings schema). 0 = skip that gate entirely.+// Bounds are UI constraints; the fallback values come from the shared defaults.const ROUND_MIN = 0;const ROUND_MAX = 20;-const DEFAULT_ARC_ROUNDS = 3;-const DEFAULT_EDITORIAL_ROUNDS = 2;-const DEFAULT_BEAT_CONTINUITY_ROUNDS = 2;-// Editorial-checks pause threshold (#1613) — mirror the server default (0 = off).-// Unlike the round bounds it has no upper cap; a large N is effectively off.-const DEFAULT_CHECK_PAUSE_THRESHOLD = 0;-// Pause-notification escalation (#1615) — mirror the server default (on). The one-// autopilot setting that defaults ON: a zero-cost in-app banner when a run pauses.-const DEFAULT_NOTIFY_ON_PAUSE = true;-// Iterate-to-quality revision loop (#2171) — mirror the server defaults. Off by-// default (a fresh burst of judge + cut LLM spend); cycles bound the cost and the-// plateau delta is the mean-score movement below which the series counts converged.-const DEFAULT_REVISION_ENABLED = false;-const DEFAULT_REVISION_MIN_CYCLES = 1;-const DEFAULT_REVISION_MAX_CYCLES = 2;-const DEFAULT_REVISION_PLATEAU_DELTA = 0.3;-// Foundation-quality gate (#2176) — mirror the server defaults. The gate itself-// defaults ON (the point of the phase); the weighted [0,10] threshold the-// foundation must clear before drafting mirrors autonovel's 7.5 bar; the improve-// loop is bounded by MAX_FOUNDATION_ROUNDS (3).-const DEFAULT_FOUNDATION_GATE = true;-const DEFAULT_FOUNDATION_THRESHOLD = 7.5;-const DEFAULT_FOUNDATION_ROUNDS = 3;-// Pipeline self-improvement — mirror the server default (off). When on, a run-// that ends badly diagnoses whether PortOS's own automation is at fault and-// files a worktree-isolated, approval-gated CoS task against PortOS to fix it.-const DEFAULT_SELF_IMPROVE = false;-// Observing orchestrator — mirror the server default (off). When on, the run-// watches its own telemetry step by step and dispatches AUTO-APPROVED PortOS-// fix tasks (worktree + PR + review loop + merge, no human gate) as pipeline-// defects surface. Supersedes the selfImprove terminal diagnosis when both on.-const DEFAULT_OBSERVER = false;-// Evidence is collected regardless; routing stays opt-in so a series cannot-// silently switch models merely because a sample threshold was reached.-const DEFAULT_AUTO_SELECT_MODELS = false;-// Force the run's route onto stages pinned on the Prompts page — mirror the-// server default (off).-const DEFAULT_OVERRIDE_STAGE_PINS = false;const AUTOPILOT_LLM_STAGES = [['characterFoundation', 'Character foundation'],['generateArc', 'Generate arc'],@@ -141,72 +103,72 @@ const clampDelta = (n, fallback) => {// are deliberately NOT here — they are never persisted.const OPTION_SPECS = {maxArcVerifyRounds: {- defaultValue: DEFAULT_ARC_ROUNDS,+ defaultValue: SERIES_AUTOPILOT_DEFAULTS.maxArcVerifyRounds,read: readInteger,- clamp: (v) => clampRound(v, DEFAULT_ARC_ROUNDS),+ clamp: (v) => clampRound(v, SERIES_AUTOPILOT_DEFAULTS.maxArcVerifyRounds),},maxEditorialRounds: {- defaultValue: DEFAULT_EDITORIAL_ROUNDS,+ defaultValue: SERIES_AUTOPILOT_DEFAULTS.maxEditorialRounds,read: readInteger,- clamp: (v) => clampRound(v, DEFAULT_EDITORIAL_ROUNDS),+ clamp: (v) => clampRound(v, SERIES_AUTOPILOT_DEFAULTS.maxEditorialRounds),},maxBeatContinuityRounds: {- defaultValue: DEFAULT_BEAT_CONTINUITY_ROUNDS,+ defaultValue: SERIES_AUTOPILOT_DEFAULTS.maxBeatContinuityRounds,read: readInteger,- clamp: (v) => clampRound(v, DEFAULT_BEAT_CONTINUITY_ROUNDS),+ clamp: (v) => clampRound(v, SERIES_AUTOPILOT_DEFAULTS.maxBeatContinuityRounds),},// #1613 — non-negative integer, no upper cap (0 = off).checkFindingsPauseThreshold: {- defaultValue: DEFAULT_CHECK_PAUSE_THRESHOLD,+ defaultValue: SERIES_AUTOPILOT_DEFAULTS.checkFindingsPauseThreshold,read: readInteger,clamp: clampThreshold,},// #1615 — plain boolean, no clamp. Defaults ON.notifyOnPause: {- defaultValue: DEFAULT_NOTIFY_ON_PAUSE,+ defaultValue: SERIES_AUTOPILOT_DEFAULTS.notifyOnPause,read: readBoolean,persistOnEdit: true,},// #2171 — revision loop: enable checkbox + cycle bounds + plateau delta.revisionEnabled: {- defaultValue: DEFAULT_REVISION_ENABLED,+ defaultValue: SERIES_AUTOPILOT_DEFAULTS.revisionEnabled,read: readBoolean,persistOnEdit: true,},revisionMinCycles: {- defaultValue: DEFAULT_REVISION_MIN_CYCLES,+ defaultValue: SERIES_AUTOPILOT_DEFAULTS.revisionMinCycles,read: readInteger,- clamp: (v) => clampCycles(v, DEFAULT_REVISION_MIN_CYCLES),+ clamp: (v) => clampCycles(v, SERIES_AUTOPILOT_DEFAULTS.revisionMinCycles),},revisionMaxCycles: {- defaultValue: DEFAULT_REVISION_MAX_CYCLES,+ defaultValue: SERIES_AUTOPILOT_DEFAULTS.revisionMaxCycles,read: readInteger,- clamp: (v) => clampCycles(v, DEFAULT_REVISION_MAX_CYCLES),+ clamp: (v) => clampCycles(v, SERIES_AUTOPILOT_DEFAULTS.revisionMaxCycles),},revisionPlateauDelta: {- defaultValue: DEFAULT_REVISION_PLATEAU_DELTA,+ defaultValue: SERIES_AUTOPILOT_DEFAULTS.revisionPlateauDelta,read: readNumber,- clamp: (v) => clampDelta(v, DEFAULT_REVISION_PLATEAU_DELTA),+ clamp: (v) => clampDelta(v, SERIES_AUTOPILOT_DEFAULTS.revisionPlateauDelta),},// #2176 — foundation gate (defaults ON) + weighted threshold + round bound.foundationGate: {- defaultValue: DEFAULT_FOUNDATION_GATE,+ defaultValue: SERIES_AUTOPILOT_DEFAULTS.foundationGate,read: readBoolean,persistOnEdit: true,},foundationThreshold: {- defaultValue: DEFAULT_FOUNDATION_THRESHOLD,+ defaultValue: SERIES_AUTOPILOT_DEFAULTS.foundationThreshold,read: readNumber,- clamp: (v) => clampFoundationThreshold(v, DEFAULT_FOUNDATION_THRESHOLD),+ clamp: (v) => clampFoundationThreshold(v, SERIES_AUTOPILOT_DEFAULTS.foundationThreshold),},maxFoundationRounds: {- defaultValue: DEFAULT_FOUNDATION_ROUNDS,+ defaultValue: SERIES_AUTOPILOT_DEFAULTS.maxFoundationRounds,read: readInteger,- clamp: (v) => clampRound(v, DEFAULT_FOUNDATION_ROUNDS),+ clamp: (v) => clampRound(v, SERIES_AUTOPILOT_DEFAULTS.maxFoundationRounds),},// Pipeline self-improvement — boolean, off by default.selfImprove: {- defaultValue: DEFAULT_SELF_IMPROVE,+ defaultValue: SERIES_AUTOPILOT_DEFAULTS.selfImprove,read: readBoolean,persistOnEdit: true,},@@ -214,17 +176,17 @@ const OPTION_SPECS = {// a scheduled unattended run is exactly where the user wants the pipeline// hardening itself.observer: {- defaultValue: DEFAULT_OBSERVER,+ defaultValue: SERIES_AUTOPILOT_DEFAULTS.observer,read: readBoolean,persistOnEdit: true,},autoSelectModels: {- defaultValue: DEFAULT_AUTO_SELECT_MODELS,+ defaultValue: SERIES_AUTOPILOT_DEFAULTS.autoSelectModels,read: readBoolean,persistOnEdit: true,},overrideStagePins: {- defaultValue: DEFAULT_OVERRIDE_STAGE_PINS,+ defaultValue: SERIES_AUTOPILOT_DEFAULTS.overrideStagePins,read: readBoolean,persistOnEdit: true,},diff --git a/client/src/components/pipeline/AutopilotPanel.test.jsx b/client/src/components/pipeline/AutopilotPanel.test.jsxindex f5de198d80..0df710a2b6 100644--- a/client/src/components/pipeline/AutopilotPanel.test.jsx+++ b/client/src/components/pipeline/AutopilotPanel.test.jsx@@ -91,6 +91,32 @@ describe('AutopilotPanel', () => {));});+ it('shows shared option defaults when saved pipeline settings are absent', async () => {+ getSettings.mockResolvedValueOnce({});+ renderPanel({ id: 's1', targetFormat: 'comic' });+ fireEvent.click(screen.getByRole('button', { name: /options/i }));++ expect(await screen.findByLabelText('Arc verify rounds')).toHaveValue(3);+ expect(screen.getByLabelText('Beat continuity rounds')).toHaveValue(2);+ expect(screen.getByLabelText('Editorial rounds')).toHaveValue(2);+ expect(screen.getByLabelText('Foundation threshold')).toHaveValue(7.5);+ expect(screen.getByLabelText('Foundation rounds')).toHaveValue(3);+ expect(screen.getByLabelText('Pause at high findings')).toHaveValue(0);++ expect(screen.getByLabelText('Notify me when a run pauses (with a resume link)')).toBeChecked();+ expect(screen.getByLabelText('Judge the foundation (world / characters / arc) before drafting')).toBeChecked();+ expect(screen.getByLabelText('Iterate to quality (revise the weakest issue under a keep/revert score gate)')).not.toBeChecked();+ expect(screen.getByLabelText('Improve the pipeline itself (diagnose PortOS when a run goes wrong)')).not.toBeChecked();+ expect(screen.getByLabelText('Observing orchestrator (auto-fix the pipeline as the run progresses)')).not.toBeChecked();+ expect(screen.getByLabelText('Let autopilot choose models from stage-specific results')).not.toBeChecked();+ expect(screen.getByLabelText('Use this provider and model for every stage (ignore Prompts stage pins)')).not.toBeChecked();++ fireEvent.click(screen.getByLabelText('Iterate to quality (revise the weakest issue under a keep/revert score gate)'));+ expect(await screen.findByLabelText('Min cycles')).toHaveValue(1);+ expect(screen.getByLabelText('Max cycles')).toHaveValue(2);+ expect(screen.getByLabelText('Plateau Δ')).toHaveValue(0.3);+ });+it('sends pilot scope and does not reattach a settled run from a delayed status response', async () => {let resolveStatus;getPipelineAutopilotStatus.mockResolvedValueOnce({ active: false })diff --git a/server/lib/README.md b/server/lib/README.mdindex 0acf065ad9..b4e759fd2c 100644--- a/server/lib/README.md+++ b/server/lib/README.md@@ -164,6 +164,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub| `shotGrammar.js` | Pure shot-grammar vocabularies (`SHOT_TYPES`, `SCREEN_DIRECTIONS`) + normalizers (`normalizeShotType`, `normalizeScreenDirection`) for a storyboard shot's camera framing + on-screen direction. Shared by the scene extractor's sanitizer, the storyboards Zod schema, and the `visual.shot-continuity` editorial check (#1315). || `storyboardScenes.js` | Durable ids + id-first addressing for `stages.storyboards.scenes[]` (#3413). `ensureStoryboardIds(scenes)` stamps a deterministic `scene-NN` / `shot-NN` id on any entry lacking one — and re-stamps later copies of a DUPLICATE id (collision-escaped with a `-2` suffix, so peers and concurrent readers derive identical ids); `resolveStoryboardTarget(list, { id, index })` → `{ index, record, matchedBy, stale }` resolves a captured id against a fresh array, falling back to the index only when no id was captured, and reporting `stale: true` (409, never an index retarget) when a captured id is gone. || `seasonStructure.js` | Season/episode structure recommendation. |+| `seriesAutopilotDefaults.js` | `SERIES_AUTOPILOT_DEFAULTS`, the immutable `pipelineEditorialChecks` defaults shared by Series Autopilot's runtime resolvers, foundation judge, and options panel. || `seriesCharacterArc.js` | Per-character story-arc shapes (`series.characterArcs[]`): want/need, start → end state, transition beats. `CHARACTER_ARC_LIMITS` / `TRANSITION_KINDS` + `TRANSITION_KIND_LABELS` / `CHARACTER_ARC_STATUSES` (a pure leaf — the arc editor in `PipelineSeries.jsx` imports the caps, kinds and labels, so no Node built-in here; ids come from `uuid.js`). Sanitizers + `renderCharacterArcsForPrompt` for the `arc.transitions` editorial check, `characterArcEvidenceRefs` (the transition-id set a lens anchor resolves against), and `renderCharacterEvolutionsForPrompt` — the cast-level render of `characterEvolution.js`'s five-stage lens the character-arc checks and the arc planner share. || `llmRoutePin.js` | The per-record LLM route pin `{ providerId, model, effort }` — `LLM_ROUTE_PIN_LIMITS` + `llmRoutePinSchema` (door check, `effort` as the shared `EFFORT_LEVELS` enum), `sanitizeLlmRoutePin(raw)` (trim/cap, `null` for an all-empty pin), and `resolveLlmRoutePin(pin, perCall)` → `{ providerId, model, effort, providerMatchesPin }`. Owns the never-cross-providers rule once, in its two shapes: `resolveLlmRoutePin` merges a record pin with an independent per-call pick per FIELD (guarded by a provider-id comparison), while `pickLlmRoutePinLayer(...layers)` + `llmRoutePinNamesProvider(layer)` take the most specific layer WHOLE for pins whose provider and model were chosen together in one control (falling through to the base layer). Consumed by `seriesLlmOverride.js`, FableLoom's play pin, and the Creative Director stage pins. || `seriesLlmOverride.js` | Pure `resolveSeriesLlmOverride(series, { overrideProvider, overrideModel })` → `{ provider, model, providerMatchesSeries }` — shared fallback so Pipeline LLM actions honor the series' configured provider/model, only inheriting the series model when the effective provider still matches. |diff --git a/server/lib/index.js b/server/lib/index.jsindex 462d4aec17..e2e73a0e35 100644--- a/server/lib/index.js+++ b/server/lib/index.js@@ -123,6 +123,7 @@ export * from './proseExportSettings.js';export * from './shotGrammar.js';export * from './storyboardScenes.js';export * from './seasonStructure.js';+export * from './seriesAutopilotDefaults.js';export * from './seriesCharacterArc.js';export * from './llmRoutePin.js';export * from './seriesLlmOverride.js';diff --git a/server/lib/seriesAutopilotDefaults.js b/server/lib/seriesAutopilotDefaults.jsnew file mode 100644index 0000000000..57e5132fb2--- /dev/null+++ b/server/lib/seriesAutopilotDefaults.js@@ -0,0 +1,20 @@+// Shared saved-setting defaults for the Series Autopilot panel and runtime.+// Keep these keyed by the existing pipelineEditorialChecks setting names.+export const SERIES_AUTOPILOT_DEFAULTS = Object.freeze({+ maxArcVerifyRounds: 3,+ maxEditorialRounds: 2,+ maxBeatContinuityRounds: 2,+ maxFoundationRounds: 3,+ checkFindingsPauseThreshold: 0,+ notifyOnPause: true,+ revisionEnabled: false,+ revisionMinCycles: 1,+ revisionMaxCycles: 2,+ revisionPlateauDelta: 0.3,+ foundationGate: true,+ foundationThreshold: 7.5,+ selfImprove: false,+ observer: false,+ autoSelectModels: false,+ overrideStagePins: false,+});diff --git a/server/services/pipeline/foundationJudge.js b/server/services/pipeline/foundationJudge.jsindex 58aa0ce638..3f4a25e17c 100644--- a/server/services/pipeline/foundationJudge.js+++ b/server/services/pipeline/foundationJudge.js@@ -37,6 +37,7 @@import { join } from 'path';import { assertValidSeriesId } from '../../lib/pipelineIds.js';+import { SERIES_AUTOPILOT_DEFAULTS } from '../../lib/seriesAutopilotDefaults.js';import { PATHS, atomicWrite, ensureDir, tryReadFile, safeJSONParse } from '../../lib/fileUtils.js';import { runStagedLLM, resolveStageContext, resolveJudgeForStage } from '../stageRunner.js';import { manuscriptContentBudgetChars, estimateTokens } from '../../lib/contextBudget.js';@@ -121,7 +122,7 @@ if (Math.abs(WEIGHT_SUM - 1) > 1e-9) {// Default gate threshold — the weighted [0,10] score the foundation must clear// before drafting. Mirrors autonovel's 7.5 foundation bar (design record// Phase 11). Overridable per-run + via the persisted setting.-export const DEFAULT_FOUNDATION_THRESHOLD = 7.5;+export const DEFAULT_FOUNDATION_THRESHOLD = SERIES_AUTOPILOT_DEFAULTS.foundationThreshold;// A strong weighted world score must not hide a critically thin character or// craft foundation. The floor follows an intentionally lowered run threshold,// but otherwise keeps every dimension at a publishable planning baseline.diff --git a/server/services/pipeline/foundationJudge.test.js b/server/services/pipeline/foundationJudge.test.jsindex efe320bdd3..421555e8b9 100644--- a/server/services/pipeline/foundationJudge.test.js+++ b/server/services/pipeline/foundationJudge.test.js@@ -1,4 +1,5 @@import { describe, it, expect, vi, beforeEach } from 'vitest';+import { SERIES_AUTOPILOT_DEFAULTS } from '../../lib/seriesAutopilotDefaults.js';import { sanitizeCharacter } from '../../lib/storyBible.js';// I/O is the only thing mocked in fileUtils — PATHS/safeJSONParse stay real so@@ -1957,6 +1958,7 @@ describe('applyFoundationFix — dimension → owning-service routing table', ()describe('DEFAULT_FOUNDATION_THRESHOLD', () => {it('mirrors autonovel\'s 7.5 foundation bar', () => {+ expect(DEFAULT_FOUNDATION_THRESHOLD).toBe(SERIES_AUTOPILOT_DEFAULTS.foundationThreshold);expect(DEFAULT_FOUNDATION_THRESHOLD).toBe(7.5);});});diff --git a/server/services/pipeline/seriesAutopilot.test.js b/server/services/pipeline/seriesAutopilot.test.jsindex 66f7517b57..8eea0a2082 100644--- a/server/services/pipeline/seriesAutopilot.test.js+++ b/server/services/pipeline/seriesAutopilot.test.js@@ -1,5 +1,6 @@import { describe, it, expect, vi, beforeEach } from 'vitest';import { mockNoPeerSync, mockNoPeers } from '../../lib/mockPathsDataRoot.js';+import { SERIES_AUTOPILOT_DEFAULTS } from '../../lib/seriesAutopilotDefaults.js';// ---- File-backed store (like autoRunner.test.js) so the REAL series/issues// services run against an in-memory map instead of Postgres. ------------------@@ -536,6 +537,29 @@ describe('resolveNextStep (pure)', () => {).maxArcVerifyRounds).toBe(MAX_ARC_VERIFY_ROUNDS);});+ it('uses the shared defaults when run options and saved settings are absent', () => {+ const defaults = SERIES_AUTOPILOT_DEFAULTS;+ expect(autopilot.resolveAutopilotRounds({}, {})).toEqual({+ maxArcVerifyRounds: defaults.maxArcVerifyRounds,+ maxEditorialRounds: defaults.maxEditorialRounds,+ maxBeatContinuityRounds: defaults.maxBeatContinuityRounds,+ maxFoundationRounds: defaults.maxFoundationRounds,+ });+ expect(autopilot.resolveAutopilotFoundationGate({}, {})).toBe(defaults.foundationGate);+ expect(autopilot.resolveAutopilotCheckPauseThreshold({}, {})).toBe(defaults.checkFindingsPauseThreshold);+ expect(autopilot.resolveAutopilotNotifyOnPause({}, {})).toBe(defaults.notifyOnPause);+ expect(autopilot.resolveAutopilotRevision({}, {})).toEqual({+ revisionEnabled: defaults.revisionEnabled,+ revisionMinCycles: defaults.revisionMinCycles,+ revisionMaxCycles: defaults.revisionMaxCycles,+ revisionPlateauDelta: defaults.revisionPlateauDelta,+ });+ expect(autopilot.resolveAutopilotSelfImprove({}, {})).toBe(defaults.selfImprove);+ expect(autopilot.resolveAutopilotObserver({}, {})).toBe(defaults.observer);+ expect(autopilot.resolveAutopilotAutoSelectModels({}, {})).toBe(defaults.autoSelectModels);+ expect(autopilot.resolveAutopilotOverrideStagePins({}, {})).toBe(defaults.overrideStagePins);+ });+it('resolveAutopilotReadinessGate: per-run option wins, else setting, else null (#1580)', () => {const { resolveAutopilotReadinessGate } = autopilot;// per-run override wins over a persisted settingdiff --git a/server/services/pipeline/seriesAutopilot/config.js b/server/services/pipeline/seriesAutopilot/config.jsindex a239ffbee8..8dec845f5c 100644--- a/server/services/pipeline/seriesAutopilot/config.js+++ b/server/services/pipeline/seriesAutopilot/config.js@@ -5,6 +5,7 @@import { readReadinessGate } from '../../../lib/editorial/index.js';import { resolveSeriesLlmOverride } from '../../../lib/seriesLlmOverride.js';+import { SERIES_AUTOPILOT_DEFAULTS } from '../../../lib/seriesAutopilotDefaults.js';import { READINESS_GATES } from '../editorialScore.js';// Bounded convergence loops — re-verify/re-review at most this many rounds, then@@ -12,13 +13,13 @@ import { READINESS_GATES } from '../editorialScore.js';// are the floor defaults; an install can raise them persistently via// pipelineEditorialChecks.{maxArcVerifyRounds,maxEditorialRounds} (or a single// run can override per-run through the autopilot start options).-export const MAX_ARC_VERIFY_ROUNDS = 3;-export const MAX_EDITORIAL_ROUNDS = 2;+export const MAX_ARC_VERIFY_ROUNDS = SERIES_AUTOPILOT_DEFAULTS.maxArcVerifyRounds;+export const MAX_EDITORIAL_ROUNDS = SERIES_AUTOPILOT_DEFAULTS.maxEditorialRounds;// Whole-manuscript beat-continuity convergence (#1510). The corpus is the// compact per-issue beat sheets, so this gate sits between beat generation and// the expensive text/script stage — bounded like the others, then pauses with// the residual findings for human review.-export const MAX_BEAT_CONTINUITY_ROUNDS = 2;+export const MAX_BEAT_CONTINUITY_ROUNDS = SERIES_AUTOPILOT_DEFAULTS.maxBeatContinuityRounds;// Foundation-quality gate (CWQE Phase 11, #2176). Before drafting, judge the// whole foundation (world / characters / arc) against a weighted rubric and@@ -27,8 +28,8 @@ export const MAX_BEAT_CONTINUITY_ROUNDS = 2;// findings for human review. Defaults ON for autopilot runs (the point of the// phase) but overridable per-run + via the persisted setting. 0 rounds skips// the gate entirely (accept the foundation as-is).-export const MAX_FOUNDATION_ROUNDS = 3;-export const DEFAULT_FOUNDATION_GATE_ENABLED = true;+export const MAX_FOUNDATION_ROUNDS = SERIES_AUTOPILOT_DEFAULTS.maxFoundationRounds;+export const DEFAULT_FOUNDATION_GATE_ENABLED = SERIES_AUTOPILOT_DEFAULTS.foundationGate;// Bounded retry budget for a delegated child runner (#1574). A child (volume// beats / text auto-run) can finish with its target stage(s) still empty when@@ -123,8 +124,8 @@ export function resolveAutopilotRounds(options = {}, settings = null) {// Foundation-gate config (#2176): whether the gate runs, and the weighted [0,10]// threshold the foundation must clear. Mirror resolveAutopilotRounds — per-run// option wins, then the persisted pipelineEditorialChecks setting, then the-// default. The enable flag defaults ON (the point of the phase); the threshold-// falls through to DEFAULT_FOUNDATION_THRESHOLD in the loop when unset. Stamped+// default. The enable flag defaults ON (the point of the phase); an unset+// threshold falls through to the foundation judge's shared default. Stamped// onto run options once at start so the loop, the dry-run plan, and a resume all// read the same effective values.export function resolveAutopilotFoundationGate(options = {}, settings = null) {@@ -156,7 +157,7 @@ export function resolveAutopilotReadinessGate(options = {}, settings = null) {// per-run option wins, then the persisted setting, then 0. A non-integer at any// layer falls through to the next. Stamped onto run options once at start so the// loop and a later resume read the same effective threshold.-export const DEFAULT_CHECK_FINDINGS_PAUSE_THRESHOLD = 0;+export const DEFAULT_CHECK_FINDINGS_PAUSE_THRESHOLD = SERIES_AUTOPILOT_DEFAULTS.checkFindingsPauseThreshold;export function resolveAutopilotCheckPauseThreshold(options = {}, settings = null) {if (Number.isInteger(options?.checkFindingsPauseThreshold)) return options.checkFindingsPauseThreshold;const pec = settings?.pipelineEditorialChecks || {};@@ -171,7 +172,7 @@ export function resolveAutopilotCheckPauseThreshold(options = {}, settings = nul// addresses the "paused runs go unnoticed" problem — but stays overridable per// run and via the persisted setting for users who don't want the noise. Boolean// at every layer: per-run option wins, then the persisted setting, then true.-export const DEFAULT_NOTIFY_ON_PAUSE = true;+export const DEFAULT_NOTIFY_ON_PAUSE = SERIES_AUTOPILOT_DEFAULTS.notifyOnPause;export function resolveAutopilotNotifyOnPause(options = {}, settings = null) {const pec = settings?.pipelineEditorialChecks || {};return pickBool(options?.notifyOnPause, pec?.notifyOnPause, DEFAULT_NOTIFY_ON_PAUSE);@@ -225,10 +226,10 @@ export function resolveAutopilotUnlockForRun(options = {}) {// least once; maxCycles is the cost ceiling; plateauDelta is the mean-score// movement below which the series counts as converged. Per-run option wins, then// the persisted pipelineEditorialChecks.revision* setting, then the default.-export const DEFAULT_REVISION_ENABLED = false;-export const DEFAULT_REVISION_MIN_CYCLES = 1;-export const DEFAULT_REVISION_MAX_CYCLES = 2;-export const DEFAULT_REVISION_PLATEAU_DELTA = 0.3;+export const DEFAULT_REVISION_ENABLED = SERIES_AUTOPILOT_DEFAULTS.revisionEnabled;+export const DEFAULT_REVISION_MIN_CYCLES = SERIES_AUTOPILOT_DEFAULTS.revisionMinCycles;+export const DEFAULT_REVISION_MAX_CYCLES = SERIES_AUTOPILOT_DEFAULTS.revisionMaxCycles;+export const DEFAULT_REVISION_PLATEAU_DELTA = SERIES_AUTOPILOT_DEFAULTS.revisionPlateauDelta;export function resolveAutopilotRevision(options = {}, settings = null) {const pec = settings?.pipelineEditorialChecks || {};const int = (o, s, fallback) => {@@ -269,7 +270,7 @@ export function resolveAutopilotRevision(options = {}, settings = null) {//// The filed task always awaits human approval and always opens a PR — see// selfImprove.js's header for why that isn't a knob.-export const DEFAULT_SELF_IMPROVE = false;+export const DEFAULT_SELF_IMPROVE = SERIES_AUTOPILOT_DEFAULTS.selfImprove;export function resolveAutopilotSelfImprove(options = {}, settings = null) {const pec = settings?.pipelineEditorialChecks || {};return pickBool(options?.selfImprove, pec?.selfImprove, DEFAULT_SELF_IMPROVE);@@ -287,7 +288,7 @@ export function resolveAutopilotSelfImprove(options = {}, settings = null) {// selfImprove (a scheduled unattended run is exactly where the user wants the// pipeline hardening itself), unlike unlockForRun (which rewrites user-set// protection state and stays per-run only).-export const DEFAULT_OBSERVER = false;+export const DEFAULT_OBSERVER = SERIES_AUTOPILOT_DEFAULTS.observer;export function resolveAutopilotObserver(options = {}, settings = null) {const pec = settings?.pipelineEditorialChecks || {};return pickBool(options?.observer, pec?.observer, DEFAULT_OBSERVER);@@ -300,7 +301,7 @@ export function resolveAutopilotObserver(options = {}, settings = null) {// stage pin, a per-stage route, and the run's own route (per-run picker OR the// series' `series.llm`, for the judge role as much as the creative one) all// remain stronger. session.js#roleLlm owns that precedence.-export const DEFAULT_AUTO_SELECT_MODELS = false;+export const DEFAULT_AUTO_SELECT_MODELS = SERIES_AUTOPILOT_DEFAULTS.autoSelectModels;export function resolveAutopilotAutoSelectModels(options = {}, settings = null) {const pec = settings?.pipelineEditorialChecks || {};return pickBool(options?.autoSelectModels, pec?.autoSelectModels, DEFAULT_AUTO_SELECT_MODELS);@@ -315,7 +316,7 @@ export function resolveAutopilotAutoSelectModels(options = {}, settings = null)// it re-routes spend but mutates nothing, and "always run everything on my one// provider" is exactly the preference an unattended scheduled run wants to// inherit. Per-run option wins, then the persisted setting, then off.-export const DEFAULT_OVERRIDE_STAGE_PINS = false;+export const DEFAULT_OVERRIDE_STAGE_PINS = SERIES_AUTOPILOT_DEFAULTS.overrideStagePins;export function resolveAutopilotOverrideStagePins(options = {}, settings = null) {const pec = settings?.pipelineEditorialChecks || {};return pickBool(options?.overrideStagePins, pec?.overrideStagePins, DEFAULT_OVERRIDE_STAGE_PINS);