Skip to content

Implement configurable reputation system with UI integration - #14

Merged
NotReeceHarris merged 2 commits into
mainfrom
feature/13/reputation-system
Jul 21, 2026
Merged

NotReeceHarris merged 2 commits into
mainfrom
feature/13/reputation-system

Conversation

@NotReeceHarris

Copy link
Copy Markdown
Owner

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:

  • Added a pure TypeScript rep engine (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.
  • Introduced a new 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:

  • Extended the forum config and schema to support the rep system, including all options (gains, caps, topic gates, enforcement actions, exemptions, and data branch), and provided defaults. [1] [2] [3]
  • Updated documentation in README.md to describe the rep system, its configuration, and workflow. [1] [2]

UI and display:

  • Updated UserBadges.svelte to display a user's rep badge alongside other badges, using the new rep system. [1] [2]
  • Added SPA-side code (src/lib/rep/ledger.ts) to fetch the rep ledger from the rep-data branch for display and client-side gating.

Dependency and tooling:

  • Added the tsx package to devDependencies for running the workflow script.

…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.
@NotReeceHarris NotReeceHarris self-assigned this Jul 21, 2026
@NotReeceHarris NotReeceHarris added the enhancement New feature or request label Jul 21, 2026
@NotReeceHarris NotReeceHarris linked an issue Jul 21, 2026 that may be closed by this pull request
7 tasks
@github-actions

Copy link
Copy Markdown

🧪 Test coverage

File                           Stmts %  Branch %  Funcs %  Lines %
-----------------------------  -------  --------  -------  -------
oauth-proxy/worker.js              100       100      100      100
src/lib/cache.ts                   100       100      100      100
src/lib/config/index.ts            100       100      100      100
src/lib/config/schema.ts           100       100      100      100
src/lib/github/api.ts              100       100      100      100
src/lib/github/auth.svelte.ts      100       100      100      100
src/lib/rep/engine.ts              100       100      100      100
src/lib/rep/ledger.ts              100       100      100      100
src/lib/ui.svelte.ts               100       100      100      100
src/lib/utils.ts                   100       100      100      100
TOTAL                              100       100      100      100

@NotReeceHarris
NotReeceHarris merged commit af64bb6 into main Jul 21, 2026
4 of 5 checks passed
@NotReeceHarris
NotReeceHarris deleted the feature/13/reputation-system branch July 21, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: optional reputation system with rep-gated topics (Actions-enforced)

1 participant