catalogue's compiled set is read from git.novox.be/novox/mesh-contracts/go/seats; the hand-written seat literal and its
verb builders go. The bar's block keeps its checks as code beside the data. A case of the seat set's test holds the
generated set equal, entry for entry, to the list compiled at 5a38a12 (testdata), but for the whole seats' additions
and the vault's two verbs; the three new registry seats are the only new entries. A holder of mesh-broker now serves its
eight verbs.
SDK-12: the vault's seat no longer promises accept and move-asks, which no holder served and nothing called; retire is
optional (design 32). The intake and move rows join one table; the move's own test goes with the two verbs.
Requires mesh-contracts (no version on the forge yet: a go.work, uncommitted, uses the sibling worktree until the
group pins it).
Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
31 lines
938 B
Go
31 lines
938 B
Go
package catalogue
|
|
|
|
import contractseats "git.novox.be/novox/mesh-contracts/go/seats"
|
|
|
|
// EngineSeat is the node seat every node's engine holds.
|
|
const EngineSeat = contractseats.NodeEngine
|
|
|
|
// EngineVerbs are the node-engine seat's verbs, in the order ADR 0563 §1 names them: its definition's, read from the
|
|
// generated seat list (design 26).
|
|
func EngineVerbs() []Verb {
|
|
s, _ := seatIn(defaultSeats, EngineSeat)
|
|
return append([]Verb(nil), s.Serves...)
|
|
}
|
|
|
|
// EngineEvents are what the seat says of an act, each naming the act, the path or access, the caller as the runtime
|
|
// proved it and the ask (ADR 0563 §1).
|
|
var EngineEvents = func() []string {
|
|
s, _ := seatIn(defaultSeats, EngineSeat)
|
|
return append([]string(nil), s.Emits...)
|
|
}()
|
|
|
|
// seatIn is the seat of that name in a list.
|
|
func seatIn(list []Seat, name string) (Seat, bool) {
|
|
for _, s := range list {
|
|
if s.Name == name {
|
|
return s, true
|
|
}
|
|
}
|
|
return Seat{}, false
|
|
}
|