add `swamp doctor extensions` subcommand for on-demand extension load diagnostics
Opened by stack72 · 4/28/2026
Problem
After swamp-club#177 lands a stderr-based warning emitter for extension load failures (so warnings appear on every command that calls ensureLoaded()), users still benefit from a way to ask "is anything wrong with my extensions?" without running another command and parsing its stderr. Today the only signal is the side-effect on commands that touch the registry; there is no dedicated diagnostic.
Proposed solution
Add swamp doctor extensions as a sibling subcommand to the existing swamp doctor audit (registered in src/cli/commands/doctor.ts). The command:
- Calls
ensureLoaded()across all five user registries (model, vault, driver, datastore, report) so every loader runs and any failures are recorded by the issue-177 warning collector. - Dumps the collector contents through a renderer that supports both log and JSON output modes, matching the project rule that every command supports both modes.
- Exits non-zero when failures are present, so this fits naturally into
swamp doctoraggregations and CI preflight checks.
Scope
Affected components:
src/cli/commands/doctor.ts— register the new subcommand.src/cli/commands/doctor_extensions.ts— new command file mirroringdoctor_audit.ts.src/libswamp/doctor/extensions.ts— application service that drives ensureLoaded across registries and reads the collector.src/presentation/renderers/doctor_extensions.ts— log + JSON renderer.
Implementation is small (~30 lines of orchestration plus the renderer) once the issue-177 collector exists.
Alternatives
- Rely solely on stderr warnings from other commands (rejected: no on-demand check).
- Surface warnings as a JSON field on every command's stdout (rejected in #177's plan: pollutes stdout contract; stderr is the right channel).
Dependencies
Blocks on swamp-club#177 — the collector mechanism must exist before this subcommand has anything to read.
Triaged
Click a lifecycle step above to view its details.
Sign in to post a ripple.