The Consensus domain is the source of truth for MinMaxHub's public content. It bridges the gap between the "Chaos" of community suggestions and the "Order" of public consumption. Consensus stores the finalized, materialized view of every entity page, ready for high-speed retrieval.
How It Works
Consensus follows a two-step process: moderation then computation.
1. Moderation
Admins review suggestions in the Moderation Queue, sorted by confidence score. They can approve or reject individual suggestions. Moderation does not trigger consensus recomputation -- that is a separate, explicit action.
2. Compute Consensus
When an admin triggers consensus computation for an entity, the system:
- Collects all eligible suggestions for each section (topic + item) of the entity.
- Ranks them using the Wilson Score algorithm, which favors statistically confident quality over raw vote count.
- Selects a winner for each section and materializes it as a consensus item.
- Removes any previously-existing consensus items that no longer have a winner.
- Invalidates the cached static page so the next visitor sees fresh content.
Wilson Score
Rather than ranking by simple vote count (up - down), MinMaxHub uses the Wilson Score Confidence Interval. This answers: "Given these votes, what is the statistical probability that this is a good suggestion?"
This means:
- A suggestion with 10 up / 0 down ranks higher than 50 up / 40 down (higher confidence).
- A suggestion with 100 up / 0 down ranks higher than 1 up / 0 down (more data).
- Ties are broken by oldest submission first.
Serving Public Pages
When a visitor loads a content page:
- The system resolves the URL slug to an entity.
- All consensus items for that entity are fetched in a single read.
- The page is assembled by walking the entity's layout and filling each section with its consensus winner.
- Sections with no consensus winner fall back to the layout's default value.
The result includes the entity metadata, layout structure, consensus content, and breadcrumbs -- everything needed to render the page in one response.
Consensus Item
Each consensus item represents the winning suggestion for a specific section of a page:
| Field | Description |
|---|---|
entityId | The entity this consensus belongs to |
topicKey | Which section of the layout |
itemKey | Which item in a collection (null for singletons) |
winningSuggestionId | The suggestion that won |
value | The materialized content |
authorId / authorUsername | Who wrote the winning suggestion |
confidence | Wilson Score |
upvotes / downvotes | Vote tallies from the winning suggestion |
computedAt | When consensus was last computed |
API Endpoints
| Method | Endpoint | Purpose | Auth |
|---|---|---|---|
POST | /consensus/compute/{entityId} | Recompute consensus for an entity | Required |
GET | /consensus/page/{entityId} | Get assembled consensus page by entity ID | Public |
GET | /consensus/resolve/{slugPath+} | Resolve a page by URL slug (includes breadcrumbs) | Public |
GET | /consensus/moderation-queue | Get low-confidence items for admin review | Required |
POST | /consensus/moderate/{suggestionId} | Approve or reject a suggestion | Required |