Feature/oracle reliability weighting 1765 - #1785
Merged
Olowodarey merged 5 commits intoAug 30, 2026
Merged
Conversation
- New immutable entity to track reliability score changes per oracle - Records match_id, was_correct flag, previous/new scores - Enables reconstruction of weighted consensus decisions at any point - Addresses requirement to persist reliability scores per oracle (Arena1X#1765)
- TypeORM migration for oracle_reliability_history table - Records immutable history of reliability score updates per oracle - Indexed on data_source and (data_source, created_at) for auditing - Enables reconstruction of consensus at any point (Arena1X#1765)
…weighting - recordOutcome now accepts matchId to persist history records - Add getScoreHistory() to retrieve audit trail for a source - Add WEIGHT_FLOOR and DEFAULT_WEIGHT configuration constants - Add getWeightFloor() and getDefaultWeight() configuration getters - Weights bounded in [0, 1], floor prevents single oracle dominance (Arena1X#1765)
- Load oracle weights from reliability service for each submission - Accumulate weighted votes instead of simple vote counts - Determine consensus winner by weighted majority vote - A single oracle cannot dominate even with perfect reliability (Arena1X#1765)
…ability - Register OracleReliabilityHistory entity in oracle module - Update reliability service tests for score history persistence - Add weighted consensus tests to oracle service tests: - Verify weights applied based on reliability scores - Ensure single oracle cannot dominate even with perfect reliability - Test 50/50 weighted tie detection - All tests passing (Arena1X#1765)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
[Backend] Oracle: Persist Reliability Scores and Weight Consensus
Problem
Oracle consensus in
oracle.service.tstreats all submissions equally, even when some oracles have historically inaccurate records. A single unreliable oracle can sway consensus toward incorrect outcomes.Solution
Implemented reliability-weighted consensus (#1765):
OracleReliabilityHistoryentity to maintain immutable audit trail of score changes per oracle, indexed for fast retrievalrecordOutcome()to acceptmatchIdand persist history records (score = correct_submissions / total_submissions)getMatchConsensus()to weight votes by each oracle's reliability score, preventing any single oracle from dominatingChanges
OracleReliabilityHistory– immutable audit trail of reliability updates1788042840000-CreateOracleReliabilityHistory– table with indexes on (data_source, created_at)OracleReliabilityServicewith history persistence and weight configurationOracleService.getMatchConsensus()for weighted votingAcceptance Criteria
✅ Consensus outcome shifts toward higher-reliability oracles
✅ Scores update after resolution and persist in history
✅ Covered by comprehensive unit tests
✅ Single high-reliability oracle cannot unilaterally decide
Closes #1765