Skip to content

fix(polymarket): permit expedited 15-minute shadow Gate - #487

Merged
proerror77 merged 2 commits into
mainfrom
codex/polymarket-15m-gate
Jul 30, 2026
Merged

proerror77 merged 2 commits into
mainfrom
codex/polymarket-15m-gate

Conversation

@proerror77

@proerror77 proerror77 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Change contract

Permit an expedited Polymarket production Gate with a 900-second Rust observation plus the existing 601-second parity tail. For a legacy-Python baseline, the Gate requires a policy-clean atomic health publication before shadow startup and continuous service identity during the run, then records that a second full-catalog Python health publication was not required. The immutable evidence records baseline_health_completion_required=false for this exception.

Issue relationship

Refs #486

Acceptance evidence

  • bash deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
  • ShellCheck on the Gate and its control-plane test
  • git diff --check
  • Spec review: PASS; Standards review: PASS

Out of scope

Uploader semantics, collector health policy, research/snapshot/#235, production installation, and production cutover.

Dependency / merge order

Base: c1bf15833d0052edaf07d7c82d0d6977405b08ba (main). No PR dependency.

Rollout / rollback impact

A future exact-source release must be rebuilt, signed, installed as a candidate, and pass real-segment preflight before the 1501-second Gate can run. The Gate remains fail-closed on Rust health, Rust/Python identity, real-segment parity, OSS readback, and immutable evidence. Reverting this PR restores the one-hour Gate policy; this PR does not alter production services.

@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: 1 minute

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: b8aaed17-c69d-471e-94e5-1b99089e6bdb

📥 Commits

Reviewing files that changed from the base of the PR and between 4aa8380 and f7b8c65.

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

Walkthrough

The shadow gate observation window changes to 900 seconds. Legacy baseline health completion becomes optional, with the requirement recorded in gate evidence and enforced conditionally by the jq policy. Control-plane tests update fixtures, mutations, timing thresholds, runtime boundaries, and health-budget assertions.

Changes

Shadow gate policy

Layer / File(s) Summary
Gate duration and legacy control flow
deployment/aliyun/polymarket-raw-ops-shadow-gate.sh
The observation window changes to 900 seconds; legacy completion checks can be disabled; gate decisions, cutoff handling, failure conditions, and evidence output reflect the new setting.
Conditional baseline completion contract
deployment/aliyun/polymarket-shadow-gate-policy.jq
Preflight duration requires at least 1501 seconds, while legacy completion fields are validated conditionally and Rust release evidence explicitly disables completion requirements.
Evidence and boundary contract tests
deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
Tests cover required and expedited legacy evidence, forged completion mutations, updated duration thresholds, runtime boundaries, and health-budget constants.

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

Sequence Diagram(s)

sequenceDiagram
  participant ShadowGate as Shadow gate
  participant Evidence as Gate evidence
  participant Policy as Gate policy
  ShadowGate->>Evidence: Record 900-second duration and completion flag
  Evidence->>Policy: Submit baseline health evidence
  Policy-->>ShadowGate: Accept or reject admission
Loading

Possibly related issues

  • proerror77/monday issue 486: Directly covers the 15-minute Rust shadow gate and optional legacy health-completion gating implemented here.

Possibly related PRs

🚥 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 summarizes the main change: enabling an expedited 15-minute shadow Gate.
Description check ✅ Passed The description covers the required contract, issue, validation, out-of-scope, dependency, and rollout details, with only minor template heading drift.
✨ 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-15m-gate

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 changed the title fix(polymarket): permit expedited 15-minute shadow gate fix(polymarket): permit expedited 15-minute shadow Gate Jul 30, 2026

@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

last_legacy_health=$current_legacy_health
last_legacy_health_change=$now_uptime

P1 Badge Require a complete legacy comparator

When the expedited gate ends before the legacy collector's documented 35–58 minute full-catalog cycle completes, this branch marks the legacy lane ready unconditionally even though the clean startup snapshot predates the parity window. The verifier in polymarket_parity.rs only requires nonempty legacy ID sets to be subsets of the Rust sets and explicitly permits unconstrained Rust-only IDs, so a partially written legacy cycle can satisfy parity after collecting only some markets; a same-PID post-start health publication containing API errors is ignored as well. This can authorize production using incomplete comparator evidence, so retain a completion/coverage proof for the selected cutoff or make parity require complete symmetric coverage before advancing.

AGENTS.md reference: AGENTS.md:L70-L74

ℹ️ 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
Comment thread deployment/aliyun/polymarket-raw-ops-shadow-gate.sh
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