Files
memind/server/portal-runtime-role.mjs
T
john 286069449b
Memind CI / Test, build, and release guards (push) Failing after 2m14s
feat: add guarded portal canary release
2026-07-26 19:51:44 +08:00

14 lines
466 B
JavaScript

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'
);
}