Skip to content

fix(polymarket): consume gated health during cutover - #516

Merged
proerror77 merged 3 commits into
mainfrom
codex/polymarket-cutover-gated-health-515
Jul 30, 2026
Merged

fix(polymarket): consume gated health during cutover#516
proerror77 merged 3 commits into
mainfrom
codex/polymarket-cutover-gated-health-515

Conversation

@proerror77

@proerror77 proerror77 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Change contract

Consume the immutable Gate's legacy-health admission during Python-to-Rust
cutover instead of requiring a new 240-second Python health publication before
promotion or after uploader drain. A PRD is unnecessary because this is the
single, already-specified defect in issue #515.

Issue relationship

Closes #515

Out of scope

Collector/uploader data behavior, shared legacy or Rust health policies, Gate
duration, CI restructuring, production mutation, research, snapshot/#235,
evaluator/MCTS, and immutable release replacement.

Dependency / merge order

Base: exact main SHA 44ad7ef73e8a30cb30656a13037792ef4cfa678a.
No stacked code dependency. Runtime issue #498 remains open and may proceed only
after this PR merges, a new exact-main artifact is verified, the real segment
preflight passes, and a new 900-second Gate passes.

Focused validation

  • RED before implementation: test-polymarket-raw-ops-control-plane.sh failed
    with cutover re-admits Python health after the immutable Gate already passed.
  • GREEN after implementation:
    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.
  • Counterexample guard proves the promotion path validates the immutable Gate
    policy, checks the exact Python runtime twice, and never re-admits current
    Python health.

Rollout / rollback impact

After merge, build and independently verify a new exact-main release, run the
real closed-segment preflight and a new strict 900-second Gate, then cut over.
All existing identity, restart-free stop, Rust health, OSS/parity, immutable
evidence, and automatic Python rollback checks remain fail-closed.

@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: 41 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: 7f6213d0-8d04-4255-b4c3-65c30127b7b0

📥 Commits

Reviewing files that changed from the base of the PR and between f3277c7 and 2331322.

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

Walkthrough

The cutover script removes legacy Python health re-admission based on baseline_health_start_required, retains Rust baseline verification, and adds control-plane assertions for runtime identity, fresh validation, and updated evidence ordering.

Changes

Legacy cutover promotion

Layer / File(s) Summary
Update cutover admission flow
deployment/aliyun/polymarket-raw-ops-cutover.sh
Removes the legacy fail-closed health check, clarifies Gate and runtime-identity requirements, and computes the pre-stop timestamp before Rust verification.
Enforce promotion contract
deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
Adds checks for legacy runtime binding, rejects verify_legacy_health, requires verify_fresh_legacy_runtime, and updates evidence ordering assertions.

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

Possibly related issues

  • proerror77/monday#490 — Related to removing Python health-admission requirements from Polymarket gate flows.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The cutover and test changes match #515 by using Gate-admitted legacy health, keeping identity checks, and adding the counterexample coverage.
Out of Scope Changes check ✅ Passed The diff stays focused on cutover logic and its verifier test, with no clear unrelated feature work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title is concise and accurately summarizes the cutover change to consume gated legacy health.
Description check ✅ Passed All required sections are present and mostly complete, with only minor heading wording differences from the template.
✨ 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-gated-health-515

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 enabled auto-merge (squash) July 30, 2026 17:00

@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 4135-4136: Update the contract checks around the legacy rollback
assertions to count the complete verify_legacy_runtime invocation, including the
expected legacy_pid, restart-count, and InvocationID arguments, rather than any
occurrence of legacy_pid. Replace the whole-file verify_fresh_legacy_runtime
search with an assertion scoped to the restored-runtime rollback path so the
check requires an actual executable call, not only the function definition.
🪄 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: 66b25871-892d-4717-9b46-e20c80e10e79

📥 Commits

Reviewing files that changed from the base of the PR and between 44ad7ef and f3277c7.

📒 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 Outdated
@proerror77
proerror77 merged commit 2407ebb into main Jul 30, 2026
45 checks passed
@proerror77
proerror77 deleted the codex/polymarket-cutover-gated-health-515 branch July 30, 2026 17:29
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.

fix(polymarket): consume gated legacy health during cutover

1 participant