fix(polymarket): merge repeated sealed reference evidence - #273
Conversation
|
Warning Review limit reached
Next review available in: 39 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 Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughPolymarket reference consolidation now derives canonical identities for trades and settlements, merges identical records while preserving the earliest row, and rejects conflicting duplicate semantics. Tests cover later-only trades, completion proofs, conflicting trade context, and settlement winner mismatches. ChangesPolymarket reference merge
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant ReferenceSegments
participant combine_references
participant IdentityValidation
ReferenceSegments->>combine_references: provide validated NDJSON rows
combine_references->>IdentityValidation: derive canonical trade or settlement identity
IdentityValidation-->>combine_references: return merge key and identity vector
combine_references-->>ReferenceSegments: preserve first duplicate or reject conflict
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: 5a42954374
ℹ️ 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".
Change contract
Merge identical canonical v2 trades and identical official settlements across already validated consecutive Polymarket reference segments exactly once, preserving the first segment clocks, while retaining later-only trades and failing closed on semantic conflicts.
Out of scope
Collector deployment or polling policy; raw-row fabrication or renumbering; completion-proof relaxation; ResearchSnapshot/evaluator logic; Binance; Paper, Shadow, or Live. A PRD is unnecessary because this is the focused behavior change already specified in #272.
Dependency or merge order
Independent code PR. After merge and exact-main compiler image publication, #270 consumes the live hour 09-11 reference segments plus bounded hour 12 full/completion segments. #232 remains downstream of #270.
Focused validation
cargo test -p hft-collector --lib polymarket_research_import::tests:: -- --nocapture(21 passed)cargo test -p hft-collector --lib(205 passed, 2 ignored)cargo clippy -p hft-collector --lib --no-default-features -- -D warningsdeployment/aliyun/test-polymarket-raw-ops-control-plane.shRollout and rollback impact
Research compiler behavior only. Rollback restores strict cross-segment duplicate rejection and blocks the affected cohort; it does not modify collector services or existing immutable artifacts.
Fixes #272
Summary by CodeRabbit