fix(collector): retain completion segments missing metadata - #761
Conversation
|
Warning Review limit reached
Next review available in: 30 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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)
📝 WalkthroughWalkthroughThe collector now checks completion identity mismatches only when metadata exists. A regression test verifies that completion-only tapes are non-canonical, incomplete, and require market metadata context. ChangesPolymarket completion 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 💡 1🛠️ Fix failing CI checks 💡
📝 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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_upload.rs`:
- Around line 4048-4071: The test
completion_without_segment_metadata_is_not_complete_or_canonical should also
verify that completion evidence is retained in
manifest["trade_completions"]["market-1"]. Assert preserved fields including
condition_id and completion_sequence from valid_trade_completion_update(), while
keeping the existing noncanonical manifest assertions unchanged.
🪄 Autofix
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 Plus
Run ID: b3f68c43-ab36-4dae-a710-8e48b897a565
📒 Files selected for processing (1)
rust_hft/tools/collector/src/polymarket_upload.rs
d73059b to
6ece127
Compare
30c02b9 to
ed440b7
Compare
Change contract
Treat a Polymarket trade-completion row without same-segment market metadata as retained noncanonical evidence instead of a contradictory identity. Continue to fail closed when present metadata disagrees with the completion symbol or market window.
Issue relationship
Closes #760
Out of scope
Timer/watchdog changes, raw tape rewriting or deletion, Gate/cutover changes, and production mutation.
Dependencies and merge order
None
Focused validation
cargo test -p hft-collector --lib --locked completion_without_segment_metadata_is_not_complete_or_canonical -- --nocapturefailed with the production error.rejects_trade_completion_identity_that_contradicts_metadataremains green and proves real contradictions fail closed.cargo test -p hft-collector --lib --locked: 312 passed, 0 failed, 2 ignored.cargo clippy -p hft-collector --lib --no-deps --locked -- -D warningspassed.git diff --checkpassed.Rollout and rollback
No direct production impact. Publication and runtime adoption remain blocked by #632. Roll back by reverting this single commit.
Scope exception
None
Summary by CodeRabbit