_obd_pipeline_smoke.nx
buildroot/runtime/consumers/_obd_pipeline_smoke.nx
about
_obd_pipeline_smoke.nx -- end-to-end OBD pipeline correctness gate.
Proves the OBD predictive-maintenance pipeline works by stitching
every layer together + asserting expected outputs:
1. nx_obd2_shim.rx_fn parses a synthetic ISO-TP Mode 01
coolant-temp response -> emits EVT_COOLANT_TEMP event
2. nx_pm_consumer_on_event ingests N drift samples ->
eventually classifies as ANOM_DRIFT_UP
3. nx_tm_emit_anomaly serializes verdict to stdout NDJSON
Synthetic dataset: coolant temperature rising linearly from 87C
to 108C across 100 samples spaced 1 hour apart (~4-day window).
Per OBD spec the high threshold is ~105C; the linear drift should
cross within the 7-day extrapolation horizon, firing ANOM_DRIFT_UP.
Status: SEED v0.1.0. 2026-05-27.
WINNER-TIER: EXEMPT (correctness gate per NISHIBENCH_WINNER_STANDARD
§antipatterns; smokes are gates not perf claims)
INCUMBENTS: n/a (correctness gate)
EXEMPTION REASON: correctness validation; no performance claim made
Exit-code convention:
0 all assertions PASS
1-9 setup-failure verdicts (memory alloc, init)
10-19 shim-path verdicts (frame parse, event emit)
20-29 consumer-path verdicts (register, on_event, classification)
30-39 telemetry-path verdicts (bus init, emit, sink)
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_telemetry.nxnx_obd2_shim.nxnx_pred_maint_consumer.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 37 | const SMOKE_N_SAMPLES: i64 = 100 // drift samples to inject |
| 38 | const SMOKE_SAMPLE_PERIOD_NS: i64 = 3600000000000 // 1 hour per sample (ns) |
| 39 | const SMOKE_START_TEMP_C: i64 = 87 |
| 40 | const SMOKE_END_TEMP_C: i64 = 108 |
| 41 | const SMOKE_THRESHOLD_LO: i64 = 70 // OBD spec low (degC) |
| 42 | const SMOKE_THRESHOLD_HI: i64 = 105 // OBD spec high |
functions
| 54 | func smoke_build_coolant_frame(out: *u8, temp_c: i64) -> i64 called by 1: smoke_assert_shim_parse |
| 68 | func smoke_assert_shim_parse(shim: *NxObd2Shim) -> i64 |
| 88 | func smoke_assert_drift_detection(consumer: *NxPredMaintConsumer, |
| 117 | func smoke_assert_telemetry_emit(bus: *NxTelemetryBus, |
| 142 | func main() -> i64 |