Skip to content

feat(research): defer unresolved factor outcomes - #140

Merged
proerror77 merged 1 commit into
mainfrom
codex/prediction-deferred-factor-outcome
Jul 18, 2026
Merged

proerror77 merged 1 commit into
mainfrom
codex/prediction-deferred-factor-outcome

Conversation

@proerror77

@proerror77 proerror77 commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Change contract

Add a crate-private unlabeled factor builder so verified-artifact snapshot code can emit unresolved rows without changing the public labeled builder behavior.

Out of scope

  • Snapshot adapter wiring
  • CLI / cloud E2E
  • Any public API expansion beyond crate-private helper exposure

Dependency or merge order

  • Base: main
  • Merge before the verified snapshot adapter refresh that consumes this helper

Focused validation

  • Added a focused unit test proving the public sampled builder still drops unresolved events while the crate-private unlabeled path emits one row with settlement_up = NaN and no official resolution timestamp.
  • Preserved resolved false/true settlement mapping in the existing public path.
  • No local Cargo build/run; GitHub CI is the validation lane for this PR.

Rollout / rollback impact

Low. This is a research-only internal seam. Rollback is a straight revert of this PR if the downstream adapter does not need the unlabeled path.

Summary by CodeRabbit

  • New Features

    • Added support for generating factor observations before event outcomes are resolved.
    • Unresolved observations now retain their data and indicate an unavailable settlement result.
  • Bug Fixes

    • Preserved existing behavior for resolved, labeled observations while correctly handling missing outcomes.
  • Configuration

    • Updated search policy snapshots for Bitcoin and Solana five-minute research missions.

@coderabbitai

coderabbitai Bot commented Jul 18, 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: 42 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: e9f3dbcd-3aa7-404e-9a7a-0ed47ff99740

📥 Commits

Reviewing files that changed from the base of the PR and between 69aed95 and 4dd4ebd.

📒 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-research/src/factors.rs
📝 Walkthrough

Walkthrough

Mission configs pin new search policy snapshots. Factor observation construction now offers labeled and unlabeled modes, retaining unresolved observations with NaN settlement values and validating later resolved outcomes.

Changes

Factor Observation Updates

Layer / File(s) Summary
Mission policy snapshot updates
rust_hft/prediction-markets/config/research_missions/*.example.json
BTC and SOL five-minute mission examples use new search_policy_snapshot_id hashes.
Unresolved factor builder behavior
rust_hft/prediction-markets/crates/ploy-research/src/factors.rs
The shared factor builder optionally retains unresolved events, maps missing settlements to NaN, and tests labeled and unlabeled results before and after resolution.

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

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: deferring unresolved factor outcomes in research.
Description check ✅ Passed The description covers the contract, scope, dependency order, validation, and rollback; only the scope-exception section is omitted.
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
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/prediction-deferred-factor-outcome

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 force-pushed the codex/prediction-deferred-factor-outcome branch from 69aed95 to a7e1976 Compare July 18, 2026 19:54
@proerror77
proerror77 force-pushed the codex/prediction-deferred-factor-outcome branch from a7e1976 to 4dd4ebd Compare July 18, 2026 20:06
@proerror77
proerror77 merged commit d477cbb into main Jul 18, 2026
25 checks passed
@proerror77
proerror77 deleted the codex/prediction-deferred-factor-outcome branch July 19, 2026 04:27
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