Skip to content

clearance

clearance

Adapter for the terok_clearance wheel.

Re-exports every symbol terok consumes from terok-clearance. Callers elsewhere in terok import from this module rather than from terok_clearance directly — see the package docstring in terok.lib.integrations for the rationale.

Every symbol comes from the wheel's top-level public API. The hub + verdict server are composed in-process by the supervisor (one of each per container) and operator UIs multiplex across the per-container sockets via MultiSocketSubscriber. There is no host-side HubService / NotifierService daemon.

set_container_mute and container_mutes are the one-shot pair a caller with no live subscription uses to mute a container's prompts and to read the mutes back. Both address the hub by the 12-character short container id its events carry, and both raise when the hub cannot be reached — an unknown state is never reported as audible.

RawClearanceSection is the schema of the clearance: section of config.yml, which the clearance hub reads. terok composes it into its global schema, so an option that clearance accepts is one that terok accepts.

__all__ = ['ALL_NOTIFY_CATEGORIES', 'COMMANDS', 'CallbackNotifier', 'EventSubscriber', 'MultiSocketSubscriber', 'NOTIFY_BLOCKED', 'NOTIFY_VERDICT', 'Notification', 'RawClearanceSection', 'container_mutes', 'create_notifier', 'set_container_mute'] module-attribute

__getattr__(name)

Resolve a re-exported name to its source module on first access (PEP 562).

Source code in src/terok/lib/integrations/clearance.py
def __getattr__(name: str) -> object:
    """Resolve a re-exported name to its source module on first access (PEP 562)."""
    try:
        target = _LAZY[name]
    except KeyError:
        raise AttributeError(f"module {__name__!r} has no attribute {name!r}") from None
    module_path, _, source_name = target.partition(":")
    value = getattr(importlib.import_module(module_path), source_name or name)
    globals()[name] = value  # cache so subsequent lookups skip __getattr__
    return value

__dir__()

Expose the lazy names to dir() / autocompletion.

Source code in src/terok/lib/integrations/clearance.py
def __dir__() -> list[str]:
    """Expose the lazy names to ``dir()`` / autocompletion."""
    return sorted({*globals(), *_LAZY})