fix(polymarket): allow Rust-only Gate parity - #497
Conversation
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe parity verifier adds Rust-self mode for empty legacy windows, exposes it through the CLI and shadow gate, reports comparison mode in evidence, and updates jq policy and control-plane tests for mode-specific validation. ChangesShadow parity comparison
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant ShadowGate
participant RawOpsCLI
participant ParityCompare
participant GatePolicy
ShadowGate->>RawOpsCLI: invoke verify-shadow-parity with parity_args
RawOpsCLI->>ParityCompare: pass allow_empty_legacy
ParityCompare->>ParityCompare: select comparison_mode and evaluate parity
ParityCompare->>GatePolicy: provide comparison evidence
GatePolicy->>ShadowGate: accept or reject evidence
Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d80bb725a
ℹ️ 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".
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
deployment/aliyun/polymarket-shadow-gate-policy.jq (1)
262-291: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winBind
rust_selfto the non-blocking legacy baseline.The policy permits
rust_selffor a runtime-stablelegacy_pythonorrust_releasebaseline if legacy counts are forged to zero. Requirebaseline_mode == "legacy_python"andbaseline_runtime_stability_required == falsein therust_selfbranch.
deployment/aliyun/polymarket-shadow-gate-policy.jq#L262-L291: constrain therust_selfmetrics branch to the non-blocking legacy baseline.deployment/aliyun/test-polymarket-raw-ops-control-plane.sh#L2578-L2598: add a forged runtime-stable legacy-overlap fixture mutated torust_selfwith zero legacy counts and assert policy rejection.As per coding guidelines, “Safety boundaries require a targeted counterexample test, not only workspace compilation.”
🤖 Prompt for 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. In `@deployment/aliyun/polymarket-shadow-gate-policy.jq` around lines 262 - 291, Constrain the rust_self branch in the policy around the comparison-mode validation to require baseline_mode == "legacy_python" and baseline_runtime_stability_required == false. Add the targeted forged runtime-stable legacy-overlap fixture in deployment/aliyun/test-polymarket-raw-ops-control-plane.sh around lines 2578-2598, mutate it to rust_self with zero legacy counts, and assert policy rejection.Source: Coding guidelines
🤖 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.
Outside diff comments:
In `@deployment/aliyun/polymarket-shadow-gate-policy.jq`:
- Around line 262-291: Constrain the rust_self branch in the policy around the
comparison-mode validation to require baseline_mode == "legacy_python" and
baseline_runtime_stability_required == false. Add the targeted forged
runtime-stable legacy-overlap fixture in
deployment/aliyun/test-polymarket-raw-ops-control-plane.sh around lines
2578-2598, mutate it to rust_self with zero legacy counts, and assert policy
rejection.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 07e897cc-47eb-415e-9343-b0d1683c7c4e
📒 Files selected for processing (5)
deployment/aliyun/polymarket-raw-ops-shadow-gate.shdeployment/aliyun/polymarket-shadow-gate-policy.jqdeployment/aliyun/test-polymarket-raw-ops-control-plane.shrust_hft/tools/collector/src/bin/polymarket-raw-ops.rsrust_hft/tools/collector/src/polymarket_parity.rs
Change contract
When the approved 15-minute Polymarket Gate has no projected legacy rows, explicitly switch final parity to
rust_selfand require positive, valid Rust trades, metadata, settlements, assets, rotation, health, real-segment, OSS, and immutable evidence. Any non-empty legacy projection continues to use strict overlap parity.Out of scope
Python collector/uploader behavior, research logic, snapshots, issue #235, production cutover, and Gate duration.
Dependency / merge order
None. Based on exact main
fe820c543f4304e3771bdf57456b470aecf35846after the prior Gate unit fix.Focused validation
cargo test -p hft-collector polymarket_parity --locked(27 passed)deployment/aliyun/test-polymarket-raw-ops-control-plane.shbash -nand ShellCheck on changed shell scriptsgit diff --checkRollout / rollback impact
This changes only final Gate admission evidence. It does not mutate production. Rollback is reverting this PR; production Python remains the rollback path until a new exact artifact passes real-segment preflight and a fresh 900+601-second Gate. Runtime issue #490 remains open until exact artifact, live Gate, cutover, and cleanup evidence are complete.
Issue relationship
Refs #490