Skip to content

fix(research): preserve real BTC mission rejection evidence - #91

Merged
proerror77 merged 2 commits into
mainfrom
codex/crypto-real-e2e-pr
Jul 17, 2026
Merged

proerror77 merged 2 commits into
mainfrom
codex/crypto-real-e2e-pr

Conversation

@proerror77

@proerror77 proerror77 commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Change contract

Make the pinned BTCUSDT top-of-book MCTS mission executable against byte-bound real LOB inputs and record the immutable fail-closed rejection produced by that exact run.

Acceptance evidence

  • The materializer emits the live-compatible book_imbalance field while retaining the governed top-depth feature.
  • Materialization evidence binds the raw segment, collector manifest, and _SUCCESS bytes by SHA-256.
  • The blessed Job fixes the one-candidate top-of-book MCTS baseline and retains main's explicit slippage, spread-crossing, notional, and depth-capacity controls.
  • The report identifies source revision 6e3607ec, the real OSS inputs and result bundle, the rejected walk-forward metrics, unopened sealed holdout, and absent Paper/Shadow/Live handoff.

Out of scope

  • Expanding the candidate search or relaxing statistical gates.
  • Paper, Shadow, or Live activation.
  • ACK image/worker deployment evidence.
  • Polymarket, collector CPU tuning, or unrelated research runners.

Dependency or merge order

None. This is based on main after #84 and #88 and preserves both changes.

Focused validation

  • cargo fmt --manifest-path rust_hft/Cargo.toml -p hft-collector -- --check
  • cargo test --manifest-path rust_hft/Cargo.toml -p hft-collector --bin lob-pit-materializer — 10 passed.
  • cargo test --manifest-path rust_hft/Cargo.toml -p alpha-harness parses_explicit_taker_execution_costs — 1 passed.
  • cargo clippy --manifest-path rust_hft/Cargo.toml -p hft-collector --bin lob-pit-materializer -- -D warnings
  • YAML parse and git diff --check passed.
  • Matt two-axis review: Standards 0 findings; Spec 0 P0-P2 findings.

Rollout/rollback impact

Research-only. Merge updates the materializer evidence schema and the example mission baseline; it does not deploy a runtime, use exchange credentials, or open execution. Revert this PR to restore the previous materializer/template/report together.

Summary by CodeRabbit

  • New Features

    • Added clearer top-of-book imbalance metrics for BTCUSDT research runs.
    • Research artifacts now include additional source verification details, including manifest and completion-marker checksums.
  • Documentation

    • Updated deployment guidance to describe the standard BTCUSDT MCTS baseline and parallel-run requirements.
    • Added a complete real-data end-to-end research report, including validation results, reproducibility information, and acceptance status.
  • Configuration

    • Updated the research job template with fixed MCTS settings and revised top-of-book, five-second-horizon parameters.

@coderabbitai

coderabbitai Bot commented Jul 17, 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: 09f3f579-25b2-4bb7-9e27-c3fd3011265c

📥 Commits

Reviewing files that changed from the base of the PR and between 04d548c and d2c0360.

📒 Files selected for processing (4)
  • deployment/aliyun/research/README.md
  • deployment/aliyun/research/k8s/alpha-mission-job.example.yaml
  • docs/reports/crypto-btcusdt-real-e2e-2026-07-17.md
  • rust_hft/tools/collector/src/bin/lob-pit-materializer.rs

📝 Walkthrough

Walkthrough

The PR separates book imbalance features, enriches PIT provenance evidence, pins the alpha mission to a BTCUSDT MCTS configuration, and adds a report for a reproducible real-data E2E run that failed acceptance after walk-forward evaluation.

Changes

BTCUSDT research flow

