fix(polymarket): reject deltas older than snapshot - #445
Merged
Merged
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe CLOB price-change path now skips deltas older than the current full-book snapshot before applying updates. Its regression test covers an uninitialized ChangesCLOB staleness handling
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
This was referenced Jul 29, 2026
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.
Change contract
Reject a Polymarket price-change delta whose source timestamp is older than the latest authenticated full-book snapshot before it can mutate cached depth. Closes #444.
This is a small, already-specified behavior correction, so a separate PRD is unnecessary; issue #444 is the scoped contract.
Out of scope
ACK Job creation or retry; collector deployment or cutover; evidence compilation; ResearchSnapshot; evaluator/MCTS; Paper, Shadow, or Live.
Dependency or merge order
Based on main
bbd9405724fc00fcf825990311d99497b8fa6f93after #442. Merge this PR before any separately authorized #313 acquisition attempt.Focused validation
first_price_change_older_than_a_full_snapshot_is_skippedfailed because the first stale delta was applied.cargo test --locked -p ploy-market-data --features live first_price_change_older_than_a_full_snapshot_is_skippedcargo test --locked -p ploy-market-data --features live(146 passed)cargo fmt -p ploy-market-data -- --checkgit diff --checkRollout and rollback impact
Recorder parsing only. Rollback restores the previous fail-closed reconnect behavior; no stored artifact is rewritten or deleted.
Summary by CodeRabbit
Bug Fixes
Documentation