# Release: Time's Up v2.5.0

**Release Date:** 2026-04-19
**Status:** Draft
**Manifest Version:** 3

## Release Summary

v2.5.0 adds a **Diagnostics** section to settings so users can see how the extension is behaving over time. The extension now records a bounded error log and periodic health snapshots to local storage, exportable as JSON for issue reporting. No network egress — all data stays on device.

## New Features

### Diagnostics & Observability Panel (FEAT-003)
**Requirement doc:** [requirements/core/FEAT-003-observability.md](../core/FEAT-003-observability.md)

A new "Diagnostics" section appears in settings (collapsed by default, next to "Advanced"). It shows:

- **Errors past 7 days** — grouped by source tag (e.g., `doomscroll-register`, `config-save`)
- **Last snapshot** — timestamp of the most recent health sample
- **Service worker uptime** — how long the SW has been alive this cycle
- **Storage used** — total `chrome.storage.local` bytes in use
- **Snapshots recorded** — ring buffer length

Three buttons:
- **Export diagnostics JSON** — downloads a snapshot suitable for sharing when reporting issues
- **Refresh** — re-reads storage (diagnostics write in the background, so the view can lag)
- **Clear diagnostics** — removes all `diagnostics_*` keys (with confirmation)

## How It Works

- **Error recorder** (`diagnostics.js` → `recordError`) — called from 8 error sites in `background.js`. Each entry captures `ts`, `source`, `message`, first 500 chars of stack, and optional context. Ring buffer capped at 100 entries.
- **Health snapshots** (`recordSnapshot`) — fires every 10th alarm tick (~10 min). Captures `tickCount`, `swUptimeMs`, `tabCount`, `storageBytes`, and where available `osMemAvailable` / `osMemTotal` (via `chrome.system.memory`) plus `jsHeapUsed` (via `performance.memory`). Ring buffer capped at 200 entries (~33h at default cadence).
- **No network** — all data lives in `chrome.storage.local` under `diagnostics_errors`, `diagnostics_snapshots`, `diagnostics_counters`. Export is user-triggered only.

## New Permission

- `system.memory` — added to `manifest.json` to sample OS free/total memory in health snapshots. Gracefully falls back if unavailable.

## Test Coverage Added

- **Unit** (`tests/unit/diagnostics.test.js`) — 21 new tests for ring buffer append/eviction, error summarization (24h/7d windows + source grouping), snapshot shape validation.
- **E2E** (`tests/e2e/diagnostics.spec.js`) — 4 new tests: section renders, summary reflects seeded data, export triggers download, clear removes data.

## Migration Notes

No user migration needed. Diagnostics storage begins empty on install or update; populates naturally as the SW runs. Existing `usage_*`, `activeSnoozes`, and `config` keys are untouched.
