nx_calibration_drift_monitor.nx
buildroot/runtime/nx_calibration_drift_monitor.nx
about
nx_calibration_drift_monitor.nx -- scheduled re-characterization + drift alerts.
module: nishi-core.perception.calibration_drift_monitor
depends: nishi-core.perception.profile + nishi-core.perception.transducer_characterizer +
nishi-core.perception.provenance_curve_store + nishi-core.perception.instrument_diagnostician +
nishi-core.io.syscalls
disk_kb: 5
capability: PERCEPTION
wired_status: PARTIAL_WIRED
MISSING_CAPABILITIES:
- SCHEDULE_PERSIST (cron-style schedule serialized to disk + restored
on substrate restart; depends on nx_race_timing already FULLY_WIRED
— wire the call site)
- CURVE_DIFF (compute delta between current FRF and stored baseline;
queued, depends on nx_fft once landed)
- ALERT_DISPATCH (surface drift findings to nx_audit_dashboard +
optional notification path; depends on dashboard UI)
- DIAGNOSTIC_HANDOFF (on drift detected, hand result to
nx_instrument_diagnostician for "is this just aging or is something
broken?" verdict)
license_tier: PUBLIC_NISHI_SUBSTRATE
genealogy_id: feedback-substrate-does-heavy-lifting-user-is-partner-not-gate_2026 +
feedback-substrate-primitives-meta-not-one-off_2026 +
feedback-self-surfacing-intelligence-staged-autonomy +
feedback-racing-timing-modes-sealed-enum +
shewhart_1931_statistical_process_control
Per cardinals [[feedback-substrate-does-heavy-lifting-user-is-partner-not-gate]]
and [[feedback-substrate-primitives-meta-not-one-off]]:
THIS primitive re-runs nx_transducer_characterize on a schedule,
compares the result to the stored baseline curve, and surfaces drift
before the drift invalidates the measurement chain.
User contribution: zero day-to-day. Substrate watches. User only
hears from substrate when drift exceeds a configurable threshold +
substrate needs ratification on the proposed action (re-calibrate,
replace component, accept as new baseline).
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_perceptual_profile.nxnx_transducer_characterizer.nxnx_provenance_curve_store.nxnx_instrument_diagnostician.nx
imported by: nobody (leaf or entry point)
structs
| 147 | struct NxDriftFinding |
consts
| 64 | const NX_DRIFT_KIND_NONE: i64 = 0 // no drift detected |
| 65 | const NX_DRIFT_KIND_MONOTONIC_DECLINE: i64 = 1 // sensitivity dropping |
| 66 | const NX_DRIFT_KIND_MONOTONIC_INCREASE: i64 = 2 // gain creep |
| 67 | const NX_DRIFT_KIND_FREQUENCY_SHIFT: i64 = 3 // resonance moved |
| 68 | const NX_DRIFT_KIND_NEW_RESONANCE_PEAK: i64 = 4 // peak appeared not in baseline |
| 69 | const NX_DRIFT_KIND_LOST_RESONANCE_PEAK: i64 = 5 // baseline peak disappeared |
| 70 | const NX_DRIFT_KIND_NOISE_FLOOR_RISE: i64 = 6 // SNR degradation |
| 71 | const NX_DRIFT_KIND_DISTORTION_INCREASE: i64 = 7 // THD climbed |
| 72 | const NX_DRIFT_KIND_INTERMITTENT_DROPOUT: i64 = 8 // not always reproducing |
| 73 | const NX_DRIFT_KIND_TEMPERATURE_RELATED: i64 = 9 // correlates with ambient temp |
| 74 | const NX_DRIFT_KIND_CARTRIDGE_DEPLETION: i64 = 10 // chemical inventory low |
| 75 | const NX_DRIFT_KIND_PIXEL_DEFECT: i64 = 11 // visual: new dead/hot pixels |
| 97 | const NX_DRIFT_ACTION_NONE: i64 = 0 // no action; drift within tolerance |
| 98 | const NX_DRIFT_ACTION_ACCEPT_NEW_BASELINE: i64 = 1 // drift normal; new baseline stored |
| 99 | const NX_DRIFT_ACTION_AUTO_RECOMPENSATE: i64 = 2 // substrate updates compensator |
| 101 | const NX_DRIFT_ACTION_PROMPT_RECALIBRATE: i64 = 3 // ask user to re-run characterize |
| 102 | const NX_DRIFT_ACTION_PROMPT_REPLACE_PART: i64 = 4 // drift beyond compensation |
| 103 | const NX_DRIFT_ACTION_HALT_USE: i64 = 5 // measurement no longer trustworthy |
| 104 | const NX_DRIFT_ACTION_DIAGNOSTIC_HANDOFF: i64 = 6 // hand to instrument_diagnostician |
| 124 | const NX_DRIFT_SCHED_DAILY: i64 = 1 |
| 125 | const NX_DRIFT_SCHED_WEEKLY: i64 = 2 |
| 126 | const NX_DRIFT_SCHED_MONTHLY: i64 = 3 |
| 127 | const NX_DRIFT_SCHED_QUARTERLY: i64 = 4 |
| 128 | const NX_DRIFT_SCHED_ON_TEMPERATURE_DROP: i64 = 5 // when ambient temp shifts >5°C |
| 129 | const NX_DRIFT_SCHED_ON_USE_HOURS: i64 = 6 // after N hours of use |
| 130 | const NX_DRIFT_SCHED_ON_DEMAND: i64 = 7 // manual trigger only |
| 131 | const NX_DRIFT_SCHED_CONTINUOUS: i64 = 8 // every characterization run |
functions
| 77 | func nx_drift_kind_name(k: i64) -> *u8 |
| 107 | func nx_drift_action_name(a: i64) -> *u8 |
| 133 | func nx_drift_sched_name(s: i64) -> *u8 |
| 167 | func nx_drift_monitor_enable(instrument_serial_ptr: *u8, instrument_serial_len: i64, |
| 180 | func nx_drift_monitor_disable(instrument_serial_ptr: *u8, instrument_serial_len: i64) -> i64 |
| 189 | func nx_drift_monitor_check_now(instrument_serial_ptr: *u8, instrument_serial_len: i64, |
| 203 | func nx_drift_monitor_handle_finding(finding_ptr: *NxDriftFinding, |
| 213 | func nx_drift_monitor_get_age_days(instrument_serial_ptr: *u8, instrument_serial_len: i64) -> i64 |
| 221 | func nx_drift_monitor_count_monitored() -> i64 |