C.W.K.
Stream
Lesson 04 of 05 · published

Derived Status: The Verdict

~10 min · derived-status, red-is-violated-expectation, membership-gates-health

Level 0Lone Machine
0 XP0/37 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete
"Status is not a field you store. It's a verdict you compute, fresh, from three inputs."

Status is a function, not a field

You never write status: healthy into a machine's record. You compute it every time, from three things: what policy says it should be (desired), what the probe saw (observed), and how old that observation is (freshness). Store the inputs; derive the verdict. A stored status is a lie waiting for the world to move on beneath it.

The vocabulary of verdicts

Green-or-red is too small a language. A useful engine speaks in verdicts that carry their reason: healthy, healthy_sleeping, maintenance, waiting_for_gui_setup, stale, degraded, unreachable_expected, unreachable_unexpected, suspended, retired, unknown. Each tells you not just that something's off, but which lever to reach for.

Membership gates health

Some verdicts short-circuit the rest: a suspended host is intentionally unmanaged, and a retired host is history — neither is unhealthy, they're simply not being asked to be anything right now. A retired machine isn't down. It's not ours to watch anymore.

Keep red expensive, and always explain it

Red belongs to unreachable_unexpected and its kin — reality breaking a promise. A sleeping laptop is healthy_sleeping, never red. And a color is never enough on its own: the interface must show the contributing facts, because red with no why isn't administration, it's an anxiety generator.

Compute the verdict; show the reasons. A status the reader can't unpack back into desired, observed, and freshness is a mood, not a diagnosis.

Code

Status is derived, every time·python
def derive_status(policy, obs):
    # Membership gates everything: not managed -> not a health verdict.
    if policy.membership == "retired":   return "retired"
    if policy.membership == "suspended": return "suspended"

    # No fresh observation. Is the silence expected by policy?
    if obs is None or obs.age_seconds > policy.alert_after_seconds:
        return "unreachable_expected" if policy.may_sleep else "stale"

    # Fresh, but not reachable. Same question, harsher stakes.
    if not obs.reachable:
        return "healthy_sleeping" if policy.may_sleep else "unreachable_unexpected"

    # Reachable, but on the wrong OS phase, or missing a promised service.
    if obs.gui_phase == "setup_assistant": return "waiting_for_gui_setup"
    if obs.missing_expected_services():    return "degraded"
    return "healthy"

# Only unreachable_unexpected (and its kin) earns red. A machine doing
# exactly what its policy allows is calm-colored, because it is not
# an emergency -- it is the plan working.

External links

Exercise

Write a small derive_status for one of your machines. Cover at least: asleep-and-allowed, asleep-and-not-allowed, stale, and degraded (up but a promised service missing). Then pick the single verdict that deserves red, and justify why the others don't.
Hint
Red should survive the 'would I want to be paged for this at 3 a.m.?' test. 'Laptop asleep, policy allows it' fails that test; 'always-on server unreachable and no override' passes it.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.