> For the complete documentation index, see [llms.txt](https://gotts.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gotts.gitbook.io/docs/gotts-vaults/vault/05-local-dev.md).

# Local Development

> **Part of**: [Vault PRD](/docs/gotts-vaults/vault.md) | **Last Updated**: 2026-02-21 | **Package**: `packages/vault/`

***

## Prerequisite: Devenv (Protocol Infrastructure Layer)

This document describes the **vault application layer** of the local development environment. It assumes a fully deployed Uniswap protocol stack is already running.

The protocol stack — WETH9, Permit2, V2, V3, V4, Universal Router, UniswapX reactors, ERC-8004 registries, and mock token liquidity — is specified in [**prd/devenv/**](/docs/devenv/devenv.md) and lives in `packages/devenv/` (`@gotts.ai/devenv`).

The vault testnet (`pnpm testnet`) calls `deployUniswapStack()` from `@gotts.ai/devenv` as its first step, then layers vault-specific contracts on top:

```
pnpm testnet (vault layer)
    │
    ├── @gotts.ai/devenv deployUniswapStack()   ← prd/devenv/ covers this
    │       - Anvil (--hardfork cancun --code-size-limit 30000)
    │       - WETH9, Permit2, V2, V3, V4 PoolManager + periphery
    │       - Universal Router, UniswapX reactors, ERC-8004 registries
    │       - Mock tokens + seeded liquidity across all protocols
    │       - Returns: UniswapDeployment (addresses, test accounts)
    │
    └── Vault deployment (this document covers this)
            - AgentVaultFactory (CREATE2)
            - Mock ERC-8004 registries (from-scratch mode only)
            - 5 test agents (Alice/Bob/Carol/Dave/Eve)
            - 3 sample vaults
            - Vault MCP server (:8080)
            - Vault debug UI (:3000)
```

The vault debug UI runs on port 3000; the devenv protocol explorer runs on port 3001. Both can be open simultaneously.

For environment variables, the vault testnet reads from `.env` (vault-specific config). The devenv layer reads from `.env.devenv`. Keep these separate to avoid collision.

***

## Local Development & Testnet

### One-Command Setup

```bash
pnpm testnet
```

This single command orchestrates the full local development environment:

1. **Start Anvil** — fork Base mainnet at a deterministic block, fast block times (1s)
2. **Deploy factory** — `DeployLocal.s.sol` deploys AgentVaultFactory, mock ERC-8004 registries, and seeds the factory with initial vaults
3. **Seed test data** — `seed-testnet.sh` registers 5 test agents with varying reputation, funds accounts, and creates 3 sample vaults via the factory
4. **Start vault server** — launches standalone MCP server on HTTP transport (port 8080)
5. **Start debug UI** — launches Vite dev server (port 3000) connected to vault server

### What `pnpm testnet` Creates

```
# 1. Anvil forks Base mainnet (or starts fresh)
# 2. Deploy AgentVaultFactory via CREATE2
# 3. Deploy mock ERC-8004 Identity + Reputation registries
# 4. Seed 5 test agents with varying reputation:
#    - Alice (trusted, rep=120):  Creates "CCA Hunter" vault (CCA + Hook enabled)
#    - Bob (verified, rep=60):    Creates "Simple Yield" vault (no CCA, no hook)
#    - Carol (basic, rep=15):     Deposits into Alice's vault
#    - Dave (unverified, rep=0):  Deposits into Bob's vault (hits tier limits)
#    - Eve (sovereign, rep=600):  Creates "Meta-Vault" that deposits into Alice + Bob
# 5. Start vault MCP server (stdio + HTTP on :8080 + WS on :8081)
# 6. Start debug UI on :3000
```

### Anvil Fork Configuration

```bash
# scripts/testnet.sh
anvil \
  --fork-url $BASE_RPC_URL \
  --fork-block-number ${ANVIL_FORK_BLOCK:-latest} \
  --block-time 1 \
  --accounts 10 \
  --balance 10000 \
  --port 8545 \
  --chain-id 8453
```

Key properties:

* **Fork source**: Base mainnet (real Uniswap V4 PoolManager, real token contracts)
* **Deterministic addresses**: Same Anvil accounts every run for reproducible testing
* **Fast blocks**: 1-second block times for rapid iteration
* **Chain ID 8453**: Matches Base mainnet so contract addresses resolve correctly

### DeployLocal.s.sol

Foundry deployment script for the local testnet:

```solidity
contract DeployLocal is Script {
    function run() external {
        vm.startBroadcast();

        // 1. Deploy mock ERC-8004 registries (not available on forked Base)
        MockIdentityRegistry identity = new MockIdentityRegistry();
        MockReputationRegistry reputation = new MockReputationRegistry();

        // 2. Deploy AgentVaultFactory (the core protocol contract)
        AgentVaultFactory factory = new AgentVaultFactory(
            address(identity),   // identity registry
            address(reputation), // reputation registry
            poolManager          // V4 PoolManager
        );

        // 3. Register test agents on mock registries
        identity.registerAgent(1, alice);   // Alice: trusted
        identity.registerAgent(2, bob);     // Bob: verified
        identity.registerAgent(3, carol);   // Carol: basic
        identity.registerAgent(4, dave);    // Dave: unverified
        identity.registerAgent(5, eve);     // Eve: sovereign
        reputation.setScore(1, 120);
        reputation.setScore(2, 60);
        reputation.setScore(3, 15);
        reputation.setScore(4, 0);
        reputation.setScore(5, 600);

        // 4. Create sample vaults via factory (as Alice, Bob, Eve)
        vm.prank(alice);
        (address aliceVault,) = factory.createVault(VaultConfig({
            baseAsset: USDC_BASE,
            creatorAgentId: 1,
            managementFeeBps: 200,    // 2%
            performanceFeeBps: 2000,  // 20%
            minReputation: 10,
            ccaEnabled: true,
            hookEnabled: true,
            hookConfig: defaultHookConfig,
            metadataURI: "ipfs://alice-cca-hunter"
        }));

        vm.prank(bob);
        (address bobVault,) = factory.createVault(VaultConfig({
            baseAsset: USDC_BASE,
            creatorAgentId: 2,
            managementFeeBps: 100,    // 1%
            performanceFeeBps: 1000,  // 10%
            minReputation: 0,
            ccaEnabled: false,
            hookEnabled: false,
            hookConfig: emptyHookConfig,
            metadataURI: "ipfs://bob-simple-yield"
        }));

        vm.stopBroadcast();

        console.log("VAULT_FACTORY_ADDRESS=%s", address(factory));
        console.log("ALICE_VAULT=%s", aliceVault);
        console.log("BOB_VAULT=%s", bobVault);
        console.log("IDENTITY_REGISTRY=%s", address(identity));
    }
}
```

### Pre-Configured Test Agents

`seed-testnet.sh` registers 5 agents with varying tiers and known addresses:

| Agent | ID | Tier       | Rep Score | Funded             | Purpose                                            |
| ----- | -- | ---------- | --------- | ------------------ | -------------------------------------------------- |
| Alice | 1  | trusted    | 120       | 100K USDC + 10 ETH | Creates "CCA Hunter" vault, full rebalance testing |
| Bob   | 2  | verified   | 60        | 50K USDC + 5 ETH   | Creates "Simple Yield" vault, standard testing     |
| Carol | 3  | basic      | 15        | 10K USDC + 1 ETH   | Deposits into Alice's vault, tier limit testing    |
| Dave  | 4  | unverified | 0         | 1K USDC + 0.5 ETH  | Deposits into Bob's vault, rejection testing       |
| Eve   | 5  | sovereign  | 600       | 200K USDC + 20 ETH | Creates "Meta-Vault", unlimited tier testing       |

All addresses are derived from Anvil's deterministic HD wallet (`m/44'/60'/0'/0/{0-4}`).

### Development Workflow After Testnet

Once `pnpm testnet` has the environment running:

```bash
# Restart just the server + UI (contracts persist on Anvil)
pnpm dev

# Run integration tests against the local Anvil fork
pnpm test:integration

# Run unit tests (no Anvil required)
pnpm test

# Run required invariant tests (MUST pass before merge — see 10-safety.md "Required Invariants")
pnpm test:invariant
```

> **CI Gate**: The `pnpm test:invariant` command runs all ERC-4626, V4 hook, Oracle/NAV, and adapter conservation invariants defined in [10-safety.md](/docs/gotts-vaults/vault/10-safety.md) Section "Required Invariants (Must Pass in CI)". This includes >=10,000 runs per handler-based invariant and the a16z ERC-4626 property test suite. PRs that fail invariant tests are blocked from merge.

### Integration Test Example

```typescript
import { VaultFactoryClient, VaultClient } from "../sdk/src/index.js";

describe("Factory vault lifecycle on Anvil fork", () => {
  it("create vault → deposit → rebalance → withdraw with yield", async () => {
    const factory = new VaultFactoryClient({
      factoryAddress: process.env.VAULT_FACTORY_ADDRESS as Address,
      chainId: 8453,
      rpcUrl: "http://localhost:8545",
      walletProvider: anvilWallet(0), // Alice
    });

    // Create a new vault via factory
    const { vaultAddress } = await factory.createVault({
      agentId: "1",
      baseAsset: USDC_BASE,
      managementFeeBps: 200,
      performanceFeeBps: 2000,
    });

    const client = new VaultClient({
      vaultAddress,
      chainId: 8453,
      rpcUrl: "http://localhost:8545",
      walletProvider: anvilWallet(2), // Carol deposits
    });

    // Deposit
    const deposit = await client.deposit("3", "10000");
    expect(deposit.shares).toBeGreaterThan(0n);

    // Rebalance (as Alice, the creator)
    const manager = new VaultClient({
      vaultAddress,
      chainId: 8453,
      rpcUrl: "http://localhost:8545",
      walletProvider: anvilWallet(0),
    });
    const rebalance = await manager.rebalance("1");
    expect(rebalance.txHashes.length).toBeGreaterThan(0);

    // Fast-forward time for fee accumulation
    await anvil.increaseTime(86400 * 30); // 30 days
    await anvil.mine();

    // Withdraw with yield
    const withdraw = await client.withdraw("3", "max");
    expect(BigInt(withdraw.assetsReturned)).toBeGreaterThan(10000n * 10n ** 6n);
  });
});
```

***

## Debug UI

### Purpose

The debug UI is a **developer-facing** tool for visualizing vault factory state and interactively testing MCP tools during local development. It is not a production frontend (see NG3). It connects to the vault MCP server via HTTP+SSE on `localhost:8080`.

### Tech Stack

| Library               | Version | Purpose                                      |
| --------------------- | ------- | -------------------------------------------- |
| React                 | ^19.0   | UI framework                                 |
| Vite                  | ^6.0    | Dev server and build                         |
| TailwindCSS           | ^4.0    | Utility-first styling                        |
| wagmi                 | ^2.0    | Ethereum wallet hooks (for Anvil connection) |
| @tanstack/react-query | ^5.0    | Data fetching, caching, auto-refresh         |
| recharts              | ^2.0    | Charts for TVL, APY, position visualization  |

### Six Views

#### Factory Dashboard

Primary view showing factory-wide health at a glance:

```
┌─────────────────────────────────────────────────────────────────┐
│  Agentic Vault Factory Dashboard                  [localhost]    │
├─────────────┬──────────────┬──────────────┬─────────────────────┤
│  Vaults     │  Total TVL    │  Agents      │  CCA Bids Active   │
│  3          │  $360,000     │  5           │  0                  │
├─────────────┴──────────────┴──────────────┴─────────────────────┤
│  Vault Registry                                                  │
│  ┌───────────────────────────────────────────────────────────┐  │
│  │ Alice's CCA Hunter │ TVL: $110K │ CCA+Hook │ Rep≥10     │  │
│  │ Bob's Simple Yield  │ TVL: $51K  │ Basic    │ Open       │  │
│  │ Eve's Meta-Vault    │ TVL: $199K │ Meta     │ Rep≥50     │  │
│  └───────────────────────────────────────────────────────────┘  │
├──────────────────────────────────────────────────────────────────┤
│  Recent Factory Events                                           │
│  12:05:32  VaultCreated     Agent #5 (Eve)   Meta-Vault     ✓  │
│  12:04:18  vault_deposit    Agent #3 → Alice's vault         ✓  │
│  12:03:01  VaultCreated     Agent #1 (Alice) CCA Hunter      ✓  │
└──────────────────────────────────────────────────────────────────┘
```

#### Vault Detail

Single-vault view showing positions, performance, depositor agents, share price chart, and risk score.

#### Positions

Detailed LP + CCA position view with tick range visualization, fee accrual, IL tracking, and CCA bid status.

#### Agents

Registry of all agents across the factory: agent ID, wallet address, tier, reputation score, shares held across vaults, deposit history.

> **Shared Components**: The Agents view and the swarm Agent Comparison / Interaction Graph views below share chart and card components with the Portal Agent Management Dashboard. The `ReputationChart`, `PortfolioValueChart`, `TierProgressionBar`, and `InteractionGraph` components are defined in the shared design system — see [prd/website/design/01-overview.md, §6.2 Shared Dashboard Components](https://github.com/wpank/gotts.ai-monorepo/blob/main/website/design/01-overview.md). The debug UI uses these components with mock/Anvil data; the Portal uses the same components with live MCP server data.

#### CCA Monitor

Active CCA auction bids: auction address, bid amount, max price, clearing price, fill status, graduation progress.

#### Tool Tester

Interactive form-based interface to invoke any of the 22 vault MCP tools:

* Dropdown to select tool (e.g., `create_vault`, `submit_cca_bid`)
* Auto-generated form fields from tool's zod schema
* Pre-filled agent IDs from test agents (Alice, Bob, Carol, Dave, Eve)
* Vault address dropdown populated from factory registry
* JSON response display with syntax highlighting
* Request/response history log

### MCP Client

The debug UI connects to the vault server via an HTTP MCP client:

```typescript
// ui/src/lib/mcp-client.ts
class HttpMcpClient {
  constructor(private baseUrl: string = "http://localhost:8080") {}

  async callTool(name: string, args: Record<string, unknown>) {
    const res = await fetch(`${this.baseUrl}/mcp`, {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        jsonrpc: "2.0",
        method: "tools/call",
        params: { name, arguments: args },
        id: crypto.randomUUID(),
      }),
    });
    return res.json();
  }
}
```

### React Query Hooks

Auto-refreshing hooks for factory and vault state:

```typescript
// ui/src/hooks/useFactoryState.ts
export function useFactoryState() {
  const client = useMcpClient();
  return useQuery({
    queryKey: ["factory", "vaults"],
    queryFn: () => client.callTool("list_vaults", {}),
    refetchInterval: 10_000, // 10s auto-refresh
  });
}

// ui/src/hooks/useVaultState.ts
export function useVaultState(vaultAddress: string) {
  const client = useMcpClient();
  return useQuery({
    queryKey: ["vault", vaultAddress, "state"],
    queryFn: () => client.callTool("vault_get_state", { vaultAddress }),
    refetchInterval: 5_000,
  });
}
```

***

## Multi-Agent Local Simulation

### Purpose

One command starts N autonomous agents — OpenClaw instances, Claude agents, or any MCP-compatible client — each with their own wallet, identity, and strategy, all interacting with the local Anvil testnet. The developer watches the swarm in the debug UI and iterates on agent behavior before deploying to mainnet.

This is the primary tool for validating that the protocol works end-to-end with real agent interactions, not just unit tests against individual contracts.

### One-Command Swarm

```bash
# Full swarm: Anvil + factory + 5 agents + MCP servers + debug UI
pnpm testnet:swarm
```

### What `pnpm testnet:swarm` Does

Building on `pnpm testnet`, the swarm command adds autonomous agents:

1. **Everything from `pnpm testnet`** — Anvil fork, factory deployment, mock registries, seed data
2. **Start 5 independent MCP server instances** — one per agent, each with its own stdio pipe and wallet
3. **Each agent gets**: wallet (from Anvil's deterministic keys), ERC-8004 identity (pre-registered), wallet policy (pre-configured)
4. **Each agent runs a different strategy profile** driven by prompt templates:
   * **Alice-agent**: Vault creator — scans for opportunities, deploys vaults
   * **Bob-agent**: Conservative allocator — deposits only into high-reputation vaults
   * **Carol-agent**: Aggressive allocator — chases highest APY
   * **Dave-agent**: New agent — hits tier limits, builds reputation
   * **Eve-agent**: Meta-vault operator — allocates across other vaults
5. **Agent behavior is driven by prompt templates** in `scripts/agent-profiles/`
6. **Debug UI shows real-time agent activity feed**, vault state changes, reputation updates

### Agent Profile Templates

```
scripts/agent-profiles/
  alice-creator.md     # System prompt for vault creator agent
  bob-conservative.md  # System prompt for conservative allocator
  carol-aggressive.md  # System prompt for aggressive yield chaser
  dave-newbie.md       # System prompt for new unverified agent
  eve-meta.md          # System prompt for meta-vault operator
```

Each profile is a system prompt + MCP server config that defines an agent's personality, risk tolerance, and strategy.

**Example profile — Bob (Conservative Allocator)**:

```markdown
You are a conservative yield agent operating on Gotts Vaults.
Your wallet: {wallet_address}. Your agent ID: 2. Your reputation: 60 (Verified tier).

Rules:

- Only deposit into vaults where creator reputation >= 50
- Maximum 30% of capital in any single vault
- Prefer Simple Yield vaults over CCA-enabled vaults
- Check vault performance weekly, withdraw if 7d APY < 2%
- Never deposit more than your tier limit ($50,000 per vault)

Available tools:

- list_vaults, get_vault_config, vault_simulate_deposit, vault_deposit
- vault_withdraw, vault_get_agent_shares, vault_get_performance
- vault_get_agent_reputation
```

**Example profile — Alice (Vault Creator)**:

```markdown
You are a vault creator agent on Gotts Vaults.
Your wallet: {wallet_address}. Your agent ID: 1. Your reputation: 120 (Trusted tier).

Rules:

- Create Simple Yield vaults when you detect underserved base assets
- Set management fee at 1.5%, performance fee at 15%
- Set minimum reputation to 0 (open to all depositors)
- Monitor your vaults: if TVL < $10K after 7 days, consider adjusting strategy
- Never create more than 3 vaults simultaneously

Available tools:

- create_vault, list_vaults, get_vault_config, vault_get_state
- vault_get_performance, vault_get_risk_metrics, vault_get_agent_reputation
```

### MCP Server Configuration Per Agent

Each agent runs its own vault MCP server instance with agent-specific configuration:

```typescript
// scripts/spawn-agent.ts
interface AgentConfig {
  id: number;
  handle: string;
  profile: string; // Path to prompt template
  walletKey: string; // Anvil deterministic key
  reputation: number;
  fundedUsdc: string;
  fundedEth: string;
}

const agents: AgentConfig[] = [
  {
    id: 1,
    handle: "alice",
    profile: "alice-creator.md",
    walletKey: ANVIL_KEYS[0],
    reputation: 120,
    fundedUsdc: "100000",
    fundedEth: "10",
  },
  {
    id: 2,
    handle: "bob",
    profile: "bob-conservative.md",
    walletKey: ANVIL_KEYS[1],
    reputation: 60,
    fundedUsdc: "50000",
    fundedEth: "5",
  },
  {
    id: 3,
    handle: "carol",
    profile: "carol-aggressive.md",
    walletKey: ANVIL_KEYS[2],
    reputation: 15,
    fundedUsdc: "10000",
    fundedEth: "1",
  },
  {
    id: 4,
    handle: "dave",
    profile: "dave-newbie.md",
    walletKey: ANVIL_KEYS[3],
    reputation: 0,
    fundedUsdc: "1000",
    fundedEth: "0.5",
  },
  {
    id: 5,
    handle: "eve",
    profile: "eve-meta.md",
    walletKey: ANVIL_KEYS[4],
    reputation: 600,
    fundedUsdc: "200000",
    fundedEth: "20",
  },
];
```

### Minimal Script Commands

```bash
# Start just the testnet (no agents)
pnpm testnet

# Start testnet + 5 autonomous agents
pnpm testnet:swarm

# Start testnet + custom number of agents
pnpm testnet:swarm --agents 3

# Add a single agent to a running testnet
pnpm agent:spawn --profile alice-creator

# Stop all agents but keep testnet running
pnpm agent:stop-all

# Time-travel: fast-forward 30 days to see fee accumulation
pnpm testnet:advance 30d

# View agent activity logs
pnpm agent:logs

# View a specific agent's log
pnpm agent:logs --agent alice
```

### Agent Activity Logging

Every agent action is logged to `logs/agents/` with structured JSON entries:

```json
{
  "timestamp": "2026-02-13T10:30:00Z",
  "agent": "bob",
  "agentId": 2,
  "action": "vault_deposit",
  "params": {
    "vaultAddress": "0x...alice-vault",
    "assets": "10000000000"
  },
  "result": {
    "status": "success",
    "shares": "9985000000",
    "txHash": "0xabc...123"
  }
}
```

### Debug UI — Swarm Views

Three additional views in the debug UI for swarm monitoring:

#### Agent Activity Feed

Real-time log of all agent actions across the swarm, color-coded by agent:

```
┌──────────────────────────────────────────────────────────────┐
│  Agent Activity Feed                           [Live ●]       │
├──────────────────────────────────────────────────────────────┤
│  10:32:15  Alice  create_vault     Simple Yield (USDC)    ✓  │
│  10:32:18  Bob    list_vaults      Found 2 vaults         ✓  │
│  10:32:20  Bob    vault_deposit    → Alice's vault  $10K  ✓  │
│  10:32:22  Carol  list_vaults      Found 2 vaults         ✓  │
│  10:32:24  Carol  vault_deposit    → Alice's vault  $5K   ✓  │
│  10:32:25  Dave   vault_deposit    → Bob's vault    $1K   ✗  │
│            ERROR: Exceeds tier limit (Unverified: $1,000)    │
│  10:32:30  Eve    list_vaults      Found 3 vaults         ✓  │
│  10:32:32  Eve    create_vault     Meta-Vault (USDC)      ✓  │
│  10:32:35  Eve    vault_deposit    → Alice's vault  $50K  ✓  │
└──────────────────────────────────────────────────────────────┘
```

#### Agent Comparison View

Side-by-side portfolio performance of all active agents:

```
┌──────────────────────────────────────────────────────────────┐
│  Agent Comparison                                             │
├──────────┬──────────┬──────────┬──────────┬──────────────────┤
│  Agent   │  Capital │  Deployed│  P&L     │  Tier            │
├──────────┼──────────┼──────────┼──────────┼──────────────────┤
│  Alice   │  $100K   │  $0 (cr) │  +$150   │  Trusted (120)   │
│  Bob     │  $50K    │  $40K    │  +$45    │  Verified (60)   │
│  Carol   │  $10K    │  $10K    │  +$12    │  Basic (15)      │
│  Dave    │  $1K     │  $500    │  -$0.10  │  Unverified (0)  │
│  Eve     │  $200K   │  $150K   │  +$180   │  Sovereign (600) │
└──────────┴──────────┴──────────┴──────────┴──────────────────┘
```

#### Interaction Graph

Visualization of which agents deposited into which vaults:

```
┌──────────────────────────────────────────────────────────────┐
│  Interaction Graph                                            │
│                                                               │
│  Alice ──creates──► [CCA Hunter Vault]                       │
│                         ▲         ▲                          │
│                         │         │                          │
│  Carol ──deposits──────┘         │                          │
│                                   │                          │
│  Eve ──deposits──────────────────┘                          │
│                                                               │
│  Bob ──creates──► [Simple Yield Vault]                       │
│                         ▲                                    │
│                         │                                    │
│  Dave ──deposits───────┘                                    │
│                                                               │
│  Eve ──creates──► [Meta-Vault] ──deposits──► Alice's Vault  │
│                                ──deposits──► Bob's Vault     │
└──────────────────────────────────────────────────────────────┘
```

### Testing Multi-Agent Scenarios

Common scenarios to validate with the swarm:

| Scenario                    | What to Verify                                               | Agents Involved                             |
| --------------------------- | ------------------------------------------------------------ | ------------------------------------------- |
| **Tier enforcement**        | Dave's deposit is rejected when over $1K                     | Dave → Bob's vault                          |
| **Reputation-gated access** | Dave cannot deposit into a vault with minReputation=10       | Dave → Alice's vault                        |
| **Competing allocators**    | Bob and Carol make different choices based on risk tolerance | Bob, Carol → all vaults                     |
| **Meta-vault composition**  | Eve's meta-vault correctly deposits into underlying vaults   | Eve → Alice, Bob vaults                     |
| **Time-dependent behavior** | After time-travel, agents check performance and rebalance    | All agents after `pnpm testnet:advance 30d` |
| **Reputation building**     | After positive interactions, Dave's tier should increase     | Dave reputation feedback                    |

### Graduating from Local to Testnet to Mainnet

```
1. LOCAL (pnpm testnet:swarm)
   - Anvil fork, fake wallets, mock registries, instant blocks
   - Perfect for rapid iteration and debugging
        │
        ▼
2. BASE SEPOLIA TESTNET
   - Real network, real gas (faucet), real ERC-8004 registries
   - Swap Anvil keys for testnet wallet (Privy test mode)
   - Set RPC_URL=https://sepolia.base.org
        │
        ▼
3. BASE MAINNET
   - Production wallet (Privy server wallet)
   - Full policy engine enabled
   - Real USDC, real gas costs (~$0.01/tx)
   - Follow security checklist from 00-quickstart.md
```
