Issue 1585, S19: the strict parser, every manifest problem function and the judge's tables (192 declarations, about 5,200 lines) and their 244 tests leave; composition keeps its own refusals and the helpers it uses. The catalogue's tests decode the manifests they build. ParseManifest, ParseManifestWith, ParseManifestForInputs, CatalogueProblems and the rest are gone; mesh-delivery-indexer/judge holds them. Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
31 lines
1.4 KiB
Go
31 lines
1.4 KiB
Go
package catalogue
|
|
|
|
// How loud a module's unhealthy condition is (novox/hq ADR 0355, extending ADR 0240).
|
|
//
|
|
// **A module may declare its unhealthy urgent.** A module whose failure costs people something they rely on
|
|
// (mail refused or stuck for everyone with a mailbox) says so with `unhealthy`, and its condition
|
|
// `module.<module>.<machine>.unhealthy` is raised urgent instead of a warning. **Urgent needs a why**, as an
|
|
// `upgrade` policy other than roll does: a person reading the catalogue sees what is lost while it is broken.
|
|
|
|
// The severities a module may declare for its unhealthy condition.
|
|
const (
|
|
// UnhealthyUrgent raises the module's unhealthy condition urgent, on every machine it runs on.
|
|
UnhealthyUrgent = "urgent"
|
|
// UnhealthyWarning is what a module's unhealthy condition is without the field, said out loud.
|
|
UnhealthyWarning = "warning"
|
|
)
|
|
|
|
// UnhealthyPolicy is what a module says about how loud its unhealthy condition is: `unhealthy` in its manifest
|
|
// (novox/hq ADR 0355).
|
|
type UnhealthyPolicy struct {
|
|
Severity string `json:"severity"`
|
|
// Why names what people lose while the module is broken. It is required: a module that says nothing of
|
|
// why it is loud is refused.
|
|
Why string `json:"why,omitempty"`
|
|
}
|
|
|
|
// UnhealthyIsUrgent is whether the module declares its unhealthy condition urgent (novox/hq ADR 0355 §1).
|
|
func (m Manifest) UnhealthyIsUrgent() bool {
|
|
return m.Unhealthy != nil && m.Unhealthy.Severity == UnhealthyUrgent
|
|
}
|