# Intent governance for the AI‑natives.

Catch drifts before they catch you.

You fight drift with LLM cleanups. The LLM says "all clean" — but it only covered what fit in the context window. The rest rots. Next PR adds fresh contradictions. The token costs of false starts and misdirections pile up. Pituitary indexes the entire corpus and checks all of it, structurally, every time. This is Karpathy's "Linting" layer for LLM Knowledge Bases — except it already exists.

View on GitHub Quick Start

What It Catches

## You fight drift every week. You're losing.

✗

### Overlapping decisions

A new spec covers ground an existing one already handles. Your last cleanup didn't catch it because both looked fine in isolation.

⚠

### Stale docs

A spec changed, but the CLAUDE.md, AGENTS.md, runbooks, and guides that reference it weren't updated.

⇄

### Code that contradicts specs

Pipe your diff in before you merge. Catch conflicts with accepted decisions at PR time.

↔

### Terminology drift

The team adopted new language but old terms persist across your docs and specs.

⏳

### Stale specs

A spec hasn't been reviewed since the code it governs changed. `check-spec-freshness` flags it.

⚙

### Compile to patch

Turn terminology findings into context-aware edits that distinguish prose from identifiers from historical entries.

What It Becomes

## Replaces the treadmill with a structural guarantee.

Detecting drift is step one. Pituitary becomes the governance layer that replaces ad-hoc LLM cleanups with full-corpus verification — slashing the token costs of false starts and misdirections caused by drifting specs, conflicting decisions, and obsolete docs.

≡

### Terminology policies

Declare canonical terms in config. Pituitary separates actionable violations from tolerated historical uses and suggests replacements.

⚙

### Compile

Turn terminology findings into patches. `pituitary compile --dry-run` generates context-aware edits that distinguish prose from identifiers from historical entries — then apply them in one pass.

→

### Diff-aware pre-merge checks

Pipe your PR diff in. Catch stale docs and spec contradictions before merge, not during quarterly audits.

⊞

### Multi-repo: single point of truth

Across multiple repositories, Pituitary becomes obligatory — the single place where cross-repo governance converges. Bind sources to named repo roots; all output carries repo identity so results stay unambiguous.

✻

### Role-aware drift

CLAUDE.md, AGENTS.md, runbooks, and architecture docs have different governance roles. Pituitary understands the difference.

☷

### Evidence chains

Section-level source refs, classification, link reasons, and suggested edits — in JSON. Machine-readable provenance for agent consumption or shareable HTML reports.

Real-World Results

## Pituitary rescued a project that was silently derailing.

The CCD framework repo — 11 specs, 29 docs, 5 canonical skills — was plagued by doc drifts, runtime contract contradictions, and deprecated terminology surfacing everywhere. The team had been running LLM cleanups that kept declaring victory. Pituitary found what those cleanups missed — because it checks the entire corpus, not a context-window sample. All models ran locally on M2 Ultra. No data left the machine.

90
deprecated-term violations
22
artifacts flagged
7
semantic contradictions

Read the full use case →

Quick Start

## 30 seconds to first finding.

Single binary (pure Go, no CGO). No Docker. No API keys required. One SQLite file.

# macOS
brew install dusk-network/tap/pituitary
# Linux / macOS (auto-detect platform, verify checksum)
curl -fsSL https://raw.githubusercontent.com/dusk-network/pituitary/main/scripts/install.sh | sh
# Manual: download from GitHub Releases, then:
tar xzf pituitary_*_*.tar.gz
sudo install pituitary /usr/local/bin/
$ pituitary init --path . # discover, index, report
$ pituitary check-doc-drift --scope all # find stale docs
$ pituitary check-terminology --scope all # audit terminology
$ pituitary compile --dry-run # preview patches
$ pituitary review-spec --path specs/X # full composite review
$ git diff origin/main...HEAD | pituitary check-compliance --diff-file -

Deterministic by default. Optionally plug in any OpenAI-compatible embedding API for deeper semantic retrieval. Runtime docs →

For Your AI Coding Assistant

## Your agent creates drift. Now make it fix drift.

Every AI session starts blind. Your agent proposes changes against specs it hasn't read, uses terminology the team deprecated two sprints ago, generates docs that contradict accepted decisions. You clean up after it, but the cleanup is another LLM session with the same partial view. The drift compounds.

Add the MCP server and your agent gets 13 governance tools backed by the full corpus index — not a context-window sample. It stops guessing and starts building against what you actually decided.

{
"mcpServers": {
"pituitary": {
"command": "pituitary",
"args": ["serve", "--config", ".pituitary/pituitary.toml"]
}
}
}

Evidence chains carry `content_trust` metadata so agents treat returned workspace text as untrusted input. `pituitary schema <command>` lets agents inspect contracts at runtime.

Claude Code Cowork Cursor Windsurf Cline Codex CLI Gemini CLI

In CI

## Catch contradictions before they reach main.

The shipped GitHub Action runs `review-spec` on PRs that touch specs and posts the report as a PR comment.

steps:
- uses: dusk-network/pituitary@v1.0.0-beta.7
with:
fail-on: error
# Or add spec checks alongside your linter:
- run: pituitary index --rebuild
- run: git diff origin/main...HEAD | pituitary check-compliance --diff-file -
- run: git diff origin/main...HEAD | pituitary check-doc-drift --diff-file -

Architecture

## Deterministic core. No embedded agent.

Single SQLite file with atomic rebuilds. CLI-first — the MCP server wraps the same analysis packages. Kernel stays pure; extensions register via `sdk.Register()` and compile into one binary.

Read ARCHITECTURE.md →