Atomic Client Feature Flag Documentation
Overview
The Terraphim AI project uses conditional compilation to control the inclusion of atomic client functionality through feature flags.
Feature Flag Details
Primary Feature Flag
- Name:
terraphim_atomic_client - Purpose: Controls compilation of atomic client and atomic haystack functionality
- Default: Disabled (not included in default features)
Files Affected
The following files have been updated to use the correct feature flag:
Core Middleware
crates/terraphim_middleware/src/lib.rscrates/terraphim_middleware/src/haystack/mod.rscrates/terraphim_middleware/src/indexer/mod.rs
Desktop Application
desktop/src-tauri/src/cmd.rs
Usage
To Enable Atomic Client
To Disable Atomic Client (Default)
# or
Implementation Details
Conditional Compilation
All atomic client code is now properly gated behind #[cfg(feature = "terraphim_atomic_client")]:
pub use AtomicHaystackIndexer;
let atomic = default;Runtime Behavior
When the feature is not enabled:
- Atomic haystack types are excluded from compilation
- Runtime warnings are logged when atomic haystacks are encountered
- Graceful fallback to other haystack types
Migration Notes
This change standardizes the feature flag naming convention across the codebase and ensures that atomic client functionality is properly optional and can be enabled on-demand by users who need it.
Testing
The changes have been validated with:
cargo build --workspace --lib- β Passcargo clippy --workspace- β Pass- Pre-commit checks - β Pass
Backward Compatibility
This change is fully backward compatible:
- Existing builds without the feature continue to work
- No breaking changes to public APIs
- Feature can be enabled/disabled without affecting core functionality