Skip to content

fix(polymarket): preserve priority polls during recovery - #372

Merged
proerror77 merged 1 commit into
mainfrom
codex/polymarket-rust-cutover-326
Jul 26, 2026
Merged

proerror77 merged 1 commit into
mainfrom
codex/polymarket-rust-cutover-326

Conversation

@proerror77

Copy link
Copy Markdown
Owner

Change contract

The Rust Polymarket reference collector keeps authoritative market-detail recovery and all priority trade polls within the existing 112-request cycle cap, while the deployment health policy validates the exact emitted accounting without requiring the removed state_recovery_markets field.

Out of scope

Research snapshot construction, Mission/evaluator/MCTS logic, Binance collectors, Polymarket full-update temporal CLOB capture (#235), trading, promotion, and production cutover itself.

Dependency or merge order

Supports #326. No code dependency. Merge before rebuilding the replacement polymarket-raw-ops candidate and rerunning the formal shadow gate. The rejected candidate 6cc03c9488f9bb5d34a623f1dea3c38d7af16c83e3829ec6b4186e96a2cb1bcf must not be reused.

Focused validation

  • Red proof: the Rust test failed because shared_market_detail_budget did not exist.
  • Red proof: the control-plane policy test rejected the incident-derived health contract.
  • cargo +1.91 test --manifest-path rust_hft/Cargo.toml --locked -p hft-collector --lib: 217 passed, 2 ignored watchdog subprocess targets.
  • cargo +1.91 clippy --manifest-path rust_hft/Cargo.toml --locked -p hft-collector --lib -- -D warnings.
  • bash deployment/aliyun/test-polymarket-raw-ops-control-plane.sh.
  • cargo +1.91 fmt --manifest-path rust_hft/Cargo.toml -- --check.
  • git diff --check.
  • Independent standards and spec reviews approved the final diff. The standards review counterexample proves under-reported post-detail priority counts are rejected.

Rollout and rollback impact

Build a new immutable exact-main Linux artifact after merge, stage it without changing production, and run the full one-hour plus maturity-tail shadow gate. Cut over only if immutable gate evidence passes. Until then the current Python reference collector and uploaders remain the rollback-safe production baseline. No snapshot or research logic changes.

Scope exception

None. Three files and 165 changed non-generated lines.

@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: 27 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: e0e16080-4ad3-4e95-b305-bcd6f8e3f704

📥 Commits

Reviewing files that changed from the base of the PR and between a105ac5 and 9e91bf7.

📒 Files selected for processing (3)
  • deployment/aliyun/polymarket-rust-health-policy.jq
  • deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
  • rust_hft/tools/collector/src/polymarket_raw.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/polymarket-rust-cutover-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.

The production shadow gate exposed two coupled contract regressions: the deployment policy still required a removed state recovery field, and detail recovery could consume enough of the shared request budget to defer priority trade polls. Reserve paired detail-plus-trade capacity from the remaining priority headroom, bind the emitted pre-detail count into the fail-closed policy, and cover under-reported priority accounting.
@proerror77
proerror77 force-pushed the codex/polymarket-rust-cutover-326 branch from fb078a4 to 9e91bf7 Compare July 26, 2026 07:53
@proerror77
proerror77 merged commit cdd53f1 into main Jul 26, 2026
38 checks passed
@proerror77
proerror77 deleted the codex/polymarket-rust-cutover-326 branch July 26, 2026 07:57
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