Repository navigation
feat: lock activity rewards for the whole week - #89
Conversation
A reload or restart used to change what the current week's milestones pay, so switching act pools mid-week paid unclaimed milestones from the new act. The first load of each week now copies rewards, bar.milestones and daily-reward.groups to reward-lock.yml, and the week pays from that copy. Reloads only stage config.yml's rewards; they replace the lock at the next weekly reset. /activity rewards shows the locked week and whether changes are waiting, and /activity rewards apply reloads and uses them right away. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (9)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughWeekly reward settings are now locked in ChangesWeekly reward locking
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Admin
participant ActivityCommand
participant ActivityConfiguration
participant RewardLockFile as reward-lock.yml
Admin->>ActivityCommand: run /activity rewards apply
ActivityCommand->>ActivityConfiguration: reload and apply rewards
ActivityConfiguration->>RewardLockFile: save current week's reward snapshot
RewardLockFile-->>ActivityConfiguration: save result
ActivityConfiguration-->>ActivityCommand: application result
ActivityCommand-->>Admin: report success or save failure
Suggested reviewers: Merge Risk: ⚪ Minimal · up to Weekly rewards stay locked until the next reset or an admin apply, and a failed save leaves the current week's rewards unchanged. No concrete merge-blocking issue was found in the supplied changes. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to Administrative access remains protected, but failed snapshot writes can still activate rewards and report the week as locked. This weakens recovery guarantees and can leave all players using rewards that reloads or restarts do not preserve. Retained concerns
Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
Comment |
Why
Rewards were read when a player claimed. So a
/activity reloadin the middle of a week (for example switchingpool_prologueto an Act 1 pool) changed the current week. Unclaimed 10/20-point milestones paid from the new act, the weekly preview changed, and players got different loot for the same week.What changes
rewards,bar.milestonesanddaily-reward.groupstoplugins/activity/reward-lock.yml, tagged with the week key. Claims, the GUI preview, daily pool rewards and the claimable placeholder all use the locked copy.PlayerStore.get/rolled), before that player's points reset./activity rewards(activity.admin): shows the locked week and whether changes are waiting./activity reloadprints the same status./activity rewards apply: reloads and locks config.yml's rewards for the current week right away. If the lock can't be saved, the week keeps its locked rewards.messages.yml.Tests
mvn verify: 816 tests pass, including the newActivityConfigurationRewardLockTest(first lock, same-week reload keeps the lock, next week switches, roll, apply now, failed save, broken lock file, no jar-default pools, fixed drop blocks) and the command tests forrewards.🤖 Generated with Claude Code