# One snippet model feeds both renderers

> 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 [component registry](https://github.com/joelhooks/rat-stack/blob/main/apps/mischief/scripts/component-registry.ts) defines agent and human renderers.
The [code-snippets design brief](/lore/code-snippets) gives both renderers one snippet model.

The proposed `CodeSnippet` carries:

- Selected source text and original line numbers.
- Highlighted lines and collapsed gaps.
- Repository, commit, path, and source link.
- Diagnostics.

HTML adds colour, a filename, numbered lines, and a source link.
Agent Markdown adds provenance and a fenced code block.
Neither renderer owns a second copy of the source facts.

Renderer parity means both views preserve those shared facts.
The planned property compares each view with the pinned source.

[Whole-file tokenization](/lore/tokenize-before-slicing) supplies the tokens.
[Engine-neutral tokens](/lore/engine-neutral-tokens-keep-adapters-replaceable) keep renderer input independent of Shiki.

See [the glossary](/glossary) for snippet model and renderer parity.

## Sources

1. [Component registry](https://github.com/joelhooks/rat-stack/blob/main/apps/mischief/scripts/component-registry.ts)
   Primary source. Agent and human renderers Accessed 2026-10-02.

2. [Code-snippets design brief](https://github.com/joelhooks/rat-stack/blob/main/.brain/resources/lore/code-snippets.svx)
   Primary source. Shared CodeSnippet model Accessed 2026-10-02.

## Lore on this page

- [Pin the source and report drift separately](/lore/pinned-sources-can-report-drift)

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

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

- Engine-neutral tokens keep adapters replaceable → The highlighter port exposes text, roles, and font styles rather than Shiki types. → [Read page](https://ratstack.sh/lore/engine-neutral-tokens-keep-adapters-replaceable)

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

- Tokenize the whole file before slicing → Select lines after tokenization so each excerpt retains the file's lexical context. → [Read page](https://ratstack.sh/lore/tokenize-before-slicing)
