H2: every seat contract says each verb's description
A tools program that serves a seat's verbs as tools reads a verb's description from the generated contract, one copy taken from seat.json, instead of writing it again. Generated again in all five folders by mesh-delivery's seatgen (feat/47-H2 b65b6173), which now writes VerbDescription; seatgen -check clean, every package's vet and tests green. Builds: design 47 H2 H-A-449
This commit is contained in:
@@ -44,6 +44,26 @@ func Verbs() []string {
|
||||
return []string{VerbAssignments, VerbProposals, VerbPropose, VerbWithdraw, VerbAgain, VerbPlacement}
|
||||
}
|
||||
|
||||
// VerbDescription is a verb's description as the seat's definition says it, "" for a verb the seat does not serve or
|
||||
// does not describe (design 47 H2 H-A-449).
|
||||
func VerbDescription(verb string) string {
|
||||
switch verb {
|
||||
case VerbAssignments:
|
||||
return "Read the assignments: one node's key, the nodes one module is placed on, or every key, each with its revision, and how full the state is against its cap. With history, one node's or one module's changes in order: a revision the state keeps whole, an older one as the proposal's changes from its assignments-changed event."
|
||||
case VerbProposals:
|
||||
return "Every open proposal of assignments: its changes, the revision of each key it was laid over, its candidates, every node's answer, the differences computed and answered, its verdict and its ask. Narrowed to one by id."
|
||||
case VerbPropose:
|
||||
return "Propose a change of assignments, with why: laid over the current keys and refused at once, naming every finding, when the result cannot be placed (two modules on one host port, a provider not placed, a seat held once held twice, two nodes with one address, two hubs, a module the indexer does not hold, a node with no record). Otherwise the nodes it touches compose it in shadow and answer, and on a passing verdict the operator is asked to approve it. Who proposes is the caller, as the runtime proves it. An add-node from mesh-enrolment, whose warrant names its node and address, is written with no ask of its own: its Approve is the enrolment's (ADR 0587 §7)."
|
||||
case VerbWithdraw:
|
||||
return "Withdraw an open proposal: its key and its candidates are deleted and assignments-withdrawn carries it whole. With why."
|
||||
case VerbAgain:
|
||||
return "Judge an open proposal now with the answers that stand, and raise its ask again when its verdict passes and the operator's channel does not hold the ask. Nothing more: the recovery of a proposal whose judgement or ask was lost."
|
||||
case VerbPlacement:
|
||||
return "Read the placements of one module as the assignments rows hold them: for each watched branch a node runs it from, the nodes that run it from there."
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Events is every event published on the seat's subject: a new copy each call.
|
||||
func Events() []string {
|
||||
return []string{EventAssignmentsProposed, EventAssignmentsWithdrawn, EventAssignmentsJudged, EventAssignmentsChanged}
|
||||
|
||||
Reference in New Issue
Block a user