-
Notifications
You must be signed in to change notification settings - Fork 87
Build a deterministic reward allocation engine using integer weights #372
Copy link
Copy link
Open
Labels
GrantFox OSSGrantFox Open Source Sponsorship program tagGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesIssue may qualify for a reward upon successful completion per campaign rulesThird CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsbackendBackend services, application logic, persistence integration, and server-side functionalityBackend services, application logic, persistence integration, and server-side functionalityconsistencyPattern and convention standardization across the codebase for uniformityPattern and convention standardization across the codebase for uniformityexpertExpert difficulty tasks requiring deep expertise and architectural decision-makingExpert difficulty tasks requiring deep expertise and architectural decision-makingrewardsReward rules, badges, role upgrades, milestones, and member recognition systemsReward rules, badges, role upgrades, milestones, and member recognition systems
Description
Activity
Metadata
Metadata
Assignees
Labels
GrantFox OSSGrantFox Open Source Sponsorship program tagGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesIssue may qualify for a reward upon successful completion per campaign rulesThird CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsbackendBackend services, application logic, persistence integration, and server-side functionalityBackend services, application logic, persistence integration, and server-side functionalityconsistencyPattern and convention standardization across the codebase for uniformityPattern and convention standardization across the codebase for uniformityexpertExpert difficulty tasks requiring deep expertise and architectural decision-makingExpert difficulty tasks requiring deep expertise and architectural decision-makingrewardsReward rules, badges, role upgrades, milestones, and member recognition systemsReward rules, badges, role upgrades, milestones, and member recognition systems
Difficulty: Expert
Type: Feature
Recommended labels (if available in this repo): rewards, backend, consistency, expert
Background
GuildPass communities may eventually distribute fixed reward pools across contributors according to contribution weight, governance decisions or campaign outcomes.
The complete reward system does not need to exist before the allocation mathematics can be implemented as a standalone pure engine.
Problem
Reward allocation becomes error-prone when floating-point percentages are used or when rounding behaviour is undefined. A pool must be distributed deterministically without creating or losing units during rounding.
Expected Outcome
Implement a pure reward allocation engine that distributes an integer reward pool across weighted recipients while guaranteeing conservation of the total pool.
Suggested Implementation
Inputs may resemble:
The engine should:
A largest-remainder approach or another mathematically sound method may be used if documented clearly.
Acceptance Criteria
pnpm typecheckpasses.pnpm buildpasses.pnpm testpasses.Likely Affected Files/Directories
Independence Requirement
This task must remain a pure mathematical engine and must not depend on the GuildPass reward engine, contribution engine or database schema.