Skip to content

fix(research): fail closed snapshot admission - #378

Merged
proerror77 merged 2 commits into
mainfrom
codex/snapshot-admission-followups-374
Jul 26, 2026
Merged

proerror77 merged 2 commits into
mainfrom
codex/snapshot-admission-followups-374

Conversation

@proerror77

@proerror77 proerror77 commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Change contract: close the outstanding #374 admission follow-up P1/P2 boundaries by admitting only baseline pipeline-smoke Mission V3 requests against baseline-authority snapshots, and by reaping a spawned sibling when its admission deadline is exhausted.

Acceptance evidence:

  • cargo test --features db --bin monday-prediction-snapshot -- --nocapture (13 passed)
  • cargo test --lib -- --nocapture (327 passed)
  • cargo test --bin alpha-harness -- --nocapture (111 passed)
  • cargo fmt --check in both affected workspaces and git diff --check
  • Two-axis code review: standards pass; spec complete for the P1/P2 feedback.

Out of scope: Mission V3 research-trial execution adapters and shared MCTS kernel (#324); V3 research admission remains fail-closed until that separate contract exists.

Dependency / merge order: follow-up to merged #374; merge before promoting #324. The two mission templates update atomically because the new authenticated snapshot source binding changes the policy fingerprint.

Rollout / rollback: no collector or live execution changes. Roll back this PR to restore the previous admission surface; this PR only narrows admission and updates the corresponding immutable policy identity.

Summary by CodeRabbit

  • Bug Fixes

    • Improved admission timeout handling to reliably terminate and clean up pending snapshot processes.
    • Tightened snapshot validation to accept only supported sources, run modes, and authority configurations.
    • Preserved snapshot source information through authentication and cache reuse.
  • Configuration

    • Updated the search policy references for Polymarket BTC and SOL five-minute research missions.

@coderabbitai

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

Run ID: b5ff32b2-a609-4475-8dbc-35a55e0e0da3

📥 Commits

Reviewing files that changed from the base of the PR and between 4c8b2c9 and e2e6f63.

📒 Files selected for processing (5)
  • rust_hft/alpha-harness/app/src/prediction_dispatch.rs
  • 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/bin/monday-prediction-snapshot.rs
  • rust_hft/prediction-markets/crates/ploy-research/src/research_snapshot.rs

📝 Walkthrough

Walkthrough

The PR adds sibling-process cleanup when admission deadlines are exhausted, threads snapshot source identity through authenticated snapshot handling, and restricts mission admission to the Polymarket Chainlink baseline authority and pipeline smoke mode. Two research mission policy snapshot hashes are updated.

Changes

Admission deadline cleanup

Layer / File(s) Summary
Deadline exhaustion reaping
rust_hft/alpha-harness/app/src/prediction_dispatch.rs
Admission timeout calculations now terminate and reap the sibling process when the deadline is exhausted, with Unix test coverage.

Snapshot authority admission

Layer / File(s) Summary
Snapshot source identity pipeline
rust_hft/prediction-markets/crates/ploy-research/src/research_snapshot.rs, rust_hft/prediction-markets/config/research_missions/*
Authenticated snapshots retain source_kind, baseline manifests use one data requirement, cache tests verify the source, and mission policy snapshot IDs are updated.
Authority-gated mission admission
rust_hft/prediction-markets/crates/ploy-research/src/bin/monday-prediction-snapshot.rs
Admission now requires the Polymarket Chainlink baseline authority, exact capabilities, and PipelineSmoke mode, with rejection and unit-test coverage.

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

Possibly related issues

Possibly related PRs

  • proerror77/monday#374 — Overlaps the admission deadline and remaining-time handling in prediction_dispatch.rs.
  • proerror77/monday#228 — Introduces the Polymarket Chainlink baseline snapshot mode used by the new authority gates.
  • proerror77/monday#363 — Provides the authenticated snapshot pipeline extended with source_kind.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: failing closed on snapshot admission.
Description check ✅ Passed The description covers the required contract, out-of-scope work, merge order, validation, and rollback.
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/snapshot-admission-followups-374

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: aeb354d0a8

ℹ️ 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".

@proerror77
proerror77 merged commit 8fbb277 into main Jul 26, 2026
38 checks passed
@proerror77
proerror77 deleted the codex/snapshot-admission-followups-374 branch July 26, 2026 11:29
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