@simonecoelhosfo/optimizely-mcp-server
Version:
Optimizely MCP Server for AI assistants with integrated CLI tools
50 lines • 1.75 kB
TypeScript
/**
* Business Logic Preserver
* @description Identifies and preserves user-specified business logic during auto-correction
*
* Purpose: Prevent auto-correction from changing business-critical values like
* traffic allocation percentages, weights, and other values that affect experiment behavior.
*/
export interface BusinessLogicChange {
field: string;
originalValue: any;
suggestedValue: any;
reason: string;
isBusinessCritical: boolean;
requiresConfirmation: boolean;
}
export interface PreservationResult {
preserved: boolean;
changes: BusinessLogicChange[];
warnings: string[];
}
export declare class BusinessLogicPreserver {
private readonly logger;
private readonly BUSINESS_CRITICAL_FIELDS;
private readonly PERCENTAGE_FIELDS;
/**
* Check if a field change affects business logic
*/
isBusinessCriticalChange(field: string, originalValue: any, newValue: any): boolean;
/**
* Analyze proposed changes and identify business logic modifications
*/
analyzeChanges(original: Record<string, any>, suggested: Record<string, any>, context?: {
entityType?: string;
operation?: string;
}): PreservationResult;
/**
* Get human-readable reason for the change
*/
private getChangeReason;
/**
* Apply preservation logic to maintain user-specified values
*/
preserveBusinessLogic(original: Record<string, any>, suggested: Record<string, any>, options?: {
preserveAll?: boolean;
preserveFields?: string[];
allowedChanges?: string[];
}): Record<string, any>;
}
export declare const businessLogicPreserver: BusinessLogicPreserver;
//# sourceMappingURL=BusinessLogicPreserver.d.ts.map