Class ResilienceConfigValidator
- All Implemented Interfaces:
Validator
Resilience configurations
at build time. Today these silently misbehave at runtime: a
maxAttempts=0 retry policy "succeeds" without ever
retrying, an enabled=true circuit breaker with a
non-positive failureThreshold never trips, a rate limiter
with maxRequests=0 blocks every call.
Negative numeric fields are surfaced as ERROR — they are unambiguously invalid (no resilience subsystem treats a negative threshold or backoff as legitimate). Misconfigurations that produce a logically-disabled subsystem are surfaced as WARNING — the operator may have intentionally disabled retry while leaving stale config for future tuning, but the more common case is "I forgot to set maxAttempts."
Scope: walks every Role attached to the agent, checks
the type-level @Resilience (if any) and every method-level
@Resilience on declared methods. Methods inherited from
Object or framework-supplied superclasses are excluded
(only role.getClass().getDeclaredMethods() is scanned).
Out of scope:
timeout=0— Javadoc explicitly says "0 means no timeout (use default)". Emitting ERROR for it would conflict with documented intent.- Speculative thresholds (e.g. "failureThreshold > maxAttempts*10 means breaker effectively never opens") — too noisy without per-deployment context.
- Live policy verification — the resilience executor at runtime is the authority on policy semantics.
Suppress with AgentBuilder.relaxValidation("AGENT-V009").
- Since:
- 0.5.0 (issue #85 slice)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionid()Short, stable id for logging and test assertions (e.g.Inspect the agent configuration and return any issues detected.
-
Constructor Details
-
ResilienceConfigValidator
public ResilienceConfigValidator()
-
-
Method Details
-
id
Description copied from interface:ValidatorShort, stable id for logging and test assertions (e.g."llm-presence"). -
validate
Description copied from interface:ValidatorInspect the agent configuration and return any issues detected. Returning an empty list means "no problems found by this validator".
-