code wiki / (root) / nx_water_quality_test.nx

nx_water_quality_test.nx

buildroot/runtime/nx_water_quality_test.nx

5473 B98 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic water
docsdependenciesstructsconstsfunctions

about

nx_water_quality_test.nx -- the water-quality GATE for nx_water_quality: TDS taste bands, the composite taste score, health mineral thresholds, and the never-poison safety admission (lead / arsenic / nitrate / PFAS / bacteria). MIGRATED OFF A HAND-ROLLED VERDICT 2026-08-14. This was a smoke test whose exit code was the FAILED ASSERTION NUMBER: `return 11` meant the lead check failed. Two consequences, and both of them are why /api/promote refused to ship it (D001): 1. NOTHING COULD READ ITS OUTCOME. nx_gate_green judges a gate from the outside by its verdict line, and there was none; no harness.jrnl frame was recorded either, so flake and erosion were invisible for this gate specifically. 2. IT STOPPED AT THE FIRST FAILURE. An early-returning assertion chain reports ONE defect per run and hides every later one, so the true blast radius of a change is never visible. It now inherits nx_gate_verdict: every tooth runs, declared == executed BY CONSTRUCTION (gv_ctr owns both counters, so a tooth that silently stops running lowers BOTH numbers instead of quietly reading green), and the exit code CARRIES the verdict. MIGRATED BY HAND, DELIBERATELY. The automated D001 candidate collapses N teeth into one boolean (ctr[0]=green; ctr[1]=1) and reports `passed 1/1` -- a one-state judge cannot see a dropped conjunct, which is the exact defect gv_ctr exists to prevent. NEGATIVE CONTROLS ARE NAMED. Six teeth carry a neg-control- prefix so the gate-law census can SEE them: a control nobody can find is a control nobody maintains. They matter more than usual here -- without them a wq_safety_admit that REFUSED EVERY SAMPLE would score full marks on the refusal teeth, so the admit-a-good-sample tooth is the discrimination control that makes the rest mean something. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_water_quality.nx nx_water_quality_test.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_water_quality.nx

imported by: nobody (leaf or entry point)

structs

none

consts

none

functions

32func main() -> i64