code wiki / (root) / nx_cr_gate.nx

nx_cr_gate.nx

buildroot/runtime/nx_cr_gate.nx

2216 B37 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_cr_gate.nx -- the SINGLE-ARG, /mcp-shaped code review gate. `nx_cr_gate <file>` reviews ONE file and exits nonzero if it has blocking findings (incomplete / non-sovereign / leak). This exact shape (one positional arg) is what the execution allowlist's tea_run (name -> ELF, ONE arg) needs to make the `code_review_gate` tool RUNNABLE over /mcp tools/call -- so an engaging LLM/agent can self-check a file BEFORE submitting it ("so LLMs don't write garbage", via the API). Without this wrapper the gate's two-arg form (`nx_code_review gate <file>`) does not fit the single-arg exec model. COMPOSES _offc/nx_code_review.elf gate (Cardinal 15: no detection logic duplicated -- it fork+execs the real reviewer and passes the verdict + exit code straight through). Sovereign (syscalls only). Run from nxc2 root. The operator still curates the allowlist row + issues the cap token -- this only makes that step POSSIBLE. license_tier: ORIGINAL expect_exit: 0 (on a clean file; 1 on blocking findings; 2 on usage)

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_cr_gate.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main g_puts sys_write sys_exit sys_fork sys_mmap sys_execve sys_wait4

structs

none

consts

none

functions

14func g_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
16func main(argc: i64, argv: *i64) -> i64