LOKI LogoLOKI CHAOSv1.11.0

Client State & Temporal Chaos ('Poisoned Well')

Corrupt persisted browser storage (localStorage / sessionStorage), trigger QuotaExceededError, shift the JS clock forward, and test rehydration survival on page.reload().

Usage

bash
loki run http://localhost:8000 --persona novice-chaotic --state-chaos
loki run http://localhost:8000 --swarm
loki run http://localhost:8000 --no-state-chaos

Active personas

StateChaosEngine (src/loki/engine/state_chaos.py) runs during novice-chaotic, swarm (--swarm), and all sessions when --state-chaos is enabled (on by default).

'Poisoned Well' Fault Types (`--state-chaos`)

FlagTypeDefaultDescription
storage_corrupt_jsonlocalStorage / sessionStoragetruncated JSONSlices serialized JSON values mid-object (e.g. {"items":[{"id":1) to expose unguarded JSON.parse() calls during state hydration.
storage_trap_literallocalStorage / sessionStorage"undefined", "null", "NaN"Replaces persisted values with JavaScript string trap literals ("undefined", "null", "NaN", "[object Object]").
storage_type_swap / schema_striplocalStorage / sessionStorageZustand / Redux-Persist awareSwaps expected types (arrays to numbers, objects to strings, positive totals to -999999) or strips required inner keys from {state, version} persistence envelopes.
quota_exhaustedStorage.prototype.setItemQuotaExceededErrorOverrides Storage.prototype.setItem in the page context to throw DOMException("QuotaExceededError") on subsequent writes.
clock_driftDate.now / new Date+1h, +2h, +24hFast-forwards the client JavaScript clock mid-session to expose expired JWT refresh loops, broken countdown timers, and cache TTL bugs.
poisoned_reloadpage.reload()end of waveReloads the page with poisoned storage still in place and inspects the DOM for white-screen hydration crashes ([UI Freeze / Poisoned Reload Collapse]).