> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.doc-detective.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.doc-detective.com/_mcp/server.

# assertion

> An articulated assertion record produced by the runner for a step result. Each record names a single verification check, whether it passed, and the values it compared. The step's result is the roll-up of its assertion results (FAIL > WARNING > all-SKIPPED > PASS). System-populated; appears in test results, not in authored specs.

An articulated assertion record produced by the runner for a step result. Each record names a single verification check, whether it passed, and the values it compared. The step's result is the roll-up of its assertion results (FAIL > WARNING > all-SKIPPED > PASS). System-populated; appears in test results, not in authored specs.

## Referenced In

* [Common](/reference/schemas/common)

## Fields

| Field       | Type                                            | Description                                                                                                                        | Default |
| :---------- | :---------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------- | :------ |
| statement   | string                                          | Required. Human-readable articulation of the check, e.g. `exitCode in [0]`. Minimum length: 1. Pattern: `\S`                       | —       |
| source      | string                                          | Required. Who defined the assertion: `implicit` (runner-defined) or `custom` (user-defined). Accepted values: `implicit`, `custom` | —       |
| result      | string                                          | Required. Outcome of evaluating the assertion. Accepted values: `PASS`, `FAIL`, `WARNING`, `SKIPPED`                               | —       |
| expected    | array,boolean,integer,null,number,object,string | Optional. The value (or values) the assertion expected. Optional.                                                                  | —       |
| actual      | array,boolean,integer,null,number,object,string | Optional. The value actually observed. Optional.                                                                                   | —       |
| description | string                                          | Optional. Human-readable explanation of the outcome. Optional.                                                                     | —       |

## Examples

```json
{
  "statement": "exitCode in [0]",
  "source": "implicit",
  "result": "PASS",
  "expected": [
    0
  ],
  "actual": 0,
  "description": "Returned exit code 0."
}
```

```json
{
  "statement": "exitCode in [0]",
  "source": "implicit",
  "result": "FAIL",
  "expected": [
    0
  ],
  "actual": 1,
  "description": "Returned exit code 1. Expected one of [0]."
}
```

```json
{
  "statement": "saved-file variation <= 0.1",
  "source": "implicit",
  "result": "WARNING"
}
```

```json
{
  "statement": "$$outputs.exitCode == 0",
  "source": "custom",
  "result": "SKIPPED"
}
```