open-standards/openpay/crates/op-fraud/Cargo.toml
Transaction Science 6fffaab33e
Some checks failed
joule-moq-room room service / joule-moq-room · does this change touch it (push) Successful in 29s
joule-moq-web browser client / joule-moq-web · does this change touch it (push) Successful in 19s
wai-app and Create / wai-app · does this change touch it (push) Successful in 18s
wai-audit collector and player integration / does this change touch it (push) Successful in 19s
wai cross-architecture byte-equality / does this change touch it (push) Successful in 19s
WAI operation catalogue / does this change touch it (push) Successful in 33s
wai-det-jpegai WAISM float-level module of record / does this change touch it (push) Successful in 19s
wai-fleet service / does this change touch it (push) Successful in 34s
wai-key-proxy / does this change touch it (push) Successful in 29s
wai-int-module WAISM module of record / does this change touch it (push) Successful in 32s
wai-ledger service / does this change touch it (push) Successful in 48s
wai media golden suite on RISC-V (emulated) / does this change touch it (push) Successful in 39s
wai-ops-gpu integer operators on GPUs / does this change touch it (push) Successful in 34s
wai-pack / wai-pack · does this change touch it (push) Successful in 33s
wai-quantum command line / does this change touch it (push) Successful in 24s
wai-quantum contract / does this change touch it (push) Successful in 28s
wai-quantum clippy / does this change touch it (push) Successful in 34s
wai-quantum editors / does this change touch it (push) Successful in 28s
wai-quantum docs, course and locales / does this change touch it (push) Successful in 37s
wai-quantum resource estimation / does this change touch it (push) Successful in 15s
wai-quantum other formats / does this change touch it (push) Successful in 15s
wai-quantum-landscape-fpga reference design / does this change touch it (push) Successful in 17s
wai-quantum for JavaScript / does this change touch it (push) Successful in 20s
wai-quantum OpenQASM reader / does this change touch it (push) Successful in 23s
wai-quantum for Python / does this change touch it (push) Successful in 22s
wai-quantum qudit jobs / does this change touch it (push) Successful in 20s
wai-quantum pulse and dynamics / does this change touch it (push) Successful in 30s
wai-quantum error correction and mitigation / does this change touch it (push) Successful in 25s
wai-quantum extension points / does this change touch it (push) Successful in 16s
wai-quantum studio and desktop / does this change touch it (push) Successful in 26s
wai-quantum service / does this change touch it (push) Successful in 27s
wai-quantum verdicts and repairs / does this change touch it (push) Successful in 24s
wai-quantum variational and algorithm library / does this change touch it (push) Successful in 30s
wai-quantum views in agent hosts / does this change touch it (push) Successful in 20s
wai-quantum on Windows / does this change touch it (push) Successful in 20s
wai-sink-android native sink library / does this change touch it (push) Successful in 26s
WAI Studio / does this change touch it (push) Successful in 21s
wai-sink-swift native sink package / does this change touch it (push) Successful in 24s
joule-moq-remote host agent / joule-moq-remote · does this change touch it (push) Successful in 9m11s
joule-moq-http live HTTP egress / joule-moq-http · does this change touch it (push) Successful in 9m18s
wai-ops-gpu integer operators on GPUs / Vulkan GPUs (jetson-hub) (push) Successful in 14m24s
wai-quantum service / service energy · linux packages (push) Failing after 13s
wai-ops-gpu integer operators on GPUs / Vulkan GPUs (framework-128gb) (push) Successful in 19m0s
WAI breaking changes and the conformance runner / WAI breaking · does this change touch WAI (push) Successful in 10s
WAI examples / WAI examples · does this change touch them (push) Successful in 14s
wai-quantum landscape energy to solution / does this change touch it (push) Successful in 15s
wai-quantum energy-landscape jobs / does this change touch it (push) Successful in 21s
wai-quantum landscape stage 0, the sampler against the exact law / does this change touch it (push) Successful in 21s
wai-quantum wasmQ / does this change touch it (push) Successful in 19s
wai web player plugins / the browser run's room compiles · linux (push) Successful in 1m25s
wai-app and Create / wai-app · tests, clippy, the line language's verifier (linux) (push) Successful in 52s
wai cross-architecture byte-equality / linux-x86_64 (push) Successful in 58s
wai tv web application / the tv application, built to its baseline and checked · linux (push) Successful in 5m0s
wai-audit collector and player integration / collector · linux (push) Successful in 4m20s
wai web player plugins / the plugins' core under Node · linux (push) Successful in 6m15s
WAI operation catalogue / the catalogue and every door · linux (push) Failing after 2m56s
wai-int-module WAISM module of record / the module of record in Chromium (push) Successful in 19s
wai-key-proxy / proxy · linux (push) Successful in 2m8s
wai media golden suite on RISC-V (emulated) / golden suite · riscv64 (emulated) (push) Successful in 1m9s
wai-ledger service / service · linux (push) Successful in 3m17s
wai-fleet service / service · linux (push) Successful in 5m25s
wai-quantum contract / the policy is linked, and the deprecations page reads (push) Successful in 7s
wai-pack / wai-pack · linux (push) Successful in 4m26s
wai-quantum docs, course and locales / the Studio's words in every locale · linux (push) Successful in 12s
wai-int-module WAISM module of record / linux · both checkers, wasmtime (Cranelift, Winch), Wasmi and Node (push) Successful in 7m11s
wai-quantum clippy / clippy, warnings denied, every feature set · linux (push) Successful in 4m23s
wai-quantum other formats / the set under wasm32-wasip2 (wasmtime) (push) Successful in 3m58s
wai-quantum contract / API compatibility · linux (push) Successful in 10m46s
wai-quantum editors / editors · linux (push) Successful in 7m39s
wai-quantum docs, course and locales / the course and the command line's languages · linux (push) Successful in 7m36s
wai-quantum other formats / readers, writers and the set · linux (push) Successful in 6m26s
wai-quantum OpenQASM reader / corpus under wasm32-wasip2 (wasmtime) (push) Successful in 1m31s
wai-det-jpegai WAISM float-level module of record / linux · both checkers, F1, F2 on wasmtime (Cranelift, Winch, Pulley) and Wasmi, the planted faults (push) Successful in 17m24s
wai-quantum contract / schemas and the committed tool lists · linux (push) Successful in 11m44s
wai-quantum qudit jobs / the module and the conformance set under wasm32-wasip2 (wasmtime) (push) Successful in 2m25s
wai-quantum OpenQASM reader / reader and corpus · linux (push) Successful in 4m22s
wai-quantum pulse and dynamics / reader, simulator and pulse jobs under wasm32-wasip2 (wasmtime) (push) Successful in 2m2s
wai-quantum pulse and dynamics / reader, simulator and pulse jobs · linux, release (push) Successful in 4m12s
wai-quantum resource estimation / estimation and calibration · linux, release (push) Successful in 13m56s
wai-quantum extension points / the registry under wasm32-wasip2 (wasmtime) (push) Successful in 3m52s
wai-quantum for Python / python · linux (push) Successful in 8m21s
wai-quantum for JavaScript / javascript · linux (push) Successful in 10m54s
wai-quantum error correction and mitigation / codes, decoders, texts and mitigation · linux, release (push) Successful in 6m13s
wai-ops-gpu integer operators on GPUs / builds · no adapter is not a pass (linux) (push) Successful in 21m9s
wai-quantum qudit jobs / the module, the job, the conformance set, the referee and the verb · linux (push) Successful in 8m48s
wai-quantum verdicts and repairs / verdicts, repairs and the intent set · linux (push) Successful in 3m41s
wai-quantum extension points / the registry and the example · linux (push) Successful in 6m53s
wai-quantum verdicts and repairs / the intent set and the verdict under wasm32-wasip2 (wasmtime) (push) Successful in 3m15s
WAI Studio / the catalogue's actions, the unit tests and the core · linux (push) Successful in 1m39s
wai-quantum studio and desktop / desktop app · linux (push) Successful in 6m48s
wai-quantum studio and desktop / studio · browser (push) Successful in 7m33s
wai-quantum variational and algorithm library / parameters, gradients, optimisers, VQE, QAOA and builders · linux, release (push) Successful in 4m11s
wai-quantum views in agent hosts / views · the page and its engine (push) Successful in 8m35s
wai-quantum views in agent hosts / views · a scripted host (push) Successful in 9m15s
wai-quantum service / service · linux (push) Successful in 14m55s
wai-quantum command line / command line · linux (push) Successful in 35m40s
WAI Studio / Studio in WebKit · linux (push) Failing after 14m55s
wai-quantum-landscape-fpga reference design / the member against the model of the logic, and the logic against the model · linux, release (push) Successful in 29m24s
wai-quantum docs, course and locales / every command and snippet in the docs · linux (push) Failing after 1h3m51s
wai cross-architecture byte-equality / linux-aarch64 (push) Successful in 4m2s
joule-moq-room room service / joule-moq-room, every target (push) Failing after 9m26s
wai-pack / wai-pack · linux-arm64 (push) Successful in 4m45s
wai-pack / wai-pack · the floor through a media prober (push) Failing after 59s
wai-int-module WAISM module of record / linux-arm64 · both checkers, wasmtime (Cranelift, Winch), Wasmi and Node (push) Successful in 7m23s
wai-pack / wai-pack · dependency licences (push) Successful in 2m6s
wai-quantum-landscape-fpga reference design / the board's code on the board's processor's architecture · linux-arm64, release (push) Successful in 2m2s
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (push) Failing after 25m29s
wai-quantum pulse and dynamics / the same bits · linux-arm64 (push) Successful in 2m32s
wai-app and Create / wai-app · Create, browser end-to-end (macos) (push) Failing after 7m6s
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (push) Successful in 8m13s
wai-det-jpegai WAISM float-level module of record / linux-arm64 · both checkers, F1, F2 on wasmtime (Cranelift, Winch, Pulley) and Wasmi, the planted faults (push) Successful in 24m35s
joule-moq-web browser client / joule-moq-web · browser end-to-end (macos) (push) Successful in 16m53s
joule-moq-http live HTTP egress / joule-moq-http, every target (push) Successful in 4m4s
wai-audit collector and player integration / collector, player integration and the browser end to end · macos (push) Successful in 1m59s
joule-moq-http in browsers / the egress and the protected room in Chromium, Firefox and WebKit · macos (push) Successful in 15m24s
wai peer delivery in browsers / peer delivery in Chromium, Firefox and WebKit · macos (push) Successful in 9m39s
wai-pack / wai-pack · independent verifier (Python) (push) Successful in 23m25s
wai-quantum variational and algorithm library / parameters, gradients, optimisers, VQE, QAOA and builders · linux-arm64, release (push) Successful in 10m28s
joule-moq-remote host agent / joule-moq-remote, every target (linux-arm64) (push) Successful in 4m14s
wai protected floor in browsers / the protected floor in Chromium, Firefox and WebKit · macos (push) Successful in 2m58s
wai cross-architecture byte-equality / macos-arm64 (reference) (push) Successful in 23s
wai tv web application / the tv application in Chromium, Firefox and WebKit · macos (push) Successful in 6m53s
wai-fleet service / service · macos (push) Successful in 1m13s
wai-ledger service / service · macos (push) Successful in 1m46s
wai-quantum extension points / the registry and the example · linux-arm64 (push) Successful in 21m26s
wai-pack / wai-pack · macos (push) Successful in 4m4s
wai-quantum command line / command line · macos (push) Successful in 2m49s
wai web player plugins / the three players in Chromium, Firefox and WebKit · macos (push) Failing after 17m42s
wai-quantum editors / editors · macos (push) Successful in 1m55s
wai-ops-gpu integer operators on GPUs / Metal GPU and browser WebGPU (macos) (push) Failing after 11m28s
wai-quantum pulse and dynamics / the same bits · macos (push) Successful in 1m46s
wai-quantum for Python / python · macos (push) Successful in 4m9s
wai-quantum qudit jobs / the same bits · macos (push) Successful in 3m29s
wai-quantum studio and desktop / desktop app · macos (push) Successful in 7m30s
joule-moq-remote host agent / joule-moq-remote, every target (macos) (push) Successful in 50s
wai-quantum service / service · macos (push) Successful in 8m21s
wai-sink-android native sink library / every ABI, the AAR, and the instrumented tests in a headless emulator · macos (push) Successful in 8m48s
WAI Studio / Studio in Chromium and Firefox · macos (push) Failing after 18m52s
wai-sink-swift native sink package / libwai slices, desktop tests, simulator tests · macos (push) Successful in 18m3s
wai-quantum on Windows / engine · windows (push) Has been cancelled
wai-quantum on Windows / command line · windows (push) Has been cancelled
wai-quantum on Windows / job service · windows (push) Has been cancelled
wai-quantum on Windows / python · windows (push) Has been cancelled
wai-quantum wasmQ / profile, engines, reference modules, adversarial, vectors · linux (push) Has been cancelled
wai-quantum wasmQ / profile, engines, reference modules, adversarial, vectors · macos (push) Has been cancelled
wai-quantum wasmQ / the reference modules rebuild to their modules of record · linux (push) Has been cancelled
wai-quantum wasmQ / interpreter and vectors under wasm32-wasip2 (wasmtime) (push) Has been cancelled
wai-quantum studio and desktop / desktop app · windows (push) Has been cancelled
wai-quantum energy-landscape jobs / reader, kernels, answers and the stated result · linux, release (push) Has been cancelled
wai-quantum energy-landscape jobs / the same bits · linux-arm64 (push) Has been cancelled
wai-quantum energy-landscape jobs / the same bits · macos (push) Has been cancelled
wai-quantum energy-landscape jobs / the module under wasm32-wasip2 (wasmtime) (push) Has been cancelled
wai-quantum energy-landscape jobs / native against WebAssembly, over many seeds (push) Has been cancelled
wai-quantum landscape stage 0, the sampler against the exact law / the small tier, to the byte · linux (push) Has been cancelled
wai-quantum landscape stage 0, the sampler against the exact law / the small tier, to the byte · macos (push) Has been cancelled
wai-quantum landscape energy to solution / the small tier, to the byte · linux (push) Has been cancelled
wai-quantum landscape energy to solution / the small tier, to the byte · macos (push) Has been cancelled
WAI examples / WAI examples · portable · linux (push) Has been cancelled
WAI examples / WAI examples · the archive, the readiness check, the browser and Apple · macos (push) Has been cancelled
WAI examples / WAI examples · android-app · linux-arm64 (push) Has been cancelled
wai cross-architecture byte-equality / windows-x86_64 (push) Has been cancelled
WAI breaking changes and the conformance runner / WAI breaking · wire, record and API against main · linux (push) Has been cancelled
WAI breaking changes and the conformance runner / WAI breaking and conform · their tests, and the independent verifiers through wai conform · linux (push) Has been cancelled
op-fraud: the onnx scorer on ort 2.0.0-rc.15
openpay's lockfile has held ort rc.15 since before this; the `onnx` feature
(off by default, built by no CI job) had not compiled since. rc.15 names the
environment a session is built in and allows one per process, its global
environment and `commit()` are gone, and its `ndarray` feature binds ndarray
0.17.

