code wiki / _hdl_build / nx_plan_run.nx

nx_plan_run.nx

buildroot/runtime/_hdl_build/nx_plan_run.nx

11564 B286 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind tooltopic plan
docsdependenciesstructsconstsfunctions

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

nx_store_seed_lib.nx nx_seg_store.nx nx_deploy_lib.nx nx_syscalls.nx nx_plan_run.nx

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

main pr_werr sys_write pr_slen sys_exit sys_mmap ss_cat sts_load ss_open_cached ssc_init sys_mmap ↻ ssc_sig_of ss_cat ↻ sys_fstatat ssc_streq ss_open ss_open2 sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn ss_cat ↻ ss_loadfile sys_map_file ss_readall ss_load_aux2 sys_mmap ↻ ss_cat ↻ ss_loadfile ↻ ss_r32 sys_munmap ssl_total_keys ss_r32 ↻ ssl_pow2 ssl_build ss_r32 ↻ ssl_hash_entry ssl_key_eq ss_r32 ↻ ssl_lookup ssl_hash_entry ↻

structs

none

consts

19const PR_CAP: i64 = 1048576
20const PR_NL: i64 = 10
21const PR_TAB: i64 = 9
22const PR_SP: i64 = 32
23const PR_MAXCOL: i64 = 16
24const PR_PAIR: i64 = 2
25const PR_SPB: i64 = 256
26const PR_MAXSTEP: i64 = 64
27const PR_MAXARG: i64 = 12
28const PR_ARENA: i64 = 65536
29const PR_PFXCAP: i64 = 256
37const PR_SNIP: i64 = 2000
38const PR_OUTCAP: i64 = 65536
39const PR_STDERR: i64 = 2
40const PR_EXIT_USAGE: i64 = 2
41const PR_EXIT_IO: i64 = 1
42const PR_EXIT_REFUSED: i64 = 4
43const PR_EXIT_STEPFAIL: i64 = 5
44const PR_ZERO: i64 = 48
45const PR_NINE: i64 = 57
46const PR_B10: i64 = 10

functions

48func 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
49func pr_werr(s: *u8) -> i64 { sys_write(PR_STDERR, s, pr_slen(s)); return 0 }
called by 1: main calls 2: sys_writepr_slen
50func pr_cols(q: *u8, ls: i64, le: i64, sp: *i64) -> i64
called by 2: pr_find_toolmain
65func pr_slice_int(q: *u8, a: i64, b: i64) -> i64
called by 1: main
71func pr_slice_eq(q: *u8, a: i64, b: i64, r: *u8, c: i64, d: i64) -> i64
called by 1: pr_find_tool
78func pr_cstr(arena: *u8, off: *i64, q: *u8, a: i64, b: i64) -> i64
called by 2: pr_find_toolmain
88func pr_find_tool(al: *u8, n: i64, q: *u8, ta: i64, tb: i64, arena: *u8, off: *i64, elfp: *i64, av: *i64) -> i64
122func pr_snip(dst: *u8, o: i64, src: *u8, n: i64) -> i64
called by 1: main
139func main(argc: i64, argv: *i64) -> i64