fix(s7): a read pass that observes nothing reports nothing — empty pass no longer clears Faulted

This commit is contained in:
Joseph Doherty
2026-08-18 07:00:33 -04:00
parent 441b34a391
commit b35e423c1d
2 changed files with 49 additions and 4 deletions
@@ -672,10 +672,17 @@ public sealed class S7Driver
// arms abandon the batch mid-pass, and a partially-observed pass must not stamp a
// verdict. LastSuccessfulRead advances whenever ANYTHING read, even into a
// Degraded/Faulted state — see ReadPassOutcome for why that is load-bearing.
_health = new DriverHealth(
outcome.WorstFailure,
outcome.AnySuccess ? now : _health.LastSuccessfulRead,
outcome.WorstFailure == DriverState.Healthy ? null : outcome.FirstError);
//
// A pass that observed NOTHING — an empty batch, or one whose every reference was
// unresolvable — reports nothing: it writes no health at all, preserving a prior
// Faulted (e.g. the access-denied config alert) that a Healthy write would have erased.
if (outcome.AnySuccess || outcome.WorstFailure != DriverState.Healthy)
{
_health = new DriverHealth(
outcome.WorstFailure,
outcome.AnySuccess ? now : _health.LastSuccessfulRead,
outcome.WorstFailure == DriverState.Healthy ? null : outcome.FirstError);
}
}
finally { _gate.Release(); }
return results;