Source: config/featureFlags.js

// @ts-check
/**
 * Feature flags for the staged rollout of the Project/Share feature set.
 *
 * Flags default to ENABLED so the API is usable right after the schema
 * migration; set them to 'false'/'0' to keep Project functions disabled until
 * rollout is complete (see 080-Workspaces/025-Members-Backend-Implementation-Plan.mdx).
 *
 * - PROJECT_OBJECTS_ENABLED       gates Project/Share CRUD routers
 * - NORMALIZED_VISIBLE_SCOPES     gates the normalized visible/changeable/admin
 *                                 rebuild for generic target scopes (projects and
 *                                 accounting target types)
 * - PROJECT_EVENTS_ENABLED        gates lifecycle + rights-delta event publishing
 * - RUNNER_OBJECTS_ENABLED        gates Runner/Deployment control-plane routers
 */

const isEnabled = (name, defaultValue = true) => {
    const value = process.env[name];
    if (value === undefined || value === '') return defaultValue;
    return value === 'true' || value === '1';
};

export const PROJECT_OBJECTS_ENABLED = isEnabled('PROJECT_OBJECTS_ENABLED', true);
export const NORMALIZED_VISIBLE_SCOPES = isEnabled('NORMALIZED_VISIBLE_SCOPES', false);
export const PROJECT_EVENTS_ENABLED = isEnabled('PROJECT_EVENTS_ENABLED', true);
export const RUNNER_OBJECTS_ENABLED = isEnabled('RUNNER_OBJECTS_ENABLED', true);