Services

CrashGuard

v1.0.0

Crash isolation service. Tracks boot attempts, activates safe mode after 3 consecutive failures, and provides recovery tools.

Methods

public function increment(string $module_slug): int

Increment crash counter before module boot. Returns new count.

public function acknowledge(string $module_slug): void

Reset crash counter after successful boot.

public function is_safe_mode(string $module_slug): bool

Check if a module is in safe mode.

Example

crash-guard.php
// Handled automatically by the Hub:
// 1. Pre-boot: increment crash counter
// 2. Module boots successfully
// 3. React sends boot-ack ping
// 4. Counter resets to 0

// If boot fails 3 times → safe mode auto-activates