Skip to content

The kernel lifecycle protocol doc describes the failure half of the health threshold machinery and never the recovery half #12033

Description

@os-warren

Observational, filed while implementing #11955. No behaviour is wrong here — this is a
documentation asymmetry that got sharper once successThreshold started binding.

What was measured

content/docs/protocol/kernel/lifecycle.mdx (the hand-written protocol page, "Custom Health
Checks") documents the failure side of PluginHealthMonitor in full:

Consecutive returned failures move the plugin to degraded first, and to unhealthy only
once failureThreshold of them accumulate. A check that throws — including one that
exceeds timeout — is the separate failed status, applied immediately with no threshold.

It names successThreshold exactly once, in a code comment listing parsed defaults
(:698), and never describes what it does. The recovery side is undocumented on that
page: nothing says which statuses the count is consulted from, that recovering is the
status a plugin sits in while the count accumulates, or what unknown does on a first
success. The six-value status vocabulary is quoted at :743 for the report shape only.

content/docs/references/kernel/plugin-lifecycle-advanced.mdx is generated from the Zod
.describe() text, so it carries the one-line "Consecutive successes needed to mark
healthy"
and nothing more — the reference page cannot describe transitions, only keys.

Why it is worth a card now

PR #12031 (#11955) makes the recovery side load-bearing: successThreshold: N now requires
N consecutive successes out of degraded, unhealthy, failed and recovering alike,
while healthy and unknown promote on the first success. That distinction is currently
recorded only in the source, the changeset and the PR body. The protocol page is where the
failure half's equivalent rules live, and it is the page an integrator reads to find out how
many successes a plugin needs before it is reported healthy.

node scripts/docs-audit/check-affected-docs.mjs is green on that PR, so no gate demands
this — which is precisely why it needs a card rather than a follow-up assumption.

Not fixed in PR #12031 because that card's declared file surface is
packages/core/src/health-monitor.ts + its test, and a docs edit would breach it.

Back-links: #11955 · PR #12031.

Generated by Claude Code

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions