Extract helper functions from the 110-line _dispatch_via_gitea():
- _format_assignment_comment() — builds markdown comment body with task details,
acceptance criteria, and footer
- _select_label() — returns Gitea label for an agent based on AGENT_REGISTRY
Main function now orchestrates: validate → select label → apply label →
format comment → post comment → return result.
Also fixes pre-existing lint issues in test files:
- Remove unused variables in test_config.py
- Fix E402 import order in test_sovereignty_metrics.py
Fixes#1136