Registry consistency
FeatureMesh enforces strict consistency rules for features in the registry.
At any time, the registry must have valid and consistent FeatureQL definitions.
These rules ensure data integrity and prevent broken dependencies when evaluating features.
No permission level can override these consistency checks.
Consistency Rules
Validity
- Use a function signature compatible with the types of the parameters
Dependency Validation
- All referenced features in parameters must exist in the system
- Features cannot reference non-existent dependencies
- Circular dependencies are not allowed
Type Safety
- Feature types must match their declared variants
- Type conversions must be explicit and valid
Lifecycle Status
- Child features (descendants) cannot have a higher status than their parent features (dependencies)
Any persistence query that would violate these consistency rules will fail.
Replacing Features
When replacing existing features, FeatureQL enforces type consistency with dependent features.
For example, if a feature is declared as BIGINT
and other features depend on it, any replacement can also be BIGINT
type.
But it's not compulsory if the function signatures of the dependencies are compatible.
For example, if a feature is declared as BIGINT
and its dependencies are casting is as FLOAT, the replacement can be of any type that can be casted as FLOAT.
Dropping Features
Features can only be dropped when no other features depend on them. If dependencies exist:
- FeatureMesh will identify the dependent features that need to be modified or removed
- You must first handle these dependencies before dropping the target feature
- The system will provide guidance on the required changes to maintain consistency
Example error message:
Error: Cannot drop feature 'customer_age' because features ['lifetime_value', 'churn_risk'] depend on it.
Action required: Modify or drop the dependent features first.