---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/validation/types/interfaces/OrderRule.md
description: Relative order required between two primitive kinds.
---

# Interface: OrderRule

Defined in: [src/batteries/validation/types.ts:27](https://github.com/NHTIO/ADK/blob/v1.20260824.1/src/src/batteries/validation/types.ts#L27)

Relative order required between two primitive kinds.

## Properties

| Property                                                 | Type                                                                | Description                                                                                                                                                              | Defined in                                                                                                                        |
| -------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
|  `after`                      | [`OrderingPrimitiveKind`](../type-aliases/OrderingPrimitiveKind.md) | Primitive that must occur after [OrderRule.before](#property-before).                                                                                                    | [src/batteries/validation/types.ts:35](https://github.com/NHTIO/ADK/blob/v1.20260824.1/src/src/batteries/validation/types.ts#L35) |
|  `before`                    | [`OrderingPrimitiveKind`](../type-aliases/OrderingPrimitiveKind.md) | Primitive that must occur first.                                                                                                                                         | [src/batteries/validation/types.ts:33](https://github.com/NHTIO/ADK/blob/v1.20260824.1/src/src/batteries/validation/types.ts#L33) |
|  `id`                            | `string`                                                            | Stable identifier used in violations and advisory configuration.                                                                                                         | [src/batteries/validation/types.ts:31](https://github.com/NHTIO/ADK/blob/v1.20260824.1/src/src/batteries/validation/types.ts#L31) |
|  `onlyLatestGroup?` | `boolean`                                                           | When true, evaluate only the current/latest group; earlier malformed historical groups are intentionally ignored, as with Anthropic's current-turn thinking requirement. | [src/batteries/validation/types.ts:42](https://github.com/NHTIO/ADK/blob/v1.20260824.1/src/src/batteries/validation/types.ts#L42) |
|  `scope`                      | `"adjacent-same-role-group"` | `"entire-turn"`                     | Whether the relationship is local to a role group or spans the whole turn.                                                                                               | [src/batteries/validation/types.ts:37](https://github.com/NHTIO/ADK/blob/v1.20260824.1/src/src/batteries/validation/types.ts#L37) |
|  `type`                        | `"order"`                                                           | Discriminator selecting the relative-order evaluator.                                                                                                                    | [src/batteries/validation/types.ts:29](https://github.com/NHTIO/ADK/blob/v1.20260824.1/src/src/batteries/validation/types.ts#L29) |
