Merge main: the trunk renamed the seats and made them data
Both branches changed the seat set from the same starting point, so every number collided and every `mesh-*` name existed twice. The trunk's numbers and names win: this branch's records became 0129/0130 and its migrations 0037/0038, and the hardcoded rename map gave way to the trunk's `seat_alias` table — a rename is a row now (ADR 0122), not a recompile. Three of my checks were wrong and the merge is what showed it: A seat with an empty protocol is a marker, not an incomplete declaration. Most node-scoped seats are markers — which module is this machine's packet filter — and refusing one refused most of the set, the showcase module included. A mistyped field name is already refused by the parser, so an empty protocol was written as one deliberately. A claim on a seat this manifest does not declare is not the parser's to judge. A module may hold a seat another module declared; that is the whole reason ADR 0126 has callers name the seat and not its provider. Whether the seat exists is a fact about the catalogue, so the refusal is at registration, where every declaration is in view. And a seat may share a name with the provision it delivers. `git`, the npm registry and the artifact store still do, because renaming a delivering seat cascades to every consumer requiring it, with a window where a holder stops resolving mid-flight. The trunk deferred exactly those three on purpose. Full suite green against a real NATS and store.
This commit is contained in:
@@ -70,7 +70,7 @@ func declaredSeatProblems(m Manifest) []string {
|
||||
var problems []string
|
||||
seen := map[string]bool{}
|
||||
|
||||
for _, s := range m.Seats {
|
||||
for _, s := range m.DefinesSeats {
|
||||
switch {
|
||||
case s.Name == "":
|
||||
problems = append(problems, fmt.Sprintf("%s declares a seat with no name", m.Module))
|
||||
@@ -105,14 +105,13 @@ func declaredSeatProblems(m Manifest) []string {
|
||||
"%s declares seat %s at scope %q; a seat is held per node, per site or per mesh",
|
||||
m.Module, s.Name, s.Scope))
|
||||
}
|
||||
if len(s.verbs()) == 0 {
|
||||
// A seat with no protocol is exclusion with nothing on the other side of it. If a
|
||||
// module only wants "there is one of me", that is a claim, and saying so keeps the
|
||||
// word "seat" meaning something callers can depend on.
|
||||
problems = append(problems, fmt.Sprintf(
|
||||
"%s declares seat %s with no protocol; a seat says what may be sent to it, what "+
|
||||
"it emits and what it serves", m.Module, s.Name))
|
||||
}
|
||||
// A seat with an empty protocol is allowed, and is the mesh saying what a machine is:
|
||||
// which module is this node's packet filter, or its showcase. Design 26 calls it a seat
|
||||
// that delivers nothing, and that is most of the node-scoped ones. ADR 0126's "a declared
|
||||
// seat carries a protocol" governs what a holder must satisfy, not that every seat offers
|
||||
// something — a marker seat's protocol is satisfied by holding it. Nothing can reach this
|
||||
// state by accident: a mistyped field name is refused by the parser above, so an empty
|
||||
// protocol was written as one.
|
||||
for _, v := range s.verbs() {
|
||||
if !name.MatchString(v) {
|
||||
problems = append(problems, fmt.Sprintf(
|
||||
@@ -143,7 +142,7 @@ func CatalogueProblems(shelf Shelf) []string {
|
||||
declaredBy := map[string]string{}
|
||||
declared := map[string]SeatDeclaration{}
|
||||
for _, module := range shelfOrder(shelf) {
|
||||
for _, s := range shelf[module].Seats {
|
||||
for _, s := range shelf[module].DefinesSeats {
|
||||
if s.Name == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user