# How validation works

> Two layers of checking: the recipe before a run, and the data after it — what each layer looks at and what neither can see.

Section: Validate · Type: concept · Last updated: 2026-09-14

Validation happens twice: the recipe before a run, and the data after it.

## The picture

Recipe (before the run) → Structure · rules · dry run (validate_recipe) → Data (after the run) → Checks with counts (in the receipt)

## What WorkLens checks

- Recipe structure, and the closest supported key when one is misspelt.
- Static satisfiability — a constraint that no row could meet is reported before any row is written.
- A one-row in-memory dry run in the engine.
- A ledger of requirements the recipe declares that the engine will not execute, so nothing is dropped silently.
- After the run: formulas, identifier checksums, ranges, allowed values, uniqueness — with counts.

## What WorkLens does not check

- The meaning of your rules. A range of 0–1 on an age column validates; it is simply wrong.
- Your application’s behaviour on the data.

## Why the ledger matters

The recipe is an open superset: it may declare any requirement, including ones the engine does not implement, so that a requirement is never lost between the business and the test. The price is that the engine must say which it executed. That list — declared but not executed — is in the validation result and in the receipt, and an agent is told to read it before drafting further.

## Common questions

**Where do I run the recipe check?**

The validate_recipe MCP tool is the fullest form and returns a next_step to follow verbatim. The studio checks a recipe as you edit it. The CLI’s check command proves a recipe is data-free before it is shared.

## Related

- [Receipts](https://theworklens.com/docs/proof/receipts): What a run’s proof report contains, field by field, with a real one — and the line between what it proves and what it does not.
- [Best practices](https://theworklens.com/docs/guides/best-practices): The 21 rules the engine gives an AI agent before it drafts a recipe — 6 of them critical — as useful to a person as to a model.
- [Limitations](https://theworklens.com/docs/validate/limitations): The 9 things the engine will not do, each with why and what to do instead — the same list an AI agent is told.
- [Tool directory](https://theworklens.com/docs/mcp/tools): All 13 tools the WorkLens MCP server exposes, grouped by the step they belong to, generated from the published contracts.

_← Previous: [Validate](https://theworklens.com/docs/validate) · Next: [Limitations](https://theworklens.com/docs/validate/limitations) →_

_Canonical: https://theworklens.com/docs/validate/how-it-works · This copy: https://theworklens.com/docs/validate/how-it-works.md_
