← Files VeraARCHIVED FILE

vendor/modules/courseware/policy.py

1.22 KB · Oct 2, 2026 · 00:29 UTC

↓ Download file

"""Product-owner choices about which workflows can run as local lessons."""

from __future__ import annotations

__all__ = ["unavailable_local_workflows", "local_unavailability"]


def unavailable_local_workflows(product: str) -> frozenset[str]:
    """Return explicit local teaching exclusions, not professional routing rules."""
    if product == "vera":
        return frozenset({"esg-reporting-assurance"})
    if product == "clara":
        return frozenset({"brand-fit", "hosted-interview", "research-video"})
    return frozenset()


def local_unavailability(product: str, workflow: object) -> str | None:
    """Explain an unavailable lesson without claiming its workflow is absent."""
    if isinstance(workflow, str) and workflow in unavailable_local_workflows(product):
        if product == "vera":
            return (
                "The ESG foundation has no qualified prepared lesson yet. "
                "Its synthetic developer demo is not a user teaching course."
            )
        return (
            "This Clara workflow requires hosted services and is unavailable in "
            "local lessons. Choose another local lesson; the normal professional "
            "workflow remains separate."
        )
    return None

SHA-256: d8b2f02f666deaecbe04f3fff02bb3351c6ea4fb636fa9ac2a2aac2ee4ec566a