"""Fail-closed compatibility shim for the uncommissioned digital twin.

AINA has no reviewed digital-twin transport, identity binding, or state-sync
contract.  Keeping the historical placeholder importable avoids breaking old
callers, while every operational entry point fails deterministically before
performing network, file, thread, or robot activity.
"""

from __future__ import annotations

LEGACY_DIGITAL_TWIN_DISABLED_MESSAGE = (
    "Digital twin control is unavailable: no commissioned AINA integration "
    "is configured"
)


class LegacyDigitalTwinDisabledError(RuntimeError):
    """Raised whenever the uncommissioned digital-twin API is invoked."""


def _disabled(*_args, **_kwargs):
    raise LegacyDigitalTwinDisabledError(LEGACY_DIGITAL_TWIN_DISABLED_MESSAGE)


class DigitalTwin:
    """Import-compatible, side-effect-free stand-in for the retired API."""

    def connect(self) -> None:
        _disabled()

    def get_environment_data(self):
        _disabled()

    def update_state(self, state) -> None:
        _disabled(state)

    def get_state(self):
        _disabled()

    def disconnect(self) -> None:
        _disabled()
