# Errors are part of the interface

> 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: [how to burn a trillion tokens and get good results](/tokenmaxx#interested).

The [code-snippets design brief](/lore/code-snippets) requires an author-facing error for each rejected snippet.

Each error carries:

- A typed error tag.
- The source document and line.
- The rejected request.
- Requested ranges and actual file length, when available.
- A repair instruction.

Invalid metadata keeps its raw values. It has no decoded request yet.

A stack trace does not meet this contract. The author needs enough context to repair the fence.

Use the [error model](/lore/error-model) to separate expected failures from defects.
Use [schema decoding](/lore/schemas-define-the-boundary) to reject invalid input at the boundary.
Use [error accumulation](/lore/accumulate-independent-errors) to report unrelated failures together.

Related reading: *Exceptional Ruby* and *Confident Ruby*, both by [Avdi Grimm](https://avdi.codes/books/).
These titles are reading pointers, not evidence for the proposed contract.

See [the glossary](/glossary) for diagnostic context and repair instruction.

## Sources

1. [Avdi Grimm's books](https://avdi.codes/books/)
   Avdi Grimm. Author and titles only; no claims about book contents. Accessed 2026-10-02.

2. [Effect Schema](https://github.com/Effect-TS/effect/blob/effect%404.0.0/packages/effect/src/Schema.ts)
   Effect contributors. Typed errors Accessed 2026-10-02.

3. [Code-snippets design brief](https://github.com/joelhooks/rat-stack/blob/main/.brain/resources/lore/code-snippets.svx)
   Primary source. Proposed diagnostic contract Accessed 2026-10-02.

## Lore on this page

- [The fence](/lore/the-fence)

## Linked from

- Accumulate independent errors before writing output → Check every independent job before any job writes an asset. → [Read page](https://ratstack.sh/lore/accumulate-independent-errors)

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

- Code snippets quote a pinned source → Design brief for a build-only code pipeline: pinned Git objects, typed diagnostics, and one snippet model for both views. → [Read page](https://ratstack.sh/lore/code-snippets)

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

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

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