JUDGE (§584, A-54): every stream of a foundation part is a predefined form, its old sections kept for good
keptUntilMoved passes the streams of a Foundation module (the findings stream <module>-findings, distribution-events); a row in caseTwoModulesCannotDeclareOneStream names distribution-events (fails without the change). Builds: design 47 G §584, A-54, A-30 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -5567,8 +5567,9 @@ var seatStreamsKeptUntilMoved = map[string][]string{
|
||||
// keptUntilMoved is whether a stream of a manifest is one kept until its module moves it: by the module's name, or by a
|
||||
// seat it claims.
|
||||
func keptUntilMoved(m catalogue.Manifest, stream string) bool {
|
||||
// A foundation part says its findings on its old stream `<module>-findings` for good (design 47 G §529, A-30).
|
||||
if stream == FindingStreamOf(m.Module) && slices.Contains(Foundation, m.Module) {
|
||||
// A foundation part keeps its old sections for good, its streams among them: its findings stream `<module>-findings`
|
||||
// (design 47 G §529, A-30) and the image registry's `distribution-events` (§584, A-54).
|
||||
if slices.Contains(Foundation, m.Module) {
|
||||
return true
|
||||
}
|
||||
if slices.Contains(streamsKeptUntilMoved[m.Module], stream) {
|
||||
|
||||
@@ -5121,12 +5121,15 @@ func caseTwoModulesCannotDeclareOneStream(t *testing.T) {
|
||||
if got := PredefinedFormProblems(catalogue.Manifest{Module: "mesh-build-go", Streams: toolchains}); len(got) != 1 {
|
||||
t.Fatalf("a toolchain stream of a module claiming no build seat was kept by its name: %v", got)
|
||||
}
|
||||
// A foundation part says its findings on its old stream `<module>-findings` for good (design 47 G §529, A-30); a part
|
||||
// that is no foundation part keeps none (its findings go by the template `events`).
|
||||
// A foundation part keeps its old streams for good: its findings stream `<module>-findings` (design 47 G §529, A-30) and
|
||||
// distribution's `distribution-events` (§584, A-54); a part that is no foundation part keeps none.
|
||||
findings := []catalogue.StreamDeclaration{{Name: "mesh-config-findings", Events: []string{"finding-written.*"}}}
|
||||
if got := PredefinedFormProblems(catalogue.Manifest{Module: "mesh-config", Streams: findings}); len(got) != 0 {
|
||||
t.Fatalf("a foundation part's findings stream was refused: %v", got)
|
||||
}
|
||||
if got := PredefinedFormProblems(catalogue.Manifest{Module: "distribution", Streams: []catalogue.StreamDeclaration{{Name: "distribution-events", Events: []string{"old-name-closed"}}}}); len(got) != 0 {
|
||||
t.Fatalf("a foundation part's events stream was refused: %v", got)
|
||||
}
|
||||
if got := PredefinedFormProblems(catalogue.Manifest{Module: "mesh-config-b", Streams: []catalogue.StreamDeclaration{{Name: "mesh-config-b-findings", Events: []string{"finding-written.*"}}}}); len(got) != 1 {
|
||||
t.Fatalf("a findings stream of a part outside the foundation was kept: %v", got)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user