code wiki / (root) / nx_gate_green_test.nx

nx_gate_green_test.nx

buildroot/runtime/nx_gate_green_test.nx

4716 B82 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic gate
docsdependenciesstructsconstsfunctions

about

nx_gate_green_test.nx -- KATs for the shared last-verdict-line judge (GATE). T3 is the construction that caught the scorecard's false-green bug: the LAST anchor line says rc=1, a LATER unrelated line says rc=0 -- the judge must say RED (the buggy whole-tail window said GREEN). seq585 (2026-07-23): THIS KAT USED TO CERTIFY THE BUG. Its case 4 read // 4: anchor absent = ABSENT = red and asserted 0 -- pinning as INTENDED the exact conflation that made 953 runnable, genuinely PASSING gates machine-read as NOT-GREEN. The 1/0 cases are KEPT (they prove the wrapper contract is unbroken for all 14 live call sites, rule 19); T7-T13 are the discriminating teeth: an absent anchor must read UNJUDGEABLE, a missing file UNREADABLE, and neither may equal RED. MIGRATE-ON-TOUCH (D001): this gate now emits via nx_gate_verdict, so the judge's own test is no longer one of the unjudgeable gates it exists to protect against. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 4 imports · 0 importers

nx_str.nx nx_syscalls.nx nx_gate_verdict.nx nx_gate_green.nx nx_gate_green_test.nx

imports: nx_str.nxnx_syscalls.nxnx_gate_verdict.nxnx_gate_green.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_ctr sys_mmap gv_head gv_puts sys_write gv_check gv_puts ↻ gt_green_is gg_line_green gg_line_judge gg_last nx_str_len nx_str_len ↻ gt_judge_is gt_judge gg_line_judge ↻ nx_str_len ↻ gt_judge ↻ gg_gate_judge sys_mmap ↻ gg_read sys_openat_rd sys_read sys_close gg_line_judge ↻ gg_gate_green gg_gate_judge ↻ sys_exit gv_verdict gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻

structs

none

consts

22const GT_GREEN: i64 = 1
23const GT_RED: i64 = 0
24const GT_UNJUDGEABLE: i64 = 0 - 1
25const GT_UNREADABLE: i64 = 0 - 2
26const GT_NOSUCH: *u8 = "knowledge/status/nx_gate_green_no_such_file.log"

functions

28func gt_green_is(log: *u8, anchor: *u8, pat: *u8, want: i64) -> i64
called by 1: main calls 2: gg_line_greennx_str_len
33func gt_judge(log: *u8, anchor: *u8, pat: *u8) -> i64
36func gt_judge_is(log: *u8, anchor: *u8, pat: *u8, want: i64) -> i64
called by 1: main calls 1: gt_judge
42func main() -> i64