nx_forkgrade_gate.nx
buildroot/runtime/nx_forkgrade_gate.nx
about
nx_forkgrade_gate.nx -- CE8 (codeeffectiveness fg_trend): does the fork census leave a TRAJECTORY, and only where it should?
END-TO-END: forks the promoted nx_forkgrade (or the <subject_elf> given as argv[1], absolutised against the CWD) over a
THREE-FILE fixture pair it plants under /tmp -- identical, A-superset, bidirectional -- so the census has known answers,
then asserts the ONE new capability: every successful census appends one row to a spine, announced (spine= fd= wrote=
of=), and two censuses in time leave two rows. The spine path is DERIVED from dirA, so the fixture writes a SIDECAR
beside its own root and the PRODUCTION spine (knowledge/status/forkgrade.spine) is asserted UNCHANGED by size: a trial
run can never forge the production trajectory. Every expected count below was decided from the fixture before the run.
RED against the pre-fg_trend binary by construction (no spine line, no sidecar): the RED-before-GREEN this gate owes.
The subject forks nx_srcdiff.elf by BARE NAME from its CWD, so the run is started in the directory where that ruler
resolves (CWD or its parent) -- derived from data, never a pinned absolute path; absent ruler = SKIP, never RED.
exit: 0 GREEN . 1 RED . 3 SKIP license_tier: ORIGINAL No hw writes.
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_tool_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
| 17 | const FGG_PATH: i64 = 1024 |
| 18 | const FGG_CAP: i64 = 1048576 |
| 19 | const FGG_TMO: i64 = 60000 |
| 20 | const FGG_ARGV: i64 = 8 |
| 21 | const FGG_WORD: i64 = 8 |
| 22 | const FGG_MODE_RWX: i64 = 493 |
| 23 | const FGG_MODE_RW: i64 = 420 |
| 24 | const FGG_ROOT: *u8 = "/tmp/nx_forkgrade_gate" |
| 25 | const FGG_DIRA: *u8 = "/tmp/nx_forkgrade_gate/A" |
| 26 | const FGG_DIRB: *u8 = "/tmp/nx_forkgrade_gate/B" |
| 27 | const FGG_LIST: *u8 = "/tmp/nx_forkgrade_gate/list.txt" |
| 28 | const FGG_SIDECAR: *u8 = "/tmp/nx_forkgrade_gate/A.forkgrade.spine" |
| 29 | const FGG_PROD_SPINE: *u8 = "knowledge/status/forkgrade.spine" |
| 30 | const FGG_RULER: *u8 = "/nx_srcdiff.elf" |
| 31 | const FGG_NFILES: i64 = 3 |
| 32 | const FGG_EXPECT_ADOPTABLE_PERMIL: i64 = 666 // (identical 1 + a_superset 1) * 1000 / 3 pairs, hand-computed from the fixture |
| 33 | const FGG_ZERO: i64 = 48 |
| 34 | const FGG_NINE: i64 = 57 |
| 35 | const FGG_NL: i64 = 10 |
| 36 | const FGG_SLASH: i64 = 47 |
functions
| 38 | func fgg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 39 | func fgg_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64 = off; var i: i64 = 0; while s[i] != (0 as u8) { dst[o] = s[i]; o = o + 1; i = i + 1 } dst[o] = 0 as u8; return o } |
| 40 | func fgg_find(buf: *u8, n: i64, needle: *u8) -> i64 |
| 47 | func fgg_has(buf: *u8, n: i64, needle: *u8) -> i64 { if fgg_find(buf, n, needle) >= 0 { return 1 } return 0 } |
| 48 | func fgg_num_after(buf: *u8, n: i64, key: *u8) -> i64 |
| 58 | func fgg_write(path: *u8, text: *u8) -> i64 |
| 68 | func fgg_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 70 | func fgg_size(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 - 1 } let s: i64 = sys_lseek(fd, 0, 2); sys_close(fd); return s } |
| 73 | func fgg_lines(path: *u8) -> i64 |
| 82 | func fgg_subject_from_argv(a1: *u8, out: *u8) -> i64 |
| 88 | func fgg_resolve(out: *u8) -> i64 |
| 104 | func fgg_ruler_root(out: *u8) -> i64 |
| 120 | func fgg_run(gen: *u8, root: *u8, out: *u8, outlen: *i64) -> i64 |
| 126 | func main(argc: i64, argv: *i64) -> i64 |