Class ContractExpressionValidator
java.lang.Object
com.tnsai.agents.validation.validators.ContractExpressionValidator
- All Implemented Interfaces:
Validator
Build-time syntax check for declarative
@Contract expressions
(AGENT-V013). Each JEXL clause — every preconditions,
postconditions and invariants entry on an action's @Contract
— is parsed via ContractEvaluator.checkSyntax(String). A malformed
expression is reported as a Severity.WARNING so it
surfaces at AgentBuilder.build() instead of failing fail-closed on the
first invocation (where ContractValidator would throw a
ContractViolationException "could not be evaluated").
Pure metadata check — only actions backed by a reflective Method
(i.e. @ActionSpec methods) can carry a @Contract; builder /
handler actions have no method and are skipped. Suppress with
.relaxValidation("AGENT-V013").
- Since:
- 0.12.0 (TNS-637 phase 5)
-
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
-
ContractExpressionValidator
public ContractExpressionValidator()
-
-
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".
-