Skip to content

feat(doctor): sweep the linked sites, fold check into site:doctor - #1485

Open
prabowosd wants to merge 2 commits into
lerd-env:mainfrom
prabowosd:feat/doctor-sweeps-sites-1358
Open

feat(doctor): sweep the linked sites, fold check into site:doctor#1485
prabowosd wants to merge 2 commits into
lerd-env:mainfrom
prabowosd:feat/doctor-sweeps-sites-1358

Conversation

@prabowosd

Copy link
Copy Markdown
Member

There are three health commands and none of them knows about the others, so anyone who wants to know whether something is wrong has to run all three, and the one people reach for first never looks at their sites. lerd doctor now ends with a [Sites] section: every linked site runs through the site-level checks and gets one line, the counts plus the first thing that is wrong, with the command to run for the detail. A machine where podman, DNS and the ports are all fine while three sites are failing no longer reports itself healthy.

The sweep has to stay quick, so it runs the cheap half of the site doctor and leaves the framework command checks, composer audit, npm audit and the response-time lookup to site:doctor on a named site. The one expensive check it keeps is whether the site's database exists, because that is what catches a site 500ing on every request, and it is no longer expensive: one engine's database list is reused for a few seconds rather than costing a container exec per site. On a fourteen site machine the sweep adds about two seconds to a doctor run.

lerd check was the third entry point and everything it validated is about the project rather than the environment, so .lerd.yaml validation moves into the site doctor as its own check. Every surface that runs the doctor validates it now, the dashboard and the MCP tool included, and check stays as a deprecated alias for site:doctor in the current directory. Folding it in also fixed a worker it was wrong about: one declared in the project's own custom_workers was only recognised on a custom-container site, so a plain site running one was told it had no definition to match.

The reclaim offer the issue asks for is already there, doctor lists it as an optional fix and --fix runs lerd cleanup after confirming.

Closes #1358

lerd doctor ends with a [Sites] section: every linked site runs the cheap half
of the site doctor and gets one line, the counts plus the first thing wrong,
naming lerd site:doctor <domain> for the detail. The framework command checks,
composer audit, npm audit and the response-time lookup stay on the per-site
command, and one engine's database list is reused across the sweep instead of
costing a container exec per site.

Validating .lerd.yaml moves into the site doctor as its own check, so every
surface runs it and lerd check becomes a deprecated alias. A worker declared in
the project's own custom_workers now counts as defined on a plain site too, not
only on a custom-container one.
@prabowosd
prabowosd requested a review from a team as a code owner August 13, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(doctor): one command that answers whether anything is wrong, sites included

1 participant