Skip to content

fix(collector): bound recovered legacy Gate timeouts - #389

Merged
proerror77 merged 3 commits into
mainfrom
codex/polymarket-gate-recoverable-baseline-388
Jul 26, 2026
Merged

fix(collector): bound recovered legacy Gate timeouts#389
proerror77 merged 3 commits into
mainfrom
codex/polymarket-gate-recoverable-baseline-388

Conversation

@proerror77

@proerror77 proerror77 commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Change contract: Allow the Polymarket Rust shadow Gate to tolerate only an otherwise-clean legacy Python comparator sample whose sole failure is non-empty api_errors, freeze the parity cutoff while it is transient, require a clean recovery within the existing 240-second health budget, and remain fail-closed for every other failure.

Out of scope: Python collector behavior; Rust collector data contract; production cutover; snapshot/research logic; #235.

Dependency or merge order: Independent focused repair for #326 after formal Gate t-jpn6s3s1l438irk; no stacked PR. Merge before building the next exact-main candidate.

Focused validation: bash -n deployment/aliyun/polymarket-raw-ops-shadow-gate.sh deployment/aliyun/test-polymarket-raw-ops-control-plane.sh; shellcheck on both files; bash deployment/aliyun/test-polymarket-raw-ops-control-plane.sh; git diff --check. Executable counterexamples cover transient through t=240, recovery at t=240, persistent or first-clean recovery at t=241, fatal legacy health, and Rust baseline rejection. Final spec and standards reviews passed.

Rollout/rollback impact: No production mutation in this PR. After merge, build an exact-main candidate and rerun the full 3600-second observation plus 601-second mature-tail Gate. Revert this PR to restore immediate failure on any legacy api_errors.

Closes #388

Summary by CodeRabbit

  • Bug Fixes

    • Improved deployment gating for legacy API health conditions.
    • Deployments now wait during transient errors, stop on fatal conditions, and proceed only after confirmed recovery.
    • Tightened parity and gate-entry checks to prevent premature progression.
  • Tests

    • Added coverage for legacy health classifications and timing-based transitions.
    • Expanded validation of deployment gate control flow and recovery decisions.

@coderabbitai

coderabbitai Bot commented Jul 26, 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: 50 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: da6ac634-404a-458e-a99b-d6f35bdefb0f

📥 Commits

Reviewing files that changed from the base of the PR and between 8c72617 and 31481ca.

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

Walkthrough

The shadow gate adds legacy health classification and bounded recovery transitions. It delays parity progression during transient API errors, treats unrecoverable states as fatal, and requires an advancing legacy health decision before entering gate evidence. Focused tests cover classifications, timing transitions, and wiring.

Changes

Legacy health gate

Layer / File(s) Summary
Legacy health state machine
deployment/aliyun/polymarket-raw-ops-shadow-gate.sh, deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
Legacy health samples are classified as clean, transient API errors, or fatal, then mapped to deterministic recovery transitions with focused assertions.
Gate progression integration
deployment/aliyun/polymarket-raw-ops-shadow-gate.sh, deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
The gate tracks error timing, rejects fatal decisions, and computes parity cutoff and evidence entry only when the legacy health decision is advance; static wiring checks cover these integrations.

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

Possibly related PRs

  • proerror77/monday#48: Both changes adjust shadow-gate advance branching and parity-window cutoff conditions.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and points to the bounded legacy Gate timeout fix, which matches the main change.
Description check ✅ Passed The description covers the contract, out-of-scope, dependency, validation, and rollout details; the scope-exception section is not required here.
Linked Issues check ✅ Passed The changes implement #388 by classifying transient legacy api_errors, holding the cutoff, and requiring recovery within the 240-second budget.
Out of Scope Changes check ✅ Passed The PR stays focused on the shadow Gate and its regression test, with no unrelated collector, cutover, or research changes visible.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/polymarket-gate-recoverable-baseline-388

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.

@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: 8c72617db5

ℹ️ 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 deployment/aliyun/polymarket-raw-ops-shadow-gate.sh
@proerror77
proerror77 merged commit e933194 into main Jul 26, 2026
40 checks passed
@proerror77
proerror77 deleted the codex/polymarket-gate-recoverable-baseline-388 branch July 26, 2026 18:40
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.

Polymarket Gate should tolerate bounded recovered legacy API timeouts

1 participant