# Upgrade Guide — v0.10.6

## What Changed

### Claim Intercept Hooks

Two new hooks that catch false operational claims by cross-checking agent output against Canonical State:

- **claim-intercept.js** (PostToolUse): Monitors Bash, Write, and Edit tool output for denial patterns. When a denial is detected near a keyword from `quick-facts.json` or `project-registry.json`, injects a warning via `additionalContext`. Never blocks — warns only.

- **claim-intercept-response.js** (Stop): Monitors the agent's direct text responses. Same detection logic but **blocks** the response (exit code 2) and forces the agent to correct itself. Guards against infinite loops via `stop_hook_active` flag.

**Detection architecture:**
1. Regex fast-path: 9 denial pattern templates (can't, don't have access, not configured, unavailable, needs human, outside scope, etc.)
2. Canonical State cross-check: Only contradicts when denial keyword appears within 100 chars of a known fact or project name
3. Rate limiting: Max 1 check per 10 seconds (shared rate file between both hooks)

**Exemptions:** Line-numbered output, git diffs, git log, node_modules paths, and test file output are automatically skipped.

### Comprehensive E2E Test Suite

117 tests across 20 phases covering the full claim-intercept pipeline. Tests run the actual hooks as Node.js subprocesses — same execution path as production.

## What to Tell Your User

- **"Your agent can no longer gaslight itself"**: If the agent says "I can't access the database" when it's registered in canonical state, it gets caught and corrected automatically.

## Summary of New Capabilities

| Capability | How to Use |
|-----------|-----------|
| Claim intercept (tool output) | Automatic — PostToolUse hook on Bash/Write/Edit |
| Claim intercept (responses) | Automatic — Stop hook on agent text |
| Rate limiting | Shared 10s cooldown prevents latency stacking |
| Contradiction logging | `.instar/state/claim-intercept.log` |
