Coverage for greyhorse / river / resolver.py: 100%
13 statements
« prev ^ index » next coverage.py v7.14.0, created at 2026-05-18 11:33 +0300
« prev ^ index » next coverage.py v7.14.0, created at 2026-05-18 11:33 +0300
1"""Operator resolver protocol — data-only context for operator execution."""
3from __future__ import annotations
5from collections.abc import Mapping
6from enum import IntEnum
7from typing import Any, Protocol, runtime_checkable
9from greyhorse.app.private.functional.linker import FragmentLinker
12@runtime_checkable
13class OperatorResolver(Protocol):
14 """Data-only protocol providing DI context for operator execution.
16 Implementations supply a ``FragmentLinker`` for multi-root type resolution,
17 an optional ``scope`` for phase-filtered linking, and ``context_values`` —
18 a read-only mapping of pre-resolved runtime dependencies (controllers,
19 handles, health reporters) keyed by snake_case type name.
21 See Also:
22 ``Component``: minimal implementation for testing.
23 """
25 @property
26 def linker(self) -> FragmentLinker:
27 """FragmentLinker for multi-root type resolution across fragments."""
28 ...
30 @property
31 def scope(self) -> IntEnum | None:
32 """Optional phase scope for ``linker.link()`` filtering."""
33 ...
35 @property
36 def context_values(self) -> Mapping[str, Any]:
37 """Read-only mapping of pre-resolved runtime dependencies."""
38 ...