Skip to content

fix(polymarket): report historical overdue settlements - #415

Merged
proerror77 merged 1 commit into
mainfrom
codex/polymarket-overdue-scope-326
Jul 27, 2026
Merged

proerror77 merged 1 commit into
mainfrom
codex/polymarket-overdue-scope-326

Conversation

@proerror77

@proerror77 proerror77 commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Change contract

Keep overdue_unresolved_markets as explicit historical incompleteness evidence without failing or restarting an otherwise healthy collection cycle.

Out of scope

Snapshot construction, research logic, #235, PID/immutable evidence checks, legacy health cadence, and immutable release replacement.

Dependency or merge order

None. Built from exact base 399b330c78e080cfe1323a704a17f3987cfda8d8.

Focused validation

  • Red proof: collector returned overdue unresolved settlements: ["market-1"]; control-plane policy test exited non-zero for the same otherwise healthy fixture.
  • Green: cargo test -p hft-collector — 223 passed, 2 ignored; all binary test targets passed.
  • Green: bash deployment/aliyun/test-polymarket-raw-ops-control-plane.sh.
  • Green: cargo clippy -p hft-collector --all-targets -- -D warnings.
  • git diff --check passed.
  • Two-axis code review: Standards 0 findings; Spec 0 findings.
  • PRD unnecessary: this is a small, already-specified behavior correction tracked by Treat historical Polymarket overdue settlements as explicit incomplete evidence #414 and implemented directly through TDD.
  • Workspace-wide cargo fmt --all -- --check remains blocked by unrelated pre-existing formatting drift; no broad formatting changes were made.

Rollout / rollback impact

After merge, build a new exact-main artifact and run a fresh 3600+601 second Gate. Production remains Python until immutable Gate evidence and cutover verification pass. Rollback remains the unchanged Python baseline.

Closes #414

Summary by CodeRabbit

  • Bug Fixes

    • Historical overdue markets no longer prevent health checks from completing.
    • Health reports now include overdue unresolved market identifiers while continuing to report other health issues.
    • Updated validation accepts arrays containing non-empty market identifiers and rejects invalid entries.
  • Tests

    • Added coverage for historical overdue markets and invalid health-report formats.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 229925dd-9a83-4184-b44c-ed704dafba33

📥 Commits

Reviewing files that changed from the base of the PR and between 399b330 and a90b6b4.

📒 Files selected for processing (4)
  • deployment/aliyun/polymarket-legacy-health-policy.jq
  • deployment/aliyun/polymarket-rust-health-policy.jq
  • deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
  • rust_hft/tools/collector/src/polymarket_raw.rs

📝 Walkthrough

Walkthrough

Historical overdue markets are now reported as explicit health evidence without failing collection. Legacy and Rust health policies accept well-formed non-empty overdue-market arrays, while control-plane tests cover missing and malformed values.

Changes

Historical overdue evidence

Layer / File(s) Summary
Collector overdue reporting
rust_hft/tools/collector/src/polymarket_raw.rs
collect_once no longer fails solely because overdue unresolved markets exist, and a Tokio test verifies the reported market and empty API errors.
Health policy validation
deployment/aliyun/*health-policy.jq, deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
Legacy and Rust policies validate arrays of non-empty strings, with control-plane fixtures covering valid historical overdue data and invalid mutations.

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

Sequence Diagram(s)

sequenceDiagram
  participant TrackedMarket
  participant collect_once
  participant HealthPolicy
  TrackedMarket->>collect_once: provide overdue unresolved market
  collect_once->>HealthPolicy: emit health payload with market ID
  HealthPolicy->>HealthPolicy: validate non-empty string array
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: reporting historical overdue settlements without failing collection.
Description check ✅ Passed The description covers the contract, out-of-scope items, dependencies, validation, rollout, and rollback, with only minor template variation.
Linked Issues check ✅ Passed The collector and both health policies now allow non-empty overdue evidence and the added regressions cover the required positive and negative cases.
Out of Scope Changes check ✅ Passed Changes stay within collector-control behavior and test updates; no unrelated snapshot, research, or release-flow changes are evident.
✨ Finishing Touches
📝 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-overdue-scope-326

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 merged commit e36d53c into main Jul 27, 2026
38 checks passed
@proerror77
proerror77 deleted the codex/polymarket-overdue-scope-326 branch July 27, 2026 23:43
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.

Treat historical Polymarket overdue settlements as explicit incomplete evidence

1 participant