Uses of Record Class
com.tnsai.metadata.ContractSpec
Packages that use ContractSpec
Package
Description
Design-by-contract support for action execution with pre/post condition validation.
Metadata extraction and representation for actions, tools, and roles.
-
Uses of ContractSpec in com.tnsai.actions.contracts
Methods in com.tnsai.actions.contracts with parameters of type ContractSpecModifier and TypeMethodDescriptionContractValidator.snapshotOldValues(ContractSpec spec, Map<String, Object> params) Captures pre-execution values for everyold(...)sub-expression in the postconditions.voidContractValidator.validateInvariants(ContractSpec spec, Map<String, Object> bindings) Checks invariants (before and after execution).voidContractValidator.validatePostconditions(ContractSpec spec, Map<String, Object> params, Object result, Map<String, Object> oldValues) Checks postconditions after execution.voidContractValidator.validatePreconditions(ContractSpec spec, Map<String, Object> params) Checks preconditions before execution. -
Uses of ContractSpec in com.tnsai.metadata
Fields in com.tnsai.metadata declared as ContractSpecModifier and TypeFieldDescriptionstatic final ContractSpecContractSpec.NONENo contract — empty gates.Methods in com.tnsai.metadata that return ContractSpecModifier and TypeMethodDescriptionContractSpec.Builder.build()ActionConfig.contract()Returns the value of thecontractrecord component.static ContractSpecAdapts a@Contractannotation into aContractSpec.Methods in com.tnsai.metadata with parameters of type ContractSpecModifier and TypeMethodDescriptionActionConfig.withContract(ContractSpec contract) Returns a copy of this config with the givenContractSpecattached — the programmatic equivalent of annotating the action method with@Contract(TNS-637).Constructors in com.tnsai.metadata with parameters of type ContractSpecModifierConstructorDescriptionActionConfig(String name, String description, ActionType type, List<ParamSpec> parameters, ActionHandler handler, ContractSpec contract, InputGuardrailConfig inputGuardrail, OutputGuardrailConfig outputGuardrail) Creates an instance of aActionConfigrecord class.ActionMetadata(String name, String description, ActionType type, List<ParamSpec> parameters, ActionHandler handler, ContractSpec contractSpec) AsActionMetadata(String, String, ActionType, List, ActionHandler)but with a declarativeContractSpec(TNS-637) — the programmatic equivalent of@Contractfor builder-added actions.ActionMetadata(String name, String description, ActionType type, List<ParamSpec> parameters, ActionHandler handler, ContractSpec contractSpec, InputGuardrailConfig inputGuardrailConfig, OutputGuardrailConfig outputGuardrailConfig) AsActionMetadata(String, String, ActionType, List, ActionHandler, ContractSpec)but also carrying per-action programmatic guardrails (TNS-643) — the builder equivalent of method-level@InputGuardrail/@OutputGuardrail, for builder-added actions that have no method to read the annotation from.