fix(health): flag metrics-stale for never-reported sites via FirstSeenAt anchor — null LastReportReceivedAt no longer skips the check (plan R2-01 T8)

This commit is contained in:
Joseph Doherty
2026-07-13 10:45:22 -04:00
parent e4765b2eed
commit 11efe4be05
4 changed files with 55 additions and 5 deletions
@@ -40,6 +40,17 @@ public sealed record SiteHealthState
/// </summary>
public DateTimeOffset LastHeartbeatAt { get; init; }
/// <summary>
/// Gets the instant this site was first observed by the aggregator (via a
/// report or a heartbeat); <c>null</c> only for states not built by the
/// aggregator (hand-constructed fixtures). Anchors metrics-staleness for a
/// site that has NEVER delivered a report (review 01 round-2 N3): with
/// <see cref="LastReportReceivedAt"/> null the staleness check previously
/// skipped the site forever. <see cref="LastHeartbeatAt"/> cannot anchor
/// this — every heartbeat advances it.
/// </summary>
public DateTimeOffset? FirstSeenAt { get; init; }
/// <summary>Gets the sequence number of the last accepted health report, used to reject out-of-order duplicates.</summary>
public long LastSequenceNumber { get; init; }
/// <summary>Gets a value indicating whether the site is currently considered online.</summary>