Skip to content

Validate ordered Polymarket reference segment sets - #154

Merged
proerror77 merged 8 commits into
mainfrom
codex/polymarket-reference-segment-set
Jul 19, 2026
Merged

Validate ordered Polymarket reference segment sets#154
proerror77 merged 8 commits into
mainfrom
codex/polymarket-reference-segment-set

Conversation

@proerror77

@proerror77 proerror77 commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Change contract:

  • Validate a bounded, ordered, immutable set of consecutive Polymarket reference-hour triplets as one fail-closed research input; bind each segment to its UTC partition, event-type counts, and canonical trade-ID version before combining it.

Out of scope:

Dependency or merge order:

Focused validation:

  • cargo test --manifest-path rust_hft/Cargo.toml -p hft-collector --lib -> 172 passed, 2 ignored.
  • cargo test --manifest-path rust_hft/prediction-markets/Cargo.toml -p ploy-market-data -> 32 passed.
  • cargo test --manifest-path rust_hft/prediction-markets/Cargo.toml -p ploy-research checked_in_btc_and_sol_templates_pin_current_brief_and_rust_policy -> passed.
  • cargo clippy --manifest-path rust_hft/Cargo.toml -p hft-collector --all-targets -- -D warnings -> passed.
  • cargo clippy --manifest-path rust_hft/prediction-markets/Cargo.toml -p ploy-market-data --all-targets --no-deps -- -D warnings -> passed.
  • git diff --check -> passed.
  • Two fixed-head reviewers at base 1870d888 and head 9270aef8 -> no findings.
  • Scope: 7 files, 656 changed lines; below the 25-file/750-line split threshold.

Rollout/rollback impact:

Summary by CodeRabbit

  • New Features

    • Research validation now supports multiple reference data segments.
    • Added validation for consecutive UTC hours, event types, archive sizes, and duplicate trade records.
    • Evidence output combines validated reference data while removing duplicate records.
    • Command-line workflows now accept multiple reference files.
  • Bug Fixes

    • Improved validation of segment identities, timestamps, manifests, and recording policies.
  • Chores

    • Updated research mission configuration snapshots and supporting test fixtures.

@coderabbitai

coderabbitai Bot commented Jul 19, 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: 49 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

Run ID: 53491b23-f8ae-4cc4-a51c-3c8268453c90

📥 Commits

Reviewing files that changed from the base of the PR and between c3e1239 and d288de2.

📒 Files selected for processing (3)
  • rust_hft/prediction-markets/config/research_missions/polymarket-btc-5m.example.json
  • rust_hft/prediction-markets/config/research_missions/polymarket-sol-5m.example.json
  • rust_hft/prediction-markets/crates/ploy-market-data/src/polymarket_evidence/artifact.rs
📝 Walkthrough

Walkthrough

The PR adds V2 validated-input support for multiple Polymarket reference segments, including bounded staging, consecutive-hour and event-type checks, deduplicated output combination, updated CLI wiring, fixtures, tests, and mission snapshot identifiers.

Changes

Polymarket multi-reference validation

Layer / File(s) Summary
Validated-input contract and evidence checks
rust_hft/prediction-markets/crates/ploy-market-data/src/polymarket_evidence/artifact.rs
Adds V2 inputs with plural references, event-type identities, reference limits, timestamp validation, and expanded sealing tests.
Reference-set staging and validation
rust_hft/tools/collector/src/polymarket_research_import.rs
Validates bounded multi-reference inputs, consecutive UTC hours, manifest identities, event types, resource limits, and deduplicated combined outputs.
CLI reference triplet wiring
rust_hft/tools/collector/src/bin/polymarket-raw-ops.rs
Accepts aligned reference path vectors, constructs ordered triplets, and passes them to validation and publication commands.
Integration fixtures and mission snapshots
rust_hft/tools/collector/src/polymarket_evidence_artifact.rs, rust_hft/tools/collector/src/polymarket_research_select.rs, rust_hft/prediction-markets/config/research_missions/*.example.json
Updates fixtures to the V2 plural-reference shape and replaces BTC and SOL policy snapshot identifiers.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant polymarket_raw_ops
  participant with_validated_research_segments
  participant combine_references
  Operator->>polymarket_raw_ops: provide reference path lists
  polymarket_raw_ops->>with_validated_research_segments: submit ordered ArtifactTriplet values
  with_validated_research_segments->>combine_references: rescan and combine reference outputs
  combine_references-->>with_validated_research_segments: produce deduplicated references.ndjson
  with_validated_research_segments-->>Operator: return V2 validation report
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 38.46% 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 clearly matches the main change: ordered Polymarket reference segment validation.
Description check ✅ Passed The description covers the required contract, out-of-scope, merge order, validation, and rollout details, with only minor heading naming differences.
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
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/polymarket-reference-segment-set

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 base branch from codex/polymarket-trade-completion-marker to main July 19, 2026 15:15
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