nanobook 0.16.2

Deterministic Rust execution engine for trading backtests: limit-order book, portfolio simulation, metrics, risk checks, and Python bindings
Documentation
name: OCaml Oracle Differential Testing

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  oracle:
    name: Test OCaml oracle against Rust implementation
    runs-on: ubuntu-latest
    
    steps:
      - name: Checkout code
        uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
      
      - name: Install OCaml
        uses: ocaml/setup-ocaml@e32b06a3e831ff2fbc6f08cf35be2085e3918014 # v3.6.1
        with:
          ocaml-compiler: 5.4
      
      - name: Cache opam
        uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
        with:
          path: ~/.opam
          key: ${{ runner.os }}-opam-${{ hashFiles('**/oracle-ocaml/dune-project') }}
      
      - name: Install OCaml dependencies
        run: |
          cd oracle-ocaml
          opam install . --deps-only --with-test
      
      - name: Build OCaml oracle library
        # Library only: test/oracle_ocaml_tests.ml predates the current
        # Replay API (replay_events lost its book argument) and uses a
        # non-existent %v printf conversion — it has never compiled.
        # Rewrite it before adding `dune build` / `dune runtest` back.
        run: |
          cd oracle-ocaml
          opam exec -- dune build lib
      
      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9  # master @ 2026-05-21
        with:
          toolchain: stable
      
      - name: Cache Rust
        uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
        with:
          path: ~/.cargo
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
      
      - name: Build Rust project
        run: cargo build --release --features event-log
      
      - name: Run differential tests
        run: |
          # Run golden corpus tests comparing OCaml oracle output against Rust implementation
          # Golden corpus location: oracle-ocaml/test/corpus/
          echo "Golden corpus testing - to be implemented with corpus creation"
      
      # `dune runtest` is disabled until test/oracle_ocaml_tests.ml is
      # rewritten against the current Replay API (see build step note).