namespace AcDream.Core.Net.Transport;
///
/// Unconditional reliable-transport counters. Increment sites are NOT
/// probe-gated — the counters are plain field writes and always current, so
/// a later probe (N5's [net-tick] extension) or a connected gate can
/// read them without having been armed in advance. Printing stays
/// probe-gated at the call sites that choose to surface them.
///
internal sealed class TransportStats
{
/// Datagrams re-emitted in response to a server NAK.
public long ResendsSent;
/// Inbound packets carrying RequestRetransmit.
public long NakRequestsReceived;
///
/// NAKed ids no longer (or never) in the sent-packet cache, dropped
/// silently instead of answering retail's RejectRetransmit
/// (divergence register TS-57 — ACE no-ops the reject, and the
/// standalone unsequenced form would trip ACE's watermark hole).
///
public long UncachedNakIds;
/// Inbound AckSequence values folded into the watermark
/// (explicit acks plus the NAK ids[0] implicit ack).
public long AcksConsumed;
/// N2: inbound duplicates of already-decoded packets, dropped
/// at zero keystream cost (encrypted, at/below the watermark, no parked
/// key — ProcessNewSeqNum @ 0x00544690).
public long InboundDupsDropped;
/// N2: inbound packets past the wrap-safe
/// watermark + 0x7FFF horizon
/// (SeqIDSanityCheck @ 0x00543A20).
public long InboundSanityDrops;
/// N2: inbound packets whose checksum failed verification
/// after admission (a sequenced encrypted failure also re-parks its
/// consumed key for the retransmission).
public long ChecksumFailures;
/// N2: inbound keystream words parked in the NAK set — one per
/// gap-walked missing id (ReceiverData::AddNakked @ 0x00549240
/// pre-draw) plus one per checksum-failure re-park.
public long KeysParked;
/// N3: cumulative AckSequence packets emitted by the
/// 2.0 s sweep (SharedNet::EnqueuePak @ 0x00543B10 — retail's
/// only ack construction site; there is no per-packet ack).
public long AcksSent;
/// N4: RequestRetransmit packets emitted by the 0.6 s
/// NAK branch (SharedNet::EnqueueNaks @ 0x00543BD0 →
/// ReceiverData::GetNaks @ 0x005490C0, ≤114 ids each).
public long NaksSent;
/// N4: mis-parked keystream words reclaimed from validated
/// cleartext RejectRetransmit sequences (the AD-51 ACE
/// adaptation; always zero against a retail server).
public long RejectWordsReclaimed;
/// Live sent-packet cache depth — the N5 watchdog value
/// (cache=N in [net-tick]; the cache is unbounded like
/// retail's, so depth is the health signal, not a cap).
public int CacheDepth => CacheDepthSource?.Invoke() ?? 0;
/// Wired by to the store's
/// Count.
internal Func? CacheDepthSource { get; set; }
}