"""Federation test-supervisor portable types + helpers.

The federation test supervisor (TS-22..TS-28, see
``docs/standards/TESTING.md`` §19) is a stdlib-only out-of-process
pytest driver that ships JSONL outcome records, auto-quarantines
flakes, and writes per-failure detail bundles. The supervisor
itself lives in the published sibling library
``mgf-test-supervisor`` (import: ``mgf.test_supervisor``); it was
extracted from ``mgf-common/scripts/_mtest/`` on 2026-05-26. CLI
access is ``mgf-fed test -- <args>`` (delegating shim) or
``mgf-test-supervisor <args>`` / ``mtest <args>`` (direct).

This subpackage holds the **consumer-readable schema types** that
downstream tooling (consumers reading ``run.jsonl``, dashboards,
status badges) parses without taking a dependency on the
supervisor. The two surfaces are alignment-pinned by
``tests/unit/testing/test_supervisor_alignment.py``.

- :class:`TestRecord` — the one-JSON-line-per-test outcome
  schema (TS-24). :data:`SCHEMA_VERSION` pins the version.
- :class:`Outcome`, :class:`Severity` — the canonical enums,
  mirroring the federation DoctorFinding vocabulary
  (:class:`mgf.hrb.diagnostics.DoctorFinding` — the one parent).
- :data:`MARKER_TIER`, :func:`effective_tier`,
  :class:`TierBudget`, :data:`TIERS` — the four-tier model
  (TS-22) + the federation marker → tier mapping (§13.11).
- :func:`default_sock_path` — parallel-safe per-pytest-xdist-worker
  socket-path helper for test daemons.
- :class:`FailureBundle`, :data:`SECTION_ORDER` — the per-failure
  detail-bundle shape (TS-27).
- :func:`perf_span`, :class:`PerfSummary` / :class:`PerfFunction` /
  :class:`PerfSpan` — per-test perf attribution (TS-28): the
  ``perf_span`` section timer plus the artifact schema the supervisor
  reads. Capture is driven by the pytest plugin under ``--mgf-perf``.

Promotion history: introduced at mgf-common 0.40.0 alongside
TS-22..TS-28. Tier per ``PUBLIC_API.md``: **stable (v0.40.0)**.
"""

from __future__ import annotations

from mgf.common.testing._failure_bundle import (
    SECTION_HEADER_FMT,
    SECTION_ORDER,
    FailureBundle,
)
from mgf.common.testing._markers import (
    DEFAULT_TIER,
    MARKER_TIER,
    TIERS,
    TierBudget,
    effective_tier,
)
from mgf.common.testing._paths import default_sock_path
from mgf.common.testing._perf import (
    DEFAULT_TOP_N,
    PERF_SCHEMA_VERSION,
    PerfFunction,
    PerfSpan,
    PerfSummary,
    perf_span,
)
from mgf.common.testing._schema import (
    DEFAULT_SEVERITY,
    SCHEMA_VERSION,
    Outcome,
    Severity,
    TestRecord,
)

__all__ = [
    "DEFAULT_SEVERITY",
    "DEFAULT_TIER",
    "DEFAULT_TOP_N",
    "MARKER_TIER",
    "PERF_SCHEMA_VERSION",
    "SCHEMA_VERSION",
    "SECTION_HEADER_FMT",
    "SECTION_ORDER",
    "TIERS",
    "FailureBundle",
    "Outcome",
    "PerfFunction",
    "PerfSpan",
    "PerfSummary",
    "Severity",
    "TestRecord",
    "TierBudget",
    "default_sock_path",
    "effective_tier",
    "perf_span",
]
