steprun: an ask on its last delivery is ended, every end is acknowledged, an unwritten end is given back (A-489a)

Builds: design 47 G §24, §25; lead answers A-489, A-489a

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
2026-11-19 15:38:16 +01:00
parent 16feb56fd4
commit 92196dde3a
7 changed files with 144 additions and 36 deletions
@@ -244,7 +244,7 @@ func TestPullDropsWhatIsNoAsk(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
go p.Pull(ctx)
waitFor(t, "three ended", func() bool { ak, tm, _ := src.Fates(); return len(ak)+len(tm) == 3 })
waitFor(t, "three acknowledged", func() bool { ak, _, _ := src.Fates(); return len(ak) == 3 })
if ran {
t.Fatal("a wrong or a declined ask ran")
}
@@ -269,7 +269,7 @@ func TestPullDropsWhatIsNoAsk(t *testing.T) {
return nil, &Declining{Text: "the ask is for 26.13.0 and this node builds with 26.12.1", Lacks: []string{"the agreed toolchain 26.13.0 (recipe 3)"}}
}}
go s2.Pull(ctx)
waitFor(t, "the ask termed on the node that sits out", func() bool { _, tm, _ := sit.Fates(); return len(tm) == 1 })
waitFor(t, "the ask acknowledged on the node that sits out", func() bool { ak, _, _ := sit.Fates(); return len(ak) == 1 })
sk, _ := sdkstep.AskStepKey("", "ace", toolchain.ID)
ss, _ := sitSteps.get(sk)
if d, ok := sdkstep.DeclinedOf(ss); !ok || len(d.Lacks) != 1 || !strings.Contains(ss.Reason, "26.12.1") {
@@ -620,7 +620,7 @@ func TestPullAnswersAnAskItCannotRead(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
go p.Pull(ctx)
waitFor(t, "both ended", func() bool { ak, tm, _ := src.Fates(); return len(ak)+len(tm) == 2 })
waitFor(t, "both acknowledged", func() bool { ak, _, _ := src.Fates(); return len(ak) == 2 })
key, _ := sdkstep.AskStepKey("", "ace", good.ID)
s, ok := st.get(key)
if !ok || s.State != sdkstep.StepRefused || !strings.Contains(s.Reason, "cannot read the ask") || !strings.Contains(s.Reason, "exactly one") {