robinhood-options-mobile

Feature Access & Beta Rollout Architecture (Beta Labs)

This document details the feature flag gating and user self-serve beta opt-in (“Beta Labs”) architecture implemented for the Signals-First MVP Scope (tracking GitHub Issue #239).


1. Overview & Goals

As Robinhood Options Mobile scales towards app store releases and broad public distribution, complex features (such as autonomous agentic order execution, social copy trading, AI assistant dialogues, multi-leg spreads, and alternative brokerage bridges) must be strictly decoupled from the core “Signals-First” baseline.

The core public MVP focus comprises:

All non-core or high-liability features are partitioned into Feature Bundles controlled by Firebase Remote Config and surfaced through the in-app Beta Labs dashboard. When a user is signed in, preferences are synchronized across local SharedPreferences, the in-memory User, and the Firestore user document.


2. Feature Access Resolution

FeatureAccessService.isFeatureEnabled applies these checks in order:

  1. Global disable: Remote Config mode disabled denies access to everyone, including admins.
  2. Explicit user flag: A boolean in User.featureFlags overrides rollout defaults and role checks. This permits an explicit Firestore grant or denial, except when the global disable switch is active.
  3. Admin-only mode: Non-admin users are denied unless an explicit user flag grants access. Admins still need to opt in locally when no explicit user flag is set.
  4. Public mode: Enabled by default; a local user opt-out disables it unless an explicit Firestore flag overrides that preference.
  5. Beta opt-in mode: Requires a local opt-in. The beta_self_opt_in_enabled master switch blocks opt-ins for non-admins when disabled; admins can still opt in.

Users manage local opt-ins and public-mode opt-outs in Beta Labs (UserWidget -> Profile & Community -> Beta Labs). Changes update local SharedPreferences and the in-memory User immediately, and synchronize to the Firestore user document when one is available.


3. Remote Config Parameters & Default Rollouts

Parameter Key Bundle Identifier Default Remote Value Scope & Functionality
beta_self_opt_in_enabled Master Switch true Master kill-switch controlling whether user self-serve opt-in is allowed.
beta_advanced_research FeatureBundle.advancedResearch betaOptIn Options flow, GEX charts, stock screeners, and SEC filings research.
beta_ai_research FeatureBundle.aiResearch betaOptIn Market Assistant Copilot, macro sentiment analyzers, AI trade coaches, and Investment Profile settings.
beta_advanced_trading FeatureBundle.advancedTrading betaOptIn Multi-leg spread builder, complex option strategy templates, and combo orders.
beta_backtesting FeatureBundle.backtesting betaOptIn Historical strategy backtesting, performance analytics, and simulation.
beta_risk_guardrails FeatureBundle.riskGuardrails betaOptIn Autonomous account loss limits, peak-to-trough drawdown protection, rapid-cancel loop detection, and tilt cooling-off locks.
beta_automated_trading FeatureBundle.automatedTrading betaOptIn Automated order execution and algorithmic trading strategies.
beta_social_copy FeatureBundle.socialCopy betaOptIn Investor discovery, shared trade logs, discussion threads, copy trading, and Portfolio & Social Privacy settings.
beta_account_tools FeatureBundle.accountTools betaOptIn Wash sale tracking, tax lot optimization, and retirement planning tools.
beta_extended_brokerages FeatureBundle.extendedBrokerages betaOptIn Alternative brokerage accounts (Fidelity CSV import, Plaid). Core platforms (Robinhood, Charles Schwab, Paper Trading, Demo) are never gated.

[!IMPORTANT] Core Brokerage Scope: Charles Schwab and Paper Trading are core, production-ready platforms in Robinhood Options Mobile alongside Robinhood and Demo. They are never subject to extendedBrokerages or beta flags. The extendedBrokerages bundle strictly applies to auxiliary or experimental integrations like Fidelity manual CSV imports and Plaid.

Remote config keys accept one of four case-insensitive strings: disabled, adminOnly, betaOptIn, or public.


4. Key Architecture Components

Enums (lib/enums.dart)

Remote Config Service (lib/services/remote_config_service.dart)

Feature Access Service (lib/services/feature_access_service.dart)

Beta Labs UI (lib/widgets/beta_labs_widget.dart)


5. UI Gating Touchpoints

User Profile (lib/widgets/user_widget.dart)


6. Testing & Quality Assurance

Comprehensive tests verify both unit logic and UI behaviors: