code wiki / (root) / nx_stepsolve_gate.nx

nx_stepsolve_gate.nx

buildroot/runtime/nx_stepsolve_gate.nx

23541 B292 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_gate_verdict.nx nx_tool_run.nx nx_gauge_lib.nx nx_stepsolve_gate.nx

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

main 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 ↻ gv_head gv_puts sys_write ↻ sys_mkdir sys_unlinkat sg_open sys_unlinkat ↻ sys_openat_wr sg_plant_triple sys_mmap ↻ sj_catn sys_mmap ↻ sg_frame sg_n sys_mmap ↻ sj_catn ↻ sys_write ↻ sg_b sys_mmap ↻ sys_write ↻ sg_w sys_write ↻ sg_slen

structs

none

consts

19const SG_ROOT: *u8 = "/tmp/nx_stepsolve_gate"
20const SG_J: *u8 = "/tmp/nx_stepsolve_gate/j.jrnl"
21const SG_J_SPINE: *u8 = "/tmp/nx_stepsolve_gate/j.jrnl.stepsolve.spine"
22const SG_J_STAMP: *u8 = "/tmp/nx_stepsolve_gate/j.jrnl.stepsolve.stamp"
23const SG_EMPTY: *u8 = "/tmp/nx_stepsolve_gate/empty.jrnl"
24const SG_CONF: *u8 = "/tmp/nx_stepsolve_gate/c.conf"
25const SG_CONF_ABSENT: *u8 = "/tmp/nx_stepsolve_gate/absent.conf"
26const SG_PROD_SPINE: *u8 = "knowledge/status/stepsolve.spine"
27const SG_PROD_STAMP: *u8 = "knowledge/status/stepsolve.stamp"
28const SG_MODE_RWX: i64 = 493
29const SG_MODE_RW: i64 = 420
30const SG_TAB: i64 = 9
31const SG_NL: i64 = 10
32const SG_LINE: i64 = 512
33const SG_OUT: i64 = 262144
34const SG_NOW: i64 = 1788700000
35const SG_NOW_S: *u8 = "1788700000"
36const SG_TS0: i64 = 1788600000
37const SG_VERB_CALL: *u8 = "call"
38const SG_VERB_RUN: *u8 = "run"
42const SG_SUP_A: i64 = 4
43const SG_SUP_B: i64 = 3
44const SG_SUP_C: i64 = 2
45const SG_SUP_D: i64 = 5
46const SG_SUP_E: i64 = 3
47const SG_SUP_F: i64 = 2
48const SG_TOTAL: i64 = 19
49const SG_EXPLAINED_PERMIL: i64 = 736 // (4+3+2+3+2)*1000/19
53const SG_JQ: *u8 = "/tmp/nx_stepsolve_gate/quality.jrnl"
54const SG_JQ_QSTAMP: *u8 = "/tmp/nx_stepsolve_gate/quality.jrnl.stepsolve.quality.stamp"
55const SG_SUP_G: i64 = 5
56const SG_FAIL_G: i64 = 4
57const SG_SUP_H: i64 = 3
58const SG_Q_QUALITY: i64 = 500 // 1000 - 4*1000/8: total support 8 (G 5 + H 3), failing 4

functions

60func sg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: sg_wsg_find
61func sg_w(fd: i64, s: *u8) -> i64 { return sys_write(fd, s, sg_slen(s)) }
62func sg_b(fd: i64, code: i64) -> i64 { let b: *u8 = sys_mmap(4); b[0] = code as u8; return sys_write(fd, b, 1) }
63func 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) }
65func sg_frame(fd: i64, ts: i64, ws: *u8, tool: *u8, verb: *u8) -> i64
69func sg_open(path: *u8) -> i64 { sys_unlinkat(path); return sys_openat_wr(path, SG_MODE_RW) }
called by 1: main calls 2: sys_unlinkatsys_openat_wr
70func sg_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: sg_subject calls 2: sys_openat_rdsys_close
71func 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 }
72func sg_lines(path: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
81func sg_find(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: sg_slen
89func sg_subject(out: *u8) -> i64
called by 1: main calls 1: sg_exists
97func sg_run(subject: *u8, journal: *u8, conf: *u8, out: *u8) -> i64
called by 1: main calls 2: sys_mmaptr_run_capture
113func sg_plant_pair(fd: i64, ts0: i64, sup: i64, tag: *u8, t1: *u8, t2: *u8, verb: *u8) -> i64
called by 1: main calls 3: sys_mmapsj_catnsg_frame
125func sg_frame_o(fd: i64, ts: i64, ws: *u8, tool: *u8, verb: *u8, outcome: *u8) -> i64
called by 1: sg_plant_pair_fail calls 3: sg_nsg_bsg_w
130func sg_plant_pair_fail(fd: i64, ts0: i64, sup: i64, nfail: i64, tag: *u8, t1: *u8, t2: *u8, verb: *u8) -> i64
143func sg_plant_triple(fd: i64, ts0: i64, sup: i64, tag: *u8, t1: *u8, t2: *u8, t3: *u8, verb: *u8) -> i64
called by 1: main calls 3: sys_mmapsj_catnsg_frame
156func main(argc: i64, argv: *i64) -> i64