"""What a worker needs to do its job. One frozen bag of collaborators, constructed once in main() and passed down. Handlers take `deps` rather than reaching for globals, which is the entire reason the worker tests run in milliseconds against a FakeProvisioner instead of needing a cluster. """ from __future__ import annotations from dataclasses import dataclass from svcforge_core.adapters.clock import Clock from svcforge_core.adapters.helm import Provisioner from svcforge_core.adapters.notify import Notifier from svcforge_core.domain.models import CatalogEntry from svcforge_core.repo.db import DictPool from svcforge_core.repo.instances import InstanceRepo from svcforge_core.repo.tasks import TaskRepo from svcforge_core.settings import Settings @dataclass(frozen=True) class WorkerDeps: """Everything a handler is allowed to touch.""" pool: DictPool instances: InstanceRepo tasks: TaskRepo provisioner: Provisioner notifier: Notifier clock: Clock catalog: dict[str, CatalogEntry] settings: Settings