function envFlag(value, fallback = false) { const raw = String(value ?? '').trim().toLowerCase(); if (!raw) return fallback; return ['1', 'true', 'yes', 'on'].includes(raw); } export function shouldRequireCheckpointApproval({ env = process.env, pendingCheckpointCount = 0, totalCheckpointCount = 1, } = {}) { if (envFlag(env.GOAL_RUN_REQUIRE_APPROVAL, false)) return true; return pendingCheckpointCount > 0 && totalCheckpointCount > 1; }