# Upgrade Guide — v0.17.2

<!-- bump: patch -->

## What Changed

### Job Run History — Full Experience Loop

The persistent job history system now captures the complete experience loop for every job execution, not just metadata:

1. **Output capture**: When a job session completes, the last ~1000 characters of session output are captured and stored as `outputSummary` in the run record. This gives visibility into what the job actually did.

2. **LLM reflection**: After every completed job (not just when `livingSkills` is enabled), an LLM reflection is generated and persisted. Each reflection includes: summary of what happened, strengths, areas for improvement, deviation analysis, purpose drift detection, and suggested changes. This is stored in the `reflection` field of the run record.

3. **Permanent retention**: Job run history is never deleted. On startup, the JSONL ledger is compacted (deduplicating pending → completed pairs) but no records are ever removed. History is memory, and memory should never be lost.

4. **Monotonic run IDs**: RunIds now include a monotonic counter to prevent collisions when multiple jobs trigger within the same millisecond.

5. **Robust test coverage**: Full e2e test suite exercising the HTTP path (trigger job via API → scheduler records history → query via API), plus comprehensive unit tests for the JobRunHistory class.

### Tunnel Manager — Named Tunnel Resilience

The TunnelManager now handles named tunnel reconnection more robustly, with exponential backoff and automatic restart on failure.

### Orphan Process Reaper — Improved Cleanup

The OrphanProcessReaper now handles edge cases in process tree traversal more gracefully.

## What to Tell Your User

- **"Your agent now learns from every job it runs."** After each job completes, the agent reflects on what happened — what went well, what could improve, and whether the job is drifting from its intended purpose. These reflections are saved permanently.
- **"Job history is now permanent."** Nothing is ever deleted from job run history. Your agent builds a complete record of everything it has done, so patterns and lessons are never lost.
- **"You can see what jobs actually did, not just whether they passed."** Job history now captures output summaries — the actual results of each run, not just pass/fail status.

## Summary of New Capabilities

| Capability | How to Use |
|-----------|-----------|
| Job output capture | Automatic — visible in job history API responses |
| LLM reflection on every job | Automatic — no config needed, always on |
| Permanent job history | Automatic — no rotation or deletion |
| Query job reflections | GET /jobs/history or GET /jobs/:slug/history |
