# Pi Verify - Auto-Verification for Pi

**Two-agent system: builder runs, verifier checks, auto-corrects.**

Inspired by [disler/the-verifier-agent](https://github.com/disler/the-verifier-agent)

## Why

> Tokens are cheap. Your time is not.

Manual review takes 50% of your day. pi-verify moves that to a second agent.

## How It Works

```
BUILDER (pi) ──► session.jsonl ──► VERIFIER (pi)
    ▲                                    │
    │        sendUserMessage()            │
    └────────────────────────────────────┘
```

1. Builder Pi runs in your terminal
2. Verifier Pi watches the session
3. After each turn, auto-checks:
   - Files created exist
   - Syntax valid
   - Tests pass
   - No dangerous commands
4. If issues → feedback loop (max 3x)
5. Still failing → human escalation

## Confidence Grades

| Grade | Meaning |
|-------|---------|
| PERFECT | All checks pass |
| VERIFIED | Minor suggestions |
| PARTIAL | Some issues |
| FAILED | Major problems |

## Installation

```bash
npm install @artale/pi-verify
```

## Usage

```bash
# Enable verification
/verify on

# Check status
/verify status

# Disable
/verify off
```

## Architecture

- **Extension**: `./src/extension.ts` - Pi integration
- **Script**: `verify.sh` - Unix socket watcher
- **Config**: `MAX_LOOPS=3` - Loop limit

## The Pattern

1. Defense in depth bash
2. Deterministic session.jsonl
3. Read-only verifier tools
4. Only verifier_prompt touches builder
5. Max loops, then human escalation