code wiki / _hdl_build / nx_gate_verdict_lib.nx

nx_gate_verdict_lib.nx

buildroot/runtime/_hdl_build/nx_gate_verdict_lib.nx

6510 B149 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic gate
docsdependenciesstructsconstsfunctions

about

nx_gate_verdict_lib.nx -- the SHARED reader for "what does this gate log say?". NO main() ON PURPOSE. WHY A MODULE AND NOT A NOTE: nx_gate_rollup.nx owns a main(), so its gr_slurp/gr_last_line cannot be imported by a second entry point -- the same structural trap nx_gatelib's own header documents for egb_walk/tr_walk ("that is why it kept being copied rather than shared -- a structural reason, not an oversight, and the fix is a module with no main() rather than a note promising to do it later"). This is that module. New readers import it instead of copying; nx_gate_rollup folds into it next. THE VERDICT CONTRACT, in one place so it cannot drift again: a gate log's NEWEST non-empty line carries the anchor. The ecosystem emits BOTH cases -- knowledge/status/deploy_ready.log, fin_spine_gate.log, coordination_gate.log and pm_dashboard_gate.log use uppercase VERDICT=, while rv64_runproof_gate.log and friends use lowercase verdict=. nx_gate_rollup matched lowercase ONLY, which made every uppercase gate read RED the instant it was registered. Case is a spelling detail, not a verdict; both are accepted here so no future reader has to rediscover that. FAIL-CLOSED: missing / empty / no-anchor is GV_NONE, never GREEN. "I could not tell" must never read as "fine" -- that is the failure mode the gate plane exists to remove. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_gate_verdict_lib.nx nx_gate_rollup.nx nx_gatereg_derive.nx

imports: nx_syscalls.nx

imported by: nx_gate_rollup.nxnx_gatereg_derive.nx

structs

none

consts

20const GV_MAGIC_86400: i64 = 86400
22const GV_LOGCAP: i64 = 262144
23const GV_LINECAP: i64 = 4096
26const GV_NONE: i64 = 0
27const GV_GREEN: i64 = 1
28const GV_RED: i64 = 2
116const GV_STATBUF: i64 = 256
117const GV_STAT_MTIME_OFF: i64 = 88

functions

30func gv_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
33func gv_slurp(path: *u8, buf: *u8, cap: i64) -> i64
48func gv_last_line(buf: *u8, n: i64, out: *u8, cap: i64) -> i64
called by 2: maingv_classify
75func gv_contains(hay: *u8, hn: i64, needle: *u8) -> i64
called by 2: gv_has_anchorgv_is_pass calls 1: gv_len
91func gv_has_anchor(line: *u8, n: i64) -> i64
called by 1: gv_classify calls 1: gv_contains
103func gv_is_pass(line: *u8, n: i64) -> i64
called by 2: maingv_classify calls 1: gv_contains
119func gv_mtime(path: *u8) -> i64
133func gv_age_days(path: *u8, now: i64) -> i64
called by 1: main calls 1: gv_mtime
141func gv_classify(path: *u8, buf: *u8, line: *u8) -> i64