Function: orderingGuardTurnMiddleware()
ts
function orderingGuardTurnMiddleware(
options: OrderingGuardOptions,
): TurnPipelineMiddlewareFn;Defined in: src/batteries/validation/middleware.ts:427
Builds a @nhtio/adk!TurnPipelineMiddlewareFn running the same ordering-guard core as orderingGuardDispatchMiddleware, once per turn before the first executor call.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | OrderingGuardOptions | Same shape and validation as orderingGuardDispatchMiddleware. |
Returns
A turn-pipeline middleware function with the same enforce/mutate semantics.
Remarks
TurnContext has no nack() — only abort() — so the default onViolation: 'nack' behavior maps to ctx.abort(error) here rather than a dispatch-style nack; onViolation: 'throw' still throws in both middleware. This asymmetry is a real, documented difference between the two contexts, not an inconsistency.