## [0.9.0] - 2026-11-23

### Added

- State fields `verifiedAt`, `verifyResult` and `prunedAt`, all
  omitted when unset, so state written by 0.8.1 loads unchanged. They
  are the groundwork for `bairn verify` and `bairn prune`.
- `bairn verify [--dry-run]` asks a sink that can confirm copies
  (Immich is the one today; with none configured, `verify` and `prune`
  exit 2 before touching state or files), with `POST
  /assets/bulk-upload-check` in batches of 500 (key permission
  `asset.upload`, which the upload key already holds), whether it still
  holds each uploaded entry's `uploadSha1` under the entry's own
  `immichAssetId`, not trashed. It stamps `verifiedAt`, or
  `verifyResult` (`trashed`, `mismatch`, `absent`) and clears an earlier
  verification. Entries with no `uploadSha1` are `unverifiable`: no call is made
  and an earlier verification is cleared; pruned entries are skipped. Immich unreachable, a 5xx or a
  malformed reply stamps nothing for that batch and exits 1. It deletes
  nothing.
- `bairn status` reports `verified`, `verifyFailed` and `pruned`.
- `bairn prune [--apply]` deletes the saved copy of entries Immich holds
  (and the `.xmp` only for a feed-video, whose sidecar bairn uploaded;
  any other `.xmp` is never touched). A dry run by default, which writes nothing; the real
  prune is operator-gated (after a restore drill), so run `bairn verify`
  and a `prune` dry run first. An entry goes only if it was verified, a
  re-verify in the same run says Immich still holds it untrashed, the
  local SHA-1 equals `uploadSha1` (a file re-saved after upload is kept)
  and the path is a regular, non-symlink file under the save directory.
  `prunedAt` is written to the state (one write per batch) before any
  unlink, so a crash is finished by the next run, which re-verifies the
  leftovers with the same gate (media present but the gate failing: the
  file is kept and the entry unpruned; media absent: the tombstone stays,
  so nothing is re-downloaded) and downloads nothing. It refuses
  on an unmounted save root and exits 1 on any error. The summary JSON is
  in `docs/configuration.md`. `--restore` is not part of this release.

### Changed

- An entry with `prunedAt` set is never counted as a missing file:
  `status --missing`, `missingFile` and `repair missing` skip it, and
  the store refuses to requeue it, so it is never downloaded again.
  No behavior change for state without `prunedAt`.

### Fixed

- A saved entry whose upload succeeded on a later run no longer keeps
  the earlier failure in `lastError`: `MarkUploaded` clears it. On load,
  an entry that is saved and uploaded has a leftover `lastError`
  cleared in memory (pre-0.7.0 saves kept it), so `status` stops
  counting it under `withErrors`. `retries` is kept as history, and the
  file is not rewritten until the next real write.