Repository navigation
Implement configurable reputation system with UI integration - #14
Merged
Merged
Conversation
…ntegration - Added reputation configuration to the forum schema with options for gains, daily caps, and enforcement actions. - Introduced a reputation engine to compute user reputation based on forum activity. - Integrated reputation display in UserBadges component and user profile pages. - Updated UI logic to gate posting permissions based on user reputation. - Implemented fetching of the reputation ledger from GitHub for real-time updates. - Added tests for reputation computation and UI behavior under various configurations.
7 tasks
🧪 Test coverage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces an optional reputation ("rep") system for the forum, allowing users to earn reputation for activity and enabling topics to require a minimum rep to post. The system is implemented via a deterministic, idempotent GitHub Actions workflow that maintains a rep ledger and enforces topic restrictions. The SPA displays rep badges and gates topics client-side, while the workflow enforces rules on posts made directly on github.com. The changes include configuration, workflow, UI updates, and a pure TypeScript rep engine.
Reputation system core implementation:
src/lib/rep/engine.ts) that computes user reputation from forum activity, applies daily caps, and determines enforcement for rep-gated topics. This engine is used both by the SPA and the GitHub Actions workflow..github/workflows/rep.yml) and entrypoint script (.github/scripts/rep-action.ts) to recompute the rep ledger on every discussion/comment event and enforce rep-gated topics by moving, locking, or deleting violating posts. [1] [2]Configuration and schema:
README.mdto describe the rep system, its configuration, and workflow. [1] [2]UI and display:
UserBadges.svelteto display a user's rep badge alongside other badges, using the new rep system. [1] [2]src/lib/rep/ledger.ts) to fetch the rep ledger from therep-databranch for display and client-side gating.Dependency and tooling:
tsxpackage todevDependenciesfor running the workflow script.