fix(collector): bind shadow parity to event time - #48
Conversation
|
Warning Review limit reached
Next review available in: 41 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe PR tightens Polymarket shadow parity around governed metadata, trades, settlements, and settlement-safe time windows. Rust comparison logic, shared validators, deployment gate policy, fixtures, regression tests, and parity documentation are updated together. ChangesPolymarket shadow parity
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa2e2d9ffd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
aa2e2d9 to
428d677
Compare
|
@codex review |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@rust_hft/tools/collector/src/polymarket_parity.rs`:
- Around line 532-564: Keep the existing retrieved_at presence and timestamp
validation in the settlement normalization flow, but remove retrieved_at from
the normalized settlement object returned by the relevant projection so
shared_values_match does not compare collector-specific polling times. Apply the
same exclusion to the corresponding settlement projection at the additionally
referenced location, while preserving all immutable settlement fields.
- Around line 814-824: The parity evidence currently records settlement counts
and IDs without content-addressing the normalized settlement data. In the
settlement comparison flow around the evidence construction, add a deterministic
digest of the normalized settlement set and include that digest in the emitted
metrics/evidence alongside the existing settlement fields, reusing the
established normalization and digest helpers used for trades and metadata.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 428dfcde-1b6f-4263-867c-51666300ac6a
📒 Files selected for processing (6)
deployment/aliyun/README.mddeployment/aliyun/polymarket-raw-ops-shadow-gate.shdeployment/aliyun/polymarket-shadow-gate-policy.jqdeployment/aliyun/test-polymarket-raw-ops-control-plane.shrust_hft/tools/collector/src/polymarket_parity.rsrust_hft/tools/collector/src/polymarket_upload.rs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 428d677ec0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
428d677 to
21066ff
Compare
21066ff to
0518229
Compare
Outcome
Fixes the failed one-hour Rust Polymarket shadow gate without weakening the fail-closed migration boundary.
Root cause
The first production-eligible shadow was stable for the full hour with identical trade IDs/counts and no duplicates, but the verifier compared settlements by collector retrieval time. Independent 30-second polling placed the same closed markets on opposite sides of the UTC boundary. It also required exact metadata set equality even when Rust validly discovered the next markets first.
Changes
Verification
A new full one-hour cloud shadow is still required after merge; no cutover is authorized by the failed prior evidence.
Summary by CodeRabbit
New Features
Documentation
Tests