code wiki / (root) / nx_langdiag_gate.nx

nx_langdiag_gate.nx

buildroot/runtime/nx_langdiag_gate.nx

11035 B167 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_langdiag_gate.nx -- THE LANGUAGE-DIAGNOSTIC PROBE CORPUS, RUN NATIVELY (2026-08-14). WHY THIS EXISTS. Every language probe shipped 2026-08-13 was driven by a hand-written shell script under _ops/ -- build, run, grep, eyeball. That is the break-glass shape the estate's own law forbids (NishiLang for everything; shell only to LAUNCH a sovereign ELF), and it carried a measured weakness the shell could not fix: THE BASH GAUNTLET'S CCFAIL CELLS ASSERT ONLY *THAT* A PROBE WAS REFUSED, NEVER *WHY*. They check the emitted .s is empty. A refusal for a COMPLETELY DIFFERENT reason -- a typo in the probe, an unrelated regression, a parser desync -- passes them silently. That is the "a suite that only asks 'was it refused?' is blind by construction" failure this estate already paid for once on the SSRF deny-tests. This gate fixes it by composing the INCUMBENT base class rather than adding a second ruler: nx_gate_lib's gl_case forks a real organ and asserts BOTH the exit code AND a required output substring. Here the forked organ is the LIVE sovereign compiler and the substring is the DISTINCTIVE PHRASE of the rule under test -- usually its capability= slug. So a refusal now has to be the RIGHT refusal, and a compiler that refused everything generically fails this gate. BITE-PROVEN 2026-08-14: planting a slug the rule never prints yields FAIL const-overshift-refused-by-name exit=2 want_exit=2 want=<planted> -- the EXIT CODE MATCHED and the REASON DID NOT, which is exactly the case a CCFAIL cell passes. ACCEPT cases are equally load-bearing: they assert exit 0 AND a real assembly marker, because a compiler that emitted NOTHING and exited 0 would pass an exit-code-only check. And they are the discrimination control -- without them, a compiler that refuses every input passes every refusal row above (bite-proven: pointing an accept row at a refusing probe goes RED). SUBJECT: the compiler at _offc/nx_cc_sovereign.elf, i.e. the artifact that actually ships. 2026-09-02 (debt 1788309098 adjudicated): the gate read RED 9/11 from 2026-08-25 to 2026-09-02 on a compiler that was CORRECT -- LN15 turned its two multi-line refusal witnesses into valid programs. The two rules survive on irreducible witnesses (nx_probe_opstart_live, nx_probe_lone_operator) and the joined forms moved to the acceptance side. A fixture that stops reaching its condition is the quietest way a conformance case goes vacuous; the receipt for this repair is in lang.gates. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_lib.nx nx_gate_verdict.nx nx_langdiag_gate.nx

imports: nx_syscalls.nxnx_gate_lib.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main ldg_resolve_subject ldg_have sys_openat_rd sys_close sys_chdir sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gl_puts sys_write ↻ gl_slen gv_ctr sys_mmap ↻ gv_head gv_puts sys_write ↻ sys_mmap ↻ ldg_refuse ldg_row gl_case sys_mmap ↻ tr_run_capture sys_mmap ↻ sys_pipe2 sys_fork sys_close ↻ sys_dup3

structs

none

consts

47const LDG_PB: i64 = 65536
48const LDG_EXIT_UNRESOLVED: i64 = 3

functions

51func ldg_have(p: *u8) -> i64
67func ldg_resolve_subject(cc: *u8) -> i64
called by 1: main calls 2: ldg_havesys_chdir
78func ldg_row(nm: *u8, src: *u8, want_exit: i64, want: *u8,
87func ldg_refuse(nm: *u8, src: *u8, want: *u8, counts: *i64, ctr: *i64, pb: *u8, po: i64) -> i64
called by 1: main calls 1: ldg_row
91func ldg_accept(nm: *u8, src: *u8, counts: *i64, ctr: *i64, pb: *u8, po: i64) -> i64
called by 1: main calls 1: ldg_row
95func main() -> i64