coverage.tiers

Runtime access to declarative [coverage.tiers] config.

Settings are validated at the boundary by otto.models.settings.CoverageSettingsSpec; at runtime the repo exposes plain dicts. This module turns those dicts into ordered TierConfig values for the CLI and reporter.

class otto.coverage.tiers.TierConfig(name: str, kind: str, precedence: int, color: str, harvest_dirs: list[~pathlib.Path] = <factory>, max_age_days: int | None = None)

Bases: object

One declared coverage tier, ready for runtime use.

name : str
kind : str
precedence : int
color : str
harvest_dirs : list[Path]
max_age_days : int | None = None
otto.coverage.tiers.load_tiers(cov_config: dict[str, Any], sut_dir: Path | None = None) list[TierConfig]

Ordered tier configs (highest precedence first).

An empty/missing tiers table yields the implicit system tier only — identical to pre-tier behavior. When sut_dir is given, each tier’s harvest_dirs has ${sut_dir} expanded (mirroring the rest of the repo’s settings expansion).

otto.coverage.tiers.resolve_get_tier(tiers: list[TierConfig], name: str | None) TierConfig

Resolve the target tier for otto cov get.

None selects the sole e2e-kind tier; ambiguity or an unknown name raises ValueError listing the candidates.