# #region SupersetContextExtractorPackage [C:4] [TYPE Module] [SEMANTICS superset, package, dashboard, dataset]
# @LAYER Infrastructure
# @BRIEF Recover dataset and dashboard context from Superset links while preserving explicit partial-recovery markers.
# @RELATION DEPENDS_ON -> [ImportedFilter]
# @RELATION DEPENDS_ON -> [TemplateVariable]
# @RELATION DEPENDS_ON -> [SupersetClient]
# @PRE  Superset link or dataset reference must be parseable enough to resolve an environment-scoped target resource.
# @POST  Returns the best available recovered context with explicit provenance and partial-recovery markers when necessary.
# @SIDE_EFFECT  Performs upstream Superset API reads.
# @INVARIANT  Partial recovery is surfaced explicitly and never misrepresented as fully confirmed context.
#
# @RATIONALE  Decomposed from monolithic superset_context_extractor.py (1397 lines) into
# domain-scoped mixins to satisfy INV_7 (module < 400 lines). The composed class
# preserves the original public API surface — all consumers continue to import
# from `src.core.utils.superset_context_extractor` without changes.
# @REJECTED  Keeping a single 1397-line file — violates fractal limit INV_7.
# #endregion SupersetContextExtractorPackage

from ._base import SupersetContextExtractorBase, SupersetParsedContext
from ._filters import SupersetContextFiltersExtractMixin
from ._parsing import SupersetContextParsingMixin
from ._pii import _mask_sensitive_text, mask_pii_value, sanitize_imported_filter_for_assistant
from ._recovery import SupersetContextRecoveryMixin
from ._templates import SupersetContextTemplatesMixin


# #region SupersetContextExtractor [C:4] [TYPE Class]
# @BRIEF Parse supported Superset URLs and recover canonical dataset/dashboard references for review-session intake.
# @RELATION DEPENDS_ON -> [Environment]
# @RELATION INHERITS -> [SupersetContextExtractorBase]
# @RELATION INHERITS -> [SupersetContextParsingMixin]
# @RELATION INHERITS -> [SupersetContextRecoveryMixin]
# @RELATION INHERITS -> [SupersetContextTemplatesMixin]
# @RELATION INHERITS -> [SupersetContextFiltersExtractMixin]
# @PRE  constructor receives a configured environment with a usable Superset base URL.
# @POST  extractor instance is ready to parse links against one Superset environment.
# @SIDE_EFFECT  downstream parse operations may call Superset APIs through SupersetClient.
class SupersetContextExtractor(
    SupersetContextFiltersExtractMixin,
    SupersetContextRecoveryMixin,
    SupersetContextTemplatesMixin,
    SupersetContextParsingMixin,
    SupersetContextExtractorBase,
):
    """Composed Superset context extractor.

    MRO: FiltersExtractMixin -> RecoveryMixin -> TemplatesMixin -> ParsingMixin -> Base.
    All consumers continue to use:
        from src.core.utils.superset_context_extractor import SupersetContextExtractor
    """
    pass


# #endregion SupersetContextExtractor


__all__ = [
    "SupersetContextExtractor",
    "SupersetParsedContext",
    "_mask_sensitive_text",
    "mask_pii_value",
    "sanitize_imported_filter_for_assistant",
]
