code wiki / _hdl_build / nx_reconcile_ops.nx
nx_reconcile_ops.nx
buildroot/runtime/_hdl_build/nx_reconcile_ops.nx
about
nx_reconcile_ops.nx -- gov lane F752 + zero-mysteries rung-1. Ops reconciler v1: diff the DECLARED
state (daemons.reg fleet + mgmt_snap.json supervisor fleet + desired_state.tsv) against LIVE procs
(/proc walk) = the observe+compare half of the K8s reconcile loop. CORRECT half = file debts; this
organ is READ-ONLY by construction (never kills procs -- the supervisor is crown-jewel; Rule 26).
Names the two-fleet split mechanically: reg rows whose health-port is absent from the snap + vice
versa (match = health-port equality, v1 declared); counts live nx_hostctl supervise procs vs the
declared desired count (knowledge/registry/desired_state.tsv, absent -> default 2 flagged).
nx_reconcile_ops run [daemons.reg] [snapfile] [desired.tsv] [outlog]
ENVELOPE (scale-law, declared in output): fleet tables 192 rows each; file windows 256KB; /proc
pids 4096; unmatched-name display 24/side. exit: 0 GREEN | 3 DRIFT | 4 ABSENT-INPUT | 2 usage.
license_tier: ORIGINAL 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
| 13 | const K_MAGIC_32700: i64 = 32700 |
| 14 | const K_MAGIC_262144: i64 = 262144 |
| 15 | const K_MAGIC_32768: i64 = 32768 |
| 16 | const K_MAGIC_8192: i64 = 8192 |
| 17 | const K_MAGIC_8000: i64 = 8000 |
| 18 | const K_MAGIC_65536: i64 = 65536 |
| 19 | const K_MAGIC_4096: i64 = 4096 |
| 20 | const K_MAGIC_4095: i64 = 4095 |
functions
| 22 | func ro_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 23 | func ro_b(rep: *u8, pos: i64, s: *u8) -> i64 { var p: i64 = pos; var i: i64 = 0; while s[i] != (0 as u8) { if p < K_MAGIC_32700 { rep[p] = s[i]; p = p + 1 } i = i + 1 } return p } called by 1: main |
| 24 | func ro_bn(rep: *u8, pos: i64, v: i64) -> i64 { var p: i64 = pos; var m: i64 = v; if m < 0 { if p < K_MAGIC_32700 { rep[p] = 45 as u8; p = p + 1 } m = 0 - m } let t: *u8 = sys_mmap(28); var k: i64 = 0; if m == 0 { t[0] = 48 as u8; k = 1 } while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } var i: i64 = 0; while i < k { if p < K_MAGIC_32700 { rep[p] = t[k - 1 - i]; p = p + 1 } i = i + 1 } return p } |
| 25 | func ro_reads(path: *u8, buf: *u8, cap: i64) -> i64 |
| 34 | func ro_find(buf: *u8, n: i64, pat: *u8) -> i64 called by 1: main |
| 48 | func ro_isdigit(c: i64) -> i64 { if c < 48 { return 0 } if c > 57 { return 0 } return 1 } called by 1: main |
| 50 | func main(argc: i64, argv: *i64) -> i64 |