Recipe catalog / move-explanation-fit
Check move explanation fit
move-explanation-fit is a Jev recipe from the jev-recipes TypeScript package. Does explanation give a reason for move that is consistent with the described game state? Use it when an agent or player justifies a move in text and you want to catch explanations that cite pieces, threats, or resources the state does not contain.
Last updated .
Explore this recipe interactively · Source and implementation guide · Markdown version
How do I use move-explanation-fit in TypeScript?
Install with npm install jev-recipes. Requires Node.js 22.9 or newer and ES modules. Set TYPESAFE_API_KEY in your server environment for live calls, which send input to TypeSafe and use API quota. See the installation guide.
import { moveExplanationFit } from 'jev-recipes/move-explanation-fit';
const result = await moveExplanationFit({
"move": "Knight from g1 to f3",
"explanation": "Developing the knight to f3 defends the pawn on e4 against the black knight's threat and prepares to castle kingside.",
"state": "Chess, White to move. White pieces: king e1, queen d1, rooks a1 and h1, bishops c1 and f1, knights b1 and g1, pawns a2 b2 c2 d2 e2 f2 g2 h2. Black pieces: king e8, queen d8, rooks a8 and h8, bishops c8 and f8, knights b8 and f6, pawns a7 b7 c7 d7 e7 f7 g7 h7. Move 2: Black has just played knight g8 to f6.",
"minConfidence": 0.8
});
console.log(result);
What input does move-explanation-fit take?
| Field | Type | Needed |
|---|---|---|
| move | string | Required |
| explanation | string | Required |
| state | string | Required |
| minConfidence | number | Optional |
Full input and result schemas
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"move": {
"type": "string"
},
"explanation": {
"type": "string"
},
"state": {
"type": "string"
},
"minConfidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"move",
"explanation",
"state"
]
},
"result": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"model": {
"type": "string"
},
"usage": {
"type": "object",
"properties": {
"input_tokens": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"output_tokens": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"input_tokens",
"output_tokens"
],
"additionalProperties": false
},
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"verdict": {
"type": "string",
"enum": [
"consistent",
"inconsistent"
]
}
},
"required": [
"model",
"usage",
"status",
"probability",
"confidence",
"verdict"
],
"additionalProperties": false
}
}What does a move-explanation-fit result look like?
This hand-authored response demonstrates the contract. It is not a model accuracy measurement. Run it without an API key: npx jev-recipes demo move-explanation-fit.
{
"model": "demo-fixture",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"status": "ready",
"probability": 0.07,
"confidence": 0.9299999999999999,
"verdict": "inconsistent"
}
Input
See shared options and behavior for client configuration, validation, and errors. Types are inferred from this folder's Zod 4 schemas.
Result
verdict is consistent when Jev's yes probability is at least 0.5 and inconsistent otherwise. probability is that yes probability. confidence is the probability of the chosen side, so a 0.1 yes probability yields inconsistent with 0.9 confidence.
A result is ready when confidence meets minConfidence. Otherwise it is review. Treat a review result as unknown and fall back to your safe default.
Reuse and calls
Uses the shared gate helper, a single yes/no question. This folder owns the question wording, the outcome descriptions, and the review policy. A live invocation makes one logical Jev request.
Limits
The verdict says whether the explanation matches the state as written, not whether the move is good, legal, or the best choice. If the supplied state description is itself wrong, the recipe cannot tell. Exact legality, position evaluation, and move generation belong in game code.
Example input
demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo move-explanation-fit shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe move-explanation-fit to inspect the input and result schemas.
How accurate is move-explanation-fit?
No verified live accuracy measurement is available. Evaluate representative cases before using this decision in your workflow.
Use the evaluation guide to measure this decision on your own labeled cases.
What are the limits of move-explanation-fit?
- Judges consistency of the explanation's wording with the described state, not whether the move is strong or the best available.
- Relies on the state description as written; it cannot detect a state description that is itself wrong. Exact position validation belongs in game code.
Which recipes are related to move-explanation-fit?
- game-action: Use game-action to have Jev choose a move from JSON game state and available actions.
- causal-attribution: Use causal-attribution to judge whether a stated cause is supported by the described outcome outside a game context.