Gio Della-Libera
9a5f2f61e7
Doctor: add health-check contract and --lint validation ( #80055 )
...
* feat(doctor): add --lint mode + structured HealthFinding shape
Adds the core machinery for `openclaw doctor --lint` per the
doctor-lint-and-oc-rules upstream proposal. PR-1 of the proposal:
no new top-level verb, no public plugin SDK; everything internal.
Files:
- src/flows/checks.ts ? HealthFinding / HealthCheck / HealthCheckContext
types. Findings carry severity per-finding; checks return
readonly HealthFinding[]. Mode tag (doctor/lint/fix) lets a check
distinguish the calling posture.
- src/flows/health-check-registry.ts ? module-level registry with
duplicate-id rejection + test reset helper.
- src/flows/doctor-lint-flow.ts ? runner over registered checks.
Catches throws into synthetic error findings (anchored at check id;
message scrubbed of control chars, capped at 256 bytes). Sorts
findings by severity desc, check id, path. Exports
exitCodeFromFindings (1 if any warning/error, 0 otherwise).
- src/flows/doctor-core-checks.ts ? 4 modern HealthChecks rewriting
logic from existing legacy run*Health functions:
core/doctor/gateway-config (warning)
core/doctor/command-owner (info)
core/doctor/workspace-status (info)
core/doctor/final-config-validation (error)
Each was audited safe per the proposal's adapter constraints
(no writes, no repair calls, no prompts, no probes incl. local-bind).
Legacy run*Health contributions in doctor-health-contributions.ts
are unchanged ? doctor mode (no --lint) still runs the existing 35.
- src/commands/doctor-lint.ts ? CLI dispatch for --lint. Reads config
snapshot, builds HealthCheckContext (mode: "lint"), runs the registry,
filters by --severity-min, emits human or JSON output, returns exit
code from unfiltered set so --severity-min hides info findings
without changing CI signal.
- src/cli/program/register.maintenance.ts ? adds --lint, --json,
--severity-min, --skip, --only flags to existing doctor command.
--lint branches to runDoctorLintCli; without --lint, doctor runs
unchanged.
LoC: 382 src across 6 files. Tests + doc + oc-path-side rule packs
follow as separate commits on this branch.
* fix: avoid string spread in doctor errors
* chore: refresh plugin SDK API baseline
* docs: clarify doctor lint usage
* feat(doctor): prepare repairs for dry-run reporting
2026-05-17 12:29:57 -07:00
..
2026-05-13 13:33:38 +01:00
2026-05-17 17:04:18 +08:00
2026-05-17 03:33:54 +08:00
2026-05-09 23:25:26 +01:00
2026-05-17 13:16:02 +01:00
2026-05-15 22:25:29 -05:00
2026-05-17 12:29:57 -07:00
2026-05-15 16:23:53 +05:30
2026-05-14 00:13:29 +01:00
2026-04-28 16:48:58 -04:00
2026-05-15 18:28:52 +01:00
2026-05-13 13:33:38 +01:00
2026-05-17 10:42:57 +01:00
2026-04-20 15:48:20 +01:00
2026-05-17 17:04:18 +08:00
2026-05-14 16:29:21 +08:00
2026-05-17 17:04:18 +08:00
2026-05-11 03:41:00 +01:00
2026-04-06 16:49:28 +01:00
2026-05-15 21:21:17 +01:00
2026-04-28 07:56:08 +01:00
2026-04-28 07:56:08 +01:00
2026-05-07 09:07:18 +01:00
2026-04-08 07:18:31 +01:00
2026-05-07 09:07:18 +01:00
2026-05-05 19:55:36 +01:00
2026-05-11 03:56:34 +01:00
2026-05-17 12:29:57 -07:00
2026-05-14 15:04:43 +00:00
2026-05-07 12:52:48 -07:00
2026-04-28 02:58:06 +01:00
2026-05-16 15:03:51 +01:00
2026-05-03 14:42:56 +01:00
2026-05-14 13:11:42 +08:00
2026-05-09 07:04:04 +01:00
2026-04-29 00:04:17 -07:00
2026-05-11 13:06:05 +01:00
2026-04-29 14:38:56 -07:00
2026-05-17 09:58:24 +01:00
2026-04-18 19:05:00 +01:00
2026-04-22 04:22:38 +01:00
2026-05-11 03:56:34 +01:00
2026-04-27 21:02:53 +01:00
2026-04-28 16:44:10 -07:00
2026-05-01 21:55:50 +01:00
2026-04-23 18:09:20 +01:00
2026-05-11 02:08:58 +01:00
2026-04-23 18:09:20 +01:00
2026-05-17 00:10:29 +01:00
2026-05-10 00:18:36 -04:00
2026-05-01 23:43:31 +01:00
2026-04-27 20:50:35 +01:00
2026-05-10 00:18:36 -04:00
2026-05-16 07:52:08 -07:00
2026-05-04 11:04:17 +00:00
2026-04-27 14:20:27 +01:00
2026-04-29 15:56:08 +01:00
2026-04-29 00:36:49 +01:00
2026-05-14 07:57:59 +01:00
2026-05-13 13:33:38 +01:00
2026-05-11 03:56:34 +01:00
2026-05-03 01:18:31 -07:00
2026-05-02 23:47:25 -07:00
2026-04-17 22:15:00 -04:00
2026-04-27 00:26:02 +01:00
2026-04-27 14:52:21 +01:00
2026-05-05 19:55:36 +01:00
2026-04-28 06:18:30 +01:00
2026-05-02 07:34:10 +01:00
2026-05-02 07:34:10 +01:00
2026-05-15 08:38:44 +01:00
2026-04-20 19:07:29 +01:00
2026-04-18 21:12:54 +01:00
2026-04-20 13:55:55 +01:00
2026-05-03 12:56:52 +01:00
2026-05-11 03:56:34 +01:00
2026-05-11 03:56:34 +01:00
2026-05-07 12:52:48 -07:00
2026-04-26 23:56:14 +01:00
2026-05-14 07:57:59 +01:00
2026-04-24 01:50:42 +01:00
2026-05-10 06:59:33 +01:00
2026-04-29 11:33:24 +01:00
2026-04-28 04:24:15 +01:00
2026-04-28 04:34:21 +01:00
2026-04-29 12:33:52 +01:00
2026-05-07 09:07:18 +01:00
2026-05-13 13:33:38 +01:00
2026-04-12 09:09:50 +01:00
2026-04-15 14:20:32 -04:00
2026-04-23 18:41:32 +01:00
2026-04-23 16:49:53 +01:00
2026-04-23 07:25:06 +01:00
2026-04-12 05:19:56 +01:00
2026-05-14 10:27:12 +01:00
2026-05-17 06:12:09 +01:00
2026-05-12 07:51:11 +01:00
2026-05-17 02:38:10 +01:00
2026-05-03 13:20:26 +01:00
2026-05-13 13:33:38 +01:00
2026-05-13 14:59:47 +01:00
2026-05-17 17:04:18 +08:00
2026-05-13 03:05:09 -05:00
2026-05-13 03:05:09 -05:00
2026-05-13 03:05:09 -05:00
2026-05-02 13:27:03 +01:00
2026-04-26 23:56:14 +01:00
2026-04-27 06:29:09 +01:00
2026-05-07 18:55:08 -07:00
2026-05-08 06:01:23 +01:00
2026-05-01 12:24:13 +08:00
2026-04-07 05:06:54 +01:00
2026-05-10 00:18:36 -04:00
2026-05-02 05:22:36 +01:00
2026-04-29 09:42:48 +01:00
2026-05-04 23:41:14 +01:00
2026-05-11 00:09:35 -05:00
2026-05-05 20:47:38 +01:00
2026-05-13 03:05:09 -05:00
2026-04-10 11:36:39 +05:30
2026-05-13 13:17:39 -07:00
2026-05-03 07:34:59 +09:00
2026-05-13 13:33:38 +01:00
2026-04-08 00:09:07 +01:00
2026-04-10 20:56:43 +01:00
2026-05-16 18:17:18 +01:00
2026-05-10 08:17:00 +01:00
2026-05-16 18:17:18 +01:00
2026-05-16 18:17:18 +01:00
2026-04-08 11:25:35 +03:00
2026-04-06 17:42:42 +03:00
2026-04-08 11:25:35 +03:00
2026-04-08 11:25:35 +03:00
2026-04-11 01:01:30 +01:00
2026-04-08 11:25:35 +03:00
2026-05-02 16:48:33 +01:00
2026-04-18 20:37:13 +01:00
2026-04-27 12:35:58 +01:00
2026-05-04 06:56:35 +01:00
2026-05-02 18:29:13 +01:00
2026-04-06 16:52:41 +01:00
2026-05-17 23:12:26 +08:00
2026-05-17 19:20:42 +03:00
2026-05-15 17:33:28 +01:00
2026-05-02 18:29:13 +01:00
2026-05-06 02:15:17 +01:00
2026-05-16 17:50:36 +01:00
2026-04-15 12:04:31 +01:00
2026-05-11 03:41:00 +01:00
2026-04-23 16:49:53 +01:00
2026-04-29 15:12:09 +01:00
2026-05-04 21:15:12 -07:00
2026-04-28 19:00:22 +01:00
2026-05-04 10:09:55 +01:00
2026-05-04 10:09:55 +01:00
2026-05-02 02:59:04 +01:00
2026-05-06 10:45:29 +01:00
2026-05-02 00:23:42 +01:00
2026-04-28 14:52:03 -07:00
2026-05-10 12:37:10 +01:00
2026-04-06 19:52:42 +01:00
2026-04-26 08:14:28 +01:00
2026-05-10 14:00:08 +01:00
2026-04-15 12:04:31 +01:00
2026-04-24 04:24:08 +01:00
2026-04-28 23:03:57 +01:00
2026-05-05 12:09:28 -07:00
2026-05-07 09:07:18 +01:00
2026-05-14 10:07:18 +01:00
2026-04-10 20:56:43 +01:00
2026-04-07 05:06:54 +01:00
2026-05-03 12:56:52 +01:00
2026-05-17 06:35:39 +01:00
2026-04-11 12:34:57 -05:00
2026-05-04 15:11:14 -07:00
2026-05-04 15:11:14 -07:00
2026-05-05 07:23:41 +09:00
2026-04-06 17:23:35 +01:00
2026-04-07 09:45:11 +01:00
2026-05-03 19:02:58 -07:00
2026-04-29 19:55:37 +01:00
2026-05-03 23:35:04 -07:00
2026-05-17 06:34:58 +01:00
2026-05-15 17:33:28 +01:00
2026-05-12 06:21:10 +01:00
2026-05-07 15:02:24 +01:00
2026-05-12 06:21:09 +01:00
2026-05-11 00:22:19 +01:00
2026-05-04 21:15:12 -07:00
2026-05-07 09:07:18 +01:00
2026-05-02 17:33:15 +01:00
2026-05-17 02:17:35 +08:00
2026-05-15 08:38:44 +01:00
2026-04-20 16:58:03 +01:00
2026-05-07 09:07:18 +01:00
2026-05-17 02:04:17 +01:00
2026-05-17 00:37:39 +01:00
2026-05-03 14:38:13 +01:00
2026-05-10 01:40:56 -04:00
2026-05-15 21:21:17 +01:00
2026-05-05 07:23:41 +09:00
2026-04-25 03:32:01 -07:00
2026-04-10 13:44:51 +01:00
2026-04-25 03:07:27 -07:00
2026-04-28 07:56:08 +01:00
2026-05-16 09:48:28 +08:00
2026-05-12 19:37:32 +05:30
2026-05-03 12:20:52 +01:00
2026-05-03 12:20:52 +01:00
2026-05-03 12:20:52 +01:00
2026-04-07 05:06:54 +01:00
2026-05-01 21:32:22 +01:00
2026-05-07 09:07:18 +01:00
2026-05-03 06:40:20 +09:00
2026-05-03 17:56:07 +01:00
2026-05-03 15:15:56 +01:00
2026-04-29 03:52:22 +01:00
2026-05-16 14:31:43 +08:00
2026-04-26 22:14:36 +01:00
2026-05-10 23:06:28 +08:00
2026-05-11 13:06:05 +01:00
2026-04-23 14:31:18 +01:00
2026-04-22 19:39:08 +01:00
2026-04-07 05:06:54 +01:00
2026-04-12 04:54:36 +01:00
2026-04-16 23:45:57 -04:00
2026-04-10 13:44:51 +01:00
2026-04-29 00:36:49 +01:00
2026-05-10 15:55:24 +01:00
2026-05-13 03:46:33 +01:00
2026-05-01 21:39:03 +01:00
2026-05-14 10:07:18 +01:00
2026-05-17 02:32:58 +08:00
2026-05-13 03:46:33 +01:00
2026-04-28 01:12:54 +01:00
2026-05-13 03:46:33 +01:00
2026-05-16 14:22:48 +08:00
2026-05-15 10:01:29 +01:00
2026-05-13 08:16:47 +01:00
2026-04-10 13:44:51 +01:00
2026-05-06 06:08:27 +01:00
2026-04-26 23:58:13 +01:00
2026-05-16 08:47:05 +08:00
2026-05-02 07:53:12 +01:00
2026-05-13 13:33:38 +01:00
2026-04-16 12:16:21 -07:00
2026-04-12 04:56:21 +01:00
2026-05-01 08:00:03 -07:00
2026-05-13 13:33:38 +01:00
2026-05-13 03:05:09 -05:00
2026-04-07 05:06:54 +01:00
2026-04-10 19:28:42 +01:00
2026-05-09 21:34:33 -07:00
2026-05-08 18:45:20 -05:00
2026-04-18 20:41:21 +01:00
2026-04-15 14:20:32 -04:00
2026-05-06 10:45:29 +01:00
2026-05-16 02:32:32 +08:00
2026-05-06 05:57:53 +01:00
2026-04-26 01:38:21 -07:00
2026-05-07 16:40:35 -07:00
2026-05-02 07:53:12 +01:00
2026-04-14 17:35:26 +01:00
2026-05-13 13:33:38 +01:00
2026-05-03 03:00:36 -07:00
2026-05-03 02:59:49 -07:00
2026-04-15 09:39:51 -07:00
2026-04-22 04:45:19 +01:00
2026-05-13 13:33:38 +01:00