Commit e43b18f
docs(protocol): show a real PluginHealthReport under Custom Health Checks (#11812)
The JSON block under `### Custom Health Checks` matched neither an HTTP body
nor the internal type its lead-in named. `PluginHealthReport`
(`packages/spec/src/kernel/plugin-lifecycle-advanced.zod.ts:90-136`, built at
`packages/core/src/health-monitor.ts:185-193`) is per-plugin, and the sketch
diverged on every structural axis:
- `checks` is an array of `{ name, status: 'passed' | 'failed' | 'warning' }`
(schema:121-126), not a keyed map of subsystems whose entries read `"healthy"`
- `uptime` lives under `metrics` in milliseconds (schema:109-116,
`Date.now() - startTime`), not at top level in seconds
- no `version` field exists (0 occurrences in schema:90-136, against a control
of 5 for `status` in the same region)
The example is now a report the monitor actually builds: `status` from
`PluginHealthStatusSchema`, `metrics.uptime` in ms, and a `checks` array whose
entry is named after the configured `checkMethod` (health-monitor.ts:119-125).
`"2.0.0"` is absent because the schema has no `version` field — not because the
literal was edited to something else.
Two fields that were already correct are unchanged: `status: "healthy"` (a real
`PluginHealthStatusSchema` member) and the `timestamp` literal.
The `### Health Status Response` sample above is untouched. That one is the
`GET /health` wire body and a different thing entirely; conflating the two is
the defect this change closes. The callout's "richer per-subsystem report"
became "per-plugin health report", since the per-subsystem block it pointed at
no longer exists.
Not audited, filed separately: the TypeScript example above the block declares
`healthChecks` as a map of async functions, while the real config is
`PluginHealthCheckSchema.checkMethod` (a method name on the plugin).
Claude-Session: https://claude.ai/code/session_015ahemw8RcTgqtxrj15PEZx
Co-authored-by: Claude <noreply@anthropic.com>1 parent dce6a01 commit e43b18f
1 file changed
Lines changed: 25 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
636 | | - | |
| 636 | + | |
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
| |||
694 | 694 | | |
695 | 695 | | |
696 | 696 | | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
704 | 702 | | |
705 | 703 | | |
706 | 704 | | |
707 | 705 | | |
708 | | - | |
709 | | - | |
710 | 706 | | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
738 | 713 | | |
739 | 714 | | |
740 | 715 | | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
741 | 729 | | |
742 | 730 | | |
743 | 731 | | |
| |||
0 commit comments