9ba587d136
The scheduled-tick branch and the discover.requested one-shot branch both read the same stale per-iteration config snapshot, so an enabled+due sweep coinciding with a pending request ran discovery twice back-to-back (idempotent but wasteful). Extract maybe_run_discovery, which unifies both triggers into a single run and is now unit-tested. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>