fix: accept causal batched Polymarket completions - #211
Conversation
|
Warning Review limit reached
Next review available in: 51 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 (2)
📝 WalkthroughWalkthroughReference segment validation now derives the segment hour start and uses it for trade-completion retrieval checks. Tests cover retrieval before recording, after recording, and before the enclosing hour. ChangesReference timestamp validation
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 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.
🧹 Nitpick comments (1)
rust_hft/prediction-markets/crates/ploy-market-data/src/polymarket_evidence/artifact.rs (1)
1377-1436: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd an explicit lower-bound equality test.
The new tests cover values below and above the bounds, but not
retrieved_at == hour_start. Add that case to protect the required inclusive lower bound.🤖 Prompt for 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. In `@rust_hft/prediction-markets/crates/ploy-market-data/src/polymarket_evidence/artifact.rs` around lines 1377 - 1436, Add a test alongside rejects_completion_retrieved_before_its_segment_hour that sets trade_completions["market-1"].retrieved_at exactly to the segment hour start, invokes seal_polymarket_evidence_triplet, and asserts successful sealing. Preserve the existing below- and above-bound rejection tests.
🤖 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.
Nitpick comments:
In
`@rust_hft/prediction-markets/crates/ploy-market-data/src/polymarket_evidence/artifact.rs`:
- Around line 1377-1436: Add a test alongside
rejects_completion_retrieved_before_its_segment_hour that sets
trade_completions["market-1"].retrieved_at exactly to the segment hour start,
invokes seal_polymarket_evidence_triplet, and asserts successful sealing.
Preserve the existing below- and above-bound rejection tests.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e1d637af-ee2f-4327-af84-a118fcdfce62
📒 Files selected for processing (1)
rust_hft/prediction-markets/crates/ploy-market-data/src/polymarket_evidence/artifact.rs
Change contract
Accept causal Polymarket trade-completion retrievals that occur before a batched segment is recorded, while enforcing the fail-closed window
segment UTC hour start <= retrieved_at <= end_recorded_at.Out of scope
Collector/importer changes, evidence bytes, permission or digest checks, snapshot/cohort construction, evaluator/MCTS, Paper/Live, 15m/1h.
Dependency / merge order
Base:
main. No stacked code dependency. This focused fix blocks cloud completion of #173 and therefore #169. Relates to #210; keep #210 open until the fresh ACK verifier proof passes.Focused validation
seals_completion_retrieved_before_its_batched_segment_is_recordedfailed under the prior lower bound.cargo test -p ploy-market-data— 48 passed.cargo fmt -p ploy-market-data -- --check— passed.cargo clippy -p ploy-market-data --all-targets --no-deps -- -D warnings— passed.ploy-market-contractsderivable-impl warnings; this PR does not own them.Rollout / rollback impact
Rollout publishes a new immutable
research-runnerimage, then reruns the existing read-only ACK typed-verifier Job using exact evidence digests. Rollback is a one-commit revert; no data migration or collector change.Why no PRD
This is a small, already-specified verifier defect with one temporal predicate and targeted counterexamples, so Matt TDD is the narrowest workflow.
Summary by CodeRabbit