diff --git a/checks/health/go.mod b/checks/health/go.mod index f008c287..991582e3 100644 --- a/checks/health/go.mod +++ b/checks/health/go.mod @@ -2,4 +2,13 @@ module checks/health go 1.26.0 -require git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261031084708-acbf80ad910a +require git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261101012031-7cab079e2ec3 + +require ( + github.com/klauspost/compress v1.20.0 // indirect + github.com/nats-io/nats.go v1.54.0 // indirect + github.com/nats-io/nkeys v0.4.16 // indirect + github.com/nats-io/nuid v1.0.1 // indirect + golang.org/x/crypto v0.57.0 // indirect + golang.org/x/sys v0.48.0 // indirect +) diff --git a/checks/health/go.sum b/checks/health/go.sum index 0989a83d..2252671d 100644 --- a/checks/health/go.sum +++ b/checks/health/go.sum @@ -1,2 +1,16 @@ git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261031084708-acbf80ad910a h1:DcSvfEmdPBKqCg5OmXRNb269EkkPe7BsEp+RykEhkgE= git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261031084708-acbf80ad910a/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261101012031-7cab079e2ec3 h1:an2f0MLx9OhaDLu5i51OMPBbuGwX+aoTzqOkFLMpVfE= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261101012031-7cab079e2ec3/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= +github.com/klauspost/compress v1.20.0 h1:a3C1ke2ohxFymNlb2HWAHjDeKCI90scRskErZkR0ezA= +github.com/klauspost/compress v1.20.0/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI= +github.com/nats-io/nats.go v1.54.0 h1:vsXoOxjHp/GmPUN+EcI7uOf/uB+iAP+kEsAFNQN0yzA= +github.com/nats-io/nats.go v1.54.0/go.mod h1:y+DZoD1oBOYfZTU681eTUiUjI0vbqYGixNVFHcjHJ0k= +github.com/nats-io/nkeys v0.4.16 h1:rd5oAuLOb8mnAycB0xleuEBNS1pVVnN0fv/FF34Eypg= +github.com/nats-io/nkeys v0.4.16/go.mod h1:llLgWoI0o4z/Q57q2R1kHfmocyhGV6VG/U18Glg1Afs= +github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +golang.org/x/crypto v0.57.0 h1:3ZVCjf8Ggz7zneR/EHRVx68Ctf+2pmIMP2UFhh9cC6M= +golang.org/x/crypto v0.57.0/go.mod h1:Fdz0i5U6CoizGwLda9DttjSk6qlZo25zYNtR+ycvuZA= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= diff --git a/checks/health/health.go b/checks/health/health.go index 0797da65..c88b9eff 100644 --- a/checks/health/health.go +++ b/checks/health/health.go @@ -1,7 +1,8 @@ // Package health is the catalogue's count of long-running resources that do not say how they are ready (novox/hq ADR 0240 rule // 8), kept in health-undeclared and judged by a test over the real tree (ADR 0529 clauses 2 and 4): it replaces the step of -// merge-check.sh that read it out of the controller's `module check`. Every manifest is read through mesh-sdk's catalogue -// package, the one the controller counts with. +// merge-check.sh that read it out of the controller's `module check`. Every manifest is decoded with mesh-sdk's catalogue +// package, the one the controller counts with, and judged by nothing here (novox/hq ADR 0578 ยง3): a resource's `health` is +// in the manifest itself, not in a template's text. package health import ( @@ -27,7 +28,11 @@ func Count(root string) (int, error) { } n := 0 for _, path := range manifests { - m, err := catalogue.ReadTreeManifest(root, filepath.Dir(path)) + raw, err := os.ReadFile(path) + if err != nil { + return 0, err + } + m, err := catalogue.Decode(raw) if err != nil { return 0, fmt.Errorf("%s: %w", path, err) } diff --git a/checks/health/reads-outside b/checks/health/reads-outside index f6ce1405..98f5c579 100644 --- a/checks/health/reads-outside +++ b/checks/health/reads-outside @@ -1,10 +1,6 @@ # What these tests read outside their package, as paths from the repository's root (a glob, or a directory read whole; # ? before a path whose absence is read). mesh-build-go hashes them into the package's digest, so its verdict is kept # until one of them changes (issue 1936). An empty list, or a line matching nothing, keeps nothing. -# every manifest through mesh-sdk's ReadTreeManifest: the root's predefined keys and each templated module's -# templates (files/ by default, or the directory its manifest names); and the root's kept count of resources that do not say how they are ready. +# every manifest, decoded; and the root's kept count of resources that do not say how they are ready. modules/*/module.json -predefined.json -modules/*/files -modules/*/templates health-undeclared