Skip to content

fix(polymarket): keep cutover bounded while backlog drains - #518

Merged
proerror77 merged 2 commits into
mainfrom
codex/polymarket-cutover-bounded-uploader-517
Jul 30, 2026
Merged

proerror77 merged 2 commits into
mainfrom
codex/polymarket-cutover-bounded-uploader-517

Conversation

@proerror77

@proerror77 proerror77 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Change contract

Keep Polymarket production promotion bounded by starting the historical
market-tape backlog asynchronously after the immutable real-segment/Gate OSS
proof, while retaining exact Rust process, timer, reference-upload, and
fail-closed checks. Refs #517.

Issue relationship

Refs #517

Out of scope

Collector or uploader data semantics, historical spool deletion/rewriting,
research, snapshot/#235, evaluator/MCTS, CI restructuring, and production
mutation.

Dependency / merge order

Base is exact main 2407ebb64df61d616af579aa675d611a273e48a0.
No stacked PR dependency. Runtime issue #517 remains open until live recovery
and cleanup evidence is recorded.

Focused validation

  • Red: control-plane test rejected the old synchronous market uploader start
    and terminal-success wait.
  • Green: bash deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
  • bash -n deployment/aliyun/polymarket-raw-ops-cutover.sh deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
  • shellcheck deployment/aliyun/polymarket-raw-ops-cutover.sh deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
  • git diff --check

Rollout / rollback impact

After Rust collector health and synchronous reference upload succeed, cutover
resets stale market-service failure state, starts a new market uploader job with
--no-block, and requires a new exact Rust Invocation/PID/exe (or fast terminal
success) within ten seconds. Both timers must be active, and market-service
failure is rechecked before evidence and success-marker publication. Historical
backlog continues under the timer. Existing immutable rollback snapshot and
official rollback command are unchanged.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 52 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: 3c069ed4-a12e-46b9-97a9-9eee4eb0c13e

📥 Commits

Reviewing files that changed from the base of the PR and between d84d64e and 4691f68.

📒 Files selected for processing (1)
  • deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
📝 Walkthrough

Walkthrough

Changes

Market upload cutover

Layer / File(s) Summary
Deferred market upload verification
deployment/aliyun/polymarket-raw-ops-cutover.sh
Adds polling that validates invocation stability, oneshot success when inactive, and the expected executable while active or activating.
Asynchronous cutover orchestration and evidence
deployment/aliyun/polymarket-raw-ops-cutover.sh
Starts market upload with --no-block, verifies failure state during cutover, enables upload timers, and records deferred-backlog evidence flags.
Cutover contract validation
deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
Checks asynchronous startup, deferred verification, failure-state reset, and the new evidence fields.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

  • proerror77/monday#34 — Provides related cutover/control-plane orchestration and test assertions extended by these changes.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately reflects the main change: keeping Polymarket cutover bounded while the backlog drains.
Description check ✅ Passed The description covers the required sections and includes the contract, issue link, out-of-scope items, validation, and rollout details.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/polymarket-cutover-bounded-uploader-517

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.

@coderabbitai coderabbitai 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.

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 `@deployment/aliyun/test-polymarket-raw-ops-control-plane.sh`:
- Around line 4310-4320: Extend the test coverage around
verify_deferred_market_upload in test-polymarket-raw-ops-control-plane.sh with
mocked runtime counterexamples, not just grep-based source checks: assert
failure for stale invocation IDs, failed or inactive oneshot results, and a
mismatched /proc/<pid>/exe. Keep each scenario targeted and verify that
verify_deferred_market_upload returns failure.
🪄 Autofix (Beta)

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: c8491612-1720-4685-9b9a-59015481a8ea

📥 Commits

Reviewing files that changed from the base of the PR and between 2407ebb and d84d64e.

📒 Files selected for processing (2)
  • deployment/aliyun/polymarket-raw-ops-cutover.sh
  • deployment/aliyun/test-polymarket-raw-ops-control-plane.sh

Comment thread deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
@proerror77
proerror77 merged commit 45b7a0c into main Jul 30, 2026
41 checks passed
@proerror77
proerror77 deleted the codex/polymarket-cutover-bounded-uploader-517 branch July 30, 2026 18:37
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