# Pin the source and report drift separately

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

New on /news: [Foldkit 0.171.0 requires result Message schemas](/news).

A pinned source identifies a repository, a full commit SHA, and a path.
The [code-snippets design brief](/lore/code-snippets) reads that source from local Git objects.
[`git show`](https://git-scm.com/docs/git-show) documents object inspection.

The proposed snippet keeps its pinned text.
Source drift compares only the selected pinned lines with HEAD.
Source drift reports a warning. It leaves the pinned text intact and lets the build continue.

Keep HEAD out of the immutable snippet cache.
The cache key identifies the pinned source.
A separate diagnostic observes source drift.

If a shallow clone does not contain the pinned Git file or commit object, tell the author to fetch history.
Do not fetch it during content generation.

This boundary keeps [build-time work](/lore/build-time-work-stays-out-of-requests) local.
The configured registry follows [ports and adapters](/lore/hexagonal-architecture).

See [the glossary](/glossary) for pinned source and source drift.

## Sources

1. [git show](https://git-scm.com/docs/git-show)
   Primary source. Reading objects 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. Pin and drift design Accessed 2026-10-02.

## Linked from

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

- Build-time work stays out of requests → Git reads and highlighting produce static assets before the Worker handles requests. → [Read page](https://ratstack.sh/lore/build-time-work-stays-out-of-requests)

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

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

- Effect + Alchemy peer patterns → Source-grounded patterns from repos on nearby Effect and Alchemy pins. → [Read page](https://ratstack.sh/resources/same-version-repos)

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

- One snippet model feeds both renderers → HTML and agent Markdown derive their code, repository, commit, path, and line numbers from the same snippet. → [Read page](https://ratstack.sh/lore/one-snippet-model-two-renderers)

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