nx_stepsolve_gate.nx
buildroot/runtime/nx_stepsolve_gate.nx
about
nx_stepsolve_gate.nx -- ES26 (engineshift al_steps): STEPS-TO-SOLVE proven END-TO-END on a planted journal.
Forks the SUBJECT ARTIFACT (the built nx_actlog, resolved from the roots the estate serves it from) with a planted
action journal and a planted conf and reads the JSON it prints, so the whole path -- indexed miner at gap zero,
closed-bigram subsumption, conf join (steps rows AND verbclass rules, a steps row winning), classification,
partition, per-rule tallies, ordering, worklist, spine and stamp -- is the subject, not a re-implementation.
Every ritual repetition lives in its OWN workstream so no cross-repeat bigram can form (the miner chains
successors per workstream). Seat frames are spelled tool:call and fork frames elf:run, the production journal's
own vocabulary (the first live beat read explained_permil=0 because a conf spelled :use could match nothing).
The stamp is judged through nx_gauge_lib in-process: the same ruler the /compare emitter renders it with.
ES27 (operator 2026-09-06: a bad one-step not rigorously evaluated is worse than a rigorous forty-step): a SECOND
planted journal with a failing one-step pair and a clean triple proves the QUALITY axis on the same subject --
fail, fail permil, risk = support x failure permil, the risk worklist most dangerous first, the quality gauge stamp.
exit: 0 GREEN . 1 RED . 3 SKIP license_tier: ORIGINAL No hw writes.
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_tool_run.nxnx_gauge_lib.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
| 19 | const SG_ROOT: *u8 = "/tmp/nx_stepsolve_gate" |
| 20 | const SG_J: *u8 = "/tmp/nx_stepsolve_gate/j.jrnl" |
| 21 | const SG_J_SPINE: *u8 = "/tmp/nx_stepsolve_gate/j.jrnl.stepsolve.spine" |
| 22 | const SG_J_STAMP: *u8 = "/tmp/nx_stepsolve_gate/j.jrnl.stepsolve.stamp" |
| 23 | const SG_EMPTY: *u8 = "/tmp/nx_stepsolve_gate/empty.jrnl" |
| 24 | const SG_CONF: *u8 = "/tmp/nx_stepsolve_gate/c.conf" |
| 25 | const SG_CONF_ABSENT: *u8 = "/tmp/nx_stepsolve_gate/absent.conf" |
| 26 | const SG_PROD_SPINE: *u8 = "knowledge/status/stepsolve.spine" |
| 27 | const SG_PROD_STAMP: *u8 = "knowledge/status/stepsolve.stamp" |
| 28 | const SG_MODE_RWX: i64 = 493 |
| 29 | const SG_MODE_RW: i64 = 420 |
| 30 | const SG_TAB: i64 = 9 |
| 31 | const SG_NL: i64 = 10 |
| 32 | const SG_LINE: i64 = 512 |
| 33 | const SG_OUT: i64 = 262144 |
| 34 | const SG_NOW: i64 = 1788700000 |
| 35 | const SG_NOW_S: *u8 = "1788700000" |
| 36 | const SG_TS0: i64 = 1788600000 |
| 37 | const SG_VERB_CALL: *u8 = "call" |
| 38 | const SG_VERB_RUN: *u8 = "run" |
| 42 | const SG_SUP_A: i64 = 4 |
| 43 | const SG_SUP_B: i64 = 3 |
| 44 | const SG_SUP_C: i64 = 2 |
| 45 | const SG_SUP_D: i64 = 5 |
| 46 | const SG_SUP_E: i64 = 3 |
| 47 | const SG_SUP_F: i64 = 2 |
| 48 | const SG_TOTAL: i64 = 19 |
| 49 | const SG_EXPLAINED_PERMIL: i64 = 736 // (4+3+2+3+2)*1000/19 |
| 53 | const SG_JQ: *u8 = "/tmp/nx_stepsolve_gate/quality.jrnl" |
| 54 | const SG_JQ_QSTAMP: *u8 = "/tmp/nx_stepsolve_gate/quality.jrnl.stepsolve.quality.stamp" |
| 55 | const SG_SUP_G: i64 = 5 |
| 56 | const SG_FAIL_G: i64 = 4 |
| 57 | const SG_SUP_H: i64 = 3 |
| 58 | const SG_Q_QUALITY: i64 = 500 // 1000 - 4*1000/8: total support 8 (G 5 + H 3), failing 4 |
functions
| 60 | func sg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 61 | func sg_w(fd: i64, s: *u8) -> i64 { return sys_write(fd, s, sg_slen(s)) } |
| 62 | func sg_b(fd: i64, code: i64) -> i64 { let b: *u8 = sys_mmap(4); b[0] = code as u8; return sys_write(fd, b, 1) } |
| 63 | func sg_n(fd: i64, v: i64) -> i64 { let b: *u8 = sys_mmap(SG_LINE); let o: i64 = sj_catn(b, 0, v); return sys_write(fd, b, o) } |
| 65 | func sg_frame(fd: i64, ts: i64, ws: *u8, tool: *u8, verb: *u8) -> i64 |
| 69 | func sg_open(path: *u8) -> i64 { sys_unlinkat(path); return sys_openat_wr(path, SG_MODE_RW) } |
| 70 | func sg_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 71 | func sg_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 } |
| 72 | func sg_lines(path: *u8) -> i64 |
| 81 | func sg_find(buf: *u8, n: i64, needle: *u8) -> i64 |
| 89 | func sg_subject(out: *u8) -> i64 |
| 97 | func sg_run(subject: *u8, journal: *u8, conf: *u8, out: *u8) -> i64 |
| 113 | func sg_plant_pair(fd: i64, ts0: i64, sup: i64, tag: *u8, t1: *u8, t2: *u8, verb: *u8) -> i64 |
| 125 | func sg_frame_o(fd: i64, ts: i64, ws: *u8, tool: *u8, verb: *u8, outcome: *u8) -> i64 |
| 130 | func sg_plant_pair_fail(fd: i64, ts0: i64, sup: i64, nfail: i64, tag: *u8, t1: *u8, t2: *u8, verb: *u8) -> i64 |
| 143 | func sg_plant_triple(fd: i64, ts0: i64, sup: i64, tag: *u8, t1: *u8, t2: *u8, t3: *u8, verb: *u8) -> i64 |
| 156 | func main(argc: i64, argv: *i64) -> i64 |