|null $limit_rule The rule whose rate limit * denied, for the anomaly alert the * caller raises once the denial is * recorded (ADR-17). */ public function __construct( public readonly Decision $decision, public readonly ?string $reason = null, public readonly ?int $policy_id = null, public readonly ?int $rule_index = null, public readonly ?int $retry_after = null, public readonly bool $ai_triage = false, public readonly bool $network = false, public readonly ?array $limit_rule = null ) { } /** * Whether a stored rule decided, rather than the built-in defaults. */ public function matched_a_rule(): bool { return null !== $this->policy_id; } /** * Whether waiting and retrying could succeed. */ public function is_retryable(): bool { return self::REASON_RATE_LIMITED === $this->reason || self::REASON_LEDGER_BUSY === $this->reason; } }