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
address review (codex): gate the reverse-outline refresh on the per-run check subset (#1575)
[._.]/ Adam Eivy60ca6d25f139
diff --git a/server/services/pipeline/seriesAutopilot.js b/server/services/pipeline/seriesAutopilot.jsindex bc6493b5f3..2db3d84bbd 100644--- a/server/services/pipeline/seriesAutopilot.js+++ b/server/services/pipeline/seriesAutopilot.js@@ -970,11 +970,24 @@ async function runEditorial(sId, record) {// an enabled LLM check will actually run. `force:false`// is a belt-and-suspenders second guard against the stored outline going fresh// between the pre-check and the call. Failures are advisory (logged), never block.++// #1575 — the per-run editorial-check subset (null = all enabled). Absent/empty+// is normalized to null so EVERY consumer (this reverse-outline gate, the budget+// plan, the checks run) resolves the identical set — otherwise a subset of checks+// that skip the outline could still trigger/bill the refresh keyed off the global+// enabled set, or the gate could bill against checks the run skips.+const editorialSubsetIds = (options) =>+ Array.isArray(options?.editorialCheckIds) && options.editorialCheckIds.length+ ? options.editorialCheckIds+ : null;+async function runReverseOutlineRefresh(sId, record) {if (record.cancelRequested) return { canceled: true };const settings = await getSettings();- // Gate 1 — does any enabled check even read the outline? If not, nothing to do.- if (!enabledChecksConsumeReverseOutline(settings)) {+ // Gate 1 — does any enabled check (narrowed to this run's subset) even read the+ // outline? If not, nothing to do — and a subset that skips outline-consuming+ // checks must not pay for a refresh those checks would have triggered.+ if (!enabledChecksConsumeReverseOutline(settings, editorialSubsetIds(record.options))) {record.runState.reverseOutlineRefreshed = true;return {};}@@ -1023,13 +1036,10 @@ async function runReverseOutlineRefresh(sId, record) {async function runEditorialChecksPass(sId, record) {if (record.cancelRequested) return { canceled: true };const settings = await getSettings();- // #1575 — a per-run subset narrows the pass to specific check ids; absent/empty- // runs every enabled check. Normalize to null so the budget gate- // (buildEditorialCheckPlan) and the run (runEditorialChecks) resolve the SAME- // set — otherwise the gate could bill against checks the run skips, or vice-versa.- const checkIds = Array.isArray(record.options.editorialCheckIds) && record.options.editorialCheckIds.length- ? record.options.editorialCheckIds- : null;+ // #1575 — narrow the pass + its budget gate to this run's subset (null = all+ // enabled). The gate (buildEditorialCheckPlan) and the run (runEditorialChecks)+ // must resolve the SAME set so billing and execution agree.+ const checkIds = editorialSubsetIds(record.options);const plan = await buildEditorialCheckPlan(sId, { checkIds, settings });const hasLlmCheck = plan.checks.some((c) => c.kind === 'llm');if (hasLlmCheck) {@@ -1391,9 +1401,9 @@ function buildDryRunPlan(series, issues, options) {plan.push({ kind: 'reverseOutline', count: 1, note: 'refresh scene segmentation for editorial checks (#1349)' });// #1575 — when a per-run subset is set, the plan must say so rather than imply// the full enabled set runs.- const editorialSubset = Array.isArray(options?.editorialCheckIds) && options.editorialCheckIds.length;+ const editorialSubset = editorialSubsetIds(options);plan.push({ kind: 'editorialChecks', count: 1, note: editorialSubset- ? `per-run subset of ${options.editorialCheckIds.length} editorial check(s) (#1575)`+ ? `per-run subset of ${editorialSubset.length} editorial check(s) (#1575)`: 'enabled editorial checks (#1284)' });plan.push({ kind: 'editorialHealthGate', count: 1, note: 'editorial health readiness gate (#1316)' });}diff --git a/server/services/pipeline/seriesAutopilot.test.js b/server/services/pipeline/seriesAutopilot.test.jsindex 560f87c1bd..b7d0e0ed40 100644--- a/server/services/pipeline/seriesAutopilot.test.js+++ b/server/services/pipeline/seriesAutopilot.test.js@@ -1226,6 +1226,12 @@ describe('autopilot conductor', () => {seriesId,expect.objectContaining({ checkIds: ['pacing'] }),);+ // The preceding reverse-outline refresh must gate on the SAME subset, so a+ // subset that skips outline-consuming checks doesn't trigger/bill a refresh.+ expect(checkRunnerSpies.enabledChecksConsumeReverseOutline).toHaveBeenCalledWith(+ expect.anything(),+ ['pacing'],+ );});it('passes checkIds:null (run all enabled) when no subset is given (#1575)', async () => {@@ -1236,6 +1242,10 @@ describe('autopilot conductor', () => {seriesId,expect.objectContaining({ checkIds: null }),);+ expect(checkRunnerSpies.enabledChecksConsumeReverseOutline).toHaveBeenCalledWith(+ expect.anything(),+ null,+ );});it('files a CoS gap task when a verify gate stalls (fileGaps)', async () => {