Skip to content

feat(research): introduce typed Mission v3 contract - #328

Merged
proerror77 merged 1 commit into
mainfrom
codex/mission-v3-321
Jul 24, 2026
Merged

proerror77 merged 1 commit into
mainfrom
codex/mission-v3-321

Conversation

@proerror77

Copy link
Copy Markdown
Owner

Change contract

Add a versioned BTC x 300-second Mission v3 contract that parses and validates typed settlement, Up-execution, and Down-execution tasks, binds run mode, authority, authenticated cohort/snapshot/policy identities, and search budget into canonical Mission identity, and rejects mismatched admission or checkpoint identity before dispatch.

Out of scope

Cohort partition implementation (#322), authenticated snapshot materialization and raw-byte rehash (#320), evaluator calculations or MCTS adapters, collector/catalog changes, Job rendering, Paper, Shadow, Live, promotion, deployment, and profitability claims.

Dependency or merge order

Depends on #315, which is merged. No stacked PR dependency; merge independently before #322, #323, and #324 consume the Mission v3 seam.

Focused validation

  • cargo test -p ploy-research prediction_mission_v3::tests --lib (9 passed)
  • cargo test -p ploy-research --lib (297 passed)
  • cargo clippy -p ploy-research --lib --no-deps -- -D warnings
  • cargo fmt --package ploy-research -- --check
  • git diff --check origin/main...HEAD
  • Matt Standards review: 0 findings after fixes
  • Matt Spec review: 0 findings after fixes

Rollout and rollback impact

Research contract only. No runtime, collector, cloud, or trading mutation. The new contract source is included in the fail-closed research policy fingerprint, so the checked-in v2 examples are repinned to the exact current policy without v2-to-v3 reinterpretation. Rollback is the single focused commit and restores the prior policy pins.

Closes #321

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@proerror77, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 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: 7d347d64-6b43-4e08-93c4-c9ddb681b088

📥 Commits

Reviewing files that changed from the base of the PR and between 7533e5c and 914d8fc.

📒 Files selected for processing (7)
  • docs/architecture/PREDICTION_MARKETS.md
  • 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/lib.rs
  • rust_hft/prediction-markets/crates/ploy-research/src/prediction_loop.rs
  • rust_hft/prediction-markets/crates/ploy-research/src/prediction_mission_v3.rs
  • rust_hft/prediction-markets/tasks/todo.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/mission-v3-321

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.

@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: 914d8fc53c

ℹ️ 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 on lines +110 to +113
pub struct AuthenticatedPredictionMissionV3Inputs {
task: PredictionMissionTask,
authority_profile: PredictionAuthorityProfile,
capabilities: BTreeSet<PredictionMissionCapability>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Bind the authenticated handle to the run mode

When #320 constructs this handle from a minimal pipeline_smoke cohort, a caller can reuse it with the same authenticated digests but change the mission to research_trial and give it a nonzero search budget: the handle does not retain run_mode, and admission compares only the task, authority, capabilities, and input digests. Because research_trial has broader cohort and evaluator permissions than pipeline_smoke (docs/architecture/PREDICTION_MARKETS.md:122-127), a fresh admission with no checkpoint can incorrectly treat smoke-only evidence as trial-ready. Bind the authenticated handle to the run mode or exact Mission hash and verify it during admission.

Useful? React with 👍 / 👎.

@proerror77
proerror77 merged commit 3b61804 into main Jul 24, 2026
35 checks passed
@proerror77
proerror77 deleted the codex/mission-v3-321 branch July 24, 2026 08:44
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.

Introduce Mission v3 typed Polymarket task and authority identity

1 participant