# Failures keep their meaning

> 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).

Model expected business failures explicitly. Hide recoverable details only where callers do not need them to preserve correctness.

> These different kinds of errors require different implementations.

Source: [Q15](/lore/durability-bibliography#q15); [B7](/lore/durability-bibliography#b7-domain-modeling-made-functional), [B10](/lore/durability-bibliography#b10-a-philosophy-of-software-design).

## Failure it prevents

A broken execution becomes a permanent business refusal, or a permanent refusal triggers endless retry.

## Our Effect 4.0.0 reading

`Schema.TaggedError` and `Effect.catchTag` carry named expected outcomes. Classification and [defect](/lore/effect-basics) policy remain domain decisions. A [service](/lore/services-capture-dependencies) seam can own recoverable mechanics.

Source: `packages/effect/src/Schema.ts`, `packages/effect/src/Effect.ts`, `packages/effect/src/Context.ts`, `packages/effect/src/Layer.ts`.

## How to check

Exercise each declared failure category. Verify retry, refusal, escalation, and uncertain outcomes remain distinguishable. This check is our proposal. The books do not prescribe it.

Continue with [Cleanup can be an idempotent postcondition](/lore/cleanup-can-be-an-idempotent-postcondition), [Pure cores reduce timeline coupling](/lore/pure-cores-reduce-timelines).

Connect this to [the existing rat-stack guidance](/lore/error-model).

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

## Sources

1. [Wlaschin, Scott. Domain Modeling Made Functional: Tackle Software Complexity with Domain-Driven Design and F#. Pragmatic Bookshelf, 2018.](https://pragprog.com/titles/swdddf/domain-modeling-made-functional/)
   Pragmatic Bookshelf. Implementation: Working with Errors; Using the Result Type to Make Errors Explicit; Handling Exceptions; Composing in Parallel with Applicatives. Accessed 2026-10-23.

2. [Ousterhout, John. A Philosophy of Software Design. 2018.](https://web.stanford.edu/~ouster/cgi-bin/book.php)
   John Ousterhout. §4.4 Deep Modules; §10.2 Too Many Exceptions; §10.3 Define Errors Out of Existence; §10.6 Mask Exceptions; §10.7 Exception Aggregation; §10.8 Just Crash?; §10.10 Taking It Too Far. Accessed 2026-10-23.

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

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

6. [Effect contributors. Effect 4.0.0. Layer.ts](https://github.com/Effect-TS/effect/blob/67ba4e46a11ccda0b6761578bfd22c04ae00167d/packages/effect/src/Layer.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)

- Cleanup can be an idempotent postcondition → Already-absent state can be success when absence is the operation’s intended result. → [Read page](https://ratstack.sh/lore/cleanup-can-be-an-idempotent-postcondition)

- durability → Keep a rat-stack app standing when a provider, pool, or dependency slows down or a worker dies. Use at any I/O boundary, connection pool, provider call, shared waiter, fan-out, flag, gate, or work that can outlive a request, or when asked "what happens when this is slow", "add a timeout", "make this durable", or "what survives a crash". → [Read page](https://ratstack.sh/skills/durability)

- 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)

- Effect basics → An Effect describes work, expected failures, and required services before a runtime executes it. → [Read page](https://ratstack.sh/lore/effect-basics)

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

- Handle expected failures without hiding defects → Declare expected failures, preserve their context, and recover by tag without turning crashes into successful outcomes. → [Read page](https://ratstack.sh/lore/error-model)

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

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