A want asking bus state waits until a build offering bus-state runs healthy on a node present (ADR 0614 §5; issue 774)
bus-state is answered with no credential of a consumer's own, so ADR 0603 §5 counts the provider's own have: the assigner reads, per pass, what the running healthy builds on online nodes offer (their manifests through the builder's builds) and holds a consumer with a bus-state entry under the provisions' rule until one offers it, handed or not and with no provisioner key. The words name bus state, and the delivery view names the edge from them. Claude-Session: https://claude.ai/code/session_01JG73KG7AfSdh6FP8VrBqCn
This commit is contained in:
@@ -135,8 +135,9 @@ func TestGraphEdges(t *testing.T) {
|
||||
for words, want := range map[string]string{
|
||||
VerbWaitWords("seat:mesh-catalog.modules", "artifact-store-tools", "g14"): "verb seat:mesh-catalog.modules",
|
||||
ReaderWaitWords("g14", []string{"tool-runner", "bus-state"}, "node-tools", "src2:abcdef"): "reader capability tool-runner, bus-state",
|
||||
"the verb is served": "",
|
||||
"the node-engine of g14 has not started": "",
|
||||
BusStateWaitWords("keeper", "g14"): "bus state",
|
||||
"the verb is served": "",
|
||||
"the node-engine of g14 has not started": "",
|
||||
} {
|
||||
if got := EdgeOfWords(words); got != want {
|
||||
t.Errorf("the edge of %q = %q, want %q", words, got, want)
|
||||
|
||||
+14
-3
@@ -5,9 +5,9 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// The words of a want held on an edge of ADR 0614 (novox/hq ADR 0614 §2, §4): no reader knows a rule number of its own for
|
||||
// The words of a want held on an edge of ADR 0614 (novox/hq ADR 0614 §2, §4, §5): no reader knows a rule number of its own for
|
||||
// either yet, so the assigner holds them under the provisions' and the composition's rules, and these words are the one
|
||||
// place they are written and read. The assigner writes them (VerbWaitWords, ReaderWaitWords); the delivery view names
|
||||
// place they are written and read. The assigner writes them (VerbWaitWords, ReaderWaitWords, BusStateWaitWords); the delivery view names
|
||||
// the edge a want waits on from them (EdgeOfWords).
|
||||
|
||||
const (
|
||||
@@ -16,8 +16,16 @@ const (
|
||||
readerOpen = "the node-engine of "
|
||||
readerMid = " does not read "
|
||||
readerTail = ", which the manifest of "
|
||||
busOpen = "bus state: "
|
||||
)
|
||||
|
||||
// BusStateWaitWords are the words of a want of module on node held until a build of a module offering bus-state runs
|
||||
// healthy on a node present (ADR 0614 §5, through ADR 0603 §5's count of the provider's own have).
|
||||
func BusStateWaitWords(module, node string) string {
|
||||
return fmt.Sprintf("%s%s asks bus state, and no build of a module offering %s runs healthy on a node present: its want on %s waits for one (ADR 0614 §5)",
|
||||
busOpen, module, BusState, node)
|
||||
}
|
||||
|
||||
// VerbWaitWords are the words of a want of module on node held until a build serving verb runs healthy (ADR 0614 §2).
|
||||
func VerbWaitWords(verb, module, node string) string {
|
||||
return fmt.Sprintf("%s%s %s%s: its want on %s waits until a build serving it runs healthy (ADR 0614 §2)", verbOpen, verb,
|
||||
@@ -32,8 +40,11 @@ func ReaderWaitWords(node string, missing []string, module, fp string) string {
|
||||
}
|
||||
|
||||
// EdgeOfWords is the edge a held want's words name: `verb <verb>` for a verb wait, `reader capability <capabilities>` for
|
||||
// a reader capability's hold, or "" for words of neither.
|
||||
// a reader capability's hold, `bus state` for a bus-state wait, or "" for words of none of them.
|
||||
func EdgeOfWords(words string) string {
|
||||
if strings.HasPrefix(words, busOpen) {
|
||||
return "bus state"
|
||||
}
|
||||
if rest, ok := strings.CutPrefix(words, verbOpen); ok {
|
||||
if verb, _, ok := strings.Cut(rest, " "); ok && strings.Contains(rest, verbClose) {
|
||||
return "verb " + verb
|
||||
|
||||
Reference in New Issue
Block a user