---
slug: "StateAudit"
name: "StateAudit"
type: "Primitives"
layer: "Infrastructure"
ref: "StateAudit#63cf"
sema_id: "sema:StateAudit#mh:SHA-256:63cfd2311667bd0cf3634a23d7c6bb15018d7903ec89e6f5453a827251d7a43c"
tags: ["Infrastructure","Primitives"]
updated: 2026-11-11
mindscape: "bootstrap"
index_url: https://mindscape.world/scapes/bootstrap.json
url: https://mindscape.world/bootstrap/StateAudit/
related: ["Audit","State","StateTransition","SpotAudit"]
---

# StateAudit

Verifying system state after an operation

Layer: Infrastructure · Category: Primitives

## Mechanism

A safety pattern where an agent performs an explicit [Audit](https://mindscape.world/scapes/bootstrap/Audit.md) of the [State](https://mindscape.world/scapes/bootstrap/State.md) immediately after a write to ensure the [StateTransition](https://mindscape.world/scapes/bootstrap/StateTransition.md) occurred as expected. Catches silent API failures.

## Invariants

- Audit timestamp is later than the write it verifies.
- Compares observed [State](https://mindscape.world/scapes/bootstrap/State.md) against the [StateTransition](https://mindscape.world/scapes/bootstrap/StateTransition.md) that was expected, not merely that a write returned.

## Failure modes

- Silent write failure: the write reported success and the [State](https://mindscape.world/scapes/bootstrap/State.md) did not change. This is the case the pattern exists for.
- Audit reads a stale replica, so a successful write looks silently failed.

## Builds on

- [Audit](https://mindscape.world/scapes/bootstrap/Audit.md) (Infrastructure; References)
- [State](https://mindscape.world/scapes/bootstrap/State.md) (Infrastructure; References)
- [StateTransition](https://mindscape.world/scapes/bootstrap/StateTransition.md) (Infrastructure; References)

## Used by

- [SpotAudit](https://mindscape.world/scapes/bootstrap/SpotAudit.md) (Infrastructure; References)

## Identity

- Sema ID: `sema:StateAudit#mh:SHA-256:63cfd2311667bd0cf3634a23d7c6bb15018d7903ec89e6f5453a827251d7a43c`
- Ref: `StateAudit#63cf`
- Supersedes:
  - `sema:StateAudit#mh:SHA-256:ce13ca0864f9b2658c7101e34eb86670079a96eba47499450f5b6105ba54925e`
  - `sema:StateAudit#mh:SHA-256:2747b8fd941dcd5a3980556d108b22f376bb3ac0ac6de1561215ad836bf5ed17`

## Links

- [Pattern page](https://mindscape.world/bootstrap/StateAudit/)
- [View in the interactive graph](https://mindscape.world/bootstrap/#StateAudit)
- [JSON](https://mindscape.world/scapes/bootstrap/StateAudit.json)
- [Index of all patterns](https://mindscape.world/scapes/bootstrap.json)
