const RUNTIME_ROLES = new Set(['stable', 'candidate']); export function resolvePortalRuntimeRole(env = process.env) { const configured = String(env.MEMIND_RUNTIME_ROLE ?? '').trim().toLowerCase(); return RUNTIME_ROLES.has(configured) ? configured : 'stable'; } export function isPassiveCanaryRuntime(env = process.env) { return ( resolvePortalRuntimeRole(env) === 'candidate' && String(env.MEMIND_CANARY_PASSIVE_RUNTIME ?? '1').trim() !== '0' ); }