D4 judge-foundation-list: the parts G puts on the foundation list keep their old sections before it
Before G's merge the foundation list stays as it is; the forge module, the image registry module and the node-engine's module are accepted with their old `objects` section, their stream `<module>-findings` and their bus state in `requires`, as G's judge accepts them, and are counted as today, so no other module's verdict moves. Builds: design 47 G §584, §627, §529, A-343, A-345 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -116,7 +116,15 @@ func TestTheJudge(t *testing.T) {
|
||||
"user": {Raw: json.RawMessage(`{"module":"user","version":"1","state":["x"]}`)},
|
||||
"late": {Raw: json.RawMessage(`{"module":"late","version":"1","logs":[{"name":"l"}]}`)},
|
||||
"newer": {Raw: json.RawMessage(`{"module":"newer","version":"1","state":["y"]}`)},
|
||||
"mesh-grants": {Raw: json.RawMessage(`{"module":"mesh-grants","version":"1","logs":[{"name":"l"}]}`)}}},
|
||||
"mesh-grants": {Raw: json.RawMessage(`{"module":"mesh-grants","version":"1","logs":[{"name":"l"}]}`)},
|
||||
// Design 47 G §584, §627, A-345: the parts G puts on the foundation list keep their old sections before it, the
|
||||
// old objects section, the stream `<module>-findings` and bus state in `requires` among them; another module's
|
||||
// old objects section, which no trunk module uses, is refused as before.
|
||||
"gitea": {Raw: json.RawMessage(`{"module":"gitea","version":"1","objects":[{"name":"incoming","max-mib":64}],` +
|
||||
`"requires":[{"name":"idle","storage":"key-value","template":"state"}]}`)},
|
||||
"mesh-host": {Raw: json.RawMessage(`{"module":"mesh-host","version":"1","streams":[` +
|
||||
`{"name":"mesh-host-findings","events":["finding-written.*"],"max-age-days":7,"max-mib":16}]}`)},
|
||||
"keeper": {Raw: json.RawMessage(`{"module":"keeper","version":"1","objects":[{"name":"incoming","max-mib":64}]}`)}}},
|
||||
{Name: "trunk", Manifests: map[string]composer.Manifest{
|
||||
"user": {Raw: json.RawMessage(`{"module":"user","version":"1","state":["x"]}`)},
|
||||
"mesh-grants": {Raw: json.RawMessage(`{"module":"mesh-grants","version":"1","logs":[{"name":"l"}]}`)}}}}}
|
||||
@@ -126,7 +134,8 @@ func TestTheJudge(t *testing.T) {
|
||||
}
|
||||
got := ov.Cases[0].Manifests
|
||||
if got["late"].Accepted || !strings.Contains(got["late"].Refused, "late uses the old section logs") ||
|
||||
!got["newer"].Accepted || !got["user"].Accepted || !got["mesh-grants"].Accepted {
|
||||
!got["newer"].Accepted || !got["user"].Accepted || !got["mesh-grants"].Accepted || !got["gitea"].Accepted ||
|
||||
!got["mesh-host"].Accepted || got["keeper"].Accepted || !strings.Contains(got["keeper"].Refused, "keeper uses the old section objects") {
|
||||
t.Errorf("the change's old sections: %+v", got)
|
||||
}
|
||||
r.Cases[0].Manifests["c"] = composer.Manifest{Digest: strings.Repeat("a", 64)}
|
||||
|
||||
@@ -23,6 +23,12 @@ var OldSections = []string{"state", "logs", "streams", "objects"}
|
||||
var Foundation = []string{"nats", "mesh-grants", "mesh-delivery-indexer", "mesh-delivery-assigner", "node-tools",
|
||||
"mesh-delivery-builder", "mesh-delivery-checker", "mesh-config", "mesh-vault"}
|
||||
|
||||
// foundationAtG are the parts design 47 G puts on the foundation list in its own change: the forge module and the image
|
||||
// registry module (G §584) and the node-engine's module (§627). Until then their old sections are accepted as a foundation
|
||||
// part's, its old `objects` section and its stream `<module>-findings` among them, and their bus state in `requires` as
|
||||
// today (A-343, A-345); they are counted as today, so no other module's verdict moves.
|
||||
var foundationAtG = []string{"gitea", "distribution", "mesh-host"}
|
||||
|
||||
// ViewOwners are the two owners whose state every reader reads through their first views and read tools, never by a
|
||||
// `reads` entry (novox/hq ADR 0615 §1): CountOwnerReads counts what is left of those entries.
|
||||
var ViewOwners = []string{"mesh-delivery-indexer", "mesh-delivery-assigner"}
|
||||
@@ -90,7 +96,7 @@ func OldSectionProblems(m catalogue.Manifest, counts OldSectionCounts) []string
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if counts == nil {
|
||||
if counts == nil || slices.Contains(foundationAtG, m.Module) {
|
||||
return nil
|
||||
}
|
||||
var problems []string
|
||||
|
||||
@@ -5701,8 +5701,9 @@ func PredefinedFormProblems(m catalogue.Manifest) []string {
|
||||
for _, s := range m.Streams {
|
||||
// A stream that keeps its history is one of the bus's predefined forms (novox/hq ADR 0592 §6).
|
||||
// A foundation part keeps its old sections for good, its streams among them: its findings stream
|
||||
// `<module>-findings` (design 47 G §529, A-30, A-146).
|
||||
if !s.KeepsHistory() && !slices.Contains(Foundation, m.Module) && !slices.Contains(streamsKeptUntilMoved[m.Module], s.Name) {
|
||||
// `<module>-findings` (design 47 G §529, A-30, A-146); so do the parts G puts on the list (A-345).
|
||||
foundation := slices.Contains(Foundation, m.Module) || slices.Contains(foundationAtG, m.Module)
|
||||
if !s.KeepsHistory() && !foundation && !slices.Contains(streamsKeptUntilMoved[m.Module], s.Name) {
|
||||
out = append(out, fmt.Sprintf("%s keeps the stream %q, outside the bus's predefined forms: keep it as a state, "+
|
||||
"a log or an object store, which the runtime reads for the module's tools and others read by `reads`", m.Module, s.Name))
|
||||
}
|
||||
|
||||
@@ -5226,6 +5226,11 @@ func caseTwoModulesCannotDeclareOneStream(t *testing.T) {
|
||||
if got := PredefinedFormProblems(catalogue.Manifest{Module: "mesh-delivery-indexer", Streams: findings}); len(got) != 0 {
|
||||
t.Fatalf("a foundation part's findings stream was refused: %v", got)
|
||||
}
|
||||
// So does a part G puts on the list, before it (design 47 G §627, A-345).
|
||||
hostFindings := []catalogue.StreamDeclaration{{Name: "mesh-host-findings", Events: []string{"finding-written.*"}}}
|
||||
if got := PredefinedFormProblems(catalogue.Manifest{Module: "mesh-host", Streams: hostFindings}); len(got) != 0 {
|
||||
t.Fatalf("the node-engine's findings stream was refused: %v", got)
|
||||
}
|
||||
}
|
||||
|
||||
// A seat name meaning two protocols is the failure nobody could diagnose afterwards.
|
||||
|
||||
Reference in New Issue
Block a user