code wiki / _hdl_build / nx_editor_loop_gate.nx
nx_editor_loop_gate.nx
buildroot/runtime/_hdl_build/nx_editor_loop_gate.nx
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
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
structs
| none |
consts
| 27 | const ELG_FILE_MODE: i64 = 420 // 0644, spelled in decimal because this dialect has no octal |
| 28 | const ELG_DIR_MODE: i64 = 493 // 0755 |
| 29 | const ELG_CAP: i64 = 8192 |
functions
| 31 | func eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 } called by 1: main |
| 32 | func ne(a: i64, b: i64) -> i64 { if a != b { return 1 } return 0 } called by 1: main |
| 33 | func g_has(s: *u8, n: i64, lit: *u8) -> i64 { if bt_find(s, n, lit, bt_len(lit)) >= 0 { return 1 } return 0 } |
| 34 | func 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 |
| 35 | func pv(label: *u8, v: i64) -> i64 { gv_puts(label); gv_num(v); gv_puts("\n" as *u8); return 0 } |
| 37 | func render_to(c: *i64, n: i64, path: *u8, out: *u8, cap: i64) -> i64 |
| 45 | func render_to_st(st: *i64, path: *u8, out: *u8, cap: i64) -> i64 |
| 52 | func main() -> i64 |