- init_runtime builds the environment over the library it is given and keeps
  it; a second call is an error, as one environment per process is.
- Without init_runtime, the environment is built on first use over the
  library ort itself would load (ORT_DYLIB_PATH, else the platform's
  onnxruntime), through init_from, so a missing library is Error::Backend as
  from_bytes documents, not a panic. Before, the two from_bytes tests could
  only pass with a runtime present; one passed without because the other's
  panic poisoned the lock.
- ndarray 0.17, the version ort binds.

clippy -D warnings with --features onnx; 50 tests pass with the system ONNX
Runtime and with none loadable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-11 23:47:17 -05:00

47 lines
2.1 KiB
TOML

[package]
name = "op-fraud"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "On-device fraud scoring. Pluggable Scorer trait; heuristic + ONNX + Burn implementations."
[dependencies]
op-core = { path = "../op-core" }
thiserror = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
time = { workspace = true }
# SHA-256 for hashing identifiers in features (no PII in model input).
sha2 = "0.11"
# ONNX Runtime binding for the production scorer. Pinned to 2.x.
# `load-dynamic` lets the operator place libonnxruntime.{so,dylib,dll} at
# a path of their choosing (App bundle on iOS, /lib on Linux kiosk, etc.).
# We do NOT enable `download-binaries`: operators audit and ship their own.
ort = { version = "2.0.0-rc.10", default-features = false, features = ["load-dynamic", "ndarray"], optional = true }
# The ndarray ort's `ndarray` feature binds (0.17 since ort 2.0.0-rc.15): the
# scorer's arrays cross into ort as that crate's types.
ndarray = { version = "0.17", optional = true }
# Burn 0.17.x is the pure-Rust ML alternative. NdArray is the only
# backend that compiles for no_std + WASM + iOS / Android, which is
# what the FFI layer (Phases 8-10) needs. We use Burn for operators who
# want to avoid shipping libonnxruntime altogether — kiosk-Linux builds,
# WASM deployments in browsers, or anywhere the binary-size budget is
# tight. ONNX Runtime adds ~10-30 MB; Burn's NdArray backend is ~1 MB.
burn = { version = "0.17", default-features = false, features = ["ndarray", "std"], optional = true }
burn-ndarray = { version = "0.17", default-features = false, features = ["std"], optional = true }
[dev-dependencies]
proptest = { workspace = true }
insta = { workspace = true }
[features]
default = ["heuristic"]
# Pure-Rust heuristic scorer. No external runtime.
heuristic = []
# ONNX Runtime scorer. Requires libonnxruntime at runtime.
onnx = ["dep:ort", "dep:ndarray"]
# Burn pure-Rust scorer. No external runtime, no extra shared library.
burn-backend = ["dep:burn", "dep:burn-ndarray"]