# Steady state recycles resources

> For agents: start with the [agent guide](https://ratstack.sh/llms.txt). Every page is Markdown by default; add `Accept: text/html` for HTML.

Free workshop: [Build Agent Loops That Never Stop Shipping](/tokenmaxx#interested).

Growing logs, retained rows, caches, and objects need a counter-mechanism. Normal operation should not depend on repeated manual cleanup.

> The Steady State pattern says, for every mechanism that accumulates a resource, some other mechanism must recycle that resource.

Source: [Q08](/lore/durability-bibliography#q08); [B4](/lore/durability-bibliography#b4-release-it).

## Failure it prevents

Memory, storage, or latency fails after enough otherwise-successful operations.

## Our Effect 4.0.0 reading

`Cache` and [Scope](/lore/scopes-own-resources) cover runtime lifetime. `PersistedQueue.layerCleanup` handles retained queue records. Durable domain data still needs a storage policy and maintenance owner.

Source: `packages/effect/src/Cache.ts`, `packages/effect/src/Scope.ts`, `packages/effect/src/persistence/PersistedQueue.ts`.

## How to check

Inspect growth over repeated work. Check retention against replay and dedupe requirements before deleting recovery evidence. This check is our proposal. The books do not prescribe it.

Continue with [Queries need result bounds](/lore/queries-need-result-bounds), [Dead letters need a return path](/lore/dead-letters-need-a-return-path).

Connect this to [the existing rat-stack guidance](/lore/scopes-own-resources).

Use [the durability skill](/skills/durability) for the full review. Return to [the durability index](/lore/durability).

## Sources

1. [Nygard, Michael T. Release It!: Design and Deploy Production-Ready Software. Pragmatic Bookshelf, 2007.](https://archive.org/details/releaseitdesignd0000nyga)
   Pragmatic Bookshelf. §4.4 Unbounded Result Sets; Chapter 5 Stability Patterns: §5.1 Timeouts, §5.2 Circuit Breaker, §5.3 Bulkheads, §5.4 Steady State, §5.5 Fail Fast, §5.6 Handshaking, §5.7 Test Harness, §5.8 Decoupling Middleware. Accessed 2026-10-23.

2. [Effect contributors. Effect 4.0.0. Cache.ts](https://github.com/Effect-TS/effect/blob/67ba4e46a11ccda0b6761578bfd22c04ae00167d/packages/effect/src/Cache.ts)
   Effect-TS. Pinned source for our Effect mapping, not a claim from the book. Accessed 2026-10-23.

3. [Effect contributors. Effect 4.0.0. Scope.ts](https://github.com/Effect-TS/effect/blob/67ba4e46a11ccda0b6761578bfd22c04ae00167d/packages/effect/src/Scope.ts)
   Effect-TS. Pinned source for our Effect mapping, not a claim from the book. Accessed 2026-10-23.

4. [Effect contributors. Effect 4.0.0. persistence/PersistedQueue.ts](https://github.com/Effect-TS/effect/blob/67ba4e46a11ccda0b6761578bfd22c04ae00167d/packages/effect/src/persistence/PersistedQueue.ts)
   Effect-TS. Pinned source for our Effect mapping, not a claim from the book. Accessed 2026-10-23.

## Linked from

- Agent guide → An Effect stack so pure (aspirational) Kit Langton will blush. → [Read page](https://ratstack.sh/llms.txt)

- Change log → What changed in the files served here, newest first. → [Read page](https://ratstack.sh/log)

- Durability bibliography → Books, checked short quotations, source limits, and Effect mapping provenance. → [Read page](https://ratstack.sh/lore/durability-bibliography)

- Durability starts with a recovery record → A reading order for storage, replay, worker ownership, overload, and recovery tests. → [Read page](https://ratstack.sh/lore/durability)

- Full agent guide → An Effect stack so pure (aspirational) Kit Langton will blush. → [Read page](https://ratstack.sh/llms-full.txt)

- Queries need result bounds → Limit result cardinality before the driver materializes an oversized response. → [Read page](https://ratstack.sh/lore/queries-need-result-bounds)

- Rat Stack lore | rat-stack → Short, source-grounded notes on the ideas and decisions behind rat-stack. → [Read page](https://ratstack.sh/lore)

- Scopes release resources when work ends → Acquire resources lazily, keep their use inside the owner, and release them after success, failure, or interruption. → [Read page](https://ratstack.sh/lore/scopes-own-resources)

- Source change history (log.md) → The generated change log as Markdown. → [Read page](https://ratstack.sh/log.md)
