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

Free workshop: [how to burn a trillion tokens and get good results](/tokenmaxx#interested).

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, not replacement text or a failed build.

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 lacks the 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 → 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)

- learn-rat-stack → See how Effect, XState, TypeScript, Alchemy, and four agent interfaces fit together. → [Read page](https://ratstack.sh/skills/learn-rat-stack)

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

- One snippet model feeds both renderers → HTML and agent Markdown derive their code and provenance 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)
