code wiki / (root) / nx_supplement_check.nx

nx_supplement_check.nx

buildroot/runtime/nx_supplement_check.nx

3735 B93 linesdepth 12pulls 19 transitivereach 0 importersview sourcekind tooltopic supplement
docsdependenciesstructsconstsfunctions

about

nx_supplement_check.nx -- C5.2 milestone: argv-aware CLI tool. The standalone "lab analyst's tool" that closes the bits-up usability arc. Takes a peak file path on the command line, runs the full supplement-adulterant detection pipeline, emits JSON to stdout, and returns banned-count as exit status so shell scripts can branch on it. USAGE: nx_supplement_check <peak-file> EXAMPLES: $ cat > /tmp/sample.txt <<EOF # LC-MS peak list 280.18 10000 742.3 102.13 8000 45.2 EOF $ qemu-riscv64-static nx_supplement_check.elf /tmp/sample.txt {"sample_id":"argv-supplied","method":"LC-ESI+-MS",...,"recommendation":"REJECT"} $ echo $? 2 # number of BANNED ingredients detected EXIT CODE CONVENTION: 0 no banned, no restricted, all peaks identified (ACCEPT) 1 bad arguments / file missing / parse error N number of banned ingredients (REJECT or REVIEW recommended) This makes shell pipelines natural: nx_supplement_check $peaks_file && echo "lot OK" || echo "REJECT"

dependencies 10 imports · 0 importers

nx_chem.nx nx_chem_molecule.nx nx_chem_smiles.nx nx_chem_periodic.nx nx_chem_valence.nx nx_chem_mass.nx nx_chem_isotope_pattern.nx nx_chem_adulterant_db.nx nx_chem_peak_list.nx nx_chem_report_json.nx nx_supplement_check.nx

imports: nx_chem.nxnx_chem_molecule.nxnx_chem_smiles.nxnx_chem_periodic.nxnx_chem_valence.nxnx_chem_mass.nxnx_chem_isotope_pattern.nxnx_chem_adulterant_db.nxnx_chem_peak_list.nxnx_chem_report_json.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_chem_peak_list_read_fil sys_read_file sys_openat_rd sys_lseek sys_mmap sys_read sys_close nx_chem_peak_list_new sys_mmap ↻ nx_chem_peak_list_parse nx_chem_peak_list_new ↻ nx_loop_begin sys_mmap ↻ nx_loop_step nx_clock_monotonic_ns sys_mmap ↻ sys_clock_gettime_mono nx_loop_break nx_chem_is_lineterm nx_chem_parse_decimal_q4 nx_loop_begin ↻ nx_loop_step ↻ nx_loop_break ↻ nx_chem_is_hspace nx_chem_peak_list_add nx_chem_adulterant_db_seed nx_chem_atomic_data_table_ nx_chem_adulterant_db_new sys_mmap ↻ sys_mmap ↻ nx_chem_adulterant_seed_sm nx_chem_adulterant_db_add nx_chem_parse_smiles nx_chem_mol_new smi_is_digit nx_chem_mol_atom nx_chem_mol_bond_add nx_chem_mol_bond smi_parse_bracket

structs

none

consts

none

functions

41func main(argc: i64, argv: *i64) -> i64