code wiki / _hdl_build / nx_orchestrate.nx
nx_orchestrate.nx
buildroot/runtime/_hdl_build/nx_orchestrate.nx
about
nx_orchestrate.nx -- auto lane (eats debt seq163). WAIT-FOR-OPENING QUEUE: sessions QUEUE actions blocked
by a sibling's in-flight work instead of colliding. Each knowledge/store/deployq- row =
id | title | precondition | status | planid | note
precondition = a CHECKABLE predicate, now COMPOUND-capable (v2, 2026-07-20 -- for safe mgmt deploys that
must fire only when the fix is STAGED *and* mgmt is CALM):
exists:<path> | contains:<path>:<needle> -- single, OR
<pred> && <pred> -- AND of two (BOTH must hold to fire)
(e.g. exists:nx_mgmt_api.elf.new && contains:knowledge/status/api_contract.log:VERDICT=GREEN).
This POLLER (cron */5, non-blocking) evaluates every `queued` row: satisfied -> FIRE the row's plan via
nx_plan_run (reusing its allowlist+pinned-arg security WHOLESALE -- an action is a pre-seeded plan-
workflow, never arbitrary exec) and re-put the row status=fired-rc<N>; unsatisfied -> WAIT (logged, no
dead thread, no clobber). SOTA: Temporal durable await-condition, sovereign. Never-brick: fires only plans.
nx_orchestrate run [qprefix] [outlog]
ENVELOPE: 64 rows/pass, precond file window 256KB, fields 800B; declared in output.
exit: 0 ran (fired/waiting/skipped counted) | 4 queue unreadable | 2 usage.
license_tier: ORIGINAL expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_tool_run.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
| 18 | const K_MAGIC_30000: i64 = 30000 |
| 19 | const K_MAGIC_262144: i64 = 262144 |
| 20 | const K_MAGIC_262160: i64 = 262160 |
| 21 | const K_MAGIC_65536: i64 = 65536 |
| 22 | const K_MAGIC_32768: i64 = 32768 |
| 23 | const K_MAGIC_65535: i64 = 65535 |
functions
| 25 | func oc_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 } called by 1: main |
| 26 | func oc_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_30000 { rep[p] = s[i]; p = p + 1 } i = i + 1 } return p } called by 1: main |
| 27 | func oc_bn(rep: *u8, pos: i64, v: i64) -> i64 { var p: i64 = pos; var m: i64 = v; if m < 0 { if p < K_MAGIC_30000 { 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_30000 { rep[p] = t[k - 1 - i]; p = p + 1 } i = i + 1 } return p } called by 1: main |
| 28 | func oc_reads(path: *u8, buf: *u8, cap: i64) -> i64 |
| 37 | func oc_has(buf: *u8, s: i64, e: i64, pat: *u8) -> i64 called by 1: oc_eval |
| 51 | func oc_cpz(dst: *u8, cap: i64, buf: *u8, s: i64, e: i64) -> i64 called by 1: main |
| 58 | func oc_pre(s: *u8, pre: *u8) -> i64 called by 1: oc_eval |
| 64 | func oc_eval(pred: *u8, fpath: *u8, fneedle: *u8, fbuf: *u8) -> i64 |
| 94 | func oc_eval_pre(fpre: *u8, fpath: *u8, fneedle: *u8, fbuf: *u8, lbuf: *u8, rbuf: *u8) -> i64 |
| 121 | func main(argc: i64, argv: *i64) -> i64 |