Skip to content

Dataset replay

Preview (replay-mode Cargo feature). The production C-ABI path requires a dataset-staging entry that is not yet exposed on the public C ABI; until that lands, replay is reachable through the in-tree test link. The accessor stays opt-in so production FFI callers cannot reach a path the C ABI does not yet expose.

The replay path drives any analytic from a dataset the engine link holds. The output stream is byte-equivalent to the live stream the same analytic would have emitted from the same wire data — frame for frame, field for field, watermark for watermark.

Minimal program

Preview. This snippet uses the replay-mode Cargo feature. Over the production C-ABI link (Client::connect) the .on_event call currently requires a dataset-staging entry that is not yet exposed on the public C ABI and is tracked as a documented follow-up. The accessor stays opt-in so production FFI callers cannot reach a path the C ABI does not yet expose. To run the example today, route through the in-tree test link (Client::with_link + the in-process engine fixture); the in-process path stages the dataset directly against the engine's replay scope without the C-ABI boundary.

rust
// Cargo.toml:
//   kairos = { version = "0.1", features = ["replay-mode"] }

use kairos::{Client, OhlcvcRow};

let client = Client::connect(("me@example.com", "secret"))?;

let sub = client
    .replay()
    .ohlcvc(["QQQ"])
    .on_event(|row: &OhlcvcRow| {
        println!("close={} volume={}", row.close, row.volume);
    })?;

// The callback fires once per bar over the finite dataset.
let _ = sub;

Dataset provisioning

The replay dataset is staged on the engine link out of band. The thin client does not marshal a dataset over the wire; from the caller's perspective, the dataset is provisioned engine-side and the public client call is just client.replay().<analytic>([...]).on_event(...).

Future revisions of the C ABI will expose a staging entry for caller-supplied datasets; until then, callers that need offline replay run through the in-tree test link.

Entitlement bypass

The replay path bypasses the per-asset historical entitlement gate, tier gates, and quota gates: the dataset came from the user, the engine is not the gatekeeper.

Correctness regressions

The replay path is positioned as a correctness-testing facility, not a strategy backtester. Stage the same dataset twice; expect bit-identical output. The property-based test suite enforces this on every commit through a proptest-driven replay-equivalence harness.

See also

Proprietary. All rights reserved.