Skip to content

feat(research): expose authenticated partition view - #383

Merged
proerror77 merged 2 commits into
mainfrom
codex/partition-view-382
Jul 26, 2026
Merged

feat(research): expose authenticated partition view#383
proerror77 merged 2 commits into
mainfrom
codex/partition-view-382

Conversation

@proerror77

@proerror77 proerror77 commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Change contract

Expose the validated partition boundary plus train/crossing-excluded/held-out membership only through authenticated ResearchSnapshot admission and cache readback. The view is derived from the verified #322 partition; callers cannot provide or recompute it. Atomically synchronize the BTC/SOL mission policy digest because research_snapshot.rs is a policy identity input.

Out of scope

MCTS/evaluator reward logic (#324), collector deployment or cutover (#326), runtime promotion, and result publication.

Dependency / merge order

Base: 5a4f1c5eadb39d472bea30eead236c985e5f85e0 (main). Depends on merged #365 catalog partition and #373/#381 sealed snapshot admission. Merge this PR before rebuilding #324.

Focused validation

  • cargo +1.91 test --locked -p ploy-research research_snapshot --lib (27 passed)
  • cargo +1.91 test --locked -p ploy-research --lib (329 passed)
  • cargo +1.91 test --locked -p ploy-research prediction_loop::tests::checked_in_btc_and_sol_templates_pin_current_brief_and_rust_policy --lib
  • rustfmt +1.91 --edition 2021 --check crates/ploy-research/src/research_snapshot.rs
  • git diff --check
  • Pre-commit review: Standards: pass; Spec: pass. Post-CI digest repair review: Standards: pass; Spec: pass.

Rollout / rollback impact

No production collector or execution change. Reverting this PR removes the read-only snapshot partition view and its synchronized template pin; authenticated snapshot admission remains fail-closed.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

AuthenticatedResearchSnapshot now carries an immutable partition view containing the verified time boundary and train, excluded, and held-out market IDs. The view is populated during authentication and preserved through fresh and cached snapshot admission.

Changes

Authenticated partition identity

Layer / File(s) Summary
Partition view contract
rust_hft/prediction-markets/crates/ploy-research/src/research_snapshot.rs
AuthenticatedPartitionView exposes partition identity getters, while AuthenticatedResearchSnapshot stores and returns the view.
Snapshot identity propagation
rust_hft/prediction-markets/crates/ploy-research/src/research_snapshot.rs
Ready cohort authentication and admitted snapshot construction propagate the authenticated partition view.
Partition view validation
rust_hft/prediction-markets/crates/ploy-research/src/research_snapshot.rs, rust_hft/prediction-markets/tasks/todo.md
Fixtures and tests verify fresh and cached snapshot access, and the migration tracker records completion.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant EventCohortPartition
  participant authenticate_ready_event_cohort
  participant AuthenticatedReadyEventCohort
  participant AuthenticatedResearchSnapshot
  EventCohortPartition->>authenticate_ready_event_cohort: partition identity
  authenticate_ready_event_cohort->>AuthenticatedReadyEventCohort: AuthenticatedPartitionView
  AuthenticatedReadyEventCohort->>AuthenticatedResearchSnapshot: partition_view
  AuthenticatedResearchSnapshot-->>AuthenticatedResearchSnapshot: expose fresh or cached view
Loading

Possibly related issues

Possibly related PRs

  • proerror77/monday#362: Introduces the partition fields copied into the new authenticated partition view.
  • proerror77/monday#363: Establishes the authenticated snapshot materialization path extended by this change.
  • proerror77/monday#381: Also threads partition or policy identity through authenticated snapshot admission and materialization.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title is concise and accurately summarizes the main change: exposing an authenticated partition view.
Description check ✅ Passed The description covers the required sections and validation; the optional Scope exception section should explicitly say None.
✨ 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/partition-view-382

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.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
rust_hft/prediction-markets/crates/ploy-research/src/research_snapshot.rs (1)

3824-3829: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Exercise the real authentication path and all membership buckets.

The test manually seeds partition_view, so it cannot catch regressions in AuthenticatedPartitionView::from_partition or authenticate_ready_event_cohort (Line 529). Empty crossing-excluded and held-out lists also leave those propagation paths untested. Add a focused test using a verified partition with distinct IDs in all three sets.

As per coding guidelines, safety boundaries require targeted counterexample tests, not only workspace compilation.

Also applies to: 5000-5021

🤖 Prompt for 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.

In `@rust_hft/prediction-markets/crates/ploy-research/src/research_snapshot.rs`
around lines 3824 - 3829, Update the test around AuthenticatedPartitionView to
construct a verified partition and obtain the view through
AuthenticatedPartitionView::from_partition and authenticate_ready_event_cohort,
rather than manually seeding partition_view. Populate distinct market IDs in
train_market_ids, crossing_excluded_market_ids, and held_out_market_ids, then
assert all three buckets propagate correctly through the authenticated path.

Source: Coding guidelines

🤖 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.

Nitpick comments:
In `@rust_hft/prediction-markets/crates/ploy-research/src/research_snapshot.rs`:
- Around line 3824-3829: Update the test around AuthenticatedPartitionView to
construct a verified partition and obtain the view through
AuthenticatedPartitionView::from_partition and authenticate_ready_event_cohort,
rather than manually seeding partition_view. Populate distinct market IDs in
train_market_ids, crossing_excluded_market_ids, and held_out_market_ids, then
assert all three buckets propagate correctly through the authenticated path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0c85476f-e835-4246-8dea-2e85e5656208

📥 Commits

Reviewing files that changed from the base of the PR and between 5a4f1c5 and 8a9920e.

📒 Files selected for processing (2)
  • rust_hft/prediction-markets/crates/ploy-research/src/research_snapshot.rs
  • rust_hft/prediction-markets/tasks/todo.md

@proerror77
proerror77 merged commit d80b2bf into main Jul 26, 2026
38 checks passed
@proerror77
proerror77 deleted the codex/partition-view-382 branch July 26, 2026 14:49
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