Skip to content
2 min read · 370 words

@nhtio/adk/batteries/validation ​

Declarative ordering validation and pipeline guards.

Variables ​

VariableDescription
ORDERING_GUARD_EFFECTIVE_TIMELINE_STASH_KEYctx.stash key under which the post-repair "effective timeline" (the in-memory, already-ordered copy repairViolations produced, with any inserted alternation fillers) is recorded for the current iteration, so repairs can be re-evaluated against it.
ORDERING_GUARD_RESULT_STASH_KEYctx.stash key under which the most recent OrderingGuardResult (repaired + unrepaired + advisories) is recorded, so a caller or a later pipeline stage can inspect exactly what this middleware did on the current iteration without parsing the nack error.
ORDERING_GUARD_SNAPSHOT_STASH_KEYctx.stash key under which the prior-iteration primitive snapshot is kept for @nhtio/adk!PreservationRule statefulness — see the plan's "Statefulness for PreservationRule" section. Exported (as ORDERING_GUARD_SNAPSHOT_STASH_KEY) so a caller can pass a custom options.snapshotStashKey without guessing the default's exact string.

Functions ​

FunctionDescription
orderingGuardDispatchMiddlewareBuilds a @nhtio/adk!DispatchPipelineMiddlewareFn that validates (and, in 'mutate' mode, best-effort repairs) turn-state primitive ordering against options.profiles before every executor call.
orderingGuardTurnMiddlewareBuilds a @nhtio/adk!TurnPipelineMiddlewareFn running the same ordering-guard core as orderingGuardDispatchMiddleware, once per turn before the first executor call.

References ​

AdjacencyRule ​

Re-exports AdjacencyRule


AlternationRule ​

Re-exports AlternationRule


BlockingOrderingRuleType ​

Re-exports BlockingOrderingRuleType


BlockingOrderingViolation ​

Re-exports BlockingOrderingViolation


createOrderingRepairError ​

Re-exports createOrderingRepairError


createOrderingViolationError ​

Re-exports createOrderingViolationError


E_INVALID_ORDERING_GUARD_OPTIONS ​

Re-exports E_INVALID_ORDERING_GUARD_OPTIONS


E_ORDERING_REPAIR_FAILED ​

Re-exports E_ORDERING_REPAIR_FAILED


E_ORDERING_VIOLATION ​

Re-exports E_ORDERING_VIOLATION


E_UNKNOWN_ORDERING_PROFILE ​

Re-exports E_UNKNOWN_ORDERING_PROFILE


IdentifierFormatRule ​

Re-exports IdentifierFormatRule


IdentifierUniquenessRule ​

Re-exports IdentifierUniquenessRule


NonEmptyTurnRule ​

Re-exports NonEmptyTurnRule


OrderingAdvisoryViolation ​

Re-exports OrderingAdvisoryViolation


OrderingGuardOptions ​

Re-exports OrderingGuardOptions


OrderingGuardResult ​

Re-exports OrderingGuardResult


OrderingPrimitiveKind ​

Re-exports OrderingPrimitiveKind


OrderingProfile ​

Re-exports OrderingProfile


OrderingRepair ​

Re-exports OrderingRepair


OrderingRepairException ​

Re-exports OrderingRepairException


OrderingRepairFailure ​

Re-exports OrderingRepairFailure


OrderingRule ​

Re-exports OrderingRule


OrderingStashedTimelineEntry ​

Re-exports OrderingStashedTimelineEntry


OrderingTimelineEntry ​

Re-exports OrderingTimelineEntry


OrderingViolation ​

Re-exports OrderingViolation


OrderingViolationException ​

Re-exports OrderingViolationException


OrderRule ​

Re-exports OrderRule


PreservationRule ​

Re-exports PreservationRule


RequiredMetadataRule ​

Re-exports RequiredMetadataRule


RoleRemapRule ​

Re-exports RoleRemapRule


SchemaIntegrityRule ​

Re-exports SchemaIntegrityRule


StaleContentAdvisoryRule ​

Re-exports StaleContentAdvisoryRule


ToolIdentityRule ​

Re-exports ToolIdentityRule


validateOptions ​

Re-exports validateOptions