Files
mesh-delivery/modules/mesh-delivery-checker/internal/check/lostask.go
T
jschoubben 1db4728081 B1 (checker): the checker's own buckets, events and asker are named from its credential's module
CheckerModule and the buckets built on it are gone; check.Bucket names a state of the credential's module, the examiner
takes the module as its asker, the tools take the served-as module, and the tools ask the indexer's read tools of the
holder of the seat mesh-catalog on each call (B2's tool addresses for the checker).

Builds: design 47 G A-296, A-210, §428

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
2026-11-12 23:35:14 +01:00

37 lines
2.4 KiB
Go

package check
import (
"strings"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/buildrun"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/clients/meshdeliverycheckerclient"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshdeliverychecker"
sdkrun "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/buildrun"
)
// **An ask the build seat gave up on ends its step** (novox/hq issue 734): mesh-sdk buildrun.LostAskWaiter hands the
// waiting asker a failed step on the node buildrun.LostNode when DEAD_LETTERS keeps the ask's copy (buildrun.HearDeadLetters,
// granted by buscompose DeadLetterReads), and, under buildrun.NotTakenBound, when no build node took the ask within the
// bound. What follows is the checker's: a try ends as error (Tryer.run), with the not-taken bound at the step bound
// (Tryer.NotTaken); a check is asked again under its claim, at most LostAskTries times, then fails as not heard and is
// asked again when the part it could not hear runs (Checker.try). A check's ask has no not-taken bound: it waits in the stream as long as
// the backlog is (ADR 0525 §9), and a check ended for a backlog would owe its pull request a failure.
// LostAskTries is how often a check asks again whose ask was given up, before it fails as not heard (UnheardWords) and is
// asked again when the part it could not hear runs.
const LostAskTries = 3
// IsLostAsk says whether a verdict failed because its ask judged nothing: the build seat gave it up (buildrun.LostWords), or
// the build module that ran its step was replaced under it, and its next process ended the step it left running
// (sdkrun.RestartReason; a delivery of the build module, as on 2026-10-28). Neither is the change's failure: the check
// is asked again, as for a given-up ask.
func IsLostAsk(v meshdeliverychecker.VerdictsByGroupHeadsValue) bool {
return v.State == meshdeliverycheckerclient.VerdictFail && (strings.Contains(failedOf(v).Words, buildrun.LostWords) ||
strings.Contains(failedOf(v).Words, sdkrun.RestartReason))
}
// IsNotTaken says whether a verdict failed because no build node took its ask within the bound (buildrun.NotTakenWords).
func IsNotTaken(v meshdeliverychecker.VerdictsByGroupHeadsValue) bool {
return v.State == meshdeliverycheckerclient.VerdictFail && strings.Contains(failedOf(v).Words, buildrun.NotTakenWords)
}