Creates a new TransformRuleExecutor
Feedback collector instance configured with storage locations
Execute a transformation rule with optional feedback collection
Executes the rule and automatically captures feedback if a sessionId is provided. The feedback collection includes:
The transformation rule to execute
The transformation context
OptionalsessionId: stringOptional feedback session ID for automatic collection
Promise resolving to transform result with optional feedback metadata
// Without feedback collection (backward compatible)
const result = await executor.executeRule(rule, context);
// With feedback collection
const sessionId = await collector.startSession(transformContext);
const result = await executor.executeRule(rule, context, sessionId);
console.info(`Feedback ID: ${result.feedbackId}`);
console.info(`Stored in: ${result.storageLocations?.join(', ')}`);
Transform Rule Executor - Executes transform rules with integrated feedback collection
This class wraps the execution of transformation rules and automatically captures feedback data for AI learning when a session is active. The feedback collection is:
With a session ID, a run captures the pre-transformation state (complexity, LOC), executes the rule, captures the post-transformation state, records the feedback and returns the result with
feedbackIdandstorageLocations. Without a session ID it only executes the rule.Example