# assertLayoutConstraints

Canonical: https://docs.shumoku.dev/en/library/api/assertLayoutConstraints
Language: en

@shumoku/core · 0.4.0 · function

# assertLayoutConstraints

[Source](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/constraints.ts#L304)

Standing-fixture gate (engine-v3-migration.md §B4, finally wired): verify after a layout and — when a BLOCKING constraint is violated — throw under \`NODE\_ENV=test\` (CI fixtures pin the guarantee), log an error otherwise. A runtime layout must NEVER fail to render because of the gate: Bun defaults NODE\_ENV to 'development', and throwing there turned a constraint report into "no diagram at all" (the flat-tree path on a 1.5k-node graph violates massively — that's a finding for #481, not a reason to refuse the bake).

```
assertLayoutConstraints(layout: ResolvedLayout, context?: string): void
```

## Parameters

| Parameter | Type | Description | Default |
| --- | --- | --- | --- |
| `layout` | `ResolvedLayout` | No additional description. | `—` |
| `context` | `string` | No additional description. | `'layout'` |

## Returns

```
void
```

[`libs/@shumoku/core/src/layout/constraints.ts:304`](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/constraints.ts#L304)
