code wiki / (root) / nx_instrument_diagnostician.nx

nx_instrument_diagnostician.nx

buildroot/runtime/nx_instrument_diagnostician.nx

12430 B240 linesdepth 4pulls 5 transitivereach 7 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_instrument_diagnostician.nx -- pattern-match measurement deltas to named fixes. module: nishi-core.perception.instrument_diagnostician depends: nishi-core.perception.profile + nishi-core.perception.transducer_characterizer + nishi-core.perception.provenance_curve_store + nishi-core.io.syscalls disk_kb: 5 capability: PERCEPTION wired_status: PARTIAL_WIRED MISSING_CAPABILITIES: - PATTERN_LIBRARY_LOAD (load known-failure-signature → fix mappings from versioned diagnostic catalog) - SIGNATURE_MATCHING (FFT peak detection, drift-trend detection, oscillation detection, etc.) - CONFIDENCE_SCORING (Bayesian update over multiple observation consistency with pattern) - LEARNING_FROM_USER_CONFIRMED_FIXES (catalog grows as new failure modes are encountered + diagnosed; per [[feedback-self-surfacing-intelligence-staged-autonomy]] this is Stage 1 SUPERVISED — user ratifies before pattern enters library) - SUGGESTED_NEXT_MEASUREMENT (when initial diagnosis is ambiguous, substrate names the disambiguating measurement to take) 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-bug-class-prevention-additive-not-restrictive + toyota_5_whys_root_cause + ohm_kirchhoff_circuit_laws Per cardinal [[feedback-substrate-does-heavy-lifting-user-is-partner-not-gate]]: When a measurement deviates from expected, THIS primitive names the likely cause + the fix. User doesn't need to know "consult datasheet + bisect signal chain" — substrate names "47 pF compensation cap here" or "ribbon damping insufficient, add 0.5mm acoustic felt strip" directly. Reuse set served by this single primitive: - DAC build diagnostics (which resistor is wrong, ground bounce, supply ripple) - Amp build diagnostics (oscillation, bias drift, capacitive load instability)

dependencies 4 imports · 3 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.nx nx_daemon_health_audit.nx nx_external_reach_probe.nx

imports: nx_syscalls.nxnx_perceptual_profile.nxnx_transducer_characterizer.nxnx_provenance_curve_store.nx

imported by: nx_calibration_drift_monitor.nxnx_daemon_health_audit.nxnx_external_reach_probe.nx

structs

159struct NxDiagPattern
176struct NxDiagResult

consts

62const NX_DIAG_SIG_VALUE_OUT_OF_RANGE: i64 = 1 // scalar measurement deviates
63const NX_DIAG_SIG_TREND_DRIFT: i64 = 2 // value drifts over time
64const NX_DIAG_SIG_OSCILLATION_DETECTED: i64 = 3 // spurious oscillation in output
65const NX_DIAG_SIG_DC_OFFSET: i64 = 4 // unexpected DC bias
66const NX_DIAG_SIG_NOISE_FLOOR_ELEVATED: i64 = 5 // baseline noise too high
67const NX_DIAG_SIG_HARMONIC_DISTORTION: i64 = 6 // nonlinearity in output
68const NX_DIAG_SIG_IMPULSE_ARTIFACT: i64 = 7 // periodic clicks / pops
69const NX_DIAG_SIG_MISSING_CHANNEL: i64 = 8 // expected channel silent
70const NX_DIAG_SIG_CHANNEL_SWAP: i64 = 9 // L/R inverted etc.
71const NX_DIAG_SIG_SATURATION: i64 = 10 // output clipping
72const NX_DIAG_SIG_DROPOUT: i64 = 11 // intermittent silence
73const NX_DIAG_SIG_RESONANCE_PEAK: i64 = 12 // FRF has unexpected peak
74const NX_DIAG_SIG_RESONANCE_DIP: i64 = 13 // FRF has unexpected dip
75const NX_DIAG_SIG_ROLLOFF_EARLY: i64 = 14 // bandwidth lower than spec
76const NX_DIAG_SIG_TIME_DELAY_EXCESSIVE: i64 = 15 // group delay too high
77const NX_DIAG_SIG_TEMPERATURE_RUNAWAY: i64 = 16 // thermal protection trip
78const NX_DIAG_SIG_CURRENT_INRUSH: i64 = 17 // power supply current spike
106const NX_DIAG_SEV_INFO: i64 = 1 // observation only, no action
107const NX_DIAG_SEV_NOTICE: i64 = 2 // worth knowing; substrate compensates
108const NX_DIAG_SEV_WARNING: i64 = 3 // marginal; user should review
109const NX_DIAG_SEV_ERROR: i64 = 4 // failed; user must address
110const NX_DIAG_SEV_CRITICAL: i64 = 5 // safety risk; halt assembly
126const NX_DIAG_FIX_ADJUST_COMPONENT: i64 = 1 // turn trim pot, tighten clamp
127const NX_DIAG_FIX_ADD_COMPONENT: i64 = 2 // solder additional cap/resistor
128const NX_DIAG_FIX_REMOVE_COMPONENT: i64 = 3 // desolder a part
129const NX_DIAG_FIX_REWORK_CONNECTION: i64 = 4 // cold solder joint, bad crimp
130const NX_DIAG_FIX_RESEAT: i64 = 5 // unplug + replug, reseat IC
131const NX_DIAG_FIX_RECALIBRATE: i64 = 6 // re-run nx_transducer_characterize
132const NX_DIAG_FIX_REPLACE_COMPONENT: i64 = 7 // component failed; swap
133const NX_DIAG_FIX_SOFTWARE_COMPENSATE: i64 = 8 // nx_signal_compensator handles
134const NX_DIAG_FIX_INVESTIGATE_FURTHER: i64 = 9 // ambiguous; substrate names
136const NX_DIAG_FIX_DEFER_TO_HUMAN: i64 = 10 // outside substrate diagnostic

functions

80func nx_diag_sig_name(s: i64) -> *u8
112func nx_diag_sev_name(s: i64) -> *u8
139func nx_diag_fix_name(f: i64) -> *u8
191func nx_diag_examine_measurement(instrument_serial_ptr: *u8, instrument_serial_len: i64,
209func nx_diag_register_pattern(pattern_ptr: *NxDiagPattern,
219func nx_diag_suggest_next_measurement(instrument_serial_ptr: *u8, instrument_serial_len: i64,
232func nx_diag_library_size() -> i64
238func nx_diag_get_last_verdict() -> i64