The chapter dispatcher's URL resolver had no dropped_at filter and no ORDER BY — a chapter whose only chapter_sources row had been soft- dropped was still dispatched against the stale URL, eating retry budget on guaranteed transients. With multiple live sources the LIMIT 1 winner was nondeterministic. Add `AND cs.dropped_at IS NULL` and `ORDER BY cs.last_seen_at DESC` to dispatch_target, bringing it in lockstep with the enqueue queries in pipeline.rs that already filter on dropped_at. Returns None when all sources are dropped — callers in daemon.rs already treat None as "ack the job, skip the work." Tests in tests/repo_chapter.rs cover the three branches (freshest live wins, dropped sources skipped, all-dropped returns None). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
862 B
862 B