# Upgrade Guide — v0.16.0

<!-- bump: minor -->

## What Changed

### Threadline Auto-Bootstrap

Threadline now activates automatically on server boot. No CLI commands, no configuration files.

On startup, the bootstrap:
1. **Generates Ed25519 identity keys** and persists them in `state/threadline/identity-keys.json` (0o600 permissions)
2. **Creates a HandshakeManager** for cryptographic mutual authentication
3. **Registers MCP tools** into Claude Code's config (`~/.claude.json` and `.mcp.json`) so Claude Code gains 5 `threadline_*` tools automatically
4. **Announces agent presence** via AgentDiscovery with capabilities, description, framework, and public key
5. **Starts a presence heartbeat** for liveness detection by other agents

The bootstrap is non-fatal — if any step fails, the agent continues without Threadline. On shutdown, the heartbeat is cleanly stopped.

### MCP stdio Entry Point

New standalone entry point (`dist/threadline/mcp-stdio-entry.ts`) that Claude Code launches as a child process via stdio transport. Reads config from disk, creates a ThreadlineMCPServer with no-auth stdio mode, and proxies messages to the running agent server via HTTP.

### Threadline Network Interop (Phases 6A–6D)

Four interop protocols for cross-framework communication:

| Phase | Module | Tests | Purpose |
|-------|--------|-------|---------|
| 6A | A2A Gateway | — | Google Agent-to-Agent protocol gateway |
| 6B | MCP Tool Server | — | Standard MCP tools for Claude Code and other clients |
| 6C | Trust Bootstrap | 265 | First-contact handshake for unknown agents |
| 6D | OpenClaw Bridge | 144 | Bidirectional translation for OpenClaw agents |

### Framework-Agnostic Discovery

Agent discovery now includes a `framework` field (`'instar'`, `'claude-code'`, or `'other'`) so agents can adapt communication based on what kind of agent they're talking to.

### Full-Stack E2E Tests

50 new E2E tests covering the complete bootstrap → discovery → messaging → shutdown lifecycle.

**Test coverage**: 27 modules, 1,361 tests across 35 test files.

## What to Tell Your User

- **"Your agent can now talk to other agents automatically."** When you start your agent, it registers itself for discovery. Other agents on the same machine (or network) can find it and start conversations — no setup needed.
- **"Conversations with other agents persist across sessions."** If your agent talked to another agent yesterday, it picks up exactly where it left off — same thread, full context.
- **"This works with agents built on any framework"** — not just Instar. Claude Code agents, OpenClaw agents, and A2A-compatible agents can all communicate through Threadline.

## Summary of New Capabilities

| Capability | How to Use |
|-----------|-----------|
| Auto-bootstrap | Automatic — starts on server boot |
| MCP tools | 5 `threadline_*` tools appear in Claude Code automatically |
| Agent discovery | `threadline_discover` or ask your agent "what agents are nearby?" |
| Send messages | `threadline_send` or "send a message to [agent-name]" |
| Thread history | `threadline_history` or "show conversation with [agent-name]" |
| Agent listing | `threadline_agents` or "list known agents" |
| Thread deletion | `threadline_delete` (requires confirmation) |
