code wiki / (root) / nx_mccabe_gate.nx

nx_mccabe_gate.nx

buildroot/runtime/nx_mccabe_gate.nx

15341 B286 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_mccabe_gate.nx -- teeth for the cyclomatic-complexity census. IN-PROCESS: imports nx_mccabe_lib.nx and calls mc_scan_file directly, so it exercises the SAME code the census runs and has no NOT-DEPLOYED failure mode. EVERY v(G) BELOW WAS COMPUTED BY HAND FIRST AND IS WRITTEN INTO THE TOOTH NAME. A complexity organ that is only checked against itself is unfalsifiable; these are six shapes whose answers are known independently. THE TWO TEETH THAT MATTER MOST ARE THE TRAPS. The trivial wrong implementation is a text search for the keywords, and it passes every counting tooth here -- only the COMMENT trap and the STRING trap refute it. Measured on the real corpus before this organ existed: the first `&&` occurrences a naive search finds are all inside comments. A SCANNER THAT DOES NOT SKIP COMMENTS MEASURES THE DOCUMENTATION, NOT THE CODE. Fixtures are planted at runtime under /tmp/mccabe_gate/ and unlinked before creation, so the gate is idempotent and shares nothing with any production beat. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_mccabe_lib.nx nx_gate_verdict.nx nx_mccabe_gate.nx

imports: nx_mccabe_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 gv_head gv_puts sys_write gv_ctr 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 ↻ mcg_path mc_cat mcg_put t fires sys_mmap ↻ gsl gw sys_write ↻ js_pending_url ev_str_bytes str_flatten ev_str_new nx_pool_alloc ev_str_len contains gsl ↻ gw ↻ mcg_clspath mc_cat ↻

structs

none

consts

20const MCG_DIR: *u8 = "/tmp/mccabe_gate\x00"
21const MCG_MODE644: i64 = 420
22const MCG_MODE755: i64 = 493
23const MCG_NFIX: i64 = 9 // fixture files planted; binds the denominator so no tooth passes on the empty set
26const MCG_CLSDIR: *u8 = "/tmp/mccabe_gate_cls\x00"
27const MCG_CLSROWS: i64 = 2 // rows in the planted table
28const MCG_CLSFIX: i64 = 5 // class fixtures planted
29const MCG_ROW_BUILDER: i64 = 1 // planted table order: BUILDER first, so a head carrying both markers reads BUILDER
30const MCG_ROW_GENERATED: i64 = 2
31const MCG_CLS_BUILDER_FILES: i64 = 2 // g_builder + g_both (first row wins)
32const MCG_CLS_GEN_FILES: i64 = 1 // g_gen only -- g_late carries the marker BEYOND the head window
33const MCG_CLS_UNMARKED_FILES: i64 = 2 // g_plain + g_late
34const MCG_CLS_GEN_VG: i64 = 2 // g_gen: one if, hand-computed

functions

36func mcg_put(path: *u8, data: *u8) -> i64
called by 1: main
46func mcg_path(buf: *u8, name: *u8) -> i64
called by 1: main calls 1: mc_cat
53func mcg_clspath(buf: *u8, name: *u8) -> i64
called by 1: main calls 1: mc_cat
61func mcg_vg(path: *u8, nf: *i64) -> i64
calls 1: mc_scan_file
76func main(argc: i64, argv: *i64) -> i64