nx_supplement_check.nx
buildroot/runtime/nx_supplement_check.nx
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
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
structs
| none |
consts
| none |
functions
| 41 | func main(argc: i64, argv: *i64) -> i64 |