"""C8 outbound (FC-emitted) external-position DTO (AZ-390 / E-C8).

The DTO carries the per-emit observability bundle the FDR (C13) needs
to reconstruct who wrote which position to the FC at what monotonic
time. The actual lat/lon/alt that travelled over the wire is owned by
the FC variant (AP's `GPS_INPUT.lat/lon`, iNav's
`MSP2_SENSOR_GPS.lat/lon`) — we only need the cross-FC scalar
``horiz_accuracy_m`` here because that field round-trips through the
covariance projector (AZ-392) and is the only common observability
target.
"""

from __future__ import annotations

from dataclasses import dataclass

from gps_denied_onboard._types.fc import FcKind
from gps_denied_onboard._types.state import PoseSourceLabel

__all__ = ["EmittedExternalPosition"]


@dataclass(frozen=True, slots=True)
class EmittedExternalPosition:
    """Observability record for a single C8 outbound position emit.

    Constructed by the AP / iNav outbound bodies (AZ-393 / AZ-394)
    immediately after the wire write succeeds; consumed by the
    runtime root for FDR logging. ``source_label`` is a
    :class:`PoseSourceLabel` enum (AZ-381 reshape); serialise via
    ``.value`` on the FDR-write side.
    """

    fc_kind: FcKind
    horiz_accuracy_m: float
    source_label: PoseSourceLabel
    emitted_at: int
    sequence_number: int
