# Failure Lab 1.0.0

Synthetic deterministic state-machine benchmark. Not a model evaluation, real incident, performance measurement or vendor price comparison.

Run offline with Node.js 22 or later. No install, dependency, model or API key:

    node --test benchmark.test.mjs
    node run.mjs > results.json

Population: 24 paired fixtures (3 kinds x sizes 1..8). Each pair has the same workload with the guard disabled and enabled. No PRNG, timestamps or environment-dependent measurements. Browser and CLI use the same engine.mjs. Serialized output is deterministic.

- Context: deliberately lossy compaction removes two rules. Re-anchoring restores them after every compaction. Metric: destructive operations (0 or 1). Does not measure an LLM's attention or compaction quality.
- Retry: all but the last attempt time out AFTER the synthetic provider commits. A stable logical operation key deduplicates effects. Metric: committed effects, not financial charges. Does not model real provider retention, concurrent requests, persistence or conflicting payloads.
- Budget: six planned steps, size work units per step, cap 10. Guard checks BEFORE spending. Metric: synthetic work units, not currency, tokens or latency.

Expected result: 22/24 unsafe before, 0/24 unsafe after. Retry size=1 and budget size=1 are safe baseline controls. This comparison proves these toy controls satisfy the specified toy invariants, not that a production agent is safe.

26 tests: 24 fixture tests with before/after assertions, guard-removal negative controls, repeatability and nonempty traces; population/serialization test; invalid-input test.

UI: all choices stay in memory until refresh. No analytics, localStorage, cookies, fetch, model calls or account access. JSON exports are local Blob downloads. The kit is decoded to a ZIP Blob from the static kit.mjs module. The parent website may separately record a page view with its existing analytics; the embedded lab does not send choices or user content.

Integration: route /failure-lab embeds /failure-lab/index.html to isolate the English interactive surface from the existing English site. Add discovery links from the Reliability hub / prototypes index in the integration branch. Test iframe keyboard focus, height/scroll and parent analytics before merge. Existing README authority, /now, GA identity, package scripts and lockfile are unchanged.

Related local pages: /prototypes/contextrot, /prototypes/echoburn, /prototypes/agent-budget, /articles/ai-agents-reliability-deterministic-layer.
