nx_gate_green.nx
buildroot/runtime/nx_gate_green.nx
about
nx_gate_green.nx -- shared LAST-VERDICT-LINE judging (the Examiner pattern
as a reusable lib): "the LAST line containing <anchor> must contain <pat>".
module: nishi-core.status.gate_green
capability: CORE_COMPUTE
EXTRACTED 2026-06-10 during the standards audit of nx_sreach_scorecard,
which had a REAL false-green bug: its line-bounding loop discarded the
newline index, so the pattern window ran to END OF FILE -- a "rc=0" on a
LATER line could green a rung whose own line said rc=1. Fixed here with the
found-index pattern and pinned by nx_gate_green_test KATs (the false-green
construction is KAT 3). Anything judging gate logs should use THIS, not a
private copy.
dependencies 2 imports · 8 importers
imports: nx_str.nxnx_syscalls.nx
imported by: nx_comms_hwup_census.nxnx_comms_perf_census.nxnx_gate_bite.nxnx_gate_green_test.nxnx_gate_migrate.nxnx_search_competitor_census.nxnx_sreach_scorecard.nxnx_wasm_promote.nx
structs
| none |
consts
| 18 | const GG_FILE_CAP: i64 = 524288 |
| 27 | const GG_GREEN: i64 = 1 |
| 28 | const GG_RED: i64 = 0 |
| 29 | const GG_UNJUDGEABLE: i64 = 0 - 1 // anchor absent: the log says NOTHING about a verdict |
| 30 | const GG_UNREADABLE: i64 = 0 - 2 // no such file / empty: nothing to judge at all |
| 31 | const GG_LF: i64 = 0x0A |
functions
| 33 | func gg_read(path: *u8, buf: *u8, cap: i64) -> i64 called by 8: gg_gate_judgegm_copygm_fsizegm_root_ensuregm_resolvegm_artifact+2 calls 3: sys_openat_rdsys_readsys_close |
| 48 | func gg_last(buf: *u8, n: i64, needle: *u8) -> i64 |
| 67 | func gg_line_judge(buf: *u8, n: i64, anchor: *u8, pat: *u8) -> i64 |
| 82 | func gg_line_green(buf: *u8, n: i64, anchor: *u8, pat: *u8) -> i64 |
| 89 | func gg_gate_judge(path: *u8, anchor: *u8, pat: *u8) -> i64 |
| 97 | func gg_gate_green(path: *u8, anchor: *u8, pat: *u8) -> i64 |