Class HitlAnnotationProcessor

java.lang.Object
dev.agenor.runtime.hitl.HitlAnnotationProcessor

public final class HitlAnnotationProcessor extends Object
Reads the RequiresApproval annotation from behavior classes registered with a BaseAgent and wraps each annotated behavior in a HumanCheckpointBehavior at agent registration time.

Called by AgenorRuntime.registerAgent() for every BaseAgent:


 // Inside AgenorRuntime.registerAgent():
 if (agent instanceof BaseAgent baseAgent) {
     HitlAnnotationProcessor.process(baseAgent, approvalGate);
 }
 

Wiring logic

  1. Iterate over all behaviors currently registered on the agent.
  2. For each behavior whose class carries RequiresApproval:
  3. Parse RequiresApproval.timeout()Duration.
  4. Instantiate ApprovalNotifier: if notifier class is the DefaultApprovalNotifier sentinel, substitute LoggingApprovalNotifier.
  5. Remove the original behavior from the agent.
  6. Add a HumanCheckpointBehavior wrapping it in its place.
Since:
0.13.0