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

count arcFields the same way in the pass and the dry-run plan

[._.]/ Adam Eivy329cd6209748
diff --git a/server/services/pipeline/seriesAutopilot/unlockPass.js b/server/services/pipeline/seriesAutopilot/unlockPass.js
index 068b4aba87..92194fe7f8 100644
--- a/server/services/pipeline/seriesAutopilot/unlockPass.js
+++ b/server/services/pipeline/seriesAutopilot/unlockPass.js
@@ -72,7 +72,10 @@ export function countSeriesLocks(series, issues) {
async function unlockSeriesRecord(series) {
const locked = series.locked || {};
const arc = locked.arc === true ? 1 : 0;
- const arcFields = Object.keys(locked.arcFields || {}).length;
+ // `=== true`, matching countSeriesLocks — the sanitizer only persists `true`,
+ // but an unsanitized record must not make the dry-run promise and the pass's
+ // own report disagree.
+ const arcFields = Object.values(locked.arcFields || {}).filter((v) => v === true).length;
const seasons = Array.isArray(series.seasons) ? series.seasons : [];
const lockedSeasons = seasons.filter((s) => s?.locked === true).length;
if (arc === 0 && arcFields === 0 && lockedSeasons === 0) return { arc: 0, arcFields: 0, seasons: 0 };