"""
Per-client feature flags (JSON on Client.features).

Use small, explicit keys so optional / legacy integrations stay out of the core path.
"""
from typing import Any, Dict, Optional


def _features_dict(client) -> Dict[str, Any]:
    if not client:
        return {}
    raw = getattr(client, "features", None) or {}
    return raw if isinstance(raw, dict) else {}


def job_efficiency_csv_enabled(client) -> bool:
    """Nixon-style job efficiency loaded from repo CSV files (branch-specific)."""
    return bool(_features_dict(client).get("job_efficiency_csv"))
