Skip to content

feat: meritocratic voting prompt#938

Merged
coodos merged 4 commits intomainfrom
feat/meritocratic-vote-prompt-instead-of-taking-charter
Apr 2, 2026
Merged

feat: meritocratic voting prompt#938
coodos merged 4 commits intomainfrom
feat/meritocratic-vote-prompt-instead-of-taking-charter

Conversation

@coodos
Copy link
Copy Markdown
Contributor

@coodos coodos commented Apr 1, 2026

Description of change

Issue Number

Type of change

  • Breaking (any change that would cause existing functionality to not work as expected)
  • New (a change which implements a new feature)
  • Update (a change which updates existing functionality)
  • Fix (a change which fixes an issue)
  • Docs (changes to the documentation)
  • Chore (refactoring, build scripts or anything else that isn't user-facing)

How the change has been tested

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Summary by CodeRabbit

  • New Features

    • Users can now add custom evaluation criteria when creating polls with reputation-weighted voting.
  • Bug Fixes

    • Fixed duplicate system messages appearing in conversation threads.
    • Improved reliability of poll evaluation result parsing.
  • Chores

    • Removed automatic periodic group check-in scheduling.
    • Updated AI model used for poll reputation calculations.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cb47a6bc-90af-4a72-a36d-ee60462e0757

📥 Commits

Reviewing files that changed from the base of the PR and between 9512a3d and ad41ae0.

📒 Files selected for processing (14)
  • platforms/cerberus/client/src/index.ts
  • platforms/cerberus/client/src/services/CerberusTriggerService.ts
  • platforms/ereputation/api/src/controllers/WebhookController.ts
  • platforms/ereputation/api/src/database/entities/Poll.ts
  • platforms/ereputation/api/src/database/migrations/1775035663491-add-custom-prompt.ts
  • platforms/ereputation/api/src/services/VotingReputationService.ts
  • platforms/ereputation/api/src/web3adapter/mappings/poll.mapping.json
  • platforms/evoting/api/src/controllers/PollController.ts
  • platforms/evoting/api/src/database/entities/Poll.ts
  • platforms/evoting/api/src/database/migrations/1775035663491-add-custom-prompt.ts
  • platforms/evoting/api/src/services/PollService.ts
  • platforms/evoting/api/src/web3adapter/mappings/poll.mapping.json
  • platforms/evoting/client/src/app/(app)/create/page.tsx
  • platforms/evoting/client/src/lib/pollApi.ts

📝 Walkthrough

Walkthrough

This PR removes charter-based periodic check-ins from Cerberus scheduling and adds system-message stacking prevention to the trigger service. Simultaneously, it introduces a customPrompt field to Poll entities in both eReputation and eVoting platforms, enabling custom evaluation criteria instead of relying solely on group charters. The reputation calculation service is upgraded to gpt-4o with improved JSON parsing robustness.

Changes

Cohort / File(s) Summary
Cerberus Startup Refactoring
platforms/cerberus/client/src/index.ts
Removed CharterMonitoringService and GroupService dependencies; replaced 24-hour periodic charter-based check-in loop with direct CerberusIntervalService initialization.
Cerberus System Message Prevention
platforms/cerberus/client/src/services/CerberusTriggerService.ts
Added isCerberusSystemMessage and findLastNonTriggerMessage helpers to detect and skip processing when the last message is already a Cerberus system message, preventing message stacking.
Poll Data Model Extensions
platforms/ereputation/api/src/database/entities/Poll.ts, platforms/evoting/api/src/database/entities/Poll.ts
Added nullable customPrompt field (text column) to Poll entity in both platforms, extending poll model with optional custom evaluation prompt.
Database Migrations
platforms/ereputation/api/src/database/migrations/1775035663491-add-custom-prompt.ts, platforms/evoting/api/src/database/migrations/1775035663491-add-custom-prompt.ts
Created forward/backward migrations to add/drop customPrompt column on polls table in both eReputation and eVoting databases.
eReputation Poll Processing
platforms/ereputation/api/src/controllers/WebhookController.ts
Updated poll creation and update handlers to persist customPrompt field; modified reputation evaluation to prioritize poll.customPrompt over group.charter when present.
eVoting Poll Creation Pipeline
platforms/evoting/api/src/controllers/PollController.ts, platforms/evoting/api/src/services/PollService.ts
Extended controller and service to extract and pass customPrompt through poll creation flow, with default null when not provided.
Web3 Adapter Mappings
platforms/ereputation/api/src/web3adapter/mappings/poll.mapping.json, platforms/evoting/api/src/web3adapter/mappings/poll.mapping.json
Added customPrompt field to localToUniversalMap for polls in both platforms, enabling proper data sync.
eVoting Client UI & Types
platforms/evoting/client/src/app/(app)/create/page.tsx, platforms/evoting/client/src/lib/pollApi.ts
Extended form schema and interfaces to include optional customPrompt field; added textarea input when votingWeight is "ereputation", allowing users to specify custom evaluation criteria.
eReputation Reputation Service
platforms/ereputation/api/src/services/VotingReputationService.ts
Upgraded OpenAI model from gpt-4 to gpt-4o; improved bulk response parsing with Markdown fence detection and trimming; adjusted system prompt language from "group charter" to "evaluation criteria".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • sosweetham
  • ananyayaya129

Poem

🐰 A whisper of charters fades to night,
Prompts bloom custom, shining bright,
Systems no longer stack and sway,
gpt-4o lights the way!
Polls evolve with grace and care,
Code flows smooth through platforms fair. ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/meritocratic-vote-prompt-instead-of-taking-charter

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coodos coodos marked this pull request as ready for review April 2, 2026 17:00
@coodos coodos merged commit aef26d4 into main Apr 2, 2026
4 checks passed
@coodos coodos deleted the feat/meritocratic-vote-prompt-instead-of-taking-charter branch April 2, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant