21d53c1e

By: ananjiani <ananjiani@noreply.codeberg.org>

fix(hermes): migrate Gmail broker to Himalaya v2 (#327)

## Why
`hermes-read mail folders` fails with `gmail request failed (himalaya exit 2)`: the installed Himalaya 2.0.0 rejects the v1 `--output json` flag. The old account config also leaves Gmail without a recognized IMAP backend.

## Changes
- Update the generated IMAP/password-command config and mailbox aliases to v2.
- Update folders, list/search, read, and fixed-destination Paperless copy commands; unwrap v2 list JSON.
- Update Gmail skill search examples to the v2 query syntax.
- Add an offline check using the actual Himalaya binary and a temporary m2dir mailbox, plus generated-config validation and a numeric-ID read-command check. Real CLI checks run only with `--self-check`, not at service startup.
- Keep numeric ID validation, folder restrictions, redaction, and the fixed Paperless destination unchanged. Upstream v2 IMAP read uses BODY.PEEK[], so reading does not set Seen.

## Validation
- Broker redaction, queue/read command, and real offline Himalaya checks: passed.
- Generated TOML accepted by Himalaya; Gmail reports an IMAP backend.
- Targeted Nix evaluation of the aragorn broker environment: passed.
- Commit hooks including nixfmt, statix, deadnix, and ripsecrets: passed.
- Independent review completed; its ID-validation blocker was fixed and the original guard was verified unchanged.

No live Gmail access, deployment, or full Nix build was performed. CI still needs to pass. Built in the separate worktree `/home/ammar/.worktrees/hermes-himalaya-v2`.

Co-authored-by: Ammar Nanjiani <ammar.nanjiani@gmail.com>
Reviewed-on: https://codeberg.org/ananjiani/infra/pulls/327

Total

13m40s

Time to Start Worker time Duration Time to finish Idle
Config 2s 9s 9s 12s 2s
Eval 10s 5m03s 5m03s 5m13s 0s
Build 5m08s 13m12s 8m34s 13m42s 1s
Suite 2s 18m25s 13m40s 13m42s 3s

Timeline

Config Eval Build
0s1m2m3m4m5m6m7m8m9m10m11m12m13m