Files
mesh-catalog/modules/mesh-conditions/cmd/mesh-conditions/homes.go
T
jschoubben 236ce2fe12 mesh-conditions: the indexer's manifest-held has its home (ADR 0632 §2; issue 1966)
A module's new entry held from the whole mesh past its bound is a finding of
the indexer's; without a home the keeper would not raise it.

Claude-Session: https://claude.ai/code/session_01JG73KG7AfSdh6FP8VrBqCn
2026-11-04 21:38:14 +01:00

215 lines
15 KiB
Go

package main
// **Where each condition kind the controller raised lives now** (novox/hq ADR 0564 clauses 4, 6, 7 and 9, the Context's
// probe table; issue 1952 C3, C5): data, so a kind's home is a row and never code. The keeper reads it to clear, once,
// what it carried of the kinds that ended with the controller (EndCarried, issue 1126); `compare`, which read it too,
// went with the controller (ADR 0590).
//
// The rows are ADR 0564's and the lead's table of 2026-10-29, by the controller's source of each kind.
// Home is where one condition kind lives.
type Home struct {
// Source is the controller's row or probe that raises it today, for whoever reads the table.
Source string
// Controller says the controller raises this kind today: a kind it never raises is the keeper's alone and is no
// difference in compare.
Controller bool
// Observer is the module whose findings raise it after the take-over; empty for a kind that ends.
Observer string
// Carried says it ended with the controller: carried from its bucket while it ran (clause 9: S4, S7, S12, S13, S14,
// S25, D5, D9, H-controller), cleared once by EndCarried and never carried again (issue 1126).
Carried bool
// Replaced says the kind itself ends and another observes its fault (D1, D10, the stuck probe): listed apart in
// compare and not carried.
Replaced bool
// Why is why a kind is carried when the record's table gave it another home: said by compare beside it.
Why string
}
// Dropped is the reason of the probes the operator dropped from this release (D2, D3, D4, D12, D-heard, D-root, D11,
// and D13's data held twice): their kinds end with the controller and are carried until the lease write.
// EndedD6 is the reason of the bus-consumer probe's kinds: the probe ended with the controller (issue 1126).
const EndedD6 = "ended with the controller on 2026-11-02; the grants part says its account consumers' differences and delays (issue 1126)"
const Dropped = "dropped 2026-10-30 by the operator; the owning module declares its own check later (research 074)"
// The kinds' homes, by kind: ADR 0564's rows, and the 63 kinds the controller's code raises that the record left without
// one, as the lead settled them under the operator's yes on 2026-10-29 (.work/47-release/kinds-section.html, with the
// lead's three changes: lease-split and image-missing do not end, and the data rows read their readings from disk-load).
var Homes = map[string]Home{
// The watchman's watchdogs (clause 4).
"silent": {Source: "S1", Controller: true, Observer: watchman},
"max-deliveries": {Source: "S9", Controller: true, Observer: watchman},
"slow-consumer": {Source: "S9", Controller: true, Observer: watchman},
"refused": {Source: "S9", Controller: true, Observer: watchman},
"connection-closed": {Source: "S9", Controller: true, Observer: watchman},
"bus-faults-unread": {Source: "S9", Controller: true, Observer: watchman},
"tools-silent": {Source: "S11", Controller: true, Observer: watchman},
"apply-failing": {Source: "S21", Controller: true, Observer: watchman},
"module-unhealthy": {Source: "health", Controller: true, Observer: watchman},
"stuck": {Source: "DM", Controller: true, Observer: watchman},
"provider-failing": {Source: "S8", Controller: true, Observer: watchman},
"provider-silent": {Source: "S8", Controller: true, Observer: watchman},
"self-check-silent": {Source: "S10", Controller: true, Observer: watchman},
// From the provision keys in waits (ADR 0570 §7), a setting's wait from the node's own health report.
"needs-operator": {Source: "health", Controller: true, Observer: watchman},
// From the vault's record of each secret given (ADR 0570 §7).
"secret-given": {Source: "desk", Controller: true, Observer: watchman},
// The watchman reading each node's own health report key (a4's, mesh-host).
"machine-network": {Source: "node", Controller: true, Observer: watchman},
"network-rewritten": {Source: "node", Controller: true, Observer: watchman},
"network-unreachable": {Source: "node", Controller: true, Observer: watchman},
"machine-units": {Source: "node", Controller: true, Observer: watchman},
"relogin-needed": {Source: "health", Controller: true, Observer: watchman},
"directory-used-as-found": {Source: "health", Controller: true, Observer: watchman},
// The self-check's probes (clause 6, the Context's table).
"lease-split": {Source: "D5", Controller: true, Observer: selfCheck}, // a seat held once answers from two holders
"stream-wrong": {Source: "D7", Controller: true, Observer: selfCheck},
"own-address-banned": {Source: "D8", Controller: true, Observer: selfCheck},
"data-unmeasured": {Source: "D13", Controller: true, Observer: selfCheck},
"data-shrank": {Source: "D13", Controller: true, Observer: selfCheck}, // readings from disk-load (L7)
"empty-replacement": {Source: "D13", Controller: true, Observer: selfCheck},
"data-quiet": {Source: "D13", Controller: true, Observer: selfCheck},
"backup-stale": {Source: "D13", Controller: true, Observer: selfCheck},
"data-missing": {Source: "D13", Controller: true, Observer: selfCheck},
"array-degraded": {Source: "D13", Controller: true, Observer: selfCheck},
"protection-missing": {Source: "D13", Controller: true, Observer: selfCheck},
"bus-reconnects": {Source: "D15", Controller: true, Observer: selfCheck},
"bucket-or-log-filling": {Source: "fill", Controller: true, Observer: selfCheck},
"bucket-or-log-unread": {Source: "fill", Controller: true, Observer: selfCheck},
"watchdogs-silent": {Source: "DW", Controller: true, Observer: selfCheck},
"core-unhealthy": {Source: "H-bus", Controller: true, Observer: selfCheck},
"agent-can-become-root": {Source: "DA", Controller: true, Observer: selfCheck},
"probe-failed": {Source: "doctor", Controller: true, Observer: selfCheck},
// The healers' own (clause 7, Limits 2).
"healer-wanted": {Source: "S15", Controller: true, Observer: healers},
"healers-braked": {Source: "healers", Controller: true, Observer: healers},
// The assigner's, as its own findings (the bus step, ADR 0565 §9).
"bus-maintenance": {Source: "bus", Controller: true, Observer: assigner},
// The provisioner's (ADR 0570 §5): its own ask replaces retire-waiting; a declined key stays its finding.
"retire-waiting": {Source: "retire", Controller: true, Observer: provisioner},
"retire-rejected": {Source: "retire", Controller: true, Observer: provisioner},
// The router's own: no channel delivered a question.
"asks-undelivered": {Source: "asks", Controller: true, Observer: messenger},
// The seat mesh-artifact-sweep (L7): an image a want names is missing from the store, artifact-store-tools' finding.
"image-missing": {Source: "S25", Controller: true, Observer: artifactStore},
// mesh-config's own (design 32): a rename it refused, a rename window or a retirement held seven days by a node, a
// retirement asked twice and not answered.
"rename-refused": {Source: "config", Observer: configModule},
"rename-window-held": {Source: "config", Observer: configModule},
"retirement-held": {Source: "config", Observer: configModule},
"retiring-unanswered": {Source: "config", Observer: configModule},
// A reader whose owner does not answer its first view past two minutes (ADR 0615 §6): written by each reader in its own
// findings (mesh-config, mesh-vault), so the kind has no one observer.
"first-view-unanswered": {Source: "views", Why: "every reader of the indexer's or the assigner's state writes its own"},
// An owner's views event too large to say (ADR 0615 §5): written by each owner of a views family in its own findings
// (the indexer, the assigner), so the kind has no one observer.
"view-too-large": {Source: "views", Why: "every owner of a views family writes its own"},
// An owner's change not said on its views family past its bound (mesh-sdk views.UnsaidFinding, id <owner>.<state>):
// written by each owner of a views family in its own findings (the indexer, the assigner), so no one observer.
"view-unsaid": {Source: "views", Why: "every owner of a views family writes its own"},
// The builder's own (design 51): a build that ended failed, a floor whose holder said nothing past its bound, an old
// form held seven days by a counted node-engine, a tag's removal asked and not done.
"build-failed": {Source: "builder", Observer: builder},
"floor-silent": {Source: "builder", Observer: builder},
"old-form-held": {Source: "builder", Observer: builder},
"tag-removal-not-done": {Source: "builder", Observer: builder},
// The builder's publishing (design 51): a holder refused the publish, or said nothing past its bound (about the name);
// a holder's outcome the builder cannot read (about the seat).
"publish-refused": {Source: "builder", Observer: builder},
"publish-unanswered": {Source: "builder", Observer: builder},
"seat-outcome-unread": {Source: "builder", Observer: builder},
// A consumer of a delivery part that stopped hearing an event family (ADR 0615 §5), cleared when it binds again: written
// by each of the indexer, the assigner, the builder and the watchman in its own findings, so the kind has no one observer.
"family-not-heard": {Source: "views", Why: "every delivery part whose consumer stopped hearing writes its own"},
// The indexer's own (design 26, ADR 0625): a seat definition that does not parse, generated types out of step with
// their definition, one seat defined by two repositories' trunks, a manifest accepted and not said.
"seat-definition-unparsed": {Source: "indexer", Observer: indexer},
"generated-types-out-of-step": {Source: "indexer", Observer: indexer},
"seat-defined-twice": {Source: "indexer", Observer: indexer},
"accepted-unsaid": {Source: "indexer", Observer: indexer},
// A module's new entry held from the whole mesh past its bound while a counted node-engine lacks the reading it
// needs (ADR 0632 §2), cleared when the hold moves or is dropped.
"manifest-held": {Source: "indexer", Observer: indexer},
// The package seats' holder (design 32): the forge refused the packages account's write token.
"packages-token-refused": {Source: "gitea", Observer: gitea},
// The kinds that end with the controller and are carried until its lease write (clauses 4, 9).
"controller-deaf": {Source: "S4", Controller: true, Carried: true},
"lease-lost": {Source: "S12", Controller: true, Carried: true},
"call-hung": {Source: "S7", Controller: true, Carried: true},
"stale-writer": {Source: "S13", Controller: true, Carried: true},
"facts-stale": {Source: "S14", Controller: true, Carried: true},
"status-slow": {Source: "D9", Controller: true, Carried: true},
"vault-silent": {Source: "send", Controller: true, Carried: true},
"declaration-files-not-put": {Source: "send", Controller: true, Carried: true},
"config-not-followed": {Source: "config", Controller: true, Carried: true},
"assignment-not-made": {Source: "assign", Controller: true, Carried: true},
"builds-not-laid-out": {Source: "start", Controller: true, Carried: true},
"sent-builds-not-copied": {Source: "start", Controller: true, Carried: true},
"fingerprint-not-composed": {Source: "done keys", Controller: true, Carried: true},
"take-in-not-consumed": {Source: "take-in", Controller: true, Carried: true},
"take-in-stalled": {Source: "take-in", Controller: true, Carried: true},
"new-module-waits": {Source: "register", Controller: true, Carried: true},
"left-out": {Source: "send", Controller: true, Carried: true},
"declaration-refused": {Source: "D1", Controller: true, Carried: true},
"unknown-field": {Source: "read", Controller: true, Carried: true},
"bus-objects-unasserted": {Source: "send", Controller: true, Carried: true},
// The controller's own bus upgrade (`bus.nats.upgrade-failed`, its DB step): it ends with the controller's lease and
// is carried until then, approved by the operator on 2026-10-31 (issue 1952); ADR 0564's table had homed it with the
// assigner, which writes no such finding, and the lead records the change of the record.
"bus-upgrade-failed": {Source: "DB", Controller: true, Carried: true},
// The self-check's bus-consumer probe (D6) judged the consumers the controller defined, and ended with it (issue
// 1126): the account consumers are the grants part's, which raises mesh-grants.consumer-differs and
// mesh-grants.consumer-behind of its own. Its kinds are carried, as the others that end with the controller.
"consumer-wrong": {Source: "D6", Controller: true, Carried: true, Why: EndedD6},
"consumer-lost": {Source: "D6", Controller: true, Carried: true, Why: EndedD6},
"consumer-behind": {Source: "D6", Controller: true, Carried: true, Why: EndedD6},
// The probes the operator dropped from this release (D2 resolvers, D3 holders, D4 archives, D12 bindings, D-heard
// withheld hearings, D-root, D11 retired data, and D13's data held twice): their kinds are carried until the lease
// write.
"resolver-wrong": {Source: "D2", Controller: true, Carried: true, Why: Dropped},
"holder-silent": {Source: "D3", Controller: true, Carried: true, Why: Dropped},
"archives-missing": {Source: "D4", Controller: true, Carried: true, Why: Dropped},
"archives-unheld": {Source: "D4", Controller: true, Carried: true, Why: Dropped},
"binding-kept": {Source: "D12", Controller: true, Carried: true, Why: Dropped},
"binding-moved": {Source: "D12", Controller: true, Carried: true, Why: Dropped},
"binding-moving": {Source: "D12", Controller: true, Carried: true, Why: Dropped},
"grant-composes-nothing": {Source: "withheld", Controller: true, Carried: true, Why: Dropped},
"root-not-free": {Source: "D-root", Controller: true, Carried: true, Why: Dropped},
"cleanup-waiting": {Source: "D11", Controller: true, Carried: true, Why: Dropped},
"data-held-twice": {Source: "D13", Controller: true, Carried: true, Why: Dropped},
// The lead, 2026-10-29: no delivery plans since R6 (wants replace them), and a stalled delivery is the watchman's
// stuck finding seen directly.
"plan-failed": {Source: "S23", Controller: true, Carried: true},
"stalled": {Source: "D14", Controller: true, Carried: true},
// The kinds that end, their faults observed otherwise (the Context's table).
"core-behind": {Source: "D10", Controller: true, Replaced: true},
}
// The observers, as the table names them.
const (
watchman = "mesh-delivery-watchman"
selfCheck = "mesh-self-check"
healers = "mesh-healers"
assigner = "mesh-delivery-assigner"
provisioner = "mesh-provisioner"
messenger = "messenger"
artifactStore = "artifact-store-tools"
configModule = "mesh-config"
vaultModule = "mesh-vault"
builder = "mesh-delivery-builder"
indexer = "mesh-delivery-indexer"
gitea = "gitea"
enrolment = "mesh-enrolment"
)
// homeOf is the home of a condition's kind, and whether the table has one.
func (k *Keeper) homeOf(kind string) (Home, bool) {
homes := k.Homes
if homes == nil {
homes = Homes
}
h, ok := homes[kind]
return h, ok
}