Repository navigation
Oracle integrity: schema drift, consistency rules, rewards, and review queue - #480
Merged
OxDev-max merged 5 commits intoOct 23, 2026
Merged
Conversation
…reaking Changes Bef Closes Refract-Protocol#279
…hecks Between Relat Closes Refract-Protocol#280
…n for Honest Oracle Closes Refract-Protocol#281
…ue and Ambiguous Or Closes Refract-Protocol#282
|
@jhayniffy Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
# Conflicts: # src/db/schema.sql
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.
Summary
Oracle integrity: schema drift, consistency rules, rewards, and review queue
What was solved
#279 — Detect Upstream Provider Schema Drift and Breaking Changes Before Ingestion Breaks
Add a versioned, per-adapter response-shape declaration and a schema-drift validator that runs before parsing/normalization on every provider fetch, classifying mismatches as
drift(warn + redacted sample capture) orbreaking(reject ingestion, quarantine source, fire alert), persisting drift events with last-known-good samples, attaching detection results to the evidence record, and exposing a per-source drift report via the operator API/CLI.Addressed:
drift(informational warn + redacted sample capture) orbreaking(ingestion rejected, source quarantined, alert fired).#280 — Implement Cross-Feed Economic Consistency Checks Between Related Metrics
Add a declarative cross-feed economic consistency layer: define rules between economically related feeds (LiquidationShield vs price/TVL, FlightDelay vs route disruption) in a new rules module, evaluate them post-consensus with point-in-time semantics, emit anomaly events with human-readable explanations, and support warn/block severity (block holds publication and trips the relevant circuit breaker). Declare feed relationships in the coverage catalog, persist rule evaluations via schema/migration, and document rationale. Rules must skip (not fail) when one side is missing and never block publication when skipped.
Addressed:
#281 — Add Operator Reward Accrual and Distribution for Honest Oracle Participation
Implement operator reward accrual and scheduled distribution for honest oracle participation: derive per-round accruals from committed consensus evidence (not live submissions), weight by stake and reputation with a per-operator cap, persist a durable idempotent ledger of accruals/adjustments/payouts, run scheduled distribution with a minimum payout threshold and dispute window, and expose an operator-facing reward history API.
Addressed:
#282 — Implement a Human Review Queue for High-Value and Ambiguous Oracle Decisions
Add a durable human review queue that gates settlement for high-value, low-confidence, evidence-immature, and post-remediation oracle decisions. Queue entries are created from claimProcessor with full evidence packets, reviewer actions (approve/reject/escalate) are audit-logged, SLA expiry escalates rather than auto-settles, and settlement rejects decisions lacking a queue entry or approval reference.
Addressed:
Changes
src/oracle/validation/schemaDrift.ts(create)src/oracle/consistency/rules.ts(create)src/services/oracleMonitor.ts(create)src/oracle/consistency/evaluate.ts(create)src/db/schema.sql(modify)src/services/operatorRewards.ts(create)src/services/reviewQueue.ts(create)src/services/claimProcessor.ts(create)src/routes/review.ts(create)Approach
Issues
Closes #279
Closes #280
Closes #281
Closes #282