The delivery repository's contracts and SDK live under modules/ as mesh-delivery-contracts and mesh-delivery-sdk, their Go module paths renamed to match the folders (the TypeScript names already did), and every importer in mesh-delivery, mesh-catalog, mesh-host, mesh-tools and mesh-sdk follows in the same group: a design as it should be, one path per module, checked by the group's check building every importer. Builds: design 47 G §427, §88 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
62 lines
2.6 KiB
Go
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 ""
|
|
}
|