code wiki / _hdl_build / nx_plan_run.nx
nx_plan_run.nx
buildroot/runtime/_hdl_build/nx_plan_run.nx
about
nx_plan_run.nx -- WORKFLOWS-AS-DATA: the sovereign plan executor (operator 2026-07-18: "i still
see scratchpadding not via nishi... get what you are doing outside of it in mcp and api and
workflow"). Kills the session-side shell-script orchestration class: a PLAN is rows in a plane
(seeded via the MCP-live nx_store_put), and ONE cap-gated tools/call executes the whole sequence
SERVER-SIDE, recording per-step results to a results plane (provenance in the plane, as always).
nx_plan_run <planid> [allowlist] [planprefix] [resultsprefix]
plan rows : knowledge/store/plan-<id>- seq<TAB>tool<TAB>arg... (executed in seq order)
results rows: knowledge/store/planrun-<id>- seq<TAB>tool<TAB>rc<TAB>output-snippet
SECURITY = the tools-plane model, no escalation: each step's tool MUST be a GREEN row in
tool_allowlist.conf; a row's PINNED args override plan args (fixed-arg pinning, caller args
ignored); unknown tool -> REFUSED fail-closed; a failing step STOPS the plan (later steps never
run) with the failure recorded. nx_plan_run itself is cap-gated on the tools plane.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 4 imports · 0 importers
imports: nx_store_seed_lib.nxnx_seg_store.nxnx_deploy_lib.nxnx_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
| 19 | const PR_CAP: i64 = 1048576 |
| 20 | const PR_NL: i64 = 10 |
| 21 | const PR_TAB: i64 = 9 |
| 22 | const PR_SP: i64 = 32 |
| 23 | const PR_MAXCOL: i64 = 16 |
| 24 | const PR_PAIR: i64 = 2 |
| 25 | const PR_SPB: i64 = 256 |
| 26 | const PR_MAXSTEP: i64 = 64 |
| 27 | const PR_MAXARG: i64 = 12 |
| 28 | const PR_ARENA: i64 = 65536 |
| 29 | const PR_PFXCAP: i64 = 256 |
| 37 | const PR_SNIP: i64 = 2000 |
| 38 | const PR_OUTCAP: i64 = 65536 |
| 39 | const PR_STDERR: i64 = 2 |
| 40 | const PR_EXIT_USAGE: i64 = 2 |
| 41 | const PR_EXIT_IO: i64 = 1 |
| 42 | const PR_EXIT_REFUSED: i64 = 4 |
| 43 | const PR_EXIT_STEPFAIL: i64 = 5 |
| 44 | const PR_ZERO: i64 = 48 |
| 45 | const PR_NINE: i64 = 57 |
| 46 | const PR_B10: i64 = 10 |
functions
| 48 | func pr_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: pr_werr |
| 49 | func pr_werr(s: *u8) -> i64 { sys_write(PR_STDERR, s, pr_slen(s)); return 0 } |
| 50 | func pr_cols(q: *u8, ls: i64, le: i64, sp: *i64) -> i64 |
| 65 | func pr_slice_int(q: *u8, a: i64, b: i64) -> i64 called by 1: main |
| 71 | func pr_slice_eq(q: *u8, a: i64, b: i64, r: *u8, c: i64, d: i64) -> i64 called by 1: pr_find_tool |
| 78 | func pr_cstr(arena: *u8, off: *i64, q: *u8, a: i64, b: i64) -> i64 |
| 88 | func pr_find_tool(al: *u8, n: i64, q: *u8, ta: i64, tb: i64, arena: *u8, off: *i64, elfp: *i64, av: *i64) -> i64 |
| 122 | func pr_snip(dst: *u8, o: i64, src: *u8, n: i64) -> i64 called by 1: main |
| 139 | func main(argc: i64, argv: *i64) -> i64 |