code wiki / _hdl_build / nx_gate_bite.nx
nx_gate_bite.nx
buildroot/runtime/_hdl_build/nx_gate_bite.nx
about
nx_gate_bite.nx -- NON-VACUITY BY MUTATION. Answers the one question a green gate cannot answer about
itself: CAN THIS GATE EVER FAIL? Closes debt seq1344; the two-operator design closes seq1413.
REWRITTEN (rule 3, not patched a fourth time). The first version accumulated four corrections in one
session -- an anchor-blind judge, a vacuity overclaim, uncounted invalid mutants, and a single operator.
Each was a real defect and the accumulation was the signal to rewrite rather than keep patching.
THE METHOD (mutation testing, the 2026 field standard): perturb the SOURCE the gate is supposed to be
judging, rebuild, and require the gate to go RED. Killing ONE mutant proves the gate bites; we stop at
the first kill because the question is binary, not a score.
★★TWO OPERATORS, ESCALATED -- because ONE OPERATOR CANNOT REACH EVERY ASSERTION SURFACE.
phase 1 COMPARISON (`==` -> `!=`): reaches logic. Kills nx_raci_gate, nx_medbill_{nsa,codes,recon,civic}.
phase 2 LITERAL (flip a letter inside a copy string): reaches OUTPUT. MEASURED: nx_healthhelp_site_gate
asserts on rendered page TEXT (tone phrases, absence of "fight"/"arsenal"), so a comparison flip in a
path that does not change emitted copy is a survivor BY CONSTRUCTION -- not a hollow gate. A
single-operator harness makes every text-asserting gate permanently unprovable and would slander all
of them. The operator must be chosen by what the gate ASSERTS ON, so we try both before concluding.
★A MUTANT THAT DOES NOT COMPILE IS NOT A KILL. nx_sov_build_run RUNS the gate as its final step, so a
non-zero build exit means EITHER the gate went RED (real kill) OR the source failed to compile (proves
only that I broke the code). Counting the second as the first would let this organ certify non-vacuity it
never observed -- the `green>=1` overclaim rebuilt inside the tool built to catch it.
★NO KILL IS NOT PROOF OF VACUITY. Killing one mutant proves a gate CAN fail; failing to kill N proves
only that those N perturbations did not reach its assertions. INCONCLUSIVE is the honest word.
★THE JUDGE IS DIALECT-TOLERANT. Gates do not all speak one form: nx_medbill_nsa_gate ends
`ADV3 ...: GREEN` with NO `verdict=` anchor. Reading "anchor absent" as "not green" made an earlier build
of this organ report a 21/21 gate as broken -- an instrument reporting its own blindness as the subject's
defect. Prefer the verdict line; fall back to the exit code; always print which judge decided.
FAIL-SAFE BY CONSTRUCTION (rule 26 spirit): pristine bytes held before the first mutation, the mutation
window is the narrowest possible (mutate -> build -> RESTORE -> only then judge), the restore is
byte-verified, and the organ REFUSES to exit 0 if it cannot prove the restore.
usage: nx_gate_bite <gate_target> <source.nx> [max_sites] [subject <subject_target>] [aim <func> <skip> | aimlist <func>] (CWD = nxc2 root)
AIMED MODE (2026-08-03, debt 1785779063): mutation testing has THREE axes -- assertion strength, fixture
coverage, and SITE REACHABILITY. Position-picked sites in a large shared subject land in guards, early
helpers and sibling codecs the gate never executes, and A TOOTH CANNOT KILL A MUTANT THAT NEVER EXECUTES.
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_gate_green.nxnx_sha256.nxnx_artifact_root.nxnx_guarded_run.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 81 | const GB_MAGIC_4096: i64 = 4096 |
| 82 | const GB_MAGIC_1024: i64 = 1024 |
| 84 | const GB_MAXSRC: i64 = 4194304 |
| 85 | const GB_DEF_SITES: i64 = 4 |
| 97 | const GB_BUILD_ADMIT: i64 = 6 // the build governor refused; nothing was compiled |
| 98 | const GB_EXIT_BUILD_REFUSED: i64 = 6 // our exit: UNPROVEN, never a verdict about the subject |
| 139 | const GB_MUTANT_DEADLINE_MS: i64 = 120000 |
| 195 | const GB_DIGEST_BYTES: i64 = 32 |
| 196 | const GB_PATH_CAP: i64 = 512 |
| 793 | const GB_ASCII_SLASH: i64 = 47 |
| 794 | const GB_ASCII_DOT: i64 = 46 |
| 795 | const GB_ASCII_N: i64 = 110 |
| 796 | const GB_ASCII_X: i64 = 120 |
| 797 | const GB_NXEXT_LEN: i64 = 3 // strlen(".nx") |
| 798 | const GB_LP_BYTES: i64 = 16 // two i64 slots for sys_read_file's length out-param |
functions
| 198 | func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 199 | func wn(v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} let b: *u8=sys_mmap(28); var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 201 | func gb_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 213 | func gb_write(path: *u8, buf: *u8, n: i64) -> i64 |
| 238 | func gb_pristine_path(out: *u8) -> i64 |
| 252 | func gb_recover_pristine() -> i64 |
| 267 | func gb_arm_pristine() -> i64 |
| 275 | func gb_disarm_pristine() -> i64 |
| 283 | func gb_load_deadline(target: *u8) -> i64 |
| 314 | func gb_in_comment(b: *u8, p: i64) -> i64 |
| 342 | func gb_site_cmp(b: *u8, n: i64, k: i64) -> i64 |
| 396 | func gb_pre_run(b: *u8, i: i64) -> i64 |
| 410 | func gb_site_num(b: *u8, n: i64, k: i64) -> i64 |
| 450 | func gb_find(hay: *u8, hn: i64, ned: *u8, nl: i64) -> i64 |
| 464 | func gb_load_gate_src(target: *u8) -> i64 |
| 498 | func gb_ident_ch(c: i64) -> i64 called by 1: gb_gate_call |
| 515 | func gb_cmp_flip(b: *u8, off: i64) -> i64 called by 1: main |
| 519 | func gb_cmp_at(b: *u8, n: i64, from: i64) -> i64 |
| 547 | func gb_num_at(b: *u8, n: i64, from: i64) -> i64 |
| 576 | func gb_aim_find(name: *u8) -> i64 |
| 600 | func gb_gate_call(k: i64, out: *u8, cap: i64) -> i64 |
| 633 | func gb_needle_audit(b: *u8, n: i64) -> i64 |
| 693 | func gb_site_needle(b: *u8, n: i64, k: i64) -> i64 |
| 758 | func gb_site_lit(b: *u8, n: i64, k: i64) -> i64 |
| 804 | func gb_resolve_artifact(name: *u8) -> *u8 |
| 831 | func gb_twin_path(prefix: *u8, name: *u8) -> *u8 |
| 854 | func gb_bank_path(p: *u8, out: *u8, lenout: *i64) -> *u8 |
| 863 | func gb_dig_path(p: *u8, out: *u8) -> i64 |
| 873 | func gb_twin_restore(p: *u8, by: *u8, ln: i64) -> i64 |
| 882 | func gb_dig_eq(a: *u8, b: *u8) -> i64 called by 1: gb_twin_check |
| 890 | func gb_twin_check(p: *u8, banked: *u8, basedig: *u8, have_base: i64) -> i64 |
| 922 | func gb_basename_is(path: *u8, name: *u8) -> i64 called by 1: main |
| 944 | func gb_build() -> i64 |
| 1011 | func gb_out_has(needle: *u8) -> i64 |
| 1023 | func gb_rungate() -> i64 |
| 1062 | func gb_green(rc: i64) -> i64 |
| 1078 | func gb_art_read(lenout: *i64) -> *u8 |
| 1086 | func gb_art_same_as_base() -> i64 |
| 1104 | func gb_try(off: i64, newbyte: i64) -> i64 |
| 1156 | func main(argc: i64, argv: *i64) -> i64 |