code wiki / _hdl_build / nx_editor_loop_gate.nx

nx_editor_loop_gate.nx

buildroot/runtime/_hdl_build/nx_editor_loop_gate.nx

14057 B219 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind gate/prooftopic editor
docsdependenciesstructsconstsfunctions

about

nx_editor_loop_gate.nx -- the no-JS edit loop end-to-end: emit a native form (0 JS), POST an op, the engine applies it, the re-render REFLECTS the change, unknown ops are rejected -- and now, the SAME posted vocabulary driving the operation log so the loop has real multi-level undo and redo with still zero JavaScript. MIGRATED OFF D001, 2026-08-25. This gate used to roll its own pass/fail counters and print its own VERDICT line, which is why /api/promote refused it: nothing outside could read its outcome. It now inherits nx_gate_verdict, so declared teeth and executed teeth are the same number by construction and the exit code carries the verdict. L1..L5 are the five assertions it already made, on the same fixtures with the same expected values -- they are the REGRESSION GUARD for the snapshot surface. L9 IS THE ANTI-VACUITY TOOTH. A single posted undo proves nothing about a log: the one-deep snapshot the canvas already had passes that. Three posted ops followed by three posted undos is the smallest test the snapshot design cannot pass, and it is driven entirely through the POSTED op strings, which is the thing a browser can actually reach. L12 GUARDS THE OTHER DIRECTION: extracting the shared button block must not have leaked the new undo and redo verbs onto the snapshot surface, which cannot honour them. Gate scratch lives under /tmp/<gate>/ so it can never share a fixture with a production beat. 100% sovereign. expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_brand_tokens.nx nx_editor_loop.nx nx_editor_loop_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_brand_tokens.nxnx_editor_loop.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_mmap ↻ put render_to sys_openat_wr el_emit_form ec_render ec_w sys_write ↻ ec_wn sys_write ↻ sys_mmap ↻ ec_kindlabel ec_w ↻ el_emit_ops ec_w ↻ sys_close sys_mmap ↻ sys_read_file sys_openat_rd

structs

none

consts

27const ELG_FILE_MODE: i64 = 420 // 0644, spelled in decimal because this dialect has no octal
28const ELG_DIR_MODE: i64 = 493 // 0755
29const ELG_CAP: i64 = 8192

functions

31func eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: main
32func ne(a: i64, b: i64) -> i64 { if a != b { return 1 } return 0 }
called by 1: main
33func g_has(s: *u8, n: i64, lit: *u8) -> i64 { if bt_find(s, n, lit, bt_len(lit)) >= 0 { return 1 } return 0 }
called by 1: main calls 2: bt_findbt_len
34func put(c: *i64, i: i64, k: i64, x: i64, y: i64, w: i64, h: i64) -> i64 { c[i*5+0]=k; c[i*5+1]=x; c[i*5+2]=y; c[i*5+3]=w; c[i*5+4]=h; return 0 }
called by 1: main
35func pv(label: *u8, v: i64) -> i64 { gv_puts(label); gv_num(v); gv_puts("\n" as *u8); return 0 }
called by 1: main calls 2: gv_putsgv_num
37func render_to(c: *i64, n: i64, path: *u8, out: *u8, cap: i64) -> i64
45func render_to_st(st: *i64, path: *u8, out: *u8, cap: i64) -> i64
52func main() -> i64