/** * Runtime-scheduler topology predicate shared by the app-side lane helpers * (`src/lib/plays/scheduler-backends/absurd-shared.ts`) and the runner * backends (`runner-backends/backends/daytona-lifecycle.ts`). * * ONE distinction drives several guards: a run whose scheduler schema is the * prod default rides the production topology (base queue names, customer code, * production egress policy), while any other schema is an ISOLATED topology — * a per-PR preview fleet or a per-worktree dev fleet running synthetic * internal test plays. Keeping the predicate here (dependency-free) lets * shared_libs code use it without importing the app-side scheduler stack. */ export const PROD_DEFAULT_RUNTIME_SCHEDULER_SCHEMA = 'runtime_scheduler'; /** * True when the scheduler schema names an isolated (preview CI / worktree) * topology. Null/empty/prod-default => false (production topology). Callers * that gate SECURITY policy on this must treat `false` as the fail-closed * production posture — an absent schema is production, never "unknown". */ export function isIsolatedRuntimeSchedulerSchema( schedulerSchema: string | null | undefined, ): boolean { const schema = schedulerSchema?.trim(); return Boolean(schema) && schema !== PROD_DEFAULT_RUNTIME_SCHEDULER_SCHEMA; }