Diagnostics
MagicUtils diagnostics provide runtime self-checks that can be executed inside a
live plugin or mod. The diagnostics service is built on top of MagicRuntime
and ships with safe infrastructure-focused checks for runtime wiring,
filesystem access, scheduler behavior, command registration exposure, and
placeholder registry access.
Bootstrap Wiring
Enable diagnostics from the platform bootstrap builder:
The service is also available from the runtime container:
Running Checks
Execute the full report or a single suite:
The built-in checks are registered through a magicutils-namespaced registry
view, so their suite IDs are prefixed. Pass the full ID to runSuite(...):
magicutils.runtimemagicutils.filesystemmagicutils.configmagicutils.schedulermagicutils.threadingmagicutils.commandsmagicutils.placeholders
Checks you register yourself through configureDiagnostics(...) receive the raw
registry, so their suite() value is used as-is (no magicutils. prefix). Group
your own checks under your own suite id, for example mymod.database.
SAFE mode avoids temp-file writes and reload probes. STANDARD mode enables
reversible probes such as temp-file writes and config reloadability checks.
Writing A Custom Check
A DiagnosticCheck describes a single self-test: a stable id(), its suite(),
a description(), the severity() that applies when it fails, the modes it
supportedModes() runs in, and a run(...) that returns a DiagnosticResult
(build one with DiagnosticResult.ok/warn/fail/skipped). The context exposes the
live runtime() and workingDirectory().
Register it during bootstrap through configureDiagnostics(...) as shown above.
supportedModes() lets you keep a probe out of SAFE runs: return
EnumSet.of(DiagnosticMode.STANDARD) if the check writes or mutates anything.
Exporting Reports
Reports can be rendered to text or exported as JSON:
The default export path is:
Command Helper
Mount diagnostics into an existing command tree the same way you mount help:
Supported command forms:
/plugin diagnostics/plugin diagnostics safe/plugin diagnostics standard/plugin diagnostics export/plugin diagnostics export standard/plugin diagnostics suite magicutils.scheduler/plugin diagnostics suite magicutils.scheduler standard