# ValidateCandidate
Source: https://docs.maelstrom-ai.co/0.2/reference/engine/type-aliases/validatecandidate/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

> **ValidateCandidate** = `ValidateCandidateSignatures`\[`"validate"`\]

Defined in: packages/engine/src/lib/planner/stage.ts:74

Heals and validates a candidate against the original request, the same way the Engine validates the candidate it ships. Results are cached per candidate object for the request, so validating inside a stage costs nothing extra when the same candidate reaches the Engine. A failure that healing cannot absorb (for example a missing `userMessage` on a request without `skipReply: true`) is an `Err`; nothing throws.

Because results are cached by object identity, a candidate must not change once it is validated: a stage that produces a different plan returns a new object. [PlannerCandidate](https://docs.maelstrom-ai.co/0.2/reference/engine/type-aliases/plannercandidate/) is deeply readonly to enforce this.

A [PlannerCandidate](https://docs.maelstrom-ai.co/0.2/reference/engine/type-aliases/plannercandidate/) validates to a [ValidatedCandidate](https://docs.maelstrom-ai.co/0.2/reference/engine/type-aliases/validatedcandidate/); a [ReplylessCandidate](https://docs.maelstrom-ai.co/0.2/reference/engine/type-aliases/replylesscandidate/) to a [ValidatedReplylessCandidate](https://docs.maelstrom-ai.co/0.2/reference/engine/type-aliases/validatedreplylesscandidate/), whose `userMessage` may be absent. A needs-clarification result is not a candidate and is not accepted here.
