Skip to content

fix(research): scope evidence completeness to requested symbols - #269

Merged
proerror77 merged 3 commits into
mainfrom
codex/polymarket-requested-symbols-268
Jul 23, 2026
Merged

proerror77 merged 3 commits into
mainfrom
codex/polymarket-requested-symbols-268

Conversation

@proerror77

@proerror77 proerror77 commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Change contract

Allow the governed snapshot compiler to aggregate an independently verified Polymarket evidence set against the exact requested research symbol set, while preserving the existing default BTCUSDT plus SOLUSDT completeness contract and all fail-closed slot, identity, overlap, digest, token, trade, and settlement checks.

Out of scope

Collector changes; evidence mutation or SOL backfill; snapshot model semantics; evaluator/MCTS; deployment configuration; Paper or Live.

Dependency / merge order

Independent focused defect discovered by #232. Merge before retrying #232. Closes #268.

Focused validation

  • cargo test --locked -p ploy-market-data (54 passed)
  • cargo test --locked -p ploy-research --features db --bin monday-prediction-snapshot (7 passed)
  • policy pin test and exact policy ID readback
  • touched-file rustfmt and git diff --check
  • Matt spec and standards reviews: approved with no blockers
  • exact-main cloud counterexample remains the post-merge rollout proof

Rollout / rollback impact

Research-only verifier context. Revert restores the hard-coded two-symbol aggregate and the known BTC-only rejection; no stored evidence is changed.

Why no PRD

This is a small, already-reproduced mismatch between the snapshot CLI single-symbol invariant and evidence-set aggregation, so Matt TDD is the direct workflow.

Summary by CodeRabbit

  • New Features

    • Added support for aggregating prediction-market evidence for selected trading symbols.
    • Verification now enforces that each time slot contains exactly the requested symbols.
  • Bug Fixes

    • Updated research mission configurations to use the latest search policy snapshots.
    • Improved validation messages for incomplete or unexpected symbol data.

@coderabbitai

coderabbitai Bot commented Jul 23, 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: 51 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 Plus

Run ID: bd37bf98-1987-4e03-9a17-1507e1e411ea

📥 Commits

Reviewing files that changed from the base of the PR and between e653499 and b766234.

📒 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/set.rs
📝 Walkthrough

Walkthrough

The Polymarket evidence aggregator now accepts requested symbol sets, validates exact per-slot membership, and preserves default BTC/SOL behavior. The snapshot verifier passes requested symbols into aggregation, while BTC and SOL mission configurations receive new policy snapshot identifiers.

Changes

Polymarket symbol-scoped verification

Layer / File(s) Summary
Configurable aggregation and slot validation
rust_hft/prediction-markets/crates/ploy-market-data/src/polymarket_evidence/set.rs
Adds symbol-scoped aggregation, validates non-empty unique supported symbols, enforces exact required-symbol sets per five-minute slot, and updates coverage tests.
Snapshot verifier symbol propagation
rust_hft/prediction-markets/crates/ploy-research/src/bin/monday-prediction-snapshot.rs, rust_hft/prediction-markets/config/research_missions/*5m.example.json
Passes requested symbols into verified evidence aggregation and updates BTC and SOL research mission snapshot identifiers.

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

Possibly related issues

  • proerror77/monday#232 — Concerns the Polymarket verified BTC snapshot workflow and the hard-coded evidence aggregation behavior addressed here.

Possibly related PRs

  • proerror77/monday#136 — Introduced the Polymarket evidence aggregation logic extended here with configurable required symbols.
  • proerror77/monday#160 — Modified the same per-member slot validation flow now parameterized by required symbols.
  • proerror77/monday#209 — Modified the snapshot verifier flow where requested-symbol propagation is now added.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely reflects the main change: scoping evidence completeness to the requested symbols.
Description check ✅ Passed The description covers the required sections and provides the change contract, out-of-scope items, validation, and rollback details.
Linked Issues check ✅ Passed The scoped aggregation, CLI threading, validation preservation, and updated tests align with the #268 acceptance criteria.
Out of Scope Changes check ✅ Passed The config hash updates and code changes appear tied to the symbol-scoping fix and its validation, with no clear unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/polymarket-requested-symbols-268

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.

🧹 Nitpick comments (1)
rust_hft/prediction-markets/crates/ploy-market-data/src/polymarket_evidence/set.rs (1)

78-101: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add negative-path tests for requested-symbol validation.

The new public API has separate empty, duplicate, and unsupported-symbol rejection branches, but the added test covers only successful BTC-only aggregation. Add focused tests for each rejection and for SOL-only input to protect the new contract.

🤖 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
`@rust_hft/prediction-markets/crates/ploy-market-data/src/polymarket_evidence/set.rs`
around lines 78 - 101, Add focused tests for
aggregate_verified_polymarket_evidence_for_symbols covering empty
required_symbols, duplicate symbols, and unsupported symbols, asserting each
returns an error. Also add a SOL-only aggregation success test, alongside the
existing BTC-only case, to verify valid single-symbol requests.
🤖 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.

Nitpick comments:
In
`@rust_hft/prediction-markets/crates/ploy-market-data/src/polymarket_evidence/set.rs`:
- Around line 78-101: Add focused tests for
aggregate_verified_polymarket_evidence_for_symbols covering empty
required_symbols, duplicate symbols, and unsupported symbols, asserting each
returns an error. Also add a SOL-only aggregation success test, alongside the
existing BTC-only case, to verify valid single-symbol requests.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 70fe1309-3203-438f-be37-c96f88d10924

📥 Commits

Reviewing files that changed from the base of the PR and between a2018be and e653499.

📒 Files selected for processing (4)
  • 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/set.rs
  • rust_hft/prediction-markets/crates/ploy-research/src/bin/monday-prediction-snapshot.rs

@proerror77
proerror77 merged commit 7b0c35d into main Jul 23, 2026
28 checks passed
@proerror77
proerror77 deleted the codex/polymarket-requested-symbols-268 branch July 23, 2026 11:32
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.

research: scope verified Polymarket slot completeness to requested symbols

1 participant