fix(calculation): hold evaluation on Bad inputs and propagate the worst input status; status-keyed dedup (05/STAB-19)

This commit is contained in:
Joseph Doherty
2026-08-20 10:37:29 -04:00
parent 3f8d5815b3
commit 48efdac600
4 changed files with 397 additions and 21 deletions
@@ -741,3 +741,20 @@ test could only pass once the production change landed.
- GREEN: 11 passed (`DependencyConsumerMuxAdapterTests` + `DependencyMuxActorTests`).
- The false "quality is stripped at the mux boundary" comment is deleted and replaced with why it was
false (theme 6: the contract moved at #478/#519 and the comment outlived the fact).
### T13 — `CalculationDriver` input quality (hold on Bad, propagate worst, status-keyed dedup)
- RED: `--filter "…CalculationDriverInputQualityTests"` ⇒ **5 failed**: `Snapshot.StatusCode should be
2150694912u` (BadNoCommunication) on the Bad-input, cold-start and passthrough cases; `should be
1073741824u` (Uncertain) on the Uncertain case; `published.Count should be 1` on the sub-code-change
case. That is the laundering, reproduced from three directions.
- GREEN: whole `Driver.Calculation.Tests` project 61/61 — the 9 new plus every pre-existing case
unchanged (the Good-only paths are byte-identical).
- **Vacuity check performed** (the plan's requirement): reverting the dedup key to value-only
(`if (st.HasValue && Equals(st.LastValue, value)) return null;`) ⇒
`An_identical_value_is_republished_when_recovering_from_a_bad_input` **FAILED** with
`published.Count should be 1` — i.e. the recovery was swallowed, exactly the "Bad forever" trap.
Restored, green.
- `TagState.LastPublishedBad` (two-state) became `HasPublished` + `LastPublishedStatus` (uint), which is
what lets a Bad→different-Bad transition republish and what makes `ReadAsync` agree with the
subscriber. The evaluator is still handed bare values here — T14 hands it the snapshots.
@@ -93,7 +93,7 @@
{
"id": "T13",
"subject": "CalculationDriver input quality: snapshots per dep, hold on Bad, publish worst-of-input once per status change, status-keyed dedup bypass on recovery, ReadOne parity",
"status": "pending",
"status": "done",
"blockedBy": [
"T1",
"T12"