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

# RegimeSense

Detecting structural breaks in reality

Mind · Inference

## Mechanism

An anomaly detector that continuously tracks divergence between the agent's internal model predictions and observed reality. It calculates a Regime Stability Score (RSS) as the rolling average of prediction accuracy over a window. High surprisal (low accuracy) indicates regime instability. When RSS drops below threshold, it signals that the underlying generative process has changed. It continuously monitors prediction error via [DriftWatch](https://semahash.org/vocabularies/bootstrap/patterns/DriftWatch.md), triggering [OntologyAdapt](https://semahash.org/vocabularies/bootstrap/patterns/OntologyAdapt.md) or [Quorum](https://semahash.org/vocabularies/bootstrap/patterns/Quorum.md) if the error signal crosses the regime-change threshold.

## Invariants

- Stability [Break](https://semahash.org/vocabularies/bootstrap/patterns/Break.md): RSS below `stability_threshold` across the window signals a regime break.
- The RSS window is `window_size` observations, fixed in advance rather than chosen per evaluation.

## Parameters

- stability_threshold: type=Float, range=[0.0, 1.0], description=RSS threshold below which regime break is detected
- window_size: type=Integer, range=[10, 1000], description=Number of observations in the rolling average window

## Preconditions

- [Agent](https://semahash.org/vocabularies/bootstrap/patterns/Agent.md) has a predictive model generating expectations
- Observations are timestamped and comparable to predictions

## Postconditions

- Alert raised if regime break detected
- RSS score computed for current window

## Failure modes

- False Positives: [Noise](https://semahash.org/vocabularies/bootstrap/patterns/Noise.md) spikes triggering unnecessary accommodations.
- Lag: RSS is a trailing indicator, so regime shifts are detected after-the-fact.
- Threshold Gaming: Setting threshold too high causes missed shifts; too low causes constant alerts.

## Where this came from

—

## Builds on

- [OntologyAdapt](https://semahash.org/vocabularies/bootstrap/patterns/OntologyAdapt.md) (references)
- [Quorum](https://semahash.org/vocabularies/bootstrap/patterns/Quorum.md) (references)
- [Agent](https://semahash.org/vocabularies/bootstrap/patterns/Agent.md) (references)
- [DriftWatch](https://semahash.org/vocabularies/bootstrap/patterns/DriftWatch.md) (references)
- [Break](https://semahash.org/vocabularies/bootstrap/patterns/Break.md) (references)
- [Noise](https://semahash.org/vocabularies/bootstrap/patterns/Noise.md) (references)

## Used by

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

## Related

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

## Identity

- Library: bootstrap 0.11.0 (root a6a3d1ff0f98)
- Ref: RegimeSense#8bba
- Hash: sema:RegimeSense#mh:SHA-256:8bba125c54467eac428d5257f67617a947a4041c04da0bdcb2ade774056b0e14

## Links

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