---
library: "bootstrap"
slug: "LayeredCheck"
name: "LayeredCheck"
ref: "LayeredCheck#6d73"
hash: "sema:LayeredCheck#mh:SHA-256:6d7379c20e7b733e77ee96409251b53d8e06133944506d9f7443b13178a38042"
type: "Inference"
layer: "Mind"
version: "0.11.0"
root: "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5"
license: null
url: "https://semahash.org/vocabularies/bootstrap/patterns/LayeredCheck"
---

# LayeredCheck

Hierarchical verification strategy

Mind · Inference

## Mechanism

A [Check](https://semahash.org/vocabularies/bootstrap/patterns/Check.md) strategy that evaluates constraints in a declared [Hierarchy](https://semahash.org/vocabularies/bootstrap/patterns/Hierarchy.md), cheapest first (e.g., existence -> [Validate](https://semahash.org/vocabularies/bootstrap/patterns/Validate.md) (schema) -> [Understand](https://semahash.org/vocabularies/bootstrap/patterns/Understand.md) (semantics), which is also increasing abstraction in the common case). It uses a [Sequence](https://semahash.org/vocabularies/bootstrap/patterns/Sequence.md) of [Gate](https://semahash.org/vocabularies/bootstrap/patterns/Gate.md)s where lower-level failures halt execution immediately, preventing resource waste on higher-level checks for fundamentally broken inputs.

## Invariants

- A lower layer's failure stops the [Sequence](https://semahash.org/vocabularies/bootstrap/patterns/Sequence.md); the next layer does not run.
- Layers run in their declared order, cheapest first.
- Each layer declares whether a finding is a failure or a warning.

## Signature

- Check(Hierarchy)

## Failure modes

- Misordered layers: an expensive check sits below a cheap one, so the halt saves nothing.
- Warning inflation: findings are classed as warnings to keep the [Sequence](https://semahash.org/vocabularies/bootstrap/patterns/Sequence.md) running, which defeats the halt.

## Where this came from

—

## Builds on

- [Sequence](https://semahash.org/vocabularies/bootstrap/patterns/Sequence.md) (composes_with)
- [Check](https://semahash.org/vocabularies/bootstrap/patterns/Check.md) (composes_with)
- [Gate](https://semahash.org/vocabularies/bootstrap/patterns/Gate.md) (composes_with)
- [Understand](https://semahash.org/vocabularies/bootstrap/patterns/Understand.md) (references)
- [Validate](https://semahash.org/vocabularies/bootstrap/patterns/Validate.md) (references)
- [Hierarchy](https://semahash.org/vocabularies/bootstrap/patterns/Hierarchy.md) (references)

## Related

- [PURECheck](https://semahash.org/vocabularies/bootstrap/patterns/PURECheck.md)

## Identity

- Library: bootstrap 0.11.0 (root a6a3d1ff0f98)
- Ref: LayeredCheck#6d73
- Hash: sema:LayeredCheck#mh:SHA-256:6d7379c20e7b733e77ee96409251b53d8e06133944506d9f7443b13178a38042

## Links

- Page: https://semahash.org/vocabularies/bootstrap/patterns/LayeredCheck
- JSON: https://semahash.org/vocabularies/bootstrap/patterns/LayeredCheck.json
- Library: https://semahash.org/vocabularies/bootstrap
- Library index: https://semahash.org/vocabularies/bootstrap/index.json
