RemovedDeliveryVerbs leaves mesh-sdk for the seat mesh-delivery's client (ADR 0634 section 2, issue 1966)
Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package meshdeliveryclient
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -89,3 +91,39 @@ func TestTheAsksAndOwedActsKeepTheirFormsAndRules(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The removed verbs are the optional rows of the seat's definition that say they were removed, each with the replacement
|
||||
// the definition gives: the list and the definition cannot drift apart.
|
||||
func TestTheRemovedVerbsAreTheDefinitionsRemovedRows(t *testing.T) {
|
||||
raw, err := os.ReadFile("../../../seats/mesh-delivery/seat.json")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var def struct {
|
||||
Verbs []struct {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Optional bool `json:"optional"`
|
||||
} `json:"verbs"`
|
||||
}
|
||||
if err := json.Unmarshal(raw, &def); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
removed := RemovedVerbs()
|
||||
rows := 0
|
||||
for _, v := range def.Verbs {
|
||||
if !strings.HasPrefix(v.Description, RemovedPrefix) {
|
||||
if _, in := removed[v.Name]; in {
|
||||
t.Errorf("%s is in the removed list, the definition keeps it", v.Name)
|
||||
}
|
||||
continue
|
||||
}
|
||||
rows++
|
||||
if want, in := removed[v.Name]; !in || !v.Optional || v.Description != RemovedPrefix+want {
|
||||
t.Errorf("%s: in the list %v, optional %v, described %q, want %q", v.Name, in, v.Optional, v.Description, RemovedPrefix+want)
|
||||
}
|
||||
}
|
||||
if rows != len(removed) || rows == 0 {
|
||||
t.Errorf("the definition removes %d verbs, the list names %d", rows, len(removed))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package meshdeliveryclient
|
||||
|
||||
// RemovedPrefix opens the description of a verb release 6 removed from the seat mesh-delivery (novox/hq ADR 0539 clause 17):
|
||||
// the definition keeps it as an optional row with no input, so the holder of before and the holder of release 6 both hold
|
||||
// the seat, and a caller is answered by name with its replacement.
|
||||
const RemovedPrefix = "Removed in R6 (ADR 0539): refused by name, naming its replacement: "
|
||||
|
||||
// RemovedVerbs are the seat's verbs release 6 removed, each with its replacement in words: with no plan the gate keeps the
|
||||
// merge's states and derives nothing after the merge. A new map each call.
|
||||
func RemovedVerbs() map[string]string {
|
||||
return map[string]string{
|
||||
"times": "the delivery view (nox-delivery): each machine's want and have, and since when",
|
||||
"what-if": "the merge check's composition, which composes every machine a change touches",
|
||||
"release": "the assigner's asks (hold, restore, backup, record), answered on the phone or in the delivery view",
|
||||
"stop": "a bad fingerprint is held and its canary set back by the assigner (ADR 0429 §6, ADR 0539 clause 18)",
|
||||
"retire-history": "nothing to retire: the gate keeps no delivery after its merge",
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user