Layer / File(s) Summary
Materializer provenance and feature publication
rust_hft/tools/collector/src/bin/lob-pit-materializer.rs
Verified segments retain manifest and _SUCCESS paths and hashes; materialized rows publish book_imbalance and top-depth imbalance fields, with deterministic fixtures and assertions for the emitted values and sidecar digests.
Pinned MCTS deployment baseline
deployment/aliyun/research/k8s/alpha-mission-job.example.yaml, deployment/aliyun/research/README.md
The job uses MCTS, $(SEED), and book_imbalance; the README identifies it as the current BTCUSDT top-of-book baseline.
Real-data E2E run record
docs/reports/crypto-btcusdt-real-e2e-2026-07-17.md
The report documents source and snapshot evidence, validation results, rejection artifacts, reproduction commands, and the next-gate decision.

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

Sequence Diagram(s)

sequenceDiagram
  participant Materializer
  participant PITRows
  participant Mission
  participant E2EReport
  Materializer->>PITRows: publish provenance and imbalance features
  PITRows->>Mission: provide point-in-time feature data
  Mission->>E2EReport: record walk-forward results and evidence
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and matches the PR’s main change: preserving BTC mission rejection evidence.
Description check ✅ Passed The description covers the required contract, out-of-scope, dependency, validation, and rollback sections; only the scope-exception heading is omitted.
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/crypto-real-e2e-pr

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

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


| Evidence | Value |
| --- | --- |
| Repository source revision | `6e3607ec11ed5470eb265480c06b0964f0653b21` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use a source revision that exists in the repository

This report is meant to be immutable run evidence, but the recorded source revision is not present in this repository (git cat-file -t 6e3607ec11ed5470eb265480c06b0964f0653b21 returns a bad object in this checkout). Anyone trying to audit or reproduce the run cannot check out the code that supposedly produced the evidence, so the run should be tied to a reachable commit or the report should clearly state where that revision is available.

Useful? React with 👍 / 👎.

Comment on lines +219 to +220
--materialization-url pit/541c1db8d839477a4ae530d96374f4ffe7a05a66c6bafbb619e8613ea38de760.materialization.json \
--materialization-sha256 541c1db8d839477a4ae530d96374f4ffe7a05a66c6bafbb619e8613ea38de760 \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not hard-code the nondeterministic materialization hash

Following the materialization command immediately above will not recreate this fixed 541c... report path/SHA, because the materializer hashes a report that includes its current created_at timestamp. In a fresh reproduction this file will be absent or the --materialization-sha256 check will fail unless the reader already has the original report, so the instructions should use the newly emitted report path/SHA or explain that the published materialization object must be downloaded instead.

Useful? React with 👍 / 👎.

@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: d2c0360081

ℹ️ 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 +83 to +86
collector_manifest_path: PathBuf,
collector_manifest_sha256: String,
success_marker_path: PathBuf,
success_marker_sha256: String,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require sidecar hashes in mission validation

When a mission is supplied a binance-lob-pit-v1 materialization manifest that was produced before these fields existed, alpha-harness still deserializes each SourceSegment with only sha256 and validate_materialization only normalizes that one field, so ACK/local mission execution can accept evidence that lacks the collector manifest and _SUCCESS bindings this change is meant to make mandatory. Please either bump/version the materialization schema or update the mission-side validator to require these sidecar hashes before the run can claim raw manifest/_SUCCESS binding.

Useful? React with 👍 / 👎.

Comment on lines +219 to +220
--materialization-url pit/541c1db8d839477a4ae530d96374f4ffe7a05a66c6bafbb619e8613ea38de760.materialization.json \
--materialization-sha256 541c1db8d839477a4ae530d96374f4ffe7a05a66c6bafbb619e8613ea38de760 \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fix non-reproducible materialization SHA in docs

In this reproduction flow, the materialization command immediately above will not create pit/541c...materialization.json on a fresh run: lob-pit-materializer includes created_at = Utc::now() in the report before hashing it, and alpha-harness rejects any --materialization-sha256 mismatch. Unless the original published materialization JSON is also downloaded, following these commands against the listed raw segments fails before evaluation instead of reproducing the recorded mission.

Useful? React with 👍 / 👎.

@proerror77
proerror77 merged commit 2ec044c into main Jul 17, 2026
35 checks passed
@proerror77
proerror77 deleted the codex/crypto-real-e2e-pr branch July 17, 2026 10:27
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