Skip to content

fix(prediction): bind execution reviews to token side - #146

Merged
proerror77 merged 1 commit into
mainfrom
codex/polymarket-side-bound-execution-evaluators
Jul 19, 2026
Merged

fix(prediction): bind execution reviews to token side#146
proerror77 merged 1 commit into
mainfrom
codex/polymarket-side-bound-execution-evaluators

Conversation

@proerror77

@proerror77 proerror77 commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Change contract

Every RepricingIcReport and FillabilityReviewReport metric row is computed from exactly one ReviewSide sample set, with per-side denominators and per-side top_n, so pooled Up/Down evidence cannot hide opposite token behavior.

Out of scope

  • FullDepthExecutionMatrixReport and slippage math, which are already side-keyed
  • liquidity gates, AutoFactor/AlphaSearch, settlement verdicts, or governed keep/discard feedback
  • 15m/1h or ETH missions, full-update ticks, collector/ECS/runtime/deployment changes
  • pooled DataHealthReport, which remains ingest metadata rather than an evaluator metric

Dependency or merge order

None. This is based directly on main e2d741a; PR #145 is already merged.

Focused validation

  • Counterexample: Up IC is positive while Down IC is negative; both survive as separate rows instead of cancelling.
  • Counterexample: Up is fillable while Down is unfillable; decisions and coverage use each side's own denominator.
  • Counterexample: top_n=1 still emits real Up and Down data rows.
  • rustfmt --edition 2021 --check passed for factors_v2.rs.
  • Both mission JSON files pass jq; git diff --check passed.
  • Two independent code/test reviews reported no findings.
  • The 36-source policy identity and 12 checked-in dependency inputs were independently recomputed. Both mission templates are pinned to sha256:12579dd6aaf0e34e26faa25f72ffe30afc88bbb08cb494321560f9ec4b28b494.
  • Cargo compilation and tests are intentionally delegated to GitHub cloud CI.

Rollout or rollback impact

The repricing and fillability text/CSV report schemas add a side column and side-specific sections. Repository-local consumers have no stale struct constructors; external report parsers must accept the new schema. No live trading or deployment authority changes. Rollback is a revert of this PR, including the two mechanical mission policy-hash pins.

Summary by CodeRabbit

  • New Features

    • Repricing analysis now reports results separately for upward and downward market sides.
    • Fillability reports now provide side-specific statistics and clearly labeled sections.
    • CSV exports include the market side for easier filtering and comparison.
  • Configuration

    • Updated search policy snapshots for Bitcoin and Solana five-minute market research configurations.
  • Tests

    • Added and updated coverage for side-specific repricing and fillability reporting.

@coderabbitai

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

Run ID: 4ee8daef-5c5f-4094-a6f6-c1a2db45d565

📥 Commits

Reviewing files that changed from the base of the PR and between e2d741a and 956ff2a.

📒 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_v2.rs

📝 Walkthrough

Walkthrough

Repricing IC and fillability reports now calculate and render results separately for up and down sides. Their public rows include ReviewSide, with tests covering side-specific output. BTC and SOL mission templates reference updated search policy snapshots.

Changes

Side-aware research reporting

Layer / File(s) Summary
Side-aware repricing IC
rust_hft/prediction-markets/crates/ploy-research/src/factors_v2.rs
Repricing IC rows and scoring are generated per side and target, formatted into side-specific sections, and covered by updated tests.
Side-aware fillability reporting
rust_hft/prediction-markets/crates/ploy-research/src/factors_v2.rs
Fillability rows carry side at the top level, use side-specific denominators, remove side as a bucket dimension, and emit separate CSV sections with side-aware tests.

Mission snapshot updates

Layer / File(s) Summary
Update mission snapshot identifiers
rust_hft/prediction-markets/config/research_missions/polymarket-*-5m.example.json
BTC and SOL example missions reference new search_policy_snapshot_id SHA-256 values.

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

Possibly related PRs

  • proerror77/monday#76: Updates the same Polymarket mission template snapshot identifiers.
  • proerror77/monday#145: Updates the same mission template snapshot fields while changing a different research pipeline.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: making review metrics side-aware.
Description check ✅ Passed The description covers the required sections and is detailed enough, with only minor heading/section-template differences.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/polymarket-side-bound-execution-evaluators

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 2175a23 into main Jul 19, 2026
26 checks passed
@proerror77
proerror77 deleted the codex/polymarket-side-bound-execution-evaluators branch July 19, 2026 05:34
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