steprun: PriorRuns reads a module's ReadSteps shape

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
2026-11-19 15:24:37 +01:00
parent 78adc23d70
commit 16feb56fd4
+7 -3
View File
@@ -125,10 +125,14 @@ func (p *Puller) sayAskEnded(msg *Pulled, ask sdkstep.StepAsk, outcome, said str
}
}
// PriorRuns is Puller.Prior over a steps state's get (buildrun.Scan.Get): the Run of the step a key holds.
func PriorRuns(get func(key string) (json.RawMessage, uint64, error)) func(string) int {
// PriorRuns is Puller.Prior over a steps state's read (a module's ReadSteps.Get): the Run of the step a key holds. Nil for no
// read (a test's), so the bus's delivery count stands.
func PriorRuns(get func(key string) (json.RawMessage, error)) func(string) int {
if get == nil {
return nil
}
return func(key string) int {
raw, _, err := get(key)
raw, err := get(key)
if err != nil || raw == nil {
return 0
}