diff --git a/checks/readable/go.mod b/checks/readable/go.mod index 5e10aa28e..8de6e7097 100644 --- a/checks/readable/go.mod +++ b/checks/readable/go.mod @@ -2,6 +2,11 @@ module checks/readable go 1.26.0 -require git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261104174359-05b3e2e1b94f +require ( + git.novox.be/novox/mesh-catalog/modules/disk-load/diskreadings v0.0.0-00010101000000-000000000000 + git.novox.be/novox/mesh-catalog/modules/restic/backupgood v0.0.0-00010101000000-000000000000 +) -require git.novox.be/novox/mesh-contracts/go v0.0.0-20261104174344-ae5266e77639 // indirect +replace git.novox.be/novox/mesh-catalog/modules/disk-load/diskreadings => ../../modules/disk-load/diskreadings + +replace git.novox.be/novox/mesh-catalog/modules/restic/backupgood => ../../modules/restic/backupgood diff --git a/checks/readable/main.go b/checks/readable/main.go index 8fa81fba9..b455f0f35 100644 --- a/checks/readable/main.go +++ b/checks/readable/main.go @@ -6,7 +6,7 @@ // the owner's manifest went with clause 5, and announcetest holds a module to its own list, not to its readers. // // An owner announces from its code. A Go module announces when its code imports mesh-sdk's go/announce: every -// announce.State literal there is read, its Name a string, a constant of the package, or a constant of mesh-sdk this +// announce.State literal there is read, its Name a string, a constant of the package, or a constant of an owner's package this // check knows (Known). A TypeScript module announces when its code says the event `states` or calls the SDK's keeps: // every `{ name: "...", readable: true }` there is read. An owner that announces nothing from code is read as before // on the mesh, and is not judged; neither is an owner outside the catalogue (another repository's). @@ -29,13 +29,15 @@ import ( "strconv" "strings" - "git.novox.be/novox/mesh-sdk/go/health" + "git.novox.be/novox/mesh-catalog/modules/disk-load/diskreadings" + "git.novox.be/novox/mesh-catalog/modules/restic/backupgood" ) -// Known are the mesh-sdk constants an announcement may name a state by, by the selector the code writes. +// Known are the constants of the owners' published packages an announcement may name a state by, by the selector the +// code writes: disk-load's readings and restic's last good night (ADR 0634 ยง4: a reading's layout is its owner's). var Known = map[string]string{ - "health.GoodState": health.GoodState, - "health.ReadingsState": health.ReadingsState, + "backupgood.GoodState": backupgood.GoodState, + "diskreadings.ReadingsState": diskreadings.ReadingsState, } const announcePkg = `"git.novox.be/novox/mesh-sdk/go/announce"` diff --git a/checks/readable/main_test.go b/checks/readable/main_test.go index 3a15e322c..808b5326e 100644 --- a/checks/readable/main_test.go +++ b/checks/readable/main_test.go @@ -30,7 +30,7 @@ func TestFindings(t *testing.T) { {"go, a known mesh-sdk name and readers", map[string]string{ "modules/r/module.json": `{"module":"r","reads":["o.good","o.s"]}`, "modules/o/module.json": `{"module":"o"}`, - "modules/o/cmd/o/main.go": goOwner + "var _ = []announce.State{{Name: health.GoodState, Readable: true}, {Name: \"s\", Readers: []string{\"r\"}}}\n"}, ""}, + "modules/o/cmd/o/main.go": goOwner + "var _ = []announce.State{{Name: backupgood.GoodState, Readable: true}, {Name: \"s\", Readers: []string{\"r\"}}}\n"}, ""}, {"go, a name that cannot be read", map[string]string{ "modules/r/module.json": `{"module":"r","reads":["o.s"]}`, "modules/o/module.json": `{"module":"o"}`,