Skip to content

[Task] docs: Document feature flags framework #327

Description

@kcenon

Summary

Document the feature flags framework in common_system including compile-time feature detection, runtime feature flags, and cross-system feature dependency management.

Parent Issue

Part of: [EPIC] docs: Address documentation gaps across all ecosystem systems (#325)

Background (Why)

common_system provides a feature flags subsystem with 4 header files that enable conditional feature activation across the ecosystem. This is important for:

  • Gradual feature rollouts
  • Platform-specific code paths
  • Optional dependency management
  • Build configuration

Source files:

  • include/kcenon/common/config/feature_flags.h — Runtime feature flag management
  • include/kcenon/common/config/feature_flags_core.h — Core flag definitions and types
  • include/kcenon/common/config/feature_detection.h — Compile-time feature detection
  • include/kcenon/common/config/feature_system_deps.h — Cross-system feature dependencies

Scope (What)

1. Feature Flags System Overview

  • Compile-time vs runtime feature flags
  • How feature flags flow through the ecosystem
  • Flag lifecycle (define → activate → check → deprecate)

2. Core Definitions (feature_flags_core.h)

  • Flag types (boolean, percentage-based, variant)
  • Flag naming conventions
  • Default values and overrides

3. Feature Detection (feature_detection.h)

  • Compile-time platform detection (OS, architecture, compiler)
  • C++ feature detection (__has_include, _cpp* macros)
  • Hardware capability detection (SIMD: AVX2, NEON)
  • How detection results feed into feature flags

4. Runtime Feature Flags (feature_flags.h)

  • Flag registration and lookup API
  • Dynamic flag evaluation
  • Flag change notifications
  • Thread-safe flag access

5. System Dependencies (feature_system_deps.h)

  • How features declare cross-system dependencies
  • Dependency resolution at build time
  • Optional vs required dependencies
  • Feature compatibility matrix

6. Usage Examples

// Compile-time
#if KCENON_HAS_FEATURE(SIMD_AVX2)
    // AVX2-optimized path
#endif

// Runtime
if (feature_flags::is_enabled("async_logging")) {
    // Async path
}

Acceptance Criteria

  • All 4 feature flag headers documented
  • Compile-time vs runtime distinction clear
  • Feature detection capabilities listed
  • Cross-system dependency model explained
  • Usage examples for both compile-time and runtime
  • Integration with CMake build system explained

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationpriority:mediumMedium priority issue

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions