Skip to content

Phase 3.1 — Feature flags module + GUIDED_STUDY_AMICUS_SYNTHESIS flag #1738

@CraigBuckmaster

Description

@CraigBuckmaster

Part of epic #1725. Phase 3 — Premium synthesis + review.

Objective

Establish a tiny feature-flag module so the Amicus-drafted synthesis path can ship behind a flag and be enabled later via a single-line PR.

Files

Create

  • app/src/config/featureFlags.ts
  • app/src/config/__tests__/featureFlags.test.ts

Implementation

// app/src/config/featureFlags.ts

/**
 * Feature flags for in-flight work that needs to ship behind a switch.
 *
 * These are compile-time constants on purpose — no remote config in this
 * codebase yet. Flipping a flag is a single-line PR + EAS Update.
 *
 * Add a comment per flag explaining what to verify before flipping.
 */
export const FEATURE_FLAGS = {
  /**
   * Enables Amicus-drafted synthesis at the end of guided study sessions.
   * Before flipping true, verify:
   *   - Epic #1446 (Amicus AI Study Partner) is past Phase 3 (chat working
   *     against the production worker).
   *   - The mode-specific system prompts in app/src/services/amicus/prompts/
   *     guidedStudy.ts have been reviewed.
   *   - Anthropic prompt caching is hitting on the system prompt (>80% cache
   *     rate observed in dev for at least 100 calls).
   * When false, premium users get the structured-form synthesis path.
   */
  GUIDED_STUDY_AMICUS_SYNTHESIS: false,
} as const;

export type FeatureFlag = keyof typeof FEATURE_FLAGS;

export function isFlagEnabled(flag: FeatureFlag): boolean {
  return FEATURE_FLAGS[flag];
}

Tests

  • isFlagEnabled('GUIDED_STUDY_AMICUS_SYNTHESIS') returns false by default.
  • TypeScript: isFlagEnabled('garbage') is a compile error.

Acceptance

  1. Module exists and exports flags + helper.
  2. Default for GUIDED_STUDY_AMICUS_SYNTHESIS is false.
  3. tsc, lint, test clean.

Out of scope

  • Using the flag (Phase 3.2 starts using it; Phase 4 fully exercises it).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions