D4: builder_seat_queue counts a step given again as waiting; a failure on a transport fault is built again as a new revision (ADR 0664, issue 1748)

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-09 22:59:50 +01:00
parent 397d2d120a
commit bfc73581ec
3 changed files with 7 additions and 3 deletions
@@ -103,6 +103,7 @@ func TestOnlyAPushFailureIsBuiltAgainBeforeTheFingerprintChanges(t *testing.T) {
{VersionTaken + "@novox/mesh-sdk@0.1.15 holds another file", false},
{RefusedKind + "a package in go", false},
{"go test: 2 failed", true},
{"a transport fault on 3 runs (ace, g14, novox)", true}, // ADR 0664: a fault of the network, not of the source
} {
if got := FailedUntilChanged(c.err); got == c.again {
t.Errorf("FailedUntilChanged(%q) = %v", c.err, got)
@@ -98,10 +98,11 @@ func Proves(taken, waiting string) bool {
}
// Waits is whether a message ahead still waits to be delivered: no build node wrote a step for it, and no ask of its
// kind asked after it was taken. A message its worker gave up on (delivered its most times) stays on a work queue until
// its age, and is not counted.
// kind asked after it was taken; or a node wrote its step again, a run that ended on a transport fault and that the bus
// gives once more after its delay (ADR 0664). A message its worker gave up on (delivered its most times) stays on a work
// queue until its age, and is not counted; a dropped ask has its step refused and is not counted either.
func (s AskSeen) Waits(q Queued) bool {
return q.Step == "" && !s.passed(q.At)
return q.Step == sdkstep.StepAgain || q.Step == "" && !s.passed(q.At)
}
func (s AskSeen) passed(at time.Time) bool {
@@ -1155,6 +1155,8 @@ func TestABuildAskWaitingInItsStreamIsNotBounded(t *testing.T) {
// Note 62: seven messages SEAT_NODE_BUILD_GO gave up on sat ahead of a Go ask for five hours.
{"seven given up on ahead, a later ask taken", seen(ahead(7, ""), later), "behind 7 given up on or taken", 0},
{"seven taken ahead (failed as poison), a later ask taken", seen(ahead(7, buildstep.StepFailed), later), "no longer delivers it", 0},
{"two to be given again after a transport fault, a later ask taken", seen(ahead(2, buildstep.StepAgain), later), "", 2},
{"two dropped (step refused) ahead, a later ask taken", seen(ahead(2, buildstep.StepRefused), later), "no longer delivers it", 0},
{"a check ask taken later proves a delivery ask passed", seen(ahead(7, ""), taken(buildstep.AskCheck, put.Add(time.Minute))), "no longer delivers it", 0},
{"a delivery ask taken later does not prove a check ask passed", func() AskSeen { s := seen(ahead(3, ""), later); s.Kind = buildstep.AskCheck; return s }(), "", 3},
} {