code wiki / (root) / nx_calibration_drift_monitor.nx

nx_calibration_drift_monitor.nx

buildroot/runtime/nx_calibration_drift_monitor.nx

11423 B223 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind orphan library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_perceptual_profile.nx nx_transducer_characterizer.nx nx_provenance_curve_store.nx nx_instrument_diagnostician.nx nx_calibration_drift_monitor.n

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

147struct NxDriftFinding

consts

64const NX_DRIFT_KIND_NONE: i64 = 0 // no drift detected
65const NX_DRIFT_KIND_MONOTONIC_DECLINE: i64 = 1 // sensitivity dropping
66const NX_DRIFT_KIND_MONOTONIC_INCREASE: i64 = 2 // gain creep
67const NX_DRIFT_KIND_FREQUENCY_SHIFT: i64 = 3 // resonance moved
68const NX_DRIFT_KIND_NEW_RESONANCE_PEAK: i64 = 4 // peak appeared not in baseline
69const NX_DRIFT_KIND_LOST_RESONANCE_PEAK: i64 = 5 // baseline peak disappeared
70const NX_DRIFT_KIND_NOISE_FLOOR_RISE: i64 = 6 // SNR degradation
71const NX_DRIFT_KIND_DISTORTION_INCREASE: i64 = 7 // THD climbed
72const NX_DRIFT_KIND_INTERMITTENT_DROPOUT: i64 = 8 // not always reproducing
73const NX_DRIFT_KIND_TEMPERATURE_RELATED: i64 = 9 // correlates with ambient temp
74const NX_DRIFT_KIND_CARTRIDGE_DEPLETION: i64 = 10 // chemical inventory low
75const NX_DRIFT_KIND_PIXEL_DEFECT: i64 = 11 // visual: new dead/hot pixels
97const NX_DRIFT_ACTION_NONE: i64 = 0 // no action; drift within tolerance
98const NX_DRIFT_ACTION_ACCEPT_NEW_BASELINE: i64 = 1 // drift normal; new baseline stored
99const NX_DRIFT_ACTION_AUTO_RECOMPENSATE: i64 = 2 // substrate updates compensator
101const NX_DRIFT_ACTION_PROMPT_RECALIBRATE: i64 = 3 // ask user to re-run characterize
102const NX_DRIFT_ACTION_PROMPT_REPLACE_PART: i64 = 4 // drift beyond compensation
103const NX_DRIFT_ACTION_HALT_USE: i64 = 5 // measurement no longer trustworthy
104const NX_DRIFT_ACTION_DIAGNOSTIC_HANDOFF: i64 = 6 // hand to instrument_diagnostician
124const NX_DRIFT_SCHED_DAILY: i64 = 1
125const NX_DRIFT_SCHED_WEEKLY: i64 = 2
126const NX_DRIFT_SCHED_MONTHLY: i64 = 3
127const NX_DRIFT_SCHED_QUARTERLY: i64 = 4
128const NX_DRIFT_SCHED_ON_TEMPERATURE_DROP: i64 = 5 // when ambient temp shifts >5°C
129const NX_DRIFT_SCHED_ON_USE_HOURS: i64 = 6 // after N hours of use
130const NX_DRIFT_SCHED_ON_DEMAND: i64 = 7 // manual trigger only
131const NX_DRIFT_SCHED_CONTINUOUS: i64 = 8 // every characterization run

functions

77func nx_drift_kind_name(k: i64) -> *u8
107func nx_drift_action_name(a: i64) -> *u8
133func nx_drift_sched_name(s: i64) -> *u8
167func nx_drift_monitor_enable(instrument_serial_ptr: *u8, instrument_serial_len: i64,
180func nx_drift_monitor_disable(instrument_serial_ptr: *u8, instrument_serial_len: i64) -> i64
189func nx_drift_monitor_check_now(instrument_serial_ptr: *u8, instrument_serial_len: i64,
203func nx_drift_monitor_handle_finding(finding_ptr: *NxDriftFinding,
213func nx_drift_monitor_get_age_days(instrument_serial_ptr: *u8, instrument_serial_len: i64) -> i64
221func nx_drift_monitor_count_monitored() -> i64