fix(prediction): separate AutoFactor discovery by token side - #147
Conversation
📝 WalkthroughWalkthroughThe change adds review-side identity to alpha-factor mining, persisted search artifacts, MCTS state, and evaluator workflows. Side-bound outputs use separate versions and directories with identity validation. Polymarket mission templates also receive updated policy snapshot identifiers. ChangesSide-bound alpha search
Mission policy snapshot updates
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Plan as AlphaSearchPlan
participant Evaluator as monday-prediction-evaluator
participant State as MCTSStateAndAlphaZoo
participant Mining as AutoFactorMining
participant Writer as SideBoundArtifactWriter
Plan->>Evaluator: Provide target, version, side, and factor names
Evaluator->>State: Validate target/version/side identity
Evaluator->>Mining: Select matching side lane and rows
Mining-->>Evaluator: Return side-labeled reports and feedback
Evaluator->>Writer: Write side-bound artifacts
Writer-->>Evaluator: Return side-specific artifact summary
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3804b17733
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In
`@rust_hft/prediction-markets/crates/ploy-research/src/bin/monday-prediction-evaluator.rs`:
- Around line 1148-1158: The Alpha Zoo snapshot loader in the alpha_zoo mapping
must stop sending side-less alpha_zoo_snapshot_v1 artifacts through
validate_repricing_input_identity for repricing lanes. Keep such snapshots out
of repricing inputs, or update the Alpha Zoo writer and loader to emit and
accept a side-bound artifact schema with the required version and side before
validation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0b739db5-106d-43a2-bb06-6a4d7e283c52
📒 Files selected for processing (7)
rust_hft/prediction-markets/config/research_missions/polymarket-btc-5m.example.jsonrust_hft/prediction-markets/config/research_missions/polymarket-sol-5m.example.jsonrust_hft/prediction-markets/crates/ploy-research/examples/persist_research_trace.rsrust_hft/prediction-markets/crates/ploy-research/src/alpha_search.rsrust_hft/prediction-markets/crates/ploy-research/src/autofactor.rsrust_hft/prediction-markets/crates/ploy-research/src/bin/monday-prediction-evaluator.rsrust_hft/prediction-markets/crates/ploy-research/src/lib.rs
Change contract
Make full-depth 10s/30s repricing AutoFactor discovery consume a mandatory typed
ReviewSide, filter rows before matrix/rolling evaluation, and provide a fail-closed side-bound artifact writer that persists undertarget/<side>/; the legacy pooled writer rejects repricing or side-tagged inputs.Out of scope
CLI persistence/resume for side-bound artifacts, Alpha Zoo side-aware production and registry migration, candidate-replay identity parsing, Research OS runtime de-duplication, settlement evaluator semantics and legacy settlement-plan fanout, full-tick collection, 15m/1h missions, ECS/runtime rollout, and episode-aware rolling boundaries.
Dependency or merge order
Base:
mainat2175a2352a804925b9fbb6e10967e0647b42d7effrom PR #146. No stacked dependency. The later side-bound producer/resume PR depends on this API after merge.Focused validation
git diff --checkrustfmt --edition 2021 --checkon all five modified Rust filesjq emptyon both mission JSONssha256:5d15126651a93b08bfb60922b7a7957ff3bdae4ae31220c43008c41e70b65184Rollout/rollback impact
Research-only foundation. The evaluator now mines and reports Up/Down repricing lanes independently but deliberately does not persist repricing artifacts until the dependent producer/resume contract is implemented; existing settlement v1 persistence remains unchanged. Revert this PR to restore pooled repricing discovery.