Skip to content

fix(collector): accept operator-tuned PM upload timeouts - #693

Merged
proerror77 merged 3 commits into
mainfrom
codex/pm-gate-dev-timeout-exception
Aug 5, 2026
Merged

proerror77 merged 3 commits into
mainfrom
codex/pm-gate-dev-timeout-exception

Conversation

@proerror77

@proerror77 proerror77 commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Change contract

Allow the Polymarket shadow Gate to use operator-tuned positive upload timeouts during rapid development instead of hard-blocking every value except 300/300. Exact timeout values remain part of the OSS configuration hash and are revalidated throughout Gate/cutover.

Issue relationship

None

Out of scope

Production timeout changes; Binance USDM/Spot; PM market collector behavior; uploader logic; research/runtime execution paths.

Dependencies and merge order

None

Focused validation

  • Red: current Gate rejected the production 3600/1800 values with Gate still hard-blocks operator-tuned upload timeouts.
  • Green: extracted real load_oss_config_snapshot accepts 3600/1800 and produces a 64-hex config hash.
  • Counterexample: the same function rejects zero with upload timeouts must be positive whole seconds.
  • bash -n on both changed scripts.
  • ShellCheck 0.11.0 on both changed scripts.
  • git diff --check and managed-worktree preflight.
  • The full control-plane script reached an unrelated existing bootstrap snapshot negative fixture and exited 4 after snapshotted Rust bootstrap binary digest changed before rollback manifest; no files outside this two-file contract were changed. GitHub CI is the clean-runner authority.

Rollout and rollback

Rebuild the exact merged polymarket-raw-ops candidate, run canonical stage/Gate/cutover, and require unchanged source/binary/control hashes, stable PM reference health and writes, natural rotation/upload, and independent OSS data/manifest/_SUCCESS readback. Roll back by restoring the prior production binary/release identity through the existing cutover contract.

Scope exception

None

Summary by CodeRabbit

  • New Features

    • Timeout values for operations are now configurable with any positive whole-second duration, replacing the previous fixed 300-second requirement.
  • Bug Fixes

    • Added validation to reject invalid or non-positive timeout values with clear error messaging.

@coderabbitai

coderabbitai Bot commented Aug 4, 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

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: 73ead4e0-a95d-4bb8-9da2-61ff7e2094b4

📥 Commits

Reviewing files that changed from the base of the PR and between 66d4b6a and 1ee1dd3.

📒 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 Gate now accepts any positive whole-second values for ZSTD_TIMEOUT_SECONDS and OSS_COPY_TIMEOUT_SECONDS. The control-plane test verifies operator-tunable validation and its binding into OSS configuration evidence.

Changes

OSS timeout validation

Layer / File(s) Summary
Configurable timeout contract and test
deployment/aliyun/polymarket-raw-ops-shadow-gate.sh, deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
The Gate rejects nonpositive or invalid timeout values and accepts positive integers. The control-plane test verifies both regex checks and the OSS configuration evidence comment.

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

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the change to accept operator-tuned Polymarket upload timeouts.
Description check ✅ Passed The description covers the required sections and clearly states the behavior, scope, validation, rollout, and rollback details.
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.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/pm-gate-dev-timeout-exception

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.

@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

🧹 Nitpick comments (1)
deployment/aliyun/test-polymarket-raw-ops-control-plane.sh (1)

4842-4849: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Test the runtime contract, not only source text.

These assertions search for regex fragments and a comment. They do not execute load_oss_config_snapshot, verify acceptance of 3600/1800, reject zero values, or prove that changed timeout values alter the digest comparison. Add or reference behavioral cases for these conditions.

🤖 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/test-polymarket-raw-ops-control-plane.sh` around lines 4842
- 4849, Replace the source-text-only assertions near load_oss_config_snapshot
with behavioral tests that execute the function, accept positive timeout values
such as 3600 and 1800, reject zero values, and verify that changing either
timeout changes the OSS configuration digest comparison. Reuse the existing test
harness and setup symbols in test-polymarket-raw-ops-control-plane.sh rather
than relying on grep checks or comments.
🤖 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/polymarket-raw-ops-shadow-gate.sh`:
- Around line 739-742: Update the timeout validation near the existing
positive-whole-seconds check so zstd_timeout_seconds cannot exceed the accepted
worst-case compression/IO window; alternatively, remove the operator override
for --zstd-timeout and use the fixed bounded timeout directly when launching
zstd. Preserve the existing OSS timeout clamping and validation behavior.

---

Nitpick comments:
In `@deployment/aliyun/test-polymarket-raw-ops-control-plane.sh`:
- Around line 4842-4849: Replace the source-text-only assertions near
load_oss_config_snapshot with behavioral tests that execute the function, accept
positive timeout values such as 3600 and 1800, reject zero values, and verify
that changing either timeout changes the OSS configuration digest comparison.
Reuse the existing test harness and setup symbols in
test-polymarket-raw-ops-control-plane.sh rather than relying on grep checks or
comments.
🪄 Autofix

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: 2d08b2f1-67e3-459e-82d6-8ed1f47f3bfe

📥 Commits

Reviewing files that changed from the base of the PR and between 5500f3e and 415ea0e.

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

Comment thread deployment/aliyun/polymarket-raw-ops-shadow-gate.sh

@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: 415ea0e767

ℹ️ 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/test-polymarket-raw-ops-control-plane.sh Outdated
@proerror77
proerror77 force-pushed the codex/pm-gate-dev-timeout-exception branch from 2f4868b to 168d4dc Compare August 5, 2026 03:58
codex added 3 commits August 5, 2026 12:17
Root cause: the shadow Gate hard-coded 300/300 even though the production uploader uses longer bounded timeouts. Validate positive whole seconds and keep the exact values hash-bound instead.
Exercise the production 3600/1800 timeout values in the existing six-hour Gate runtime-budget contract and retire the obsolete exact-300 assertion.
Use the same operator-tuned upload timeout values in the admission-budget fixture as in the runtime-budget regression.
@proerror77
proerror77 force-pushed the codex/pm-gate-dev-timeout-exception branch from 168d4dc to 1ee1dd3 Compare August 5, 2026 04:17
@proerror77
proerror77 merged commit 470ad3a into main Aug 5, 2026
45 checks passed
@proerror77
proerror77 deleted the codex/pm-gate-dev-timeout-exception branch August 5, 2026 04:24
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.

2 participants