Skip to content

Decompose RewardHandler reward services - #289

Merged
BenCodez merged 6 commits into
masterfrom
refactor/reward-services
Aug 23, 2026
Merged

BenCodez merged 6 commits into
masterfrom
refactor/reward-services

Conversation

@BenCodez

Copy link
Copy Markdown
Owner

Summary

Continue the reward cleanup by extracting several cohesive responsibilities from RewardHandler into focused classes under com.bencodez.advancedcore.api.rewards.

Changes

  • add RewardLoader
    • reward folder management
    • reward file discovery/name normalization
    • default/example reward setup
    • reward-file loading and directly-defined reward file handling
  • add RewardValidator
    • valid reward path state
    • reward-content checks
    • directly-defined reward file conflict checks
  • add SubRewardResolver
    • directly-defined sub-reward discovery
    • recursive traversal
    • cycle protection for repeated sub-reward paths
  • add RewardInjectionRegistry
    • injected rewards and requirements
    • reward placeholders
    • built-in registration
    • stable priority sorting
  • keep RewardHandler as the public compatibility facade with the same existing methods delegating to the focused services
  • keep reward execution logic in RewardHandler for a later focused executor refactor
  • add RewardServicesTest coverage for loader discovery, injection ordering, validator facade behavior, and recursive sub-reward protection

All new classes are under api.rewards, matching the current package layout.

This is primarily a behavior-preserving organization refactor, with the intentional correctness improvement that recursive sub-reward discovery is bounded instead of recursing indefinitely.

@BenCodez
BenCodez marked this pull request as ready for review August 23, 2026 19:17
@BenCodez
BenCodez merged commit 23f3b31 into master Aug 23, 2026
4 checks passed
@BenCodez
BenCodez deleted the refactor/reward-services branch August 23, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant