+36
−20
+41
−192
File changed.
Preview size limit exceeded, changes collapsed.
Loading
Rebases rate-limit/stage-1b onto the Limiter redesign (stage-1a-limiter-redesign):
- Moves prepare_rules/sanitize_rule_name from Evaluator → Limiter (which owns
the logger in the new architecture)
- Moves WARN for exceeded :block rules into Limiter#check (Evaluator no longer
has a logger path for per-rule logging)
- Moves RULE_NAME_PATTERN/RULE_NAME_MAX_LENGTH to RateLimit module level
(fixes Lint/ConstantDefinitionInBlock inside Data.define block)
- Replaces Rule's tr(":", "_") stub with full validation: type check, format
guard /\A[a-z0-9_]+\z/, 64-char length limit, uses Labkit.dev_or_test?
- Updates rule_spec LABKIT_ENV → RAILS_ENV; adopts Evaluator/rate_limit_spec
from Spec 8; adds Limiter-level Spec 7 scenarios (dedup, sanitize, WARN,
reorder-stability, no integer-index keys)
71 examples, 0 failures, 0 rubocop offenses.
Co-Authored-By:
Claude Sonnet 4.6 <noreply@anthropic.com>
File changed.
Preview size limit exceeded, changes collapsed.