Rewards: credit closed days through the outbox relay #4
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/rewards"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
platform.inbox.HabitPeriodClosedV1,StreakReachedV1andDayClosedV1. Tentative entries are not published.Ledgerper user, credited when a day closes: diminishing returns, daily caps, half rewards in a habit's first 3 days, perfect-day pollen, and each streak milestone item once per user.Vitalityper user: starts at 50, moves 30% of the way towards each day's adherence, never drops below 20, unchanged on vacation days.BalancePolicy.v1. An anti-corruption layer turns Habits events into Rewards commands.GET /api/rewards/ledgerand/vitality, andRewardGrantedV1/VitalityChangedV1for the game.Design decision (in
docs/contexts/rewards.md): the server credits only final facts. Pending earnings will be a client prediction, so undo never reaches Rewards.Checked against the running API: one user with a missed, a missed and a met day got 5 nectar, 15 pollen and vitality 47, as calculated by hand.
🤖 Generated with Claude Code