contracts-node-engine-apply-order-and-word: the verb apply-order and the constant want:version on the seat node-engine
Generated with seatgen whose identifier function splits on ':' (H-A-64, the contracts-indexer-bridge developer's change in mesh-delivery-sdk/seatgen); seatgen -check passes only with it. Builds: design 47 H §771, §772, H-A-45, H-A-46, H-A-63, H-A-64
This commit is contained in:
@@ -26,6 +26,7 @@ const (
|
||||
VerbCompose = "compose"
|
||||
VerbComposeCandidate = "compose-candidate"
|
||||
VerbManifestReads = "manifest-reads"
|
||||
VerbApplyOrder = "apply-order"
|
||||
VerbSeatList = "seat-list"
|
||||
VerbSeatListAgain = "seat-list-again"
|
||||
VerbFirstViews = "first-views"
|
||||
@@ -47,7 +48,7 @@ const (
|
||||
|
||||
// Verbs is every verb the seat serves, in its definition's order: a new copy each call.
|
||||
func Verbs() []string {
|
||||
return []string{VerbHandOver, VerbAccessAct, VerbJudgeDirectories, VerbSetuidSearch, VerbRootFree, VerbActs, VerbPackages, VerbComposition, VerbCompose, VerbComposeCandidate, VerbManifestReads, VerbSeatList, VerbSeatListAgain, VerbFirstViews, VerbFirstViewAgain, VerbEntryAgain, VerbProcessBuilds}
|
||||
return []string{VerbHandOver, VerbAccessAct, VerbJudgeDirectories, VerbSetuidSearch, VerbRootFree, VerbActs, VerbPackages, VerbComposition, VerbCompose, VerbComposeCandidate, VerbManifestReads, VerbApplyOrder, VerbSeatList, VerbSeatListAgain, VerbFirstViews, VerbFirstViewAgain, VerbEntryAgain, VerbProcessBuilds}
|
||||
}
|
||||
|
||||
// Events is every event published on the seat's subject: a new copy each call.
|
||||
@@ -705,6 +706,14 @@ type LoginFallback struct {
|
||||
Why string `json:"why"`
|
||||
}
|
||||
|
||||
// ManifestReadWord is the word a node-engine states in manifest-reads when it reads a want by version and not by digests (design 47 H 772, H-A-45); the assigner holds a node whose engine does not state it. Other words in manifest-reads are free.
|
||||
type ManifestReadWord = string
|
||||
|
||||
// The values of ManifestReadWord.
|
||||
const (
|
||||
ManifestReadWordWantVersion = "want:version"
|
||||
)
|
||||
|
||||
// ManifestReadsChanged is what a node-engine says when what it reads changed or its node returned (ADR 0618 §4).
|
||||
type ManifestReadsChanged struct {
|
||||
// when it says it, RFC 3339
|
||||
@@ -1404,6 +1413,32 @@ type ManifestReadsAnswer struct {
|
||||
V int64 `json:"v"`
|
||||
}
|
||||
|
||||
// ApplyOrderInput is what apply-order takes.
|
||||
type ApplyOrderInput struct {
|
||||
}
|
||||
|
||||
// ApplyOrderAnswerOrderItem is a type of the contract.
|
||||
type ApplyOrderAnswerOrderItem struct {
|
||||
// the module whose want waits to be applied
|
||||
Module string `json:"module"`
|
||||
// the want's pipeline (its key); absent for a want in none
|
||||
Pipeline string `json:"pipeline,omitempty"`
|
||||
// its place in the order, the first applied being 1
|
||||
Position int64 `json:"position"`
|
||||
// the mover's tier in its pipeline; absent for a want in none
|
||||
Rank int64 `json:"rank,omitempty"`
|
||||
// the modules it waits on; empty when it waits for nothing
|
||||
Waits []string `json:"waits"`
|
||||
// why it stands there, in one sentence
|
||||
Why string `json:"why"`
|
||||
}
|
||||
|
||||
// ApplyOrderAnswer is what apply-order answers.
|
||||
type ApplyOrderAnswer struct {
|
||||
// one row per unapplied changed want, in the order it will be applied
|
||||
Order []ApplyOrderAnswerOrderItem `json:"order"`
|
||||
}
|
||||
|
||||
// SeatListInput is what seat-list takes.
|
||||
type SeatListInput struct {
|
||||
}
|
||||
|
||||
@@ -127,6 +127,8 @@ func TestFixtures(t *testing.T) {
|
||||
decode: func(b []byte) (any, error) { var v CompositionAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
|
||||
{name: "composition says withheld unknown when the grants part does not answer", subject: "", given: "{\"composition\":{\"key\":\"\"},\"judged\":{\"judgement\":\"\",\"waits_for_yes\":false,\"words\":\"\"},\"module\":\"zsh\",\"node\":\"workstation\",\"started\":false,\"withheld-unknown\":\"withheld unknown: the grants part does not answer\"}", wire: "{\"composition\":{\"key\":\"\"},\"judged\":{\"judgement\":\"\",\"waits_for_yes\":false,\"words\":\"\"},\"module\":\"zsh\",\"node\":\"workstation\",\"started\":false,\"withheld-unknown\":\"withheld unknown: the grants part does not answer\"}",
|
||||
decode: func(b []byte) (any, error) { var v CompositionAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
|
||||
{name: "apply-order answers the changed wants in the order they are applied, with why and what each waits on", subject: "", given: "{\"order\":[{\"module\":\"mesh-broker\",\"position\":1,\"waits\":[],\"why\":\"the bus module is applied first\"},{\"module\":\"mesh-delivery-view\",\"pipeline\":\"main.2\",\"position\":2,\"rank\":2,\"waits\":[\"mesh-delivery-indexer\"],\"why\":\"rank 2 of main.2, after rank 1\"}]}", wire: "{\"order\":[{\"module\":\"mesh-broker\",\"position\":1,\"waits\":[],\"why\":\"the bus module is applied first\"},{\"module\":\"mesh-delivery-view\",\"pipeline\":\"main.2\",\"position\":2,\"rank\":2,\"waits\":[\"mesh-delivery-indexer\"],\"why\":\"rank 2 of main.2, after rank 1\"}]}",
|
||||
decode: func(b []byte) (any, error) { var v ApplyOrderAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
|
||||
}
|
||||
for _, c := range cases {
|
||||
v, err := c.decode([]byte(c.given))
|
||||
|
||||
Reference in New Issue
Block a user