fix(calculation): read cache carries real input status + timestamps

This commit is contained in:
Joseph Doherty
2026-08-20 10:40:15 -04:00
parent 48efdac600
commit 60e5b40228
6 changed files with 163 additions and 25 deletions
@@ -547,11 +547,9 @@ public sealed class CalculationDriver : IDriver, IDependencyConsumer, ISubscriba
return;
}
// Projected to bare values for now — the evaluator's own read cache still fabricates Good, which
// the next task fixes by handing it the snapshots. Only reachable with USABLE inputs (the Bad
// hold above returned), so nothing Bad is being flattened here.
var depValues = pending.Dependencies.ToDictionary(kv => kv.Key, kv => kv.Value.Value, StringComparer.Ordinal);
var result = _evaluator.Evaluate(def.RawPath, def.ScriptSource, depValues);
// Snapshots, not bare values: the script's ctx.GetTag(path).StatusCode / .SourceTimestampUtc are
// then the input's real ones rather than a fabricated Good stamped at evaluation time (05/STAB-19).
var result = _evaluator.Evaluate(def.RawPath, def.ScriptSource, pending.Dependencies);
string? failureReason = null;
(object? Value, uint StatusCode)? toPublish;