Files
mesh-delivery/sdk/graph/waits.go
T
jschoubben 541eaa20fe
mesh/delivery merged: source.main moved to novox/mesh-delivery@21eaa55b277a
mesh/delivery-group group fix/47-G-bridge merged: every member is merged
mesh/check checking 541eaa20fec4 on 21eaa55b277a
Bridge for G's take-in: the pre-G package directories contracts/go and sdk again, unused
The running pre-G indexer publishes a repository's packages only when every package directory it published last is
still in the tree; G moved contracts/go and sdk to modules/, so mesh-delivery's packages, G's renamed paths among them,
are never published and nothing importing them builds (2026-11-13, indexer journal 'its packages are not published').
These are the trees of e70754ef, unchanged, without sdk/module.json (no second module). Nothing imports them; they go
once G's indexer runs and publishes without them.

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
2026-11-13 14:34:40 +01:00

62 lines
2.6 KiB
Go

package graph
import (
"fmt"
"strings"
)
// 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, BusStateWaitWords); the delivery view names
// the edge a want waits on from them (EdgeOfWords).
const (
verbOpen = "the verb "
verbClose = " invokes is served by no running build"
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,
module, verbClose, node)
}
// ReaderWaitWords are the words of a want of module at fp held on node until its node-engine states the reader
// capabilities missing (ADR 0614 §4).
func ReaderWaitWords(node string, missing []string, module, fp string) string {
return fmt.Sprintf("%s%s%s%s%s%s at %s needs: the want moves once that engine states it", readerOpen, node, readerMid,
strings.Join(missing, ", "), readerTail, module, fp)
}
// 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, `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
}
}
if rest, ok := strings.CutPrefix(words, readerOpen); ok {
if _, rest, ok := strings.Cut(rest, readerMid); ok {
if missing, _, ok := strings.Cut(rest, readerTail); ok {
return "reader capability " + missing
}
}
}
return ""
}