code wiki / (root) / nx_haccp.nx

nx_haccp.nx

buildroot/runtime/nx_haccp.nx

5507 B146 linesdepth 3pulls 3 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_haccp.nx -- FOOD-SCIENCE SUITE / REGULATORY (HACCP) rung. Turns the safety + preservation science into the HACCP framework: for each process step it names the hazard, decides whether the step is a CRITICAL CONTROL POINT (CCP) or a prerequisite (PRP), sets the grounded CRITICAL LIMIT, monitors an observation against it, and HALTS the batch when a CCP is breached (the never-poison law applied to a whole process). Grounded critical limits (FDA Food Code 2022): cook poultry 74 C (165 F) / ground 71 / whole cut + seafood 63 reheat 74 C; hot-hold >= 57 C (135 F); cold-hold <= 5 C (41 F) two-stage cooling 57->21 C in <= 2 h, then 21->5 C in <= 4 h low-acid canning: 12-D botulinum cook (composes nx_preservation) acidification: pH <= 4.6 (composes the ferment never-poison line) THE exceed: a paper HACCP binder lists limits; this MONITORS an observation against the grounded limit and HALTS by construction when a CCP fails -- and it reuses the SAME preservation/ferment science the rest of the suite runs on (one source of truth, not a re-typed chart). genealogy_id: codex_haccp_7_principles + fda_food_code_2022 + nishi_never_poison

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_preservation.nx nx_haccp.nx nx_haccp_test.nx

imports: nx_syscalls.nxnx_preservation.nx

imported by: nx_haccp_test.nx

structs

none

consts

27const HC_RECEIVE: i64 = 0
28const HC_STORE: i64 = 1
29const HC_PREP: i64 = 2
30const HC_COOK: i64 = 3
31const HC_COOL: i64 = 4
32const HC_HOT_HOLD: i64 = 5
33const HC_COLD_HOLD: i64 = 6
34const HC_REHEAT: i64 = 7
35const HC_CAN: i64 = 8
36const HC_ACIDIFY: i64 = 9
37const HC_SERVE: i64 = 10
38const HC_STEP_N: i64 = 11
40const HC_HAZ_NONE: i64 = 0
41const HC_HAZ_BIO: i64 = 1 // pathogens
42const HC_HAZ_CHEM: i64 = 2 // allergens, toxins, residues
43const HC_HAZ_PHYS: i64 = 3 // glass, metal, bone
45const HC_CCP_NO: i64 = 0 // prerequisite program (PRP)
46const HC_CCP_YES: i64 = 1 // critical control point
48const HC_OK: i64 = 0
49const HC_HALT: i64 = 1 // CCP breached -> never-poison halt
52const HC_FOOD_POULTRY: i64 = 0
53const HC_FOOD_GROUND: i64 = 1
54const HC_FOOD_WHOLE: i64 = 2
55const HC_FOOD_SEAFOOD: i64 = 3
59const HC_COOK_POULTRY_C: i64 = 74
60const HC_COOK_GROUND_C: i64 = 71
61const HC_COOK_WHOLE_C: i64 = 63
62const HC_REHEAT_C: i64 = 74
63const HC_HOT_HOLD_C: i64 = 57
64const HC_COLD_HOLD_C: i64 = 5
65const HC_COOL_S1_HOURS: i64 = 2 // 57 C -> 21 C within 2 h
66const HC_COOL_S2_HOURS: i64 = 4 // 21 C -> 5 C within 4 h
67const HC_ACIDIFY_PH: i64 = 4600

functions

71func haccp_primary_hazard(step: i64) -> i64
called by 1: main
87func haccp_is_ccp(step: i64) -> i64
called by 1: main
100func haccp_cook_limit(food_class: i64) -> i64
109func haccp_cook_admit(observed_c: i64, food_class: i64) -> i64
called by 1: main calls 1: haccp_cook_limit
115func haccp_cool_admit(stage1_hours: i64, stage2_hours: i64) -> i64
called by 1: main
121func haccp_hot_hold_admit(observed_c: i64) -> i64
called by 1: main
126func haccp_cold_hold_admit(observed_c: i64) -> i64
called by 1: main
131func haccp_reheat_admit(observed_c: i64) -> i64
137func haccp_can_admit(hold_mmin: i64, d_mmin: i64) -> i64
called by 1: main calls 1: pv_is_12d
143func haccp_acidify_admit(ph_milli: i64) -> i64
called by 1: main