---
library: "bootstrap"
slug: "GracefulDegradation"
name: "GracefulDegradation"
ref: "GracefulDegradation#6633"
hash: "sema:GracefulDegradation#mh:SHA-256:6633433b9b713c199d43b085ec6e07183544183c507e5c9673aafa0518135df9"
type: "Protocols"
layer: "Society"
version: "0.11.0"
root: "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5"
license: null
url: "https://semahash.org/vocabularies/bootstrap/patterns/GracefulDegradation"
---

# GracefulDegradation

When verification fails, fall back to inline definition

Society · Protocols

## Mechanism

Resolution Fallback [Strategy](https://semahash.org/vocabularies/bootstrap/patterns/Strategy.md). When a Pattern_ID is not found in local storage, the system attempts to resolve it via secondary channels (Inline Payload -> Network Request) rather than halting immediately. Crucially, any definition acquired this way must be cryptographically verified against the requested Pattern_ID. It defaults to [FailClosed](https://semahash.org/vocabularies/bootstrap/patterns/FailClosed.md) if verification fails, but attempts to parse verified inline definitions to maintain continuity.

## Invariants

- A definition enters local storage only if it validates fully.
- An externally acquired definition is hashed and verified against the requested ID before loading.
- Rejects definitions larger than `max_def_size`.
- Expands inline definitions no deeper than `max_recursion_depth`.
- Defaults to [FailClosed](https://semahash.org/vocabularies/bootstrap/patterns/FailClosed.md) when verification fails.

## Parameters

- max_def_size: type=PositiveInteger, range=unspecified, description=Largest inline definition accepted, in bytes. Deliberately uncapped; default 100KB.
- max_recursion_depth: type=Integer, range=[1, 5], description=Depth of inline-definition expansion permitted before the chain is refused.

## Preconditions

- [Message](https://semahash.org/vocabularies/bootstrap/patterns/Message.md) contains fallback data OR sender is reachable
- Pattern lookup failed

## Postconditions

- Pattern resolved and locally minted OR Transaction aborted

## Failure modes

- Hash Mismatch: Inline definition claims to be Pattern#X but hashes to Pattern#Y (Spoofing).
- DoS via Definition: Sender includes massive multi-megabyte 'definition' to exhaust receiver memory.
- Dependency Hell: Inline definition references other unknown patterns, triggering recursive lookups.

## Where this came from

—

## Builds on

- [Message](https://semahash.org/vocabularies/bootstrap/patterns/Message.md) (references)
- [FailClosed](https://semahash.org/vocabularies/bootstrap/patterns/FailClosed.md) (references)
- [Strategy](https://semahash.org/vocabularies/bootstrap/patterns/Strategy.md) (references)

## Used by

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

## Identity

- Library: bootstrap 0.11.0 (root a6a3d1ff0f98)
- Ref: GracefulDegradation#6633
- Hash: sema:GracefulDegradation#mh:SHA-256:6633433b9b713c199d43b085ec6e07183544183c507e5c9673aafa0518135df9

## Links

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