nx_mccabe_gate.nx
buildroot/runtime/nx_mccabe_gate.nx
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
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
structs
| none |
consts
| 20 | const MCG_DIR: *u8 = "/tmp/mccabe_gate\x00" |
| 21 | const MCG_MODE644: i64 = 420 |
| 22 | const MCG_MODE755: i64 = 493 |
| 23 | const MCG_NFIX: i64 = 9 // fixture files planted; binds the denominator so no tooth passes on the empty set |
| 26 | const MCG_CLSDIR: *u8 = "/tmp/mccabe_gate_cls\x00" |
| 27 | const MCG_CLSROWS: i64 = 2 // rows in the planted table |
| 28 | const MCG_CLSFIX: i64 = 5 // class fixtures planted |
| 29 | const MCG_ROW_BUILDER: i64 = 1 // planted table order: BUILDER first, so a head carrying both markers reads BUILDER |
| 30 | const MCG_ROW_GENERATED: i64 = 2 |
| 31 | const MCG_CLS_BUILDER_FILES: i64 = 2 // g_builder + g_both (first row wins) |
| 32 | const MCG_CLS_GEN_FILES: i64 = 1 // g_gen only -- g_late carries the marker BEYOND the head window |
| 33 | const MCG_CLS_UNMARKED_FILES: i64 = 2 // g_plain + g_late |
| 34 | const MCG_CLS_GEN_VG: i64 = 2 // g_gen: one if, hand-computed |
functions
| 36 | func mcg_put(path: *u8, data: *u8) -> i64 called by 1: main |
| 46 | func mcg_path(buf: *u8, name: *u8) -> i64 |
| 53 | func mcg_clspath(buf: *u8, name: *u8) -> i64 |
| 61 | func mcg_vg(path: *u8, nf: *i64) -> i64 calls 1: mc_scan_file |
| 76 | func main(argc: i64, argv: *i64) -> i64 |