# car-state

Thread-safe state store for the [Common Agent Runtime](https://github.com/Parslee-ai/car).

## What it does

A key-value state store where every mutation produces a `StateTransition` record for audit
and replay. Supports snapshots and restore for rollback. Uses `parking_lot::Mutex` for
low-overhead concurrent access.

## Usage

```rust
use car_state::StateStore;
use serde_json::Value;

let store = StateStore::new();
store.set("auth", Value::Bool(true), "action-1");
assert_eq!(store.get("auth"), Some(Value::Bool(true)));

let snap = store.snapshot();
store.set("temp", Value::from(42), "action-2");
store.restore(snap, 1); // rollback
```

Part of [CAR](https://github.com/Parslee-ai/car) -- see the main repo for full documentation.
