# State Isolation

Record: `arch:state-isolation`
Kind: principle
Layer: [Atomic Boundary](https://banes-lab.com/records/layer/atomic-boundary.md)
Severity: mandatory
Scope: function, component, service
Canonical: https://banes-lab.com/ontology#arch-state-isolation

## Repair

- Refactored by: Encapsulate State, Pass Explicit State, Use Immutable Data
- Detected by: static mutable fields, shared caches without ownership
- Violated by: [global mutable state](https://banes-lab.com/records/lex/global-mutable-state.md)
- Measured by: global state count
- Enforced by: lint rules, architecture tests

## requires

- [Encapsulation](https://banes-lab.com/records/arch/encapsulation.md)
- [Ownership](https://banes-lab.com/records/lex/ownership.md)

## reinforces

- [Predictability](https://banes-lab.com/records/arch/predictability.md)
- [Concurrency Safety](https://banes-lab.com/records/lex/concurrency-safety.md)

## enables

- [Testability](https://banes-lab.com/records/arch/testability.md)

## conflicts-with

- [Shared Mutable State](https://banes-lab.com/records/arch/shared-mutable-state.md)

## tensions-with

- [Data Sharing](https://banes-lab.com/records/lex/data-sharing.md)

## tensions

- [State Isolation Data Sharing](https://banes-lab.com/records/tension/data-sharing-state-isolation.md)
