Files
james.maes 0785d6e57d fix(01-WR-11): typed FeatureFlag enum prevents silent-typo feature disable
Phase 1 REVIEW.md WR-11: `FeatureFlags.isEnabled(_ key: String)` fell
through to `false` on any typo — `"orpheusTtsEnabled"` (wrong case),
`"orpheus_tts_enabled"` (wrong separator), etc. Phase 6 (Orpheus /
WhisperKit) wiring depends on these flags; a silently-disabled
feature caused by a typo is nearly impossible to debug.

packages/Config/Sources/Config/FeatureFlags.swift
- Add `public enum FeatureFlag: String, CaseIterable, Sendable` with
  cases `orpheusTTSEnabled`, `whisperKitSTTEnabled` (both known keys
  per REQUIREMENTS.md).
- Add `isEnabled(_ flag: FeatureFlag)` as the canonical typed path.
- Rename the string-keyed lookup to `isEnabledDynamic(_:)` so
  production callers get a compile error on typos — the dynamic
  string path is retained only for the dev overlay's "list all
  flags" affordance.

packages/Config/Tests/ConfigTests/PerTurnSnapshotTests.swift
- Update two existing tests to use the typed-enum API.
- New `test_featureFlagEnumRawValueMatchesDecoder` — regression guard
  that the enum cases' rawValue matches the JSON key the decoder
  sees, so a rename to `orpheusTtsEnabled` fails the build, not
  silently breaks feature detection.

No production callers of the old string-keyed `isEnabled` exist
outside tests — no migration needed elsewhere.
2026-04-23 16:29:54 -05:00
..