Fix MCP rule previews after matching scope rename

Merged
SU
2mo ago
+1-1

Summary

Fix the main-branch regression introduced when #3990 (ec5cbd90143460260e56e081f88bc461396b82bb) merged after #4013.

The MCP rule preview wrapper still called matching_resources_scope, which #4013 renamed to matching_scope. This raised NameError in preview/create/update/apply rule flows and caused all 20 errors in the failing main run.

Delegate Rule#matching_resources to the current matching_scope method. Keep matching, family/account visibility, and preview-token behavior unchanged. Existing behavioral tests already cover the regression; no assertions are weakened or skipped.

Validation

  • Reproduced on unchanged current main (577d32bc4685b71032d46d6c86574ed977b1701b): preview tests produced 4 NameError errors (seed 60064).
  • After the fix: all rule-function, Rule model, and rule subdirectory tests pass: 166 runs, 491 assertions, no failures/errors/skips (seed 60064).
  • Ruby lint, ERB lint (743 files), Biome (135 files), and Brakeman (0 errors, 0 security warnings) pass.
  • Local system tests are not applicable to this one-line backend delegation correction; the original failing main run's system-test job passed.
  • Full bin/rails test --seed 60064: 11,772 runs, 54,356 assertions, 0 failures, 0 errors, 34 skips.