nx_lmexport.nx
buildroot/runtime/nx_lmexport.nx
about
nx_lmexport.nx -- SOVEREIGN replacement for nx_landmine_export.cron.sh (2026-08-07).
OPERATOR DOCTRINE: .sh is not the Nishi ecosystem. But this wrapper is NOT a pure swap -- I said it was,
from reading its FIRST LINE, and filed that as guidance (retracted in debt 1786114148). It carries THREE
safety properties, and a bare organ row would have silently deleted all three:
(1) FAIL-CLOSED ON EMPTY -- an empty plane load is REFUSED, never exported (the vacuous-verify law).
(2) SHRINK GUARD -- a GENERATED VIEW that loses a third of its rows is a CLOBBER SIGNAL, not
an export. Refuse when new < cur*2/3.
(3) ATOMIC REPLACE -- assemble the whole file in a temp, then rename over the target, so a
reader never observes a half-written registry.
(STAR)A WRAPPER THAT LOOKS LIKE THE LAST WRAPPER IS NOT THE SAME WRAPPER -- ENUMERATE ITS SERVICES EVERY
TIME. The argument-plus-redirection shape that made fallbackharden and ddqbeat pure swaps is exactly what
made this one LOOK swappable; the resemblance is the hazard.
FAITHFULNESS NOTE ON THE SHRINK TEST. The shell computed $((CUR * 2 / 3)) -- INTEGER division, which
TRUNCATES -- and refused when NEW was strictly less than that. The obvious "cleaner" rewrite (new*3 <
cur*2) is NOT the same predicate: at cur=10 the shell threshold is 6 and admits new=6, while the cross-
multiplied form rejects it. A guard must be ported EXACTLY, not improved in passing, so the truncating
form is reproduced verbatim.
(STAR)PORTING A GUARD IS NOT REFACTORING IT -- AN OFF-BY-ONE IN A SAFETY PREDICATE IS A SAFETY CHANGE.
nx_lmexport (no args; the clock dispatches it bare)
Exit: 0 OK · 2 empty-load REFUSED · 3 shrink REFUSED · 1 internal failure.
Output goes to stdout, which the clock's per-job capture routes to logs/lmexport.log automatically.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 28 | const LM_PLANE: *u8 = "knowledge/store/landmine-" |
| 29 | const LM_CLI: *u8 = "/volume1/homes/elderwesto/nishihost/nx_store_put.elf" |
| 30 | const LM_TMP: *u8 = "/tmp/nx_lmexport.tmp" |
| 50 | const LM_FULL: *u8 = "knowledge/registry/.lmexport.tmp" |
| 51 | const LM_TARGET: *u8 = "knowledge/registry/landmines.tsv" |
| 52 | const LM_MODE: i64 = 0x1a4 |
| 53 | const LM_CAP: i64 = 4194304 |
| 54 | const LM_H1: *u8 = "# GENERATED VIEW (F871 2026-07-20) -- SSOT is the knowledge/store/landmine- seg-store plane. DO NOT hand-edit:\\n" |
| 55 | const LM_H2: *u8 = "# hand edits are OVERWRITTEN by nx_lmexport.elf (clock beat). Add/retire landmines via:\\n" |
| 56 | const LM_H3: *u8 = "# ./nx_store_put.elf knowledge/store/landmine- put <actor> <LM-id> <category> <text> (replaces by id, hist- provenanced)\\n" |
functions
| 58 | func lm_o(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 59 | func lm_cat(d: *u8, o: i64, s: *u8) -> i64 { var x: i64=o; var i: i64=0; while s[i]!=(0 as u8){d[x]=s[i];x=x+1;i=i+1} return x } |
| 60 | func lm_num(d: *u8, o: i64, v: i64) -> i64 { var x: i64=o; var mm: i64=v; if mm<0{d[x]=45 as u8;x=x+1;mm=0-mm} if mm==0{d[x]=48 as u8;return x+1} let t:*u8=sys_mmap(24); var k:i64=0; while mm>0{t[k]=(48+(mm%10)) as u8;mm=mm/10;k=k+1} var j:i64=0; while j<k{d[x]=t[k-1-j];x=x+1;j=j+1} return x } |
| 66 | func lm_kv(m: *u8, o: i64, k: *u8, v: i64) -> i64 { var x: i64 = lm_cat(m, o, k); x = lm_num(m, x, v); return x } |
| 67 | func lm_say(tag: *u8, a: i64, b: i64) -> i64 |
| 76 | func main() -> i64 |