Skip to content

fix(collector): accept verified Polymarket trade supersets - #380

Merged
proerror77 merged 2 commits into
mainfrom
codex/polymarket-trade-parity-superset-326
Jul 26, 2026
Merged

proerror77 merged 2 commits into
mainfrom
codex/polymarket-trade-parity-superset-326

Conversation

@proerror77

Copy link
Copy Markdown
Owner

Change contract

Allow the Polymarket Rust shadow gate to pass when it captures every mature Python-baseline trade with matching canonical contracts and no duplicates, while also capturing additional canonical Rust trades.

Acceptance evidence

  • Reproduced the production failure from the fixed ECS spools: Python-only=0, Rust-only=83, duplicate counts=0, shared contracts matched; the prior exact-ID check failed.
  • Added a red-to-green Rust regression for a verified Rust trade superset.
  • cargo test -p hft-collector polymarket_parity::tests -- --nocapture
  • cargo test -p hft-collector --lib (220 passed, 2 ignored)
  • cargo clippy -p hft-collector --all-targets -- -D warnings
  • bash deployment/aliyun/test-polymarket-raw-ops-control-plane.sh

Out of scope

Collector polling, snapshot/research logic, #235 full-update CLOB collection, and production cutover.

Dependency / merge order

Depends on the already-merged OSS readback retry in PR #376. Merge this before building the next exact-main candidate and formal Gate.

Rollout / rollback impact

The parity producer and its admission policy change atomically: the producer emits explicit dedupe, coverage, and contract checks and the policy consumes all three. Python omissions, duplicates, and conflicting shared records remain hard failures. No production change occurs in this PR; rollback is retaining the Python baseline if the subsequent Gate fails.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@proerror77, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 10 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 44ae0ca1-f58c-44b4-a213-a3007d6b5a94

📥 Commits

Reviewing files that changed from the base of the PR and between 8fbb277 and 616b5a0.

📒 Files selected for processing (3)
  • deployment/aliyun/polymarket-shadow-gate-policy.jq
  • deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
  • rust_hft/tools/collector/src/polymarket_parity.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/polymarket-trade-parity-superset-326

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proerror77
proerror77 force-pushed the codex/polymarket-trade-parity-superset-326 branch from 5a041b5 to 06865aa Compare July 26, 2026 11:53

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a041b576d

ℹ️ 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".

Comment thread rust_hft/tools/collector/src/polymarket_parity.rs
@proerror77

Copy link
Copy Markdown
Owner Author

P1 已修复于 616b5a00:共享的 trade_metadata_context_mismatch_ids 现在要求每条成交的 trade_ts_unix 位于其 metadata [startDate, endDate] 内;缺失或非法时间也 fail-closed。新增 Rust-only 成交在 market 结束后 1 秒的回归测试,以及 metadata 时间窗错误复用的反例测试。验证:cargo test -p hft-collector --lib(221 passed, 2 ignored)、strict Clippy、control-plane tests 均通过。

@proerror77
proerror77 merged commit 7f40520 into main Jul 26, 2026
38 checks passed
@proerror77
proerror77 deleted the codex/polymarket-trade-parity-superset-326 branch July 26, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant