# FR: `@x12i/api-simulator` — mutable / shared simulation state helpers

**Status:** Shipped in **1.3.0** (`context.state`, `getState` / `resetState`; `createStore` remains the CRUD helper)  
**Package:** `@x12i/api-simulator` **1.0.0+**  
**Consumers:** workers with actions / multi-step pagination (Cortex isolate, CrowdStrike contain, Nessus scans, etc.)

## Problem

API-local `data` is treated as **read-only** per request. Action endpoints and multi-page cursors need mutable shared state (isolate an endpoint → subsequent GET reflects isolation). Today consumers close over ad-hoc module state outside the package, which is easy to get wrong across APIs/vendors.

## Goals

1. Documented mutable store API shared across endpoints of an `ApiDefinition` (e.g. `context.state.get/set`, or writable `data` with copy-on-write rules).
2. Optional reset / snapshot helpers for tests.
3. Clear concurrency notes (single-process simulators).

## Non-goals

- Durable persistence across process restarts
- Multi-tenant isolation beyond what consumer simulations define

## Acceptance

- Simulation handlers can update shared state that subsequent `dispatch` calls observe
- `listEndpoints` / definition validation still reject invalid endpoint configs
- README example for “isolate then list”
