Skip to content

fix(polymarket): complete legacy rollback before health - #520

Merged
proerror77 merged 1 commit into
mainfrom
codex/polymarket-legacy-rollback-health-519
Jul 30, 2026
Merged

fix(polymarket): complete legacy rollback before health#520
proerror77 merged 1 commit into
mainfrom
codex/polymarket-legacy-rollback-health-519

Conversation

@proerror77

@proerror77 proerror77 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Change contract

For a legacy Python rollback, restore and verify the exact saved collector/timer
state without waiting for the collector's next approximately 35-minute
full-cycle health publication. Keep Rust-to-Rust rollback health advancement
strict and unchanged.

Issue relationship

Refs #519

Out of scope

Gate duration, collector/uploader data semantics, Python cycle performance,
quote-collector RuntimeMaxSec, research, snapshot/#235, evaluator/MCTS, and CI
restructuring.

Dependency or merge order

Based on exact main 45b7a0ca933abdc74ea613be06c8aedc8b7d9425, after the
bounded uploader cutover fix in PR #518. No stacked PR dependency remains.

Focused validation

  • Focused test changed RED first: rollback no longer verifies the restored legacy identity at every boundary.
  • 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
  • bash deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
  • git diff --check

Rollout / rollback impact

Rollout requires a new exact-main release artifact before the next production
cutover. The runtime controller remains /root. Revert this commit to restore
the prior behavior. The saved rollback manifest, exact Python ExecStart,
PID/InvocationID/NRestarts checks, canonical FragmentPath/DropInPaths checks,
timer-state verification, and immutable marker flow remain fail-closed.

Counterexample

Production invocation t-jpn6sictxlowsg0 restored the exact Python runtime but
had no new health.json within 180 seconds, so the old code exited before
restoring timers. The focused test now rejects any legacy rollback path that
still calls verify_fresh_legacy_runtime, while requiring four exact
verify_legacy_runtime boundaries including the final check after saved timer
state restoration.

Summary by CodeRabbit

  • Bug Fixes

    • Improved legacy rollback verification to confirm runtime identity and recovery state more reliably.
    • Prevented rollback checks from incorrectly requiring legacy health-policy validation.
    • Updated rollback safeguards and error handling for more accurate verification results.
  • Tests

    • Updated control-plane checks to enforce the revised legacy rollback verification behavior and ordering.

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

@proerror77
proerror77 enabled auto-merge (squash) July 30, 2026 19:23
@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: 13 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: 0351de2a-38c3-4078-8815-4f2683d38e8f

📥 Commits

Reviewing files that changed from the base of the PR and between 7e6feed and cf21028.

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

Walkthrough

Legacy rollback verification now validates only runtime identity instead of identity plus health freshness. Control-plane contract tests enforce the updated verifier usage and final-check ordering.

Changes

Legacy rollback verification

Layer / File(s) Summary
Use identity-only rollback checks
deployment/aliyun/polymarket-raw-ops-cutover.sh
Rollback polling, recovery, and final preservation checks now use verify_legacy_runtime with the rollback PID, restart counter, and invocation ID.
Update rollback contract assertions
deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
Contract checks require four identity verifications, reject verify_fresh_legacy_runtime, and track the final identity check for ordering assertions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

  • proerror77/monday#419: Introduced legacy health freshness binding that previously influenced verify_fresh_legacy_runtime expectations.
  • proerror77/monday#501: Updated related cutover and rollback contract assertions for legacy verification sequencing.
  • proerror77/monday#516: Modified related legacy verifier expectations across cutover and rollback checks.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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 summarizes the legacy rollback verification change.
Description check ✅ Passed The description covers the change contract, issue link, validation, rollout, and out-of-scope details, with only minor template wording differences.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/polymarket-legacy-rollback-health-519

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-legacy-rollback-health-519 branch from 7e6feed to cf21028 Compare July 30, 2026 20:09
@proerror77
proerror77 merged commit 8dc4869 into main Jul 30, 2026
41 checks passed
@proerror77
proerror77 deleted the codex/polymarket-legacy-rollback-health-519 branch July 30, 2026 20:20
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