code wiki / _hdl_build / nx_orchestrate.nx

nx_orchestrate.nx

buildroot/runtime/_hdl_build/nx_orchestrate.nx

13527 B260 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_tool_run.nx nx_orchestrate.nx

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

main oc_w tr_run_capture sys_mmap sys_pipe2 sys_fork sys_close sys_dup3 sys_execve_clean sys_close ↻ sys_execve sys_exit sys_read sys_wait4 wait_exit_code oc_b oc_bn oc_cpz oc_eval_pre oc_eval oc_pre oc_reads sys_read ↻ oc_has sys_openat_append sys_openat_wr sys_renameat

structs

none

consts

18const K_MAGIC_30000: i64 = 30000
19const K_MAGIC_262144: i64 = 262144
20const K_MAGIC_262160: i64 = 262160
21const K_MAGIC_65536: i64 = 65536
22const K_MAGIC_32768: i64 = 32768
23const K_MAGIC_65535: i64 = 65535

functions

25func 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
26func 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
27func 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
28func oc_reads(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: oc_eval calls 1: sys_read
37func oc_has(buf: *u8, s: i64, e: i64, pat: *u8) -> i64
called by 1: oc_eval
51func oc_cpz(dst: *u8, cap: i64, buf: *u8, s: i64, e: i64) -> i64
called by 1: main
58func oc_pre(s: *u8, pre: *u8) -> i64
called by 1: oc_eval
64func oc_eval(pred: *u8, fpath: *u8, fneedle: *u8, fbuf: *u8) -> i64
called by 1: oc_eval_pre calls 3: oc_preoc_readsoc_has
94func oc_eval_pre(fpre: *u8, fpath: *u8, fneedle: *u8, fbuf: *u8, lbuf: *u8, rbuf: *u8) -> i64
called by 1: main calls 1: oc_eval
121func main(argc: i64, argv: *i64) -> i64