K5 missing-reads-go: graph.MissingReads goes, with its rows

Builds: design 47 H2 H-A-639 (DQ-1)
This commit is contained in:
2026-11-25 17:10:55 +01:00
parent 25e9d71e19
commit e0f69f73d3
2 changed files with 0 additions and 56 deletions
@@ -18,25 +18,6 @@ func TestGraphEdges(t *testing.T) {
t.Run("a node's value", nodeValues)
t.Run("a reader of the seat list waits for its holder", readersOfTheSeatList)
t.Run("a verb is served by a running healthy have of the node-engine contract", servedByHaves)
// ADR 0636 §2, issue 1966: a need of a bootstrapped seat is read by every engine whatever its statement names; a seat
// not bootstrapped and a word stay missing, and an engine stating none is read as the baseline.
t.Run("a bootstrapped seat is read by every engine", func(t *testing.T) {
stated := []string{"word:claims", "word:invokes"}
for _, c := range []struct {
name string
needs, stated []string
want []string
}{
{"mesh-catalog and node-backup", []string{"seat:mesh-catalog", "seat:node-backup", "word:invokes"}, stated, nil},
{"a seat not bootstrapped", []string{"seat:mesh-catalog", "seat:mesh-vault"}, stated, []string{"seat:mesh-vault"}},
{"a word", []string{"seat:node-engine", "word:zone"}, stated, []string{"word:zone"}},
{"the baseline", []string{"seat:mesh-catalog", "form:seat-reach"}, nil, []string{"form:seat-reach"}},
} {
if got := MissingReads(c.needs, c.stated); !slices.Equal(got, c.want) {
t.Errorf("%s: missing %v, want %v", c.name, got, c.want)
}
}
})
fp := "src2:" + strings.Repeat("b", 64)
node := func(repository, path string, edit func(*Node)) Node {
n := Node{FP: fp, Repository: repository, Path: path}
-37
View File
@@ -1,37 +0,0 @@
package graph
import (
"slices"
"strings"
"sync"
"git.novox.be/novox/mesh-sdk/go/catalogue"
"git.novox.be/novox/mesh-sdk/go/seatlist"
)
// bootstrappedReads are the reader capabilities `seat:<seat>` of the bootstrapped seats: the embedded files' own, so
// computed once.
var bootstrappedReads = sync.OnceValue(func() []string {
var out []string
for _, d := range seatlist.Bootstrapped() {
out = append(out, catalogue.ReadSeat+d.Seat)
}
return out
})
// MissingReads is catalogue.MissingManifestReads with every need of a bootstrapped seat counted as read (novox/hq ADR 0614
// §4, ADR 0636 §2): every reader of the seat list holds the bootstrapped seats from its start, before it has read the list,
// so a manifest naming one is read by every node-engine whatever its statement names. Without it an engine whose statement
// was made before its list was in use states no seat, and the node-engine's own build naming mesh-catalog is held on the
// very engine that would state it (issue 1966). The assigner's capability hold and the indexer's hold both judge with it,
// so the rule is one.
func MissingReads(needs, stated []string) []string {
boot := bootstrappedReads()
missing := slices.DeleteFunc(catalogue.MissingManifestReads(needs, stated), func(n string) bool {
return strings.HasPrefix(n, catalogue.ReadSeat) && slices.Contains(boot, n)
})
if len(missing) == 0 {
return nil
}
return missing